f73b79ae04
Co-authored-by: Roy Lee <roylee17@gmail.com>
29 lines
660 B
Go
29 lines
660 B
Go
// Copyright (c) 2015 The btcsuite developers
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package blockchain
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// BenchmarkIsCoinBase performs a simple benchmark against the IsCoinBase
|
|
// function.
|
|
func BenchmarkIsCoinBase(b *testing.B) {
|
|
tx, _ := GetBlock100000().Tx(1)
|
|
b.ResetTimer()
|
|
for i := 0; i < b.N; i++ {
|
|
IsCoinBase(tx)
|
|
}
|
|
}
|
|
|
|
// BenchmarkIsCoinBaseTx performs a simple benchmark against the IsCoinBaseTx
|
|
// function.
|
|
func BenchmarkIsCoinBaseTx(b *testing.B) {
|
|
tx, _ := GetBlock100000().Tx(1)
|
|
b.ResetTimer()
|
|
for i := 0; i < b.N; i++ {
|
|
IsCoinBaseTx(tx.MsgTx())
|
|
}
|
|
}
|