From dfeb41a4fb8a377f0501abfb28a6d1b1d41646b8 Mon Sep 17 00:00:00 2001 From: IronGauntlets Date: Mon, 23 Dec 2024 18:00:25 +0000 Subject: [PATCH] Add BenchmarkStateDiffHash() --- core/state_update_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/state_update_test.go b/core/state_update_test.go index 74fac50699..a6b1505fb3 100644 --- a/core/state_update_test.go +++ b/core/state_update_test.go @@ -79,6 +79,18 @@ func TestStateDiffHash(t *testing.T) { } } +func BenchmarkStateDiffHash(b *testing.B) { + client := feeder.NewTestClient(b, &utils.SepoliaIntegration) + gw := adaptfeeder.New(client) + su, err := gw.StateUpdate(context.Background(), 38748) + require.NoError(b, err) + + b.ResetTimer() + for n := 0; n < b.N; n++ { + su.StateDiff.Hash() + } +} + func TestStateDiffLength(t *testing.T) { client := feeder.NewTestClient(t, &utils.Sepolia) gw := adaptfeeder.New(client)