From f8bfb3aa5e9d0bb7382793a284937c5bebc539b0 Mon Sep 17 00:00:00 2001 From: Jonas Theis <4181434+jonastheis@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:28:30 +0800 Subject: [PATCH] fix(GPO): tests (#938) * fix(GPO): tests * fix `newTestBackend` * improve --------- Co-authored-by: HAOYUatHZ Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> --- eth/gasprice/feehistory_test.go | 2 +- eth/gasprice/gasprice_test.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/eth/gasprice/feehistory_test.go b/eth/gasprice/feehistory_test.go index 9aec85ce05..1d594a4452 100644 --- a/eth/gasprice/feehistory_test.go +++ b/eth/gasprice/feehistory_test.go @@ -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, []float64{0, 10}, 32, 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 { config := Config{ diff --git a/eth/gasprice/gasprice_test.go b/eth/gasprice/gasprice_test.go index d88bdb1b31..104cff0c8f 100644 --- a/eth/gasprice/gasprice_test.go +++ b/eth/gasprice/gasprice_test.go @@ -143,10 +143,12 @@ func newTestBackend(t *testing.T, londonBlock *big.Int, pending bool) *testBacke config.BernoulliBlock = londonBlock config.CurieBlock = londonBlock config.ShanghaiTime = nil + config.DarwinTime = nil if londonBlock != nil { shanghaiTime := londonBlock.Uint64() * 12 config.ShanghaiTime = &shanghaiTime - config.DarwinTime = &shanghaiTime + darwinTime := londonBlock.Uint64() * 12 + config.DarwinTime = &darwinTime } config.TerminalTotalDifficulty = common.Big0