refactor the rest of the term builders to use more concise code

This commit is contained in:
Kasey White 2023-03-20 22:33:27 -04:00 committed by Lucas
parent 7c3750bbb4
commit 6e5b24a937
10 changed files with 346 additions and 1142 deletions

View File

@ -4,10 +4,7 @@ use indexmap::{IndexMap, IndexSet};
use itertools::Itertools; use itertools::Itertools;
use uplc::{ use uplc::{
ast::{ ast::{
builder::{ builder::{CONSTR_FIELDS_EXPOSER, CONSTR_INDEX_EXPOSER},
apply_wrap, constr_index_exposer, delayed_choose_list, delayed_if_else, if_else,
CONSTR_FIELDS_EXPOSER,
},
Constant as UplcConstant, Name, Term, Type as UplcType, Constant as UplcConstant, Name, Term, Type as UplcType,
}, },
builtins::DefaultFunction, builtins::DefaultFunction,
@ -191,79 +188,39 @@ impl ClauseProperties {
pub fn convert_type_to_data(term: Term<Name>, field_type: &Arc<Type>) -> Term<Name> { pub fn convert_type_to_data(term: Term<Name>, field_type: &Arc<Type>) -> Term<Name> {
if field_type.is_bytearray() { if field_type.is_bytearray() {
apply_wrap(DefaultFunction::BData.into(), term) Term::b_data().apply(term)
} else if field_type.is_int() { } else if field_type.is_int() {
apply_wrap(DefaultFunction::IData.into(), term) Term::i_data().apply(term)
} else if field_type.is_void() { } else if field_type.is_void() {
apply_wrap( term.choose_unit(Term::Constant(
apply_wrap(Term::Builtin(DefaultFunction::ChooseUnit).force(), term),
Term::Constant(
UplcConstant::Data(PlutusData::Constr(Constr { UplcConstant::Data(PlutusData::Constr(Constr {
tag: convert_constr_to_tag(0).unwrap(), tag: convert_constr_to_tag(0).unwrap(),
any_constructor: None, any_constructor: None,
fields: vec![], fields: vec![],
})) }))
.into(), .into(),
), ))
)
} else if field_type.is_map() { } else if field_type.is_map() {
apply_wrap(DefaultFunction::MapData.into(), term) Term::map_data().apply(term)
} else if field_type.is_string() { } else if field_type.is_string() {
apply_wrap( Term::b_data().apply(Term::Builtin(DefaultFunction::EncodeUtf8).apply(term))
DefaultFunction::BData.into(),
apply_wrap(DefaultFunction::EncodeUtf8.into(), term),
)
} else if field_type.is_tuple() && matches!(field_type.get_uplc_type(), UplcType::Pair(_, _)) { } else if field_type.is_tuple() && matches!(field_type.get_uplc_type(), UplcType::Pair(_, _)) {
apply_wrap( Term::list_data()
Term::Lambda { .apply(
parameter_name: Name { Term::mk_cons()
text: "__pair".to_string(), .apply(Term::fst_pair().apply(Term::var("__pair".to_string())))
unique: 0.into(), .apply(
} Term::mk_cons()
.into(), .apply(Term::snd_pair().apply(Term::var("__pair".to_string())))
body: apply_wrap( .apply(Term::empty_list()),
DefaultFunction::ListData.into(),
apply_wrap(
apply_wrap(
Term::Builtin(DefaultFunction::MkCons).force(),
apply_wrap(
Term::Builtin(DefaultFunction::FstPair).force().force(),
Term::Var(
Name {
text: "__pair".to_string(),
unique: 0.into(),
}
.into(),
),
),
),
apply_wrap(
apply_wrap(
Term::Builtin(DefaultFunction::MkCons).force(),
apply_wrap(
Term::Builtin(DefaultFunction::SndPair).force().force(),
Term::Var(
Name {
text: "__pair".to_string(),
unique: 0.into(),
}
.into(),
),
),
),
Term::Constant(UplcConstant::ProtoList(UplcType::Data, vec![]).into()),
),
), ),
) )
.into(), .lambda("__pair".to_string())
}, .apply(term)
term,
)
} else if field_type.is_list() || field_type.is_tuple() { } else if field_type.is_list() || field_type.is_tuple() {
apply_wrap(DefaultFunction::ListData.into(), term) Term::list_data().apply(term)
} else if field_type.is_bool() { } else if field_type.is_bool() {
if_else( term.if_else(
term,
Term::Constant( Term::Constant(
UplcConstant::Data(PlutusData::Constr(Constr { UplcConstant::Data(PlutusData::Constr(Constr {
tag: convert_constr_to_tag(1).unwrap(), tag: convert_constr_to_tag(1).unwrap(),
@ -288,101 +245,32 @@ pub fn convert_type_to_data(term: Term<Name>, field_type: &Arc<Type>) -> Term<Na
pub fn convert_data_to_type(term: Term<Name>, field_type: &Arc<Type>) -> Term<Name> { pub fn convert_data_to_type(term: Term<Name>, field_type: &Arc<Type>) -> Term<Name> {
if field_type.is_int() { if field_type.is_int() {
apply_wrap(DefaultFunction::UnIData.into(), term) Term::un_i_data().apply(term)
} else if field_type.is_bytearray() { } else if field_type.is_bytearray() {
apply_wrap(DefaultFunction::UnBData.into(), term) Term::un_b_data().apply(term)
} else if field_type.is_void() { } else if field_type.is_void() {
delayed_if_else( Term::equals_integer()
apply_wrap( .apply(Term::integer(0.into()))
apply_wrap( .apply(Term::fst_pair().apply(Term::unconstr_data().apply(term)))
DefaultFunction::EqualsInteger.into(), .delayed_if_else(Term::unit(), Term::Error)
Term::Constant(UplcConstant::Integer(0.into()).into()),
),
apply_wrap(
Term::Builtin(DefaultFunction::FstPair).force().force(),
apply_wrap(DefaultFunction::UnConstrData.into(), term),
),
),
Term::Constant(UplcConstant::Unit.into()),
Term::Error,
)
} else if field_type.is_map() { } else if field_type.is_map() {
apply_wrap(DefaultFunction::UnMapData.into(), term) Term::unmap_data().apply(term)
} else if field_type.is_string() { } else if field_type.is_string() {
apply_wrap( Term::Builtin(DefaultFunction::DecodeUtf8).apply(Term::un_b_data().apply(term))
DefaultFunction::DecodeUtf8.into(),
apply_wrap(DefaultFunction::UnBData.into(), term),
)
} else if field_type.is_tuple() && matches!(field_type.get_uplc_type(), UplcType::Pair(_, _)) { } else if field_type.is_tuple() && matches!(field_type.get_uplc_type(), UplcType::Pair(_, _)) {
apply_wrap( Term::mk_pair_data()
Term::Lambda { .apply(Term::head_list().apply(Term::var("__list_data")))
parameter_name: Name { .apply(Term::head_list().apply(Term::var("__tail".to_string())))
text: "__list_data".to_string(), .lambda("__tail".to_string())
unique: 0.into(), .apply(Term::tail_list().apply(Term::var("__list_data")))
} .lambda("__list_data")
.into(), .apply(Term::unlist_data().apply(term))
body: apply_wrap(
Term::Lambda {
parameter_name: Name {
text: "__tail".to_string(),
unique: 0.into(),
}
.into(),
body: apply_wrap(
apply_wrap(
Term::Builtin(DefaultFunction::MkPairData),
apply_wrap(
Term::Builtin(DefaultFunction::HeadList).force(),
Term::Var(
Name {
text: "__list_data".to_string(),
unique: 0.into(),
}
.into(),
),
),
),
apply_wrap(
Term::Builtin(DefaultFunction::HeadList).force(),
Term::Var(
Name {
text: "__tail".to_string(),
unique: 0.into(),
}
.into(),
),
),
)
.into(),
},
apply_wrap(
Term::Builtin(DefaultFunction::TailList).force(),
Term::Var(
Name {
text: "__list_data".to_string(),
unique: 0.into(),
}
.into(),
),
),
)
.into(),
},
apply_wrap(Term::Builtin(DefaultFunction::UnListData), term),
)
} else if field_type.is_list() || field_type.is_tuple() { } else if field_type.is_list() || field_type.is_tuple() {
apply_wrap(DefaultFunction::UnListData.into(), term) Term::unlist_data().apply(term)
} else if field_type.is_bool() { } else if field_type.is_bool() {
apply_wrap( Term::equals_integer()
apply_wrap( .apply(Term::integer(1.into()))
DefaultFunction::EqualsInteger.into(), .apply(Term::fst_pair().apply(Term::unconstr_data().apply(term)))
Term::Constant(UplcConstant::Integer(1.into()).into()),
),
apply_wrap(
Term::Builtin(DefaultFunction::FstPair).force().force(),
apply_wrap(DefaultFunction::UnConstrData.into(), term),
),
)
} else { } else {
term term
} }
@ -564,246 +452,97 @@ pub fn list_access_to_uplc(
if let Some((first, names)) = names.split_first() { if let Some((first, names)) = names.split_first() {
let (current_tipo, tipos) = tipos.split_first().unwrap(); let (current_tipo, tipos) = tipos.split_first().unwrap();
let head_list = if matches!(current_tipo.get_uplc_type(), UplcType::Pair(_, _)) let head_list =
&& is_list_accessor if matches!(current_tipo.get_uplc_type(), UplcType::Pair(_, _)) && is_list_accessor {
{ Term::head_list().apply(Term::var(format!(
apply_wrap(
Term::Builtin(DefaultFunction::HeadList).force(),
Term::Var(
Name {
text: format!("tail_index_{}_{}", current_index, id_list[current_index]),
unique: 0.into(),
}
.into(),
),
)
} else {
convert_data_to_type(
apply_wrap(
Term::Builtin(DefaultFunction::HeadList).force(),
Term::Var(
Name {
text: format!(
"tail_index_{}_{}", "tail_index_{}_{}",
current_index, id_list[current_index] current_index, id_list[current_index]
), )))
unique: 0.into(), } else {
} convert_data_to_type(
.into(), Term::head_list().apply(Term::var(format!(
), "tail_index_{}_{}",
), current_index, id_list[current_index]
))),
&current_tipo.to_owned(), &current_tipo.to_owned(),
) )
}; };
if names.len() == 1 && tail { if names.len() == 1 && tail {
if first == "_" && names[0] == "_" { if first == "_" && names[0] == "_" {
Term::Lambda { term.lambda("_".to_string())
parameter_name: Name {
text: "_".to_string(),
unique: 0.into(),
}
.into(),
body: term.into(),
}
} else if first == "_" { } else if first == "_" {
Term::Lambda { term.lambda(names[0].clone())
parameter_name: Name { .apply(Term::tail_list().apply(Term::var(format!(
text: format!("tail_index_{}_{}", current_index, id_list[current_index]),
unique: 0.into(),
}
.into(),
body: apply_wrap(
Term::Lambda {
parameter_name: Name {
text: names[0].clone(),
unique: 0.into(),
}
.into(),
body: term.into(),
},
apply_wrap(
Term::Builtin(DefaultFunction::TailList).force(),
Term::Var(
Name {
text: format!(
"tail_index_{}_{}", "tail_index_{}_{}",
current_index, id_list[current_index] current_index, id_list[current_index]
), ))))
unique: 0.into(), .lambda(format!(
} "tail_index_{}_{}",
.into(), current_index, id_list[current_index]
), ))
),
)
.into(),
}
} else if names[0] == "_" { } else if names[0] == "_" {
Term::Lambda { term.lambda(first.clone()).apply(head_list).lambda(format!(
parameter_name: Name {
text: format!("tail_index_{}_{}", current_index, id_list[current_index]),
unique: 0.into(),
}
.into(),
body: apply_wrap(
Term::Lambda {
parameter_name: Name {
text: first.clone(),
unique: 0.into(),
}
.into(),
body: term.into(),
},
head_list,
)
.into(),
}
} else {
Term::Lambda {
parameter_name: Name {
text: format!("tail_index_{}_{}", current_index, id_list[current_index]),
unique: 0.into(),
}
.into(),
body: apply_wrap(
Term::Lambda {
parameter_name: Name {
text: first.clone(),
unique: 0.into(),
}
.into(),
body: apply_wrap(
Term::Lambda {
parameter_name: Name {
text: names[0].clone(),
unique: 0.into(),
}
.into(),
body: term.into(),
},
apply_wrap(
Term::Builtin(DefaultFunction::TailList).force(),
Term::Var(
Name {
text: format!(
"tail_index_{}_{}", "tail_index_{}_{}",
current_index, id_list[current_index] current_index, id_list[current_index]
), ))
unique: 0.into(), } else {
} term.lambda(names[0].clone())
.into(), .apply(Term::tail_list().apply(Term::var(format!(
), "tail_index_{}_{}",
), current_index, id_list[current_index]
) ))))
.into(), .lambda(first.clone())
}, .apply(head_list)
head_list, .lambda(format!(
) "tail_index_{}_{}",
.into(), current_index, id_list[current_index]
} ))
} }
} else if names.is_empty() { } else if names.is_empty() {
if first == "_" { if first == "_" {
Term::Lambda { if check_last_item {
parameter_name: Name { Term::tail_list()
text: if check_last_item { .apply(Term::var(format!(
"tail_index_{}_{}",
current_index, id_list[current_index]
)))
.delayed_choose_list(
term,
Term::Error.trace(
"List/Tuple/Constr contains more items than expected".to_string(),
),
)
} else {
term
}
.lambda(if check_last_item {
format!("tail_index_{}_{}", current_index, id_list[current_index]) format!("tail_index_{}_{}", current_index, id_list[current_index])
} else { } else {
"_".to_string() "_".to_string()
}, })
unique: 0.into(), } else {
} if check_last_item {
.into(), Term::tail_list()
body: if check_last_item { .apply(Term::var(format!(
delayed_choose_list(
apply_wrap(
Term::Builtin(DefaultFunction::TailList).force(),
Term::Var(
Name {
text: format!(
"tail_index_{}_{}", "tail_index_{}_{}",
current_index, id_list[current_index] current_index, id_list[current_index]
), )))
unique: 0.into(), .delayed_choose_list(
}
.into(),
),
),
term, term,
apply_wrap( Term::Error.trace(
apply_wrap( "List/Tuple/Constr contains more items than expected".to_string(),
Term::Builtin(DefaultFunction::Trace).force(),
Term::Constant(
UplcConstant::String(
"List/Tuple/Constr contains more items than expected"
.to_string(),
)
.into(),
), ),
),
Term::Delay(Term::Error.into()),
) )
.force(),
)
.into()
} else { } else {
term.into() term
},
} }
} else { .lambda(first.clone())
Term::Lambda { .apply(head_list)
parameter_name: Name { .lambda(format!(
text: format!("tail_index_{}_{}", current_index, id_list[current_index]),
unique: 0.into(),
}
.into(),
body: apply_wrap(
Term::Lambda {
parameter_name: Name {
text: first.clone(),
unique: 0.into(),
}
.into(),
body: if check_last_item {
delayed_choose_list(
apply_wrap(
Term::Builtin(DefaultFunction::TailList).force(),
Term::Var(
Name {
text: format!(
"tail_index_{}_{}", "tail_index_{}_{}",
current_index, id_list[current_index] current_index, id_list[current_index]
), ))
unique: 0.into(),
}
.into(),
),
),
term,
apply_wrap(
apply_wrap(
Term::Builtin(DefaultFunction::Trace).force(),
Term::Constant(
UplcConstant::String(
"List/Tuple/Constr contains more items than it expected"
.to_string(),
)
.into(),
),
),
Term::Delay(Term::Error.into()),
)
.force(),
)
.into()
} else {
term.into()
},
},
head_list,
)
.into(),
}
} }
} else if first == "_" { } else if first == "_" {
let mut list_access_inner = list_access_to_uplc( let mut list_access_inner = list_access_to_uplc(
@ -825,33 +564,15 @@ pub fn list_access_to_uplc(
if &parameter_name.text == "_" { if &parameter_name.text == "_" {
body.as_ref().clone() body.as_ref().clone()
} else { } else {
Term::Lambda { list_access_inner
parameter_name: Name { .apply(Term::tail_list().apply(Term::var(format!(
text: format!(
"tail_index_{}_{}", "tail_index_{}_{}",
current_index, id_list[current_index] current_index, id_list[current_index]
), ))))
unique: 0.into(), .lambda(format!(
}
.into(),
body: apply_wrap(
list_access_inner,
apply_wrap(
Term::Builtin(DefaultFunction::TailList).force(),
Term::Var(
Name {
text: format!(
"tail_index_{}_{}", "tail_index_{}_{}",
current_index, id_list[current_index] current_index, id_list[current_index]
), ))
unique: 0.into(),
}
.into(),
),
),
)
.into(),
}
} }
} }
_ => list_access_inner, _ => list_access_inner,
@ -859,14 +580,7 @@ pub fn list_access_to_uplc(
match &list_access_inner { match &list_access_inner {
Term::Lambda { .. } => list_access_inner, Term::Lambda { .. } => list_access_inner,
_ => Term::Lambda { _ => list_access_inner.lambda("_".to_string()),
parameter_name: Name {
text: "_".to_string(),
unique: 0.into(),
}
.into(),
body: list_access_inner.into(),
},
} }
} else { } else {
let mut list_access_inner = list_access_to_uplc( let mut list_access_inner = list_access_to_uplc(
@ -886,88 +600,35 @@ pub fn list_access_to_uplc(
body, body,
} => { } => {
if &parameter_name.text == "_" { if &parameter_name.text == "_" {
Term::Lambda { body.as_ref()
parameter_name: Name { .clone()
text: format!( .lambda(first.clone())
.apply(head_list)
.lambda(format!(
"tail_index_{}_{}", "tail_index_{}_{}",
current_index, id_list[current_index] current_index, id_list[current_index]
), ))
unique: 0.into(),
}
.into(),
body: apply_wrap(
Term::Lambda {
parameter_name: Name {
text: first.clone(),
unique: 0.into(),
}
.into(),
body: body.as_ref().clone().into(),
},
head_list,
)
.into(),
}
} else { } else {
Term::Lambda { list_access_inner
parameter_name: Name { .apply(Term::tail_list().apply(Term::var(format!(
text: format!(
"tail_index_{}_{}", "tail_index_{}_{}",
current_index, id_list[current_index] current_index, id_list[current_index]
), ))))
unique: 0.into(), .lambda(first.clone())
} .apply(head_list)
.into(), .lambda(format!(
body: apply_wrap(
Term::Lambda {
parameter_name: Name {
text: first.clone(),
unique: 0.into(),
}
.into(),
body: apply_wrap(
list_access_inner,
apply_wrap(
Term::Builtin(DefaultFunction::TailList).force(),
Term::Var(
Name {
text: format!(
"tail_index_{}_{}", "tail_index_{}_{}",
current_index, id_list[current_index] current_index, id_list[current_index]
), ))
unique: 0.into(),
}
.into(),
),
),
)
.into(),
},
head_list,
)
.into(),
} }
} }
} _ => list_access_inner
_ => Term::Lambda { .lambda(first.clone())
parameter_name: Name { .apply(head_list)
text: format!("tail_index_{}_{}", current_index, id_list[current_index]), .lambda(format!(
unique: 0.into(), "tail_index_{}_{}",
} current_index, id_list[current_index]
.into(), )),
body: apply_wrap(
Term::Lambda {
parameter_name: Name {
text: first.clone(),
unique: 0.into(),
}
.into(),
body: list_access_inner.into(),
},
head_list,
)
.into(),
},
}; };
list_access_inner list_access_inner
} }
@ -1316,36 +977,15 @@ pub fn wrap_validator_args(term: Term<Name>, arguments: &[TypedArg]) -> Term<Nam
let mut term = term; let mut term = term;
for arg in arguments.iter().rev() { for arg in arguments.iter().rev() {
if !matches!(arg.tipo.get_uplc_type(), UplcType::Data) { if !matches!(arg.tipo.get_uplc_type(), UplcType::Data) {
term = apply_wrap( term = term
Term::Lambda { .lambda(arg.arg_name.get_variable_name().unwrap_or("_").to_string())
parameter_name: Name { .apply(convert_data_to_type(
text: arg.arg_name.get_variable_name().unwrap_or("_").to_string(), Term::var(arg.arg_name.get_variable_name().unwrap_or("_").to_string()),
unique: 0.into(),
}
.into(),
body: term.into(),
},
convert_data_to_type(
Term::Var(
Name {
text: arg.arg_name.get_variable_name().unwrap_or("_").to_string(),
unique: 0.into(),
}
.into(),
),
&arg.tipo, &arg.tipo,
), ));
);
} }
term = Term::Lambda { term = term.lambda(arg.arg_name.get_variable_name().unwrap_or("_").to_string())
parameter_name: Name {
text: arg.arg_name.get_variable_name().unwrap_or("_").to_string(),
unique: 0.into(),
}
.into(),
body: term.into(),
}
} }
term term
} }
@ -1353,7 +993,7 @@ pub fn wrap_validator_args(term: Term<Name>, arguments: &[TypedArg]) -> Term<Nam
pub fn wrap_as_multi_validator(spend: Term<Name>, mint: Term<Name>) -> Term<Name> { pub fn wrap_as_multi_validator(spend: Term<Name>, mint: Term<Name>) -> Term<Name> {
Term::equals_integer() Term::equals_integer()
.apply(Term::integer(0.into())) .apply(Term::integer(0.into()))
.apply(constr_index_exposer(Term::var("__second_arg"))) .apply(Term::var(CONSTR_INDEX_EXPOSER).apply(Term::var("__second_arg")))
.delayed_if_else( .delayed_if_else(
mint.apply(Term::var("__first_arg")) mint.apply(Term::var("__first_arg"))
.apply(Term::var("__second_arg")), .apply(Term::var("__second_arg")),

View File

@ -5,8 +5,8 @@ use itertools::Itertools;
use uplc::{ use uplc::{
ast::{ ast::{
builder::{ builder::{
self, apply_wrap, assert_on_list, constr_index_exposer, final_wrapper, self, assert_on_list, final_wrapper, repeat_tail_list, ASSERT_ON_LIST,
repeat_tail_list, ASSERT_ON_LIST, CONSTR_FIELDS_EXPOSER, CONSTR_GET_FIELD, CONSTR_FIELDS_EXPOSER, CONSTR_GET_FIELD, CONSTR_INDEX_EXPOSER,
}, },
Constant as UplcConstant, Name, NamedDeBruijn, Program, Term, Type as UplcType, Constant as UplcConstant, Name, NamedDeBruijn, Program, Term, Type as UplcType,
}, },
@ -97,12 +97,6 @@ impl<'a> CodeGenerator<'a> {
let mut term = self.uplc_code_gen(&mut ir_stack); let mut term = self.uplc_code_gen(&mut ir_stack);
if self.needs_field_access {
term = builder::constr_get_field(term);
term = builder::constr_fields_exposer(term);
}
// Wrap the validator body if ifThenElse term unit error // Wrap the validator body if ifThenElse term unit error
term = final_wrapper(term); term = final_wrapper(term);
@ -134,9 +128,7 @@ impl<'a> CodeGenerator<'a> {
}; };
term = wrap_as_multi_validator(spend, mint); term = wrap_as_multi_validator(spend, mint);
term = builder::constr_get_field(term); self.needs_field_access = true;
term = builder::constr_fields_exposer(term);
} }
term = wrap_validator_args(term, params); term = wrap_validator_args(term, params);
@ -154,24 +146,26 @@ impl<'a> CodeGenerator<'a> {
self.convert_opaque_type_to_inner_ir(&mut ir_stack); self.convert_opaque_type_to_inner_ir(&mut ir_stack);
let mut term = self.uplc_code_gen(&mut ir_stack); let term = self.uplc_code_gen(&mut ir_stack);
if self.needs_field_access {
term = builder::constr_get_field(term);
term = builder::constr_fields_exposer(term);
}
self.finalize(term, false) self.finalize(term, false)
} }
fn finalize(&mut self, term: Term<Name>, wrap_as_validator: bool) -> Program<Name> { fn finalize(&mut self, term: Term<Name>, wrap_as_validator: bool) -> Program<Name> {
let term = if wrap_as_validator || self.used_data_assert_on_list { let mut term = if wrap_as_validator || self.used_data_assert_on_list {
assert_on_list(term) assert_on_list(term)
} else { } else {
term term
}; };
if self.needs_field_access {
term = builder::constr_get_field(term);
term = builder::constr_fields_exposer(term);
term = builder::constr_index_exposer(term);
}
let mut program = Program { let mut program = Program {
version: (1, 0, 0), version: (1, 0, 0),
term, term,
@ -708,8 +702,6 @@ impl<'a> CodeGenerator<'a> {
tipo, tipo,
.. ..
} => { } => {
self.needs_field_access = true;
ir_stack.push(Air::RecordAccess { ir_stack.push(Air::RecordAccess {
scope: scope.clone(), scope: scope.clone(),
record_index: *index, record_index: *index,
@ -4508,41 +4500,31 @@ impl<'a> CodeGenerator<'a> {
.apply(right) .apply(right)
.if_else(Term::bool(false), Term::bool(true)) .if_else(Term::bool(false), Term::bool(true))
} }
BinOp::LtInt => apply_wrap( BinOp::LtInt => Term::Builtin(DefaultFunction::LessThanInteger)
apply_wrap(DefaultFunction::LessThanInteger.into(), left), .apply(left)
right, .apply(right),
), BinOp::LtEqInt => Term::Builtin(DefaultFunction::LessThanEqualsInteger)
.apply(left)
BinOp::LtEqInt => apply_wrap( .apply(right),
apply_wrap(DefaultFunction::LessThanEqualsInteger.into(), left), BinOp::GtEqInt => Term::Builtin(DefaultFunction::LessThanEqualsInteger)
right, .apply(right)
), .apply(left),
BinOp::GtEqInt => apply_wrap( BinOp::GtInt => Term::Builtin(DefaultFunction::LessThanInteger)
apply_wrap(DefaultFunction::LessThanEqualsInteger.into(), right), .apply(right)
left, .apply(left),
), BinOp::AddInt => Term::add_integer().apply(left).apply(right),
BinOp::GtInt => apply_wrap( BinOp::SubInt => Term::Builtin(DefaultFunction::SubtractInteger)
apply_wrap(DefaultFunction::LessThanInteger.into(), right), .apply(left)
left, .apply(right),
), BinOp::MultInt => Term::Builtin(DefaultFunction::MultiplyInteger)
BinOp::AddInt => { .apply(left)
apply_wrap(apply_wrap(DefaultFunction::AddInteger.into(), left), right) .apply(right),
} BinOp::DivInt => Term::Builtin(DefaultFunction::DivideInteger)
BinOp::SubInt => apply_wrap( .apply(left)
apply_wrap(DefaultFunction::SubtractInteger.into(), left), .apply(right),
right, BinOp::ModInt => Term::Builtin(DefaultFunction::ModInteger)
), .apply(left)
BinOp::MultInt => apply_wrap( .apply(right),
apply_wrap(DefaultFunction::MultiplyInteger.into(), left),
right,
),
BinOp::DivInt => apply_wrap(
apply_wrap(DefaultFunction::DivideInteger.into(), left),
right,
),
BinOp::ModInt => {
apply_wrap(apply_wrap(DefaultFunction::ModInteger.into(), left), right)
}
}; };
arg_stack.push(term); arg_stack.push(term);
} }
@ -4607,6 +4589,7 @@ impl<'a> CodeGenerator<'a> {
arg_stack.push(term); arg_stack.push(term);
} }
Air::AssertConstr { constr_index, .. } => { Air::AssertConstr { constr_index, .. } => {
self.needs_field_access = true;
let constr = arg_stack.pop().unwrap(); let constr = arg_stack.pop().unwrap();
let mut term = arg_stack.pop().unwrap(); let mut term = arg_stack.pop().unwrap();
@ -4616,7 +4599,7 @@ impl<'a> CodeGenerator<'a> {
term = Term::equals_integer() term = Term::equals_integer()
.apply(Term::integer(constr_index.into())) .apply(Term::integer(constr_index.into()))
.apply(constr_index_exposer(constr)) .apply(Term::var(CONSTR_INDEX_EXPOSER.to_string()).apply(constr))
.delayed_if_else(term, error_term); .delayed_if_else(term, error_term);
arg_stack.push(term); arg_stack.push(term);
@ -4638,6 +4621,7 @@ impl<'a> CodeGenerator<'a> {
Air::When { Air::When {
subject_name, tipo, .. subject_name, tipo, ..
} => { } => {
self.needs_field_access = true;
let subject = arg_stack.pop().unwrap(); let subject = arg_stack.pop().unwrap();
let subject = if tipo.is_int() let subject = if tipo.is_int()
@ -4649,7 +4633,7 @@ impl<'a> CodeGenerator<'a> {
{ {
subject subject
} else { } else {
constr_index_exposer(subject) Term::var(CONSTR_INDEX_EXPOSER).apply(subject)
}; };
let mut term = arg_stack.pop().unwrap(); let mut term = arg_stack.pop().unwrap();
@ -4813,7 +4797,7 @@ impl<'a> CodeGenerator<'a> {
} else { } else {
Term::equals_integer() Term::equals_integer()
.apply(checker) .apply(checker)
.apply(constr_index_exposer(Term::var(subject_name))) .apply(Term::var(CONSTR_INDEX_EXPOSER).apply(Term::var(subject_name)))
}; };
let term = condition let term = condition
@ -5031,6 +5015,7 @@ impl<'a> CodeGenerator<'a> {
indices, indices,
.. ..
} => { } => {
self.needs_field_access = true;
let tail_name_prefix = "__tail_index".to_string(); let tail_name_prefix = "__tail_index".to_string();
let record = arg_stack.pop().unwrap(); let record = arg_stack.pop().unwrap();
@ -5105,7 +5090,6 @@ impl<'a> CodeGenerator<'a> {
term = term.lambda(tail_name).apply(tail_list); term = term.lambda(tail_name).apply(tail_list);
} }
self.needs_field_access = true;
term = term term = term
.lambda(prev_tail_name) .lambda(prev_tail_name)
.apply(Term::var(CONSTR_FIELDS_EXPOSER.to_string()).apply(record)); .apply(Term::var(CONSTR_FIELDS_EXPOSER.to_string()).apply(record));

View File

@ -50,6 +50,10 @@ impl Term<Name> {
Term::Constant(Constant::Bool(b).into()) Term::Constant(Constant::Bool(b).into())
} }
pub fn unit() -> Self {
Term::Constant(Constant::Unit.into())
}
pub fn empty_list() -> Self { pub fn empty_list() -> Self {
Term::Constant(Constant::ProtoList(Type::Data, vec![]).into()) Term::Constant(Constant::ProtoList(Type::Data, vec![]).into())
} }
@ -80,6 +84,26 @@ impl Term<Name> {
Term::Builtin(DefaultFunction::IData) Term::Builtin(DefaultFunction::IData)
} }
pub fn unconstr_data() -> Self {
Term::Builtin(DefaultFunction::UnConstrData)
}
pub fn un_i_data() -> Self {
Term::Builtin(DefaultFunction::UnIData)
}
pub fn un_b_data() -> Self {
Term::Builtin(DefaultFunction::UnBData)
}
pub fn unmap_data() -> Self {
Term::Builtin(DefaultFunction::UnMapData)
}
pub fn unlist_data() -> Self {
Term::Builtin(DefaultFunction::UnListData)
}
pub fn equals_integer() -> Self { pub fn equals_integer() -> Self {
Term::Builtin(DefaultFunction::EqualsInteger) Term::Builtin(DefaultFunction::EqualsInteger)
} }
@ -145,6 +169,21 @@ impl Term<Name> {
.apply(else_term) .apply(else_term)
} }
pub fn choose_unit(self, then_term: Self) -> Self {
Term::Builtin(DefaultFunction::ChooseUnit)
.force()
.apply(self)
.apply(then_term)
}
pub fn delayed_choose_unit(self, then_term: Self) -> Self {
Term::Builtin(DefaultFunction::ChooseUnit)
.force()
.apply(self)
.apply(then_term.delay())
.force()
}
pub fn delayed_if_else(self, then_term: Self, else_term: Self) -> Self { pub fn delayed_if_else(self, then_term: Self, else_term: Self) -> Self {
Term::Builtin(DefaultFunction::IfThenElse) Term::Builtin(DefaultFunction::IfThenElse)
.force() .force()
@ -173,540 +212,93 @@ impl Term<Name> {
} }
} }
pub fn apply_wrap(function: Term<Name>, arg: Term<Name>) -> Term<Name> {
Term::Apply {
function: function.into(),
argument: arg.into(),
}
}
pub fn final_wrapper(term: Term<Name>) -> Term<Name> { pub fn final_wrapper(term: Term<Name>) -> Term<Name> {
Term::Force( term.delayed_if_else(Term::unit(), Term::Error)
Term::Apply {
function: Term::Apply {
function: Term::Apply {
function: Term::Force(Term::Builtin(DefaultFunction::IfThenElse).into()).into(),
argument: term.into(),
}
.into(),
argument: Term::Delay(Term::Constant(Constant::Unit.into()).into()).into(),
}
.into(),
argument: Term::Delay(Term::Error.into()).into(),
}
.into(),
)
} }
pub fn assert_on_list(term: Term<Name>) -> Term<Name> { pub fn assert_on_list(term: Term<Name>) -> Term<Name> {
apply_wrap( term.lambda(ASSERT_ON_LIST.to_string())
Term::Lambda { .apply(Term::var(ASSERT_ON_LIST.to_string()).apply(Term::var(ASSERT_ON_LIST.to_string())))
parameter_name: Name { .lambda(ASSERT_ON_LIST.to_string())
text: ASSERT_ON_LIST.to_string(), .apply(
unique: 0.into(), Term::var("__list_to_check".to_string())
} .delayed_choose_list(
.into(), Term::unit(),
body: apply_wrap( Term::var("__check_with".to_string())
Term::Lambda { .apply(Term::head_list().apply(Term::var("__list_to_check".to_string())))
parameter_name: Name { .choose_unit(
text: ASSERT_ON_LIST.to_string(), Term::var(ASSERT_ON_LIST.to_string())
unique: 0.into(), .apply(Term::var(ASSERT_ON_LIST.to_string()))
} .apply(
.into(), Term::tail_list()
body: term.into(), .apply(Term::var("__list_to_check".to_string())),
}, )
apply_wrap( .apply(Term::var("__check_with".to_string())),
Term::Var(
Name {
text: ASSERT_ON_LIST.to_string(),
unique: 0.into(),
}
.into(),
),
Term::Var(
Name {
text: ASSERT_ON_LIST.to_string(),
unique: 0.into(),
}
.into(),
),
), ),
) )
.into(), .lambda("__check_with".to_string())
}, .lambda("__list_to_check".to_string())
Term::Lambda { .lambda(ASSERT_ON_LIST),
parameter_name: Name {
text: ASSERT_ON_LIST.to_string(),
unique: 0.into(),
}
.into(),
body: Term::Lambda {
parameter_name: Name {
text: "list_to_check".to_string(),
unique: 0.into(),
}
.into(),
body: Term::Lambda {
parameter_name: Name {
text: "check_with".to_string(),
unique: 0.into(),
}
.into(),
body: delayed_choose_list(
Term::Var(
Name {
text: "list_to_check".to_string(),
unique: 0.into(),
}
.into(),
),
Term::Constant(Constant::Unit.into()),
apply_wrap(
apply_wrap(
Term::Builtin(DefaultFunction::ChooseUnit).force(),
apply_wrap(
Term::Var(
Name {
text: "check_with".to_string(),
unique: 0.into(),
}
.into(),
),
apply_wrap(
Term::Builtin(DefaultFunction::HeadList).force(),
Term::Var(
Name {
text: "list_to_check".to_string(),
unique: 0.into(),
}
.into(),
),
),
),
),
apply_wrap(
apply_wrap(
apply_wrap(
Term::Var(
Name {
text: ASSERT_ON_LIST.to_string(),
unique: 0.into(),
}
.into(),
),
Term::Var(
Name {
text: ASSERT_ON_LIST.to_string(),
unique: 0.into(),
}
.into(),
),
),
apply_wrap(
Term::Builtin(DefaultFunction::TailList).force(),
Term::Var(
Name {
text: "list_to_check".to_string(),
unique: 0.into(),
}
.into(),
),
),
),
Term::Var(
Name {
text: "check_with".to_string(),
unique: 0.into(),
}
.into(),
),
),
),
)
.into(),
}
.into(),
}
.into(),
},
) )
} }
pub fn constr_fields_exposer(term: Term<Name>) -> Term<Name> { pub fn constr_fields_exposer(term: Term<Name>) -> Term<Name> {
Term::Apply { term.lambda(CONSTR_FIELDS_EXPOSER.to_string()).apply(
function: Term::Lambda { Term::snd_pair()
parameter_name: Name { .apply(Term::unconstr_data().apply(Term::var("__constr_var".to_string())))
text: CONSTR_FIELDS_EXPOSER.to_string(), .lambda("__constr_var"),
unique: 0.into(),
}
.into(),
body: term.into(),
}
.into(),
argument: Term::Lambda {
parameter_name: Name {
text: "__constr_var".to_string(),
unique: 0.into(),
}
.into(),
body: Term::Apply {
function: Term::Force(
Term::Force(Term::Builtin(DefaultFunction::SndPair).into()).into(),
) )
.into(),
argument: Term::Apply {
function: Term::Builtin(DefaultFunction::UnConstrData).into(),
argument: Term::Var(
Name {
text: "__constr_var".to_string(),
unique: 0.into(),
}
.into(),
)
.into(),
}
.into(),
}
.into(),
}
.into(),
}
} }
pub fn constr_index_exposer(term: Term<Name>) -> Term<Name> { pub fn constr_index_exposer(term: Term<Name>) -> Term<Name> {
Term::Apply { term.lambda(CONSTR_INDEX_EXPOSER.to_string()).apply(
function: Term::Force(Term::Force(Term::Builtin(DefaultFunction::FstPair).into()).into()) Term::fst_pair()
.into(), .apply(Term::unconstr_data().apply(Term::var("__constr_var".to_string())))
argument: Term::Apply { .lambda("__constr_var".to_string()),
function: Term::Builtin(DefaultFunction::UnConstrData).into(), )
argument: term.into(),
}
.into(),
}
} }
pub fn constr_get_field(term: Term<Name>) -> Term<Name> { pub fn constr_get_field(term: Term<Name>) -> Term<Name> {
Term::Apply { term.lambda(CONSTR_GET_FIELD.to_string())
function: Term::Lambda { .apply(
parameter_name: Name { Term::var(CONSTR_GET_FIELD.to_string())
text: CONSTR_GET_FIELD.to_string(), .apply(Term::var(CONSTR_GET_FIELD.to_string()))
unique: 0.into(), .apply(Term::integer(0.into())),
}
.into(),
body: term.into(),
}
.into(),
argument: Term::Lambda {
parameter_name: Name {
text: "__constr_list".to_string(),
unique: 0.into(),
}
.into(),
body: Term::Lambda {
parameter_name: Name {
text: "__arg_number".to_string(),
unique: 0.into(),
}
.into(),
body: Term::Apply {
function: Term::Lambda {
parameter_name: Name {
text: "__recurse".to_string(),
unique: 0.into(),
}
.into(),
body: Term::Apply {
function: Term::Apply {
function: Term::Apply {
function: Term::Var(
Name {
text: "__recurse".to_string(),
unique: 0.into(),
}
.into(),
) )
.into(), .lambda(CONSTR_GET_FIELD)
argument: Term::Var( .apply(
Name { Term::equals_integer()
text: "__recurse".to_string(), .apply(Term::var("__wanted_arg".to_string()))
unique: 0.into(), .apply(Term::var("__current_arg_number".to_string()))
} .if_else(
.into(), Term::head_list(),
Term::var(CONSTR_GET_FIELD)
.apply(Term::var(CONSTR_GET_FIELD))
.apply(
Term::add_integer()
.apply(Term::var("__current_arg_number".to_string()))
.apply(Term::integer(1.into())),
) )
.into(), .apply(
} Term::tail_list()
.into(), .apply(Term::var("__current_list_of_constr_args".to_string())),
// Start recursive with index 0 of list
argument: Term::Constant(Constant::Integer(0.into()).into()).into(),
}
.into(),
argument: Term::Var(
Name {
text: "__constr_list".to_string(),
unique: 0.into(),
}
.into(),
) )
.into(), .apply(Term::var("__wanted_arg"))
} .lambda("__current_list_of_constr_args".to_string()),
.into(),
}
.into(),
argument: Term::Lambda {
parameter_name: Name {
text: "__self_recursor".to_string(),
unique: 0.into(),
}
.into(),
body: Term::Lambda {
parameter_name: Name {
text: "__current_arg_number".to_string(),
unique: 0.into(),
}
.into(),
body: Term::Lambda {
parameter_name: Name {
text: "__list_of_constr_args".to_string(),
unique: 0.into(),
}
.into(),
body: Term::Apply {
function: Term::Apply {
function: Term::Apply {
function: Term::Apply {
function: Term::Force(
Term::Builtin(DefaultFunction::IfThenElse)
.into(),
) )
.into(), .apply(Term::var("__list_of_constr_args".to_string()))
argument: Term::Apply { .lambda("__wanted_arg".to_string())
function: Term::Apply { .lambda("__list_of_constr_args")
function: Term::Builtin( .lambda("__current_arg_number".to_string())
DefaultFunction::EqualsInteger, .lambda(CONSTR_GET_FIELD.to_string()),
) )
.into(),
argument: Term::Var(
Name {
text: "__arg_number".to_string(),
unique: 0.into(),
}
.into(),
)
.into(),
}
.into(),
argument: Term::Var(
Name {
text: "__current_arg_number"
.to_string(),
unique: 0.into(),
}
.into(),
)
.into(),
}
.into(),
}
.into(),
argument: Term::Force(
Term::Builtin(DefaultFunction::HeadList).into(),
)
.into(),
}
.into(),
argument: Term::Lambda {
parameter_name: Name {
text: "__current_list_of_constr_args".to_string(),
unique: 0.into(),
}
.into(),
body: Term::Apply {
function: Term::Apply {
function: Term::Apply {
function: Term::Var(
Name {
text: "__self_recursor".to_string(),
unique: 0.into(),
}
.into(),
)
.into(),
argument: Term::Var(
Name {
text: "__self_recursor".to_string(),
unique: 0.into(),
}
.into(),
)
.into(),
}
.into(),
argument: Term::Apply {
function: Term::Apply {
function: Term::Builtin(
DefaultFunction::AddInteger,
)
.into(),
argument: Term::Var(
Name {
text: "__current_arg_number"
.to_string(),
unique: 0.into(),
}
.into(),
)
.into(),
}
.into(),
argument: Term::Constant(
Constant::Integer(1.into()).into(),
)
.into(),
}
.into(),
}
.into(),
argument: Term::Apply {
function: Term::Force(
Term::Builtin(DefaultFunction::TailList)
.into(),
)
.into(),
argument: Term::Var(
Name {
text: "__current_list_of_constr_args"
.to_string(),
unique: 0.into(),
}
.into(),
)
.into(),
}
.into(),
}
.into(),
}
.into(),
}
.into(),
argument: Term::Var(
Name {
text: "__list_of_constr_args".to_string(),
unique: 0.into(),
}
.into(),
)
.into(),
}
.into(),
}
.into(),
}
.into(),
}
.into(),
}
.into(),
}
.into(),
}
.into(),
}
}
pub fn delayed_if_else(
condition: Term<Name>,
then_term: Term<Name>,
else_term: Term<Name>,
) -> Term<Name> {
Term::Apply {
function: Term::Apply {
function: Term::Apply {
function: Term::Builtin(DefaultFunction::IfThenElse).force().into(),
argument: condition.into(),
}
.into(),
argument: Term::Delay(then_term.into()).into(),
}
.into(),
argument: Term::Delay(else_term.into()).into(),
}
.force()
}
pub fn if_else(condition: Term<Name>, then_term: Term<Name>, else_term: Term<Name>) -> Term<Name> {
Term::Apply {
function: Term::Apply {
function: Term::Apply {
function: Term::Builtin(DefaultFunction::IfThenElse).force().into(),
argument: condition.into(),
}
.into(),
argument: then_term.into(),
}
.into(),
argument: else_term.into(),
}
}
pub fn delayed_choose_list(
list: Term<Name>,
empty_list_term: Term<Name>,
else_term: Term<Name>,
) -> Term<Name> {
Term::Apply {
function: Term::Apply {
function: Term::Apply {
function: Term::Builtin(DefaultFunction::ChooseList)
.force()
.force()
.into(),
argument: list.into(),
}
.into(),
argument: Term::Delay(empty_list_term.into()).into(),
}
.into(),
argument: Term::Delay(else_term.into()).into(),
}
.force()
}
pub fn choose_list(
list: Term<Name>,
empty_list_term: Term<Name>,
else_term: Term<Name>,
) -> Term<Name> {
Term::Apply {
function: Term::Apply {
function: Term::Apply {
function: Term::Builtin(DefaultFunction::ChooseList)
.force()
.force()
.into(),
argument: list.into(),
}
.into(),
argument: empty_list_term.into(),
}
.into(),
argument: else_term.into(),
}
} }
pub fn repeat_tail_list(term: Term<Name>, repeat: usize) -> Term<Name> { pub fn repeat_tail_list(term: Term<Name>, repeat: usize) -> Term<Name> {
let mut term = term; let mut term = term;
for _ in 0..repeat { for _ in 0..repeat {
term = Term::Apply { term = Term::tail_list().apply(term);
function: Term::Builtin(DefaultFunction::TailList).force().into(),
argument: term.into(),
};
} }
term term
} }

View File

@ -4,7 +4,7 @@ use indexmap::IndexMap;
use itertools::Itertools; use itertools::Itertools;
use crate::{ use crate::{
ast::{builder::apply_wrap, Name, Program, Term}, ast::{Name, Program, Term},
builtins::DefaultFunction, builtins::DefaultFunction,
}; };
// use crate::builtins::{DefaultFunction}; // use crate::builtins::{DefaultFunction};
@ -33,21 +33,13 @@ impl Program<Name> {
for default_func_index in builtin_map.keys().sorted().cloned() { for default_func_index in builtin_map.keys().sorted().cloned() {
let default_func: DefaultFunction = default_func_index.try_into().unwrap(); let default_func: DefaultFunction = default_func_index.try_into().unwrap();
term = apply_wrap( term = term
Term::Lambda { .lambda(format!("__{}_wrapped", default_func.aiken_name()))
parameter_name: Name { .apply(if default_func.force_count() == 1 {
text: format!("__{}_wrapped", default_func.aiken_name()),
unique: 0.into(),
}
.into(),
body: term.into(),
},
if default_func.force_count() == 1 {
Term::Builtin(default_func).force() Term::Builtin(default_func).force()
} else { } else {
Term::Builtin(default_func).force().force() Term::Builtin(default_func).force().force()
}, });
);
} }
Program { Program {

View File

@ -21,8 +21,8 @@
} }
} }
], ],
"compiledCode": "58e301000032323232323232323232222533300632323232533300a3370e9000000899251300400214a060166ea8004c8c8cc004dd6198019802198019802002a40009000119baf33004300500148000020c0040048894ccc03c0084cdd2a400497ae013232533300d300300213374a90001980900125eb804ccc01401400400cc04c00cc04400888c8ccc0040052000003222333300c3370e008004024466600800866e0000d200230140010012300a37540022930b180080091129998040010a4c26600a600260140046660060066016004002ae695cdaab9d5573caae7d5d02ba157441", "compiledCode": "58e50100003232323232323232323232323222253330093232533300b3370e9000000899251300a00214a064601a6ea8004004c8c8cc004dd6198041805198041805001a40009000119baf33009300b00148000018c0040048894ccc0400084cdd2a400497ae013232533300e300300213374a90001980980125eb804ccc01401400400cc05000cc048008526163001001222533300b00214984cc020c004c034008ccc00c00cc038008004cc0040052000222233330063370e0020060184666600a00a66e000112002300e001002002230053754002ae695cdaab9d5573caae7d5d02ba157441",
"hash": "bc602ee0cfd14a415cdd83dd746ae6260507ffec1827cf1bddc77893" "hash": "67da7558138818e07b4615b50e849829f0f5f9859a60cd817aff942e"
}, },
{ {
"title": "spend.spend", "title": "spend.spend",
@ -38,8 +38,8 @@
"$ref": "#/definitions/Data" "$ref": "#/definitions/Data"
} }
}, },
"compiledCode": "59015f010000323232323232323232322225333006323232323233001003232323322323232323330140014a0944004c94ccc05c0045288a5000133223233223253330173370e90010008801099190009bab301e00130110033018375400400297adef6c6033223300800200100200100100237566601260140049001001a441050000000000003001001222533301300213374a900125eb804c8c8c8c94ccc04ccdc7802800899ba548000cc060dd300125eb804ccc01c01c00c014dd7180a0019bab3014002301700330150023001001222533301000214a026464a66601c600600429444ccc01401400400cc05000cc048008dd6198009801198009801001a400090021119199800800a4000006444666601866e1c0100080488ccc010010cdc0001a40046028002002460146ea8004526163001001222533300800214984cc014c004c028008ccc00c00cc02c0080055cd2b9b5573aaae7955cfaba05742ae89", "compiledCode": "59016101000032323232323232323232323232222533300932323233001003232323322323232323330150014a0944004c94ccc0600045288a5000133223233223253330183370e90010008801099190009bab301f001301700332301a375400200400297adef6c6033223300800200100200100100237566601c60200049001001a45050000000000003001001222533301400213374a900125eb804c8c8c8c94ccc050cdc7802800899ba548000cc064dd300125eb804ccc01c01c00c014dd7180a8019bab3015002301800330160023001001222533301100214a026464a66601e600600429444ccc01401400400cc05400cc04c008dd6198031804198031804000a400090020a4c2c6002002444a66601600429309980418009806801199801801980700100099800800a40004444666600c66e1c00400c0308cccc014014cdc000224004601c0020040044600a6ea80055cd2b9b5573aaae7955cfaba05742ae881",
"hash": "6eeaf674bce0a9f818f396839364850e4b4bfb36efc13b61456ff630" "hash": "f8437a12347bff5782bd8ca695a3cce1e2375bb5e7358e3dd5163527"
} }
], ],
"definitions": { "definitions": {

View File

@ -19,8 +19,8 @@
"$ref": "#/definitions/spend~1PoolRedeemer" "$ref": "#/definitions/spend~1PoolRedeemer"
} }
}, },
"compiledCode": "59030501000032323232323232323232322225333006323232323232323232533300f3370e900000089925130090021533300f3370e9001000899191919299980999b87480080044c8c8cccc8888c8c8c8c8c9289812000980b19299980e99b8748000c080dd500088008a9980fa492a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016330120070033022001301432533301b3370e9000180f1baa0011001153301d49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300f005001300d48901ff00010001012005301b001300d00214a0602a6ea8004cc028c02c03120023017001300900213232323253330133370e9001000899191999911119191919192513024001301632533301d3370e900018101baa0011001153301f49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016330120070033022001301432533301b3370e9000180f1baa0011001153301d49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300f005001300d48901ff00010001012005301b001300d00214a0602a6ea8004cc028c02c031200230170013009002301137540026600c600e0129000119ba548000cc04ccdd2a4004660266ea40052f5c06602666e9520024bd7025eb8088cc010dd6198031803998031803801240009002119baf3300730080014800000888cc00cdd6198029803198029803001240009000119baf3300630073300630070014800920000023001001222533301000213374a900125eb804c8c94ccc034c00c0084cdd2a40006602600497ae013330050050010033014003301200222323330010014800000c888cccc030cdc3802001009919980200219b8000348008c0540040048c02cdd50008a4c2c6002002444a666012004293099802980098058011998018019806001000ab9a5736ae7155ceaab9e5573eae815d0aba201", "compiledCode": "5902fe010000323232323232323232323232323232222533300a3232323232323253330113370e9000000899251300f002153330113370e9001000899191919299980a99b87480080044c8c8cccc8888c8c8c8c8c9289813000980e19299980f99b8748000c078004400454cc08524012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016330120070033024001301a32533301d3370e9000180e00088008a9980fa4812a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300f005001300d48901ff0000e001010005301d001301300214a060260026601e60220149001180c8009807801099191919299980a99b87480080044c8c8cccc8888c8c8c8c8c9289813000980e19299980f99b8748000c078004400454cc0852412a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016330120070033024001301a32533301d3370e9000180e00088008a9980fa4812a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300f005001300d48901ff0000e001010005301d001301300214a060260026601e60220149001180c80098078011807800998059806803a4000466e952000330153374a90011980a9ba90014bd701980a99ba5480092f5c097ae02233004375866016601a66016601a004900024008466ebccc030c038005200000222330033758660146018660146018004900024000466ebccc02cc034cc02cc034005200248000008c0040048894ccc0480084cdd2a400497ae013232533300f300300213374a90001980a80125eb804ccc01401400400cc05800cc050008526163001001222533300d00214984cc024c004c03c008ccc00c00cc040008004cc0040052000222233330073370e00200601c4666600a00a66e00011200230100010020022300737540024600a6ea80055cd2b9b5738aae7555cf2ab9f5740ae855d11",
"hash": "5ed31a0590509ea818c80fdb4a1cc25a72e7b24a5c28115739ec38d3" "hash": "0ffbb7961d9eadaed5dce11d1b06289daa8e1837bb4c6580990385da"
} }
], ],
"definitions": { "definitions": {

View File

@ -19,8 +19,8 @@
"$ref": "#/definitions/Void" "$ref": "#/definitions/Void"
} }
}, },
"compiledCode": "5904a1010000323232323232323232323222253330063232323232323232323232323232323232323232323232323375e6e98008dd300099980a1bac33016301733016301701848001200422533301f3375e66030603200490000020998061bab3301830190024800800440052f5bded8c06660266eb0cc054c058cc054c05805d200048000894ccc078cdd79980b980c1980b980c0012400490000018998059bab33017301833017301800248009200200110014bd6f7b6301980a180a800a4000604200260420026024002603c002602064a66602e66e1d2000301a375400220022a660329212a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163232330013758660226024660226024026900024000466ebccc048c04c00520000043001001222533301e00213374a900125eb804c8c94ccc06cc00c0084cdd2a40006604200497ae0133300500500100330220033020002301c001300e3253330153370e9001180c1baa001100115330174912a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300d300e00f4800888c8004cccc8888cccc03001000c008004008004888c94ccc064c94ccc07c0045288a5000113374a900125eb804cdd2a40006603e6e980052f5c066664444666601600800600400200400244464a66603866e1c005200013374a900125eb804cdd2a4000660446ea00052f5c066e0000800401800c894ccc050cdc8001000899ba5480012f5c02a66602866e3c0080044cdd2a400497ae013374a900225eb80c004004888894ccc068010400c4c8c8c8c8ccccc02402400cccccc02801c004008018014018014dd7180d8019bad301b002301e005301c0043001001222222533301900513301a337606ea4010dd4001a5eb7bdb1804c8c8c8c94ccc060cdd79980280400099ba5480012f5c026603c66ec0dd48041ba8007009153330183371e01000226464a66603466e1d20000011323233022337606ea4030dd40008039bad302200130140021005301c375400266600c01000e00426603c66ec0dd48009ba800233333300a00a003008007006005375c60340066eb4c068008c074018c06c014c004004888894ccc058010400c4c8c8c8c8ccccc02402400cccccc02801c004008018014018014dd7180b8019bab3017002301a005301800430010012222225333015005133016337606ea4010dd3001a5eb7bdb1804c8c8c8c94ccc050cdd79980280400099ba5480012f5c026603466ec0dd48041ba6007009153330143371e01000226464a66602c66e1d2000001132323301e337606ea4030dd30008039bab301e001301000210053018375400266600c01000e00426603466ec0dd48009ba600233333300a00a003008007006005375c602c0066eacc058008c064018c05c014c00400488894ccc04400c40044c8c8cc010008cccc01801800401000cc054010c04c00c88c8ccc0040052000003222333300c3370e008004026466600800866e0000d200230150010012300b37540022930b180080091129998048010a4c26600a600260160046660060066018004002ae695cdab9c5573aaae7955cfaba05742ae881", "compiledCode": "59049f010000323232323232323232323232323232222533300a323232323232323232323232323232323232323232323375e6e98008dd300099980a1bac3301b301d3301b301d0164800120042253330213375e6603a603e00490000020998061bab3301d301f0024800800440052f5bded8c06660266eb0cc068c070cc068c070055200048000894ccc080cdd79980e180f1980e180f0012400490000018998059bab3301c301e3301c301e00248009200200110014bd6f7b6301980c980d800a40006046002604600260300026040002602c64a66603266e1d200030180011001153301b4912a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e001632323300137586602c60306602c6030022900024000466ebccc05cc06400520000043001001222533302000213374a900125eb804c8c94ccc074c00c0084cdd2a40006604600497ae0133300500500100330240033022002301e00130143253330173370e9001180b00088008a9980ca492a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e001633012301400d4800888c8004cccc8888cccc03001000c008004008004888c94ccc06cc94ccc0840045288a5000113374a900125eb804cdd2a4000660426e980052f5c066664444666601600800600400200400244464a66603c66e1c005200013374a900125eb804cdd2a4000660486ea00052f5c066e0000800401800c894ccc058cdc8001000899ba5480012f5c02a66602c66e3c0080044cdd2a400497ae013374a900225eb80c004004888894ccc070010400c4c8c8c8c8ccccc02402400cccccc02801c004008018014018014dd7180e8019bad301d0023020005301e0043001001222222533301b00513301c337606ea4010dd4001a5eb7bdb1804c8c8c8c94ccc068cdd79980280400099ba5480012f5c026604066ec0dd48041ba80070091533301a3371e01000226464a66603866e1d20000011323233024337606ea4030dd40008039bad3024001301a0021005301a001333006008007002133020337606ea4004dd40011999998050050018040038030029bae301c003375a6038004603e00c603a00a600200244444a6660300082006264646464666660120120066666601400e00200400c00a00c00a6eb8c06400cdd5980c801180e002980d0021800800911111299980b80289980c19bb037520086e9800d2f5bded8c0264646464a66602c66ebccc014020004cdd2a400097ae013301c337606ea4020dd30038048a99980b19b8f0080011323253330183370e9000000899191981019bb037520186e9800401cdd59810000980b0010802980b00099980300400380109980e19bb037520026e98008cccccc02802800c02001c018014dd7180c0019bab3018002301b006301900530010012222533301300310011323233004002333300600600100400330170043015003149858c0040048894ccc0340085261330093001300f002333003003301000200133001001480008888cccc01ccdc38008018071199980280299b8000448008c0400040080088c01cdd5000918029baa0015734ae6d5ce2ab9d5573caae7d5d02ba15745",
"hash": "df1c2d58a2a6a0002c4f4d3d9be395b5bb39290a62b70959970e06c3" "hash": "88abe485cde26d7ab6bbbf8cfdc8b628f57621dd3c236a35920bc7d8"
}, },
{ {
"title": "spend2.backtrace", "title": "spend2.backtrace",
@ -36,8 +36,8 @@
"$ref": "#/definitions/Void" "$ref": "#/definitions/Void"
} }
}, },
"compiledCode": "590109010000323232323232323232323222253330063232324a2600464a66601266e1d2000300c375400220022a660169212a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016323233001375866006600866006600800a9000240084944c0040048894ccc0400084cdd2a400497ae013232533300d300300213374a90001980980125eb804ccc01401400400cc05000cc04800888c8ccc0040052000003222333300c3370e008004026466600800866e0000d200230150010012300b37540022930b180080091129998048010a4c26600a600260160046660060066018004002ae695cdab9c5573aaae7955cfaba05742ae881", "compiledCode": "59010b01000032323232323232323232323232322225333009324a2601064a66601466e1d200032300e375400200220022a6601892012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e001632323300137586601060146601060140069000240084944c0040048894ccc0440084cdd2a400497ae013232533300e300300213374a90001980a00125eb804ccc01401400400cc05400cc04c008526163001001222533300c00214984cc020c004c038008ccc00c00cc03c008004cc0040052000222233330063370e00200601a4666600a00a66e000112002300f001002002230063754002ae695cdab9c5573aaae7955cfaba05742ae89",
"hash": "a48c257b952e82673f9832cba28bf43833fddb1b02ec0aeabe25e338" "hash": "ce1eb9a3b54205ca539e1b3260a1f2c3b71512621d3ab6ccf53edf85"
} }
], ],
"definitions": { "definitions": {

View File

@ -10,10 +10,8 @@ type DayOfTheWeek {
fn is_work(day: DayOfTheWeek) { fn is_work(day: DayOfTheWeek) {
when day is { when day is {
Tuesday | Wednesday | Thursday | Friday | Saturday -> Tuesday | Wednesday | Thursday | Friday | Saturday -> True
True _ -> False
_ ->
False
} }
} }
@ -27,12 +25,10 @@ test is_work_2() {
fn is_happy_hour(day: DayOfTheWeek, current_time: Int) { fn is_happy_hour(day: DayOfTheWeek, current_time: Int) {
when day is { when day is {
Monday | Sunday -> Monday | Sunday -> True
True
Tuesday | Wednesday | Thursday | Friday | Saturday if current_time > 18 -> Tuesday | Wednesday | Thursday | Friday | Saturday if current_time > 18 ->
True True
_ -> _ -> False
False
} }
} }

View File

@ -19,8 +19,8 @@
"$ref": "#/definitions/RedeemerWrapper$Int" "$ref": "#/definitions/RedeemerWrapper$Int"
} }
}, },
"compiledCode": "58a7010000323232323232323232322253330063370e900018041baa0011332253330083370e004902a0a4c2c6eb40080044cc88c894ccc028cdc399b800040024815052616375a0026eb4008c02cc8c028dd50008009119199800800a4000006444666601066e1c0100080348ccc010010cdc0001a4004601e0020026002002444a666010004293099802980098048011998018019805001000ab9a5736aae7555cf2ab9f5742ae89", "compiledCode": "58a901000032323232323232323232322253330073370e90001918051baa0010011332253330093370e004902a0a4c2c6eb40080044cc88c894ccc02ccdc399b800040024815052616375a0026eb4008c030c8c02cdd5000800980080091129998050010a4c26600e6002601600466600600660180040026600200290001111199980299b8700100300a2333300500533700008900118060008010012b9a5736aae7555cf2ab9f5742ae89",
"hash": "d5e5d02c9a5b71045eb8a0cfabd036d3a89bc3a403491bbff65a9621" "hash": "d6fb9dd55ea4830d0cb22eab55b4c9b15520da39ea32dafa134e77d7"
}, },
{ {
"title": "foo.mint", "title": "foo.mint",
@ -30,8 +30,8 @@
"$ref": "#/definitions/Int" "$ref": "#/definitions/Int"
} }
}, },
"compiledCode": "58a7010000323232323232323232322253330063370e900018041baa0011332253330083370e004902a0a4c2c6eb40080044cc88c894ccc028cdc399b800040024815052616375a0026eb4008c02cc8c028dd50008009119199800800a4000006444666601066e1c0100080348ccc010010cdc0001a4004601e0020026002002444a666010004293099802980098048011998018019805001000ab9a5736aae7555cf2ab9f5742ae89", "compiledCode": "58a901000032323232323232323232322253330073370e90001918051baa0010011332253330093370e004902a0a4c2c6eb40080044cc88c894ccc02ccdc399b800040024815052616375a0026eb4008c030c8c02cdd5000800980080091129998050010a4c26600e6002601600466600600660180040026600200290001111199980299b8700100300a2333300500533700008900118060008010012b9a5736aae7555cf2ab9f5742ae89",
"hash": "d5e5d02c9a5b71045eb8a0cfabd036d3a89bc3a403491bbff65a9621" "hash": "d6fb9dd55ea4830d0cb22eab55b4c9b15520da39ea32dafa134e77d7"
} }
], ],
"definitions": { "definitions": {

View File

@ -19,8 +19,8 @@
"$ref": "#/definitions/Void" "$ref": "#/definitions/Void"
} }
}, },
"compiledCode": "59046f0100003232323232323232323222253330063232323232300200132323232323233015333010323330113375e660146016002900b26126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a0944cc024c02802d20004c0103d87a80004c0103d879800033015333010323253330123370e900100089919299980a19baf3300d300e00148001300126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013370e6eb4cc034c038005200248000528180c80098060010b18099baa00133009300a00b48009300103d87a80004c0103d8798000330153330103232533301600116132533301700113232300c001330193330143375e6e98dd5998069807000a40046e98c0152080a8d6b9074c0103d87a80004c0103d8798000330193330143375e6601a601c6601a601c002900024000980122d8799f581c11111111111111111111111111111111111111111111111111111111ff004c0103d87a80004c0103d879800033019333014323253330163370e9000000899250301000214a2602e6ea8004cc034c038cc034c038005200048009300103d87a80004c0103d8798000330193330143375e6601a601c002900219ba5480012f5c098103d87a80004c0103d8798000330193330143375e6601a601c002900319ba5480092f5c098103d87a80004c0103d87980004bd70180c8010b180c8009bac3300a300b00148010cc024c02802d20004c0103d87a80004c0103d879800033015333010323375e6e98dd5998051805800a400c6e98c009205433009300a00b4800130103d87a80004c0103d87980004bd701199911299980999b870014800052f5bded8c02646400266664444666601400800600400297adef6c6000400100833332222333300c0040030020014bd6f7b630001000803a45004881000013001001222225333016004133017337606ea400cdd300125eb7bdb1804c8c8c8c94ccc058cdd79980280380099ba5480012f5c026603666ec0dd48039ba6006008153330163371e00e00226603666ec0dd48039ba600600313301b337606ea4004dd3001199998048048018038030029bae30170033756602e004603400a603000844a66601c66e400080044cdd2a400097ae01533300e3371e004002266e9520024bd70099ba5480112f5c0600200244444a66602600826602866ec0dd48019ba80024bd6f7b630099191919299980999baf330050070013374a900025eb804cc060cdd81ba9007375000c0102a66602666e3c01c0044cc060cdd81ba9007375000c00626603066ec0dd48009ba800233333009009003007006005375c60280066eb4c050008c05c014c054010c004004894ccc0380045288991929998060010998020020008a5030120023370e900118061baa301000122323330010014800000c888cccc030cdc3802001009119980200219b8000348008c0500040048c028dd50008a4c2c6002002444a666010004293099802980098050011998018019805801000ab9a5736aae7555cf2ab9f5740ae855d101", "compiledCode": "5904710100003232323232323232323232323232222533300a323232300200132323232323233017333012323330133375e6601e6022002900b26126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a0944cc038c04002520004c0103d87a80004c0103d879800033017333012323253330143370e900100089919299980b19baf33012301400148001300126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013370e6eb4cc048c050005200248000528180d80098090010b1809000998071808004a4004980103d87a80004c0103d8798000330173330123232533301800116132533301900113232300c0013301b3330163375e6e98dd599809180a000a40046e98c0152080a8d6b9074c0103d87a80004c0103d87980003301b3330163375e660246028660246028002900024000980122d8799f581c11111111111111111111111111111111111111111111111111111111ff004c0103d87a80004c0103d87980003301b333016323253330183370e9000000899250301600214a2602c002660246028660246028002900024004980103d87a80004c0103d87980003301b3330163375e660246028002900219ba5480012f5c098103d87a80004c0103d87980003301b3330163375e660246028002900319ba5480092f5c098103d87a80004c0103d87980004bd70180d8010b180d8009bac3300f301100148010cc038c04002520004c0103d87a80004c0103d879800033017333012323375e6e98dd5998079808800a400c6e98c00920543300e30100094800130103d87a80004c0103d87980004bd701199911299980a99b870014800052f5bded8c02646400266664444666601400800600400297adef6c6000400100833332222333300c0040030020014bd6f7b630001000803a45004881000013001001222225333018004133019337606ea400cdd300125eb7bdb1804c8c8c8c94ccc060cdd79980280380099ba5480012f5c026603a66ec0dd48039ba6006008153330183371e00e00226603a66ec0dd48039ba600600313301d337606ea4004dd3001199998048048018038030029bae301900337566032004603800a603400844a66602066e400080044cdd2a400097ae0153330103371e004002266e9520024bd70099ba5480112f5c0600200244444a66602a00826602c66ec0dd48019ba80024bd6f7b630099191919299980a99baf330050070013374a900025eb804cc068cdd81ba9007375000c0102a66602a66e3c01c0044cc068cdd81ba9007375000c00626603466ec0dd48009ba800233333009009003007006005375c602c0066eb4c058008c064014c05c010c004004894ccc0400045288991929998070010998020020008a5030140023370e900118071baa3012001149858c0040048894ccc0300085261330093001300e002333003003300f00200133001001480008888cccc01ccdc38008018069199980280299b8000448008c03c0040080088c018dd5000918021baa0015734ae6d55ceaab9e5573eae815d0aba21",
"hash": "1b19d9e3de3e442bfc49be1d4465f9e86268bd085d3b12d926cf5368" "hash": "eaf94df11baeb5cffea5f5e0a2428162ee93809520ca112fbad0b0ab"
}, },
{ {
"title": "deploy.spend", "title": "deploy.spend",
@ -36,8 +36,8 @@
"$ref": "#/definitions/Data" "$ref": "#/definitions/Data"
} }
}, },
"compiledCode": "5903f001000032323232323232323232322225333006323232323230020013301033300a32323375e0040026601893260103d87980000074c103d87a80004c0103d87980003301033300a32323232323232330123253330123370e900000089919299980c980e0010a4c2a6602c921364c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2069742065787065637465640016375a603400260180042a660289213a28636f6e20737472696e672022436f6e73747220696e64657820646964206e6f74206d6174636820616e7920747970652076617269616e742229001630143754002a66602266ebd30106d8799f182aff0000113370e64600a00200690020a50301700130093253330103370e900018099baa0011001153301249012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163322330060020010013237280026ecd30106d8799f182aff0037566600e60106600e6010012900024028600200244a6660260022900009919b8048008cc00c00c004c058004c0040048894ccc0480084cdd2a400497ae013232323253330113371e00a002266e952000330170024bd7009998038038018029bae30130033013002301600330140024c0103d87a80004c0103d87980003301033300a32533301000116132533301100116132323232533301032323009001330173330113375e660146016002900226126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff004c0103d87a80004c0103d8798000330173330113375e6601460160029003260122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff004c0103d87a80004c0103d87980004bd700010991918048009980b99980899baf3300a300b3300a300b0014800120024c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff004c0103d87a80004c0103d879800033017333011323253330133370e9002000899251300d00216301537540026601460160029002260103d87a80004c0103d87980004bd700008a50301600430150041630140013013001375866006600866006600800a900024008980103d87a80004c0103d87980004bd7018008009129998078008a5113232533300c00213300400400114a0602600466e1d2002300d3754602200244646660020029000001911199980619b870040020132333004004337000069001180a800800918059baa001149858c0040048894ccc0240085261330053001300b002333003003300c0020015734ae6d5ce2ab9d5573caae7d5d02ba15745", "compiledCode": "5903ee010000323232323232323232323232323232222533300a32323230020013301233300c32323375e0040026601c93260103d87980000054c103d87a80004c0103d87980003301233300c32323232323232330143253330143370e900000089919299980d980f0010a4c2a66030921334c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2065787065637465640016375a603800260240042a6602c9213a28636f6e20737472696e672022436f6e73747220696e64657820646964206e6f74206d6174636820616e7920747970652076617269616e7422290016301200153330133375e98106d8799f182aff0000113370e64600a00200690020a503019001300f3253330123370e9000180880088008a9980a24812a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163322330060020010013237280026ecd30106d8799f182aff00375666018601c66018601c00e900024028600200244a66602a0022900009919b8048008cc00c00c004c060004c0040048894ccc0500084cdd2a400497ae013232323253330133371e00a002266e952000330190024bd7009998038038018029bae30150033015002301800330160024c0103d87a80004c0103d87980003301233300c32533301200116132533301300116132323232533301232323009001330193330133375e6601e6022002900226126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff004c0103d87a80004c0103d8798000330193330133375e6601e60220029003260122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff004c0103d87a80004c0103d87980004bd700010991918048009980c99980999baf3300f30113300f30110014800120024c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff004c0103d87a80004c0103d879800033019333013323253330153370e900200089925130130021630130013300f30110014801130103d87a80004c0103d87980004bd700008a503018004301700416301600130150013758660106014660106014006900024008980103d87a80004c0103d87980004bd7018008009129998088008a5113232533300e00213300400400114a0602a00466e1d2002300f375460260022930b180080091129998068010a4c2660126002601e00466600600660200040026600200290001111199980399b8700100300e233330050053370000890011808000801001118039baa001230053754002ae695cdab9c5573aaae7955cfaba05742ae881",
"hash": "918ab345c2babf62b5fc5c319d41b4bd72648bdbeb73dcd17f17db63" "hash": "9e256628a3020d60ff765f9761b896c8be331ae383631f3d7038bee8"
}, },
{ {
"title": "mint.mint", "title": "mint.mint",
@ -47,8 +47,8 @@
"$ref": "#/definitions/Data" "$ref": "#/definitions/Data"
} }
}, },
"compiledCode": "590488010000323232323232323232323222533300532323232323001003300100122533300f00114a226464a6660180042660080080022940c04c008cdc3a4004601a6ea8c044004cc034ccc01cc8c8c8c8c8c8c94ccc04cc0580084c8c8cdc78018009bae3016001300932533300f3370e900018091baa0011001153301149012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300830090034800854cc0412401364c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2069742065787065637465640016375c602800264646464600c00200200264640026644660100040020029110000137566600c600e6600c600e00290002401000e600200244a666020002297ae01323232323301537520026600c00c0066eb8c04400cdd59808801180a0011809000980080091129998078010a5eb7bdb1804c8c8c8c94ccc038cdc7802800880189980a19bb037520026e98008ccc01c01c00c014dd718080019bab3010002301300330110024c103d87a80004c0103d87980003300d333007323232323322323232323253330123370e90010008b0991919b87001483c850dd6980d0009806801180a1baa001332233008002001001488103666f6f0033223233223253330153370e90010008801099190009bab301d00130100033017375400400297adef6c6033223300b002001002001375666012601400690040009bae30150013008533300d3370e900018081baa0021002153300f49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e001633005300600748008cc014c01801d20003001001222533301100213374a900125eb804c8c8c8c94ccc040cdc7802800899ba548000cc058dd400125eb804ccc01c01c00c014dd718090019bad3012002301500330130023001001222533300f00213374a900125eb804c8c8c8c94ccc038cdc7802800899ba548000cc050dd300125eb804ccc01c01c00c014dd718080019bab3010002301300330110024c103d87a80004c0103d87980003300d3330073232323233223232533300f3375e006002266e1cc8c018004dd5998049805198049805002240009009240042940c054004c020c94ccc038cdc3a400060226ea8004400454cc0412412a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e001633223300700200137566600e60106600e60100049000240246600e6010004900100380418008009129998080008a400026466e0120023300300300130130013001001222533300f00213374a900125eb804c8c8c8c94ccc038cdd7802800899ba548000cc0500092f5c0266600e00e00600a6020006602000460260066022004980103d87a80004c0103d87980004bd701119199800800a4000006444666601666e1c0100080488ccc010010cdc0001a40046028002002460146ea8004526163001001222533300900214984cc014c004c02c008ccc00c00cc0300080055cd2b9b5738aae7555cf2ab9f5740ae855d11", "compiledCode": "5904820100003232323232323232323232323232322253330093232323001003300100122533301100114a226464a66601c0042660080080022940c054008cdc3a4004601e6ea8c04c004cc03cccc024c8c8c8c8c8c8c94ccc054c0600084c8c8cdc78018009bae3018001300e3253330113370e9000180800088008a99809a4812a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300c300e0034800854cc0492401334c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2065787065637465640016375c602c00264646464600c002002002646400266446601000400200291100001375666014601866014601800290002401000a600200244a666024002297ae01323232323301737520026600c00c0066eb8c04c00cdd59809801180b001180a000980080091129998088010a5eb7bdb1804c8c8c8c94ccc040cdc7802800880189980b19bb037520026e98008ccc01c01c00c014dd718090019bab3012002301500330130024c103d87a80004c0103d87980003300f333009323232323322323232323253330143370e90010008b0991919b87001483c850dd6980e00098090011809000999119804001000800a44103666f6f0033223233223253330173370e90010008801099190009bab301f001301500330150020014bd6f7b6301991198058010008010009bab3300d300f00348020004dd7180b8009806a99980799b8748000c038008400854cc0452412a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e001633009300b00548008cc024c02c01520003001001222533301300213374a900125eb804c8c8c8c94ccc048cdc7802800899ba548000cc060dd400125eb804ccc01c01c00c014dd7180a0019bad3014002301700330150023001001222533301100213374a900125eb804c8c8c8c94ccc040cdc7802800899ba548000cc058dd300125eb804ccc01c01c00c014dd718090019bab3012002301500330130024c103d87a80004c0103d87980003300f333009323232323322323253330113375e006002266e1cc8c018004dd5998069807998069807802240009009240042940c05c004c034c94ccc040cdc3a4000601e00220022a660249212a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016332233007002001375666016601a66016601a00490002402466016601a004900100280318008009129998090008a400026466e0120023300300300130150013001001222533301100213374a900125eb804c8c8c8c94ccc040cdd7802800899ba548000cc0580092f5c0266600e00e00600a60240066024004602a0066026004980103d87a80004c0103d87980004bd700a4c2c6002002444a66601a00429309980498009807801199801801980800100099800800a40004444666600e66e1c00400c0388cccc014014cdc00022400460200020040044600e6ea80048c014dd5000ab9a5736ae7155ceaab9e5573eae815d0aba201",
"hash": "4713fb6d48ba86a228f79b958ae5ef137cdb08e02a9c2f72052bf5e5" "hash": "bfb5300db2017d35da65921fe782672da77ff7039831b23c59e57908"
}, },
{ {
"title": "withdrawals.spend", "title": "withdrawals.spend",
@ -64,8 +64,8 @@
"$ref": "#/definitions/Void" "$ref": "#/definitions/Void"
} }
}, },
"compiledCode": "59029101000032323232323232323232222533300632323232323001003300100122533300f00114a226464a66601a0042660080080022940c04c008cdc3a4004601a6ea8c044004c8c8c8cc040ccc02cc8c94ccc034cdc3a40040022c2646466e1c0052054375a6028002600e004601c6ea8004cc004dd5998021802998021802803240009006260126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff004c0103d87a80004c0103d87980003301033300b3232533300d3370e90010008b0991919b8700148070dd6980a000980380118071baa00133001375666008600a66008600a00c90002401898126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004c0103d87a80004c0103d87980003301033300b3375e6e9cc8c8c8c008004dd599803180399803180380424000900618008009129998088008a5eb804c8c8c8c8cc058004cc01801800cc04800cdd69809001180a80118098009ba7330104c0126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff00330104c126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004bd7026103d87a80004c0103d87980004bd70111980180100098008009112999807801099ba5480092f5c0264646464a66601e66ebc0140044cdd2a4000660286ea00092f5c0266600e00e00600a60200066eb4c040008c04c00cc04400888c8ccc0040052000003222333300c3370e008004024466600800866e0000d200230140010012300a37540022930b180080091129998040010a4c26600a600260140046660060066016004002ae695cdaab9d5573caae7d5d02ba15745", "compiledCode": "5902940100003232323232323232323232323232222533300a3232323001003300100122533301100114a226464a66601e0042660080080022940c054008cdc3a4004601e6ea8c04c004c8c8c8cc048ccc034c8c94ccc03ccdc3a40040022c2646466e1c0052054375a602c002601a004601a002660026eaccc024c02ccc024c02c01120004803130126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff004c0103d87a80004c0103d87980003301233300d3232533300f3370e90010008b0991919b8700148070dd6980b00098068011806800998009bab33009300b33009300b00448001200c4c126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004c0103d87a80004c0103d87980003301233300d3375e6e9cc8c8c8c008004dd599805980699805980680324000900618008009129998098008a5eb804c8c8c8c8cc060004cc01801800cc05000cdd6980a001180b801180a8009ba7330124c0126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff00330124c126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004bd7026103d87a80004c0103d87980004bd70111980180100098008009112999808801099ba5480092f5c0264646464a66602266ebc0140044cdd2a40006602c6ea00092f5c0266600e00e00600a60240066eb4c048008c05400cc04c008526163001001222533300c00214984cc024c004c038008ccc00c00cc03c008004cc0040052000222233330073370e00200601a4666600a00a66e000112002300f001002002230063754002460086ea80055cd2b9b5573aaae7955cfaba05742ae881",
"hash": "8926bce06966e878646861478d817460794aeaddb9d7440446b07e0f" "hash": "d36e5d8c48a95c1cb550e607be407603a8a2d89a553bc8d6c6aee915"
} }
], ],
"definitions": { "definitions": {