mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 09:50:08 +01:00
caac0f821a
In this commit, we update all the btcutil imports to point to the new sub-module. In the same commit, we also modify the recently added `btcutil/go.mod` file as we need to continue pointing to the _old_ version of btcd, until we merge this PR and push a new tag.
32 lines
705 B
Go
32 lines
705 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"
|
|
|
|
"github.com/btcsuite/btcd/btcutil"
|
|
)
|
|
|
|
// BenchmarkIsCoinBase performs a simple benchmark against the IsCoinBase
|
|
// function.
|
|
func BenchmarkIsCoinBase(b *testing.B) {
|
|
tx, _ := btcutil.NewBlock(&Block100000).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 := Block100000.Transactions[1]
|
|
b.ResetTimer()
|
|
for i := 0; i < b.N; i++ {
|
|
IsCoinBaseTx(tx)
|
|
}
|
|
}
|