commit validator changes and tests

This commit is contained in:
microproofs
2023-04-28 16:47:50 -04:00
committed by Kasey
parent b108c0f610
commit 0d0c96deda
4 changed files with 676 additions and 185 deletions

View File

@@ -63,6 +63,18 @@ impl<T> Term<T> {
)
}
pub fn map_values(vals: Vec<Constant>) -> Self {
Term::Constant(
Constant::ProtoList(Type::Pair(Type::Data.into(), Type::Data.into()), vals).into(),
)
}
pub fn pair_values(fst_val: Constant, snd_val: Constant) -> Self {
Term::Constant(
Constant::ProtoPair(Type::Data, Type::Data, fst_val.into(), snd_val.into()).into(),
)
}
pub fn constr_data() -> Self {
Term::Builtin(DefaultFunction::ConstrData)
}
@@ -135,6 +147,14 @@ impl<T> Term<T> {
Term::Builtin(DefaultFunction::SubtractInteger)
}
pub fn div_integer() -> Self {
Term::Builtin(DefaultFunction::DivideInteger)
}
pub fn mod_integer() -> Self {
Term::Builtin(DefaultFunction::ModInteger)
}
pub fn length_of_bytearray() -> Self {
Term::Builtin(DefaultFunction::LengthOfByteString)
}