Fix: additional tipo case when using Pairs type inside of a redeemer or datum type

This commit is contained in:
microproofs 2025-01-30 18:54:14 +07:00
parent cb69325af5
commit 7d6925545c
No known key found for this signature in database
GPG Key ID: 14F93C84DE6AFD17
3 changed files with 39 additions and 1 deletions

View File

@ -719,7 +719,14 @@ pub fn get_arg_type_name(tipo: &Type) -> String {
let inner_args = elems.iter().map(|arg| get_arg_type_name(arg)).collect_vec();
inner_args.join("_")
}
_ => unreachable!(),
Type::Pair { fst, snd, .. } => {
let inner_args = [fst, snd]
.iter()
.map(|arg| get_arg_type_name(arg))
.collect_vec();
inner_args.join("_")
}
_ => unreachable!("WTF {:#?}", tipo),
}
}

View File

@ -0,0 +1,19 @@
name = "aiken-lang/104"
version = "0.0.0"
license = "Apache-2.0"
description = "Aiken contracts for project 'aiken-lang/104'"
[repository]
user = "aiken-lang"
project = "104"
platform = "github"
[[dependencies]]
name = "aiken-lang/stdlib"
version = "main"
source = "github"
[[dependencies]]
name = "aiken-lang/fuzz"
version = "main"
source = "github"

View File

@ -0,0 +1,12 @@
pub type Thing =
Option<Pairs<ByteArray, Pairs<ByteArray, Int>>>
validator foo_3 {
mint(redeemer: Thing, _policy_, _tx) {
redeemer == redeemer
}
else(_) {
fail
}
}