func calculateSubtreeHashWithOneLeaf(key *chainhash.Hash, value *chainhash.Hash, atLevel uint8) chainhash.Hash {
	h := *value

	for i := uint8(0); i < atLevel; i++ {
		right := isRight(*key, i+1)

		// the key is in the right subtree
		if right {
			h = primitives.CombineHashes(&primitives.EmptyTrees[i], &h)
		} else {
			h = primitives.CombineHashes(&h, &primitives.EmptyTrees[i])
		}
	}

	return h
}
// calculateSubtreeHashWithOneLeaf calculates the hash of a subtree with only a single leaf at a certain height.
// atLevel is the height to calculate at.
calculateSubtreeHashWithOneLeaf calculates the hash of a subtree with only a single leaf at a certain height.
atLevel is the height to calculate at.
// calculateSubtreeHashWithOneLeaf calculates the hash of a subtree with only a single leaf at a certain height . // atLevel is the height to calculate at .
func calculateSubtreeHashWithOneLeaf(key *chainhash.Hash, value *chainhash.Hash, atLevel uint8) chainhash.Hash {
	h := *value
	for i := uint8(0); i < atLevel; i++ {
		right := isRight(*key, i+1)
		if right {
			h = primitives.CombineHashes(&primitives.EmptyTrees[i], &h)
		} else {
			h = primitives.CombineHashes(&h, &primitives.EmptyTrees[i])
		}
	}
	return h
}
func calculateSubtreeHashWithOneLeaf ( key * chainhash . Hash , value * chainhash . Hash , atLevel uint8 ) chainhash . Hash { h := * value for i := uint8 ( 0 ) ; i < atLevel ; i ++ { right := isRight ( * key , i + 1 ) if right { h = primitives . CombineHashes ( & primitives . EmptyTrees [ i ] , & h ) } else { h = primitives . CombineHashes ( & h , & primitives . EmptyTrees [ i ] ) } } return h }
calculateSubtreeHashWithOneLeaf calculates the hash of a subtree with only a single leaf at a certain height.
calculateSubtreeHashWithOneLeaf calculates the hash of a subtree with only a single leaf at a certain height .
// the key is in the right subtree