Skip to content

Commit 3023473

Browse files
committed
core/types: add benchmark
1 parent e3f1e40 commit 3023473

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

core/types/transaction_signing_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/ethereum/go-ethereum/common"
2626
"github.com/ethereum/go-ethereum/crypto"
2727
"github.com/ethereum/go-ethereum/params"
28+
"github.com/ethereum/go-ethereum/params/forks"
2829
"github.com/ethereum/go-ethereum/rlp"
2930
)
3031

@@ -188,3 +189,14 @@ func createTestLegacyTxInner() *LegacyTx {
188189
Data: nil,
189190
}
190191
}
192+
193+
func Benchmark_modernSigner_Equal(b *testing.B) {
194+
signer1 := newModernSigner(big.NewInt(1), forks.Amsterdam)
195+
signer2 := newModernSigner(big.NewInt(1), forks.Amsterdam)
196+
197+
for b.Loop() {
198+
if !signer1.Equal(signer2) {
199+
b.Fatal("expected signers to be equal")
200+
}
201+
}
202+
}

0 commit comments

Comments
 (0)