|
|
@ -793,8 +793,13 @@ func (b *SimulatedBackend) AdjustTime(adjustment time.Duration) error { |
|
|
|
if len(b.pendingBlock.Transactions()) != 0 { |
|
|
|
if len(b.pendingBlock.Transactions()) != 0 { |
|
|
|
return errors.New("Could not adjust time on non-empty block") |
|
|
|
return errors.New("Could not adjust time on non-empty block") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Get the last block
|
|
|
|
|
|
|
|
block := b.blockchain.GetBlockByHash(b.pendingBlock.ParentHash()) |
|
|
|
|
|
|
|
if block == nil { |
|
|
|
|
|
|
|
return fmt.Errorf("could not find parent") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
blocks, _ := core.GenerateChain(b.config, b.blockchain.CurrentBlock(), ethash.NewFaker(), b.database, 1, func(number int, block *core.BlockGen) { |
|
|
|
blocks, _ := core.GenerateChain(b.config, block, ethash.NewFaker(), b.database, 1, func(number int, block *core.BlockGen) { |
|
|
|
block.OffsetTime(int64(adjustment.Seconds())) |
|
|
|
block.OffsetTime(int64(adjustment.Seconds())) |
|
|
|
}) |
|
|
|
}) |
|
|
|
stateDB, _ := b.blockchain.State() |
|
|
|
stateDB, _ := b.blockchain.State() |
|
|
|