mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Fixes to overrides
This commit is contained in:
parent
26f20b21b4
commit
cb24543ddd
1 changed files with 7 additions and 3 deletions
|
|
@ -390,8 +390,7 @@ func (sim *simulator) sanitizeChain(blocks []simBlock) ([]simBlock, error) {
|
||||||
block.BlockOverrides.Number = (*hexutil.Big)(n)
|
block.BlockOverrides.Number = (*hexutil.Big)(n)
|
||||||
}
|
}
|
||||||
if block.BlockOverrides.Withdrawals == nil {
|
if block.BlockOverrides.Withdrawals == nil {
|
||||||
var withdrawals types.Withdrawals
|
block.BlockOverrides.Withdrawals = &types.Withdrawals{}
|
||||||
block.BlockOverrides.Withdrawals = &withdrawals
|
|
||||||
}
|
}
|
||||||
diff := new(big.Int).Sub(block.BlockOverrides.Number.ToInt(), prevNumber)
|
diff := new(big.Int).Sub(block.BlockOverrides.Number.ToInt(), prevNumber)
|
||||||
if diff.Cmp(common.Big0) <= 0 {
|
if diff.Cmp(common.Big0) <= 0 {
|
||||||
|
|
@ -407,7 +406,12 @@ func (sim *simulator) sanitizeChain(blocks []simBlock) ([]simBlock, error) {
|
||||||
for i := uint64(0); i < gap.Uint64(); i++ {
|
for i := uint64(0); i < gap.Uint64(); i++ {
|
||||||
n := new(big.Int).Add(prevNumber, big.NewInt(int64(i+1)))
|
n := new(big.Int).Add(prevNumber, big.NewInt(int64(i+1)))
|
||||||
t := prevTimestamp + timestampIncrement
|
t := prevTimestamp + timestampIncrement
|
||||||
b := simBlock{BlockOverrides: &override.BlockOverrides{Number: (*hexutil.Big)(n), Time: (*hexutil.Uint64)(&t)}}
|
b := simBlock{
|
||||||
|
BlockOverrides: &override.BlockOverrides{
|
||||||
|
Number: (*hexutil.Big)(n),
|
||||||
|
Time: (*hexutil.Uint64)(&t),
|
||||||
|
Withdrawals: &types.Withdrawals{},
|
||||||
|
}}
|
||||||
prevTimestamp = t
|
prevTimestamp = t
|
||||||
res = append(res, b)
|
res = append(res, b)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue