fix(GPO): tests (#938)

* fix(GPO): tests

* fix `newTestBackend`

* improve

---------

Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
This commit is contained in:
Jonas Theis 2024-07-30 13:28:30 +08:00 committed by GitHub
parent c6b46fb268
commit f8bfb3aa5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -51,7 +51,7 @@ func TestFeeHistory(t *testing.T) {
{true, 1000, 1000, 2, rpc.PendingBlockNumber, nil, 32, 2, nil}, {true, 1000, 1000, 2, rpc.PendingBlockNumber, nil, 32, 2, nil},
{true, 1000, 1000, 2, rpc.PendingBlockNumber, []float64{0, 10}, 32, 2, nil}, {true, 1000, 1000, 2, rpc.PendingBlockNumber, []float64{0, 10}, 32, 2, nil},
{false, 1000, 1000, 2, rpc.FinalizedBlockNumber, []float64{0, 10}, 24, 2, nil}, {false, 1000, 1000, 2, rpc.FinalizedBlockNumber, []float64{0, 10}, 24, 2, nil},
{false, 1000, 1000, 2, rpc.SafeBlockNumber, []float64{0, 10}, 24, 2, nil}, //{false, 1000, 1000, 2, rpc.SafeBlockNumber, []float64{0, 10}, 24, 2, nil}, // We currently do not use rpc.SafeBlockNumber
} }
for i, c := range cases { for i, c := range cases {
config := Config{ config := Config{

View file

@ -143,10 +143,12 @@ func newTestBackend(t *testing.T, londonBlock *big.Int, pending bool) *testBacke
config.BernoulliBlock = londonBlock config.BernoulliBlock = londonBlock
config.CurieBlock = londonBlock config.CurieBlock = londonBlock
config.ShanghaiTime = nil config.ShanghaiTime = nil
config.DarwinTime = nil
if londonBlock != nil { if londonBlock != nil {
shanghaiTime := londonBlock.Uint64() * 12 shanghaiTime := londonBlock.Uint64() * 12
config.ShanghaiTime = &shanghaiTime config.ShanghaiTime = &shanghaiTime
config.DarwinTime = &shanghaiTime darwinTime := londonBlock.Uint64() * 12
config.DarwinTime = &darwinTime
} }
config.TerminalTotalDifficulty = common.Big0 config.TerminalTotalDifficulty = common.Big0