diff --git a/pkg/core/block.go b/pkg/core/block.go index 1561a3fa5..a7e2b4791 100644 --- a/pkg/core/block.go +++ b/pkg/core/block.go @@ -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. diff --git a/pkg/crypto/merkle_tree.go b/pkg/crypto/hash/merkle_tree.go similarity index 94% rename from pkg/crypto/merkle_tree.go rename to pkg/crypto/hash/merkle_tree.go index b1d289806..6e980d0b1 100644 --- a/pkg/crypto/merkle_tree.go +++ b/pkg/crypto/hash/merkle_tree.go @@ -1,9 +1,8 @@ -package crypto +package hash import ( "errors" - "github.com/CityOfZion/neo-go/pkg/crypto/hash" "github.com/CityOfZion/neo-go/pkg/util" ) @@ -66,7 +65,7 @@ func buildMerkleTree(leaves []*MerkleTreeNode) (*MerkleTreeNode, error) { b1 := parents[i].leftChild.hash.BytesBE() b2 := parents[i].rightChild.hash.BytesBE() b1 = append(b1, b2...) - parents[i].hash = hash.DoubleSha256(b1) + parents[i].hash = DoubleSha256(b1) } return buildMerkleTree(parents) diff --git a/pkg/crypto/merkle_tree_test.go b/pkg/crypto/hash/merkle_tree_test.go similarity index 98% rename from pkg/crypto/merkle_tree_test.go rename to pkg/crypto/hash/merkle_tree_test.go index dbd65c03a..89bb573fc 100644 --- a/pkg/crypto/merkle_tree_test.go +++ b/pkg/crypto/hash/merkle_tree_test.go @@ -1,4 +1,4 @@ -package crypto +package hash import ( "testing"