mirror of
https://github.com/FlipsideCrypto/dcrd.git
synced 2026-02-06 10:56:47 +00:00
txscript: Add bench for stake revocation scripts.
This commit is contained in:
parent
8468b0de2f
commit
9b3f4c924e
@ -392,3 +392,18 @@ func BenchmarkIsStakeGenerationScript(b *testing.B) {
|
||||
_ = isStakeGenScript(scriptVersion, script)
|
||||
}
|
||||
}
|
||||
|
||||
// BenchmarkIsStakeRevocationScript benchmarks how long it takes to analyze a
|
||||
// very large script to determine if it is a standard stake revocation script.
|
||||
func BenchmarkIsStakeRevocationScript(b *testing.B) {
|
||||
script, err := genComplexScript()
|
||||
if err != nil {
|
||||
b.Fatalf("failed to create benchmark script: %v", err)
|
||||
}
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
pops, _ := parseScript(script)
|
||||
_ = isStakeRevocation(pops)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user