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

@@ -3,11 +3,11 @@
[[requirements]]
name = "aiken-lang/stdlib"
version = "3b47c89006e7580c2213370d7426ed2a38d2836e"
version = "main"
source = "github"
[[packages]]
name = "aiken-lang/stdlib"
version = "3b47c89006e7580c2213370d7426ed2a38d2836e"
version = "main"
requirements = []
source = "github"

View File

@@ -1,6 +1,8 @@
name = "aiken-lang/acceptance_test_067"
version = "0.0.0"
version = '0.0.0'
description = ''
dependencies = [
{ name = "aiken-lang/stdlib", version = "3b47c89006e7580c2213370d7426ed2a38d2836e", source = "github" },
]
[[dependencies]]
name = 'aiken-lang/stdlib'
version = 'main'
source = 'github'

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) }
}