mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 18:00:11 +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.
24 lines
680 B
Go
24 lines
680 B
Go
// Copyright (c) 2013-2017 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"
|
|
)
|
|
|
|
// TestMerkle tests the BuildMerkleTreeStore API.
|
|
func TestMerkle(t *testing.T) {
|
|
block := btcutil.NewBlock(&Block100000)
|
|
merkles := BuildMerkleTreeStore(block.Transactions(), false)
|
|
calculatedMerkleRoot := merkles[len(merkles)-1]
|
|
wantMerkle := &Block100000.Header.MerkleRoot
|
|
if !wantMerkle.IsEqual(calculatedMerkleRoot) {
|
|
t.Errorf("BuildMerkleTreeStore: merkle root mismatch - "+
|
|
"got %v, want %v", calculatedMerkleRoot, wantMerkle)
|
|
}
|
|
}
|