github.com/lbryio/lbcd@v0.22.119/claimtrie/merkletrie/merkletrie_test.go (about) 1 package merkletrie 2 3 import ( 4 "testing" 5 6 "github.com/lbryio/lbcd/chaincfg/chainhash" 7 "github.com/lbryio/lbcd/claimtrie/node" 8 9 "github.com/stretchr/testify/require" 10 ) 11 12 func TestName(t *testing.T) { 13 14 r := require.New(t) 15 16 target, _ := chainhash.NewHashFromStr("e9ffb584c62449f157c8be88257bd1eebb2d8ef824f5c86b43c4f8fd9e800d6a") 17 18 data := []*chainhash.Hash{EmptyTrieHash} 19 root := node.ComputeMerkleRoot(data) 20 r.True(EmptyTrieHash.IsEqual(root)) 21 22 data = append(data, NoChildrenHash, NoClaimsHash) 23 root = node.ComputeMerkleRoot(data) 24 r.True(target.IsEqual(root)) 25 }