From 41a40b65708ed8b4ac545177fd52c4e542ed8bc7 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:23:54 +0100 Subject: [PATCH] fix BLOCKHASH test --- core/vm/runtime/runtime_test.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index d569b20587..b9ce0e364b 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -248,11 +248,7 @@ func (d *dummyChain) GetHeader(h common.Hash, n uint64) *types.Header { } func (d *dummyChain) Config() *params.ChainConfig { - return nil -} - -func (d *dummyChain) GetHeaderByNumber(n uint64) *types.Header { - return d.GetHeader(common.Hash{}, n) + return ¶ms.ChainConfig{} } // TestBlockhash tests the blockhash operation. It's a bit special, since it internally @@ -325,8 +321,8 @@ func TestBlockhash(t *testing.T) { if last.Uint64() != 744 { t.Fatalf("last block should be 744, got %d (%x)", last, ret[64:96]) } - if exp, got := 255, chain.counter; exp != got { - t.Errorf("suboptimal; too much chain iteration, expected %d, got %d", exp, got) + if exp, got := 256, chain.counter; exp != got { + t.Errorf("suboptimal; too many chain iteration, expected %d, got %d", exp, got) } }