mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
core/types: add benchmark
This commit is contained in:
parent
22e5dcea0c
commit
3c6d115b06
1 changed files with 12 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
|
"github.com/ethereum/go-ethereum/params/forks"
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -188,3 +189,14 @@ func createTestLegacyTxInner() *LegacyTx {
|
||||||
Data: nil,
|
Data: nil,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Benchmark_modernSigner_Equal(b *testing.B) {
|
||||||
|
signer1 := newModernSigner(big.NewInt(1), forks.Amsterdam)
|
||||||
|
signer2 := newModernSigner(big.NewInt(1), forks.Amsterdam)
|
||||||
|
|
||||||
|
for b.Loop() {
|
||||||
|
if !signer1.Equal(signer2) {
|
||||||
|
b.Fatal("expected signers to be equal")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue