mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 19:02:28 +00:00
crypto: move merkle tree into the hash package
It's all about hashes, so it makes sense putting it there.
This commit is contained in:
parent
db5555bb15
commit
ee28fb08f6
3 changed files with 6 additions and 7 deletions
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/CityOfZion/neo-go/pkg/core/transaction"
|
||||
"github.com/CityOfZion/neo-go/pkg/crypto"
|
||||
"github.com/CityOfZion/neo-go/pkg/crypto/hash"
|
||||
"github.com/CityOfZion/neo-go/pkg/io"
|
||||
"github.com/CityOfZion/neo-go/pkg/util"
|
||||
"github.com/Workiva/go-datastructures/queue"
|
||||
|
@ -30,13 +30,13 @@ func (b *Block) Header() *Header {
|
|||
}
|
||||
}
|
||||
|
||||
func merkleTreeFromTransactions(txes []*transaction.Transaction) (*crypto.MerkleTree, error) {
|
||||
func merkleTreeFromTransactions(txes []*transaction.Transaction) (*hash.MerkleTree, error) {
|
||||
hashes := make([]util.Uint256, len(txes))
|
||||
for i, tx := range txes {
|
||||
hashes[i] = tx.Hash()
|
||||
}
|
||||
|
||||
return crypto.NewMerkleTree(hashes)
|
||||
return hash.NewMerkleTree(hashes)
|
||||
}
|
||||
|
||||
// rebuildMerkleRoot rebuilds the merkleroot of the block.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue