params: allow setting Petersburg block before chain head (#21473)
* Allow setting PetersburgBlock before chainhead if it is at the same block as ConstantinopleBlock * Add a negative test
This commit is contained in:
@ -70,6 +70,23 @@ func TestCheckCompatible(t *testing.T) {
|
||||
RewindTo: 9,
|
||||
},
|
||||
},
|
||||
{
|
||||
stored: &ChainConfig{ConstantinopleBlock: big.NewInt(30)},
|
||||
new: &ChainConfig{ConstantinopleBlock: big.NewInt(30), PetersburgBlock: big.NewInt(30)},
|
||||
head: 40,
|
||||
wantErr: nil,
|
||||
},
|
||||
{
|
||||
stored: &ChainConfig{ConstantinopleBlock: big.NewInt(30)},
|
||||
new: &ChainConfig{ConstantinopleBlock: big.NewInt(30), PetersburgBlock: big.NewInt(31)},
|
||||
head: 40,
|
||||
wantErr: &ConfigCompatError{
|
||||
What: "Petersburg fork block",
|
||||
StoredConfig: nil,
|
||||
NewConfig: big.NewInt(31),
|
||||
RewindTo: 30,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
Reference in New Issue
Block a user