fix: switch from unwrap to if let to allow boolean when

fix: test 67 fixed to take in ByteArray instead of string literal
This commit is contained in:
Kasey White
2023-02-20 04:37:33 -05:00
parent 2394438a91
commit 70164282f8
4 changed files with 33 additions and 23 deletions

View File

@@ -54,7 +54,7 @@ test to_list_1() {
// Function returning a hash of a given Merkle Tree element
pub fn root_hash(self: MerkleTree<a>) -> Hash<Sha2_256, ByteArray> {
when self is {
Empty -> #""
Empty -> ""
Leaf { hash, .. } -> hash
Node { hash, .. } -> hash
}
@@ -579,6 +579,6 @@ fn get_proof_item_value(proof_item: ProofItem) -> Hash<Sha2_256, ByteArray> {
}
}
fn create_string_item_hash_fn() -> fn(String) -> Hash<Sha2_256, String> {
fn(x: String) { sha2_256(from_string(x)) }
fn create_string_item_hash_fn() -> fn(ByteArray) -> Hash<Sha2_256, String> {
fn(x: ByteArray) { sha2_256(x) }
}