fix: add missing type checks for the new bls primitives
This commit is contained in:
parent
63f96d13ca
commit
45177cd08b
|
@ -4049,6 +4049,12 @@ impl<'a> CodeGenerator<'a> {
|
|||
Term::equals_string()
|
||||
} else if tipo.is_bytearray() {
|
||||
Term::equals_bytestring()
|
||||
} else if tipo.is_bls381_12_g1() {
|
||||
Term::bls12_381_g1_equal()
|
||||
} else if tipo.is_bls381_12_g2() {
|
||||
Term::bls12_381_g2_equal()
|
||||
} else if tipo.is_ml_result() {
|
||||
panic!("ML Result equality is not supported")
|
||||
} else {
|
||||
Term::equals_data()
|
||||
};
|
||||
|
|
|
@ -579,6 +579,12 @@ pub fn get_variant_name(t: &Rc<Type>) -> String {
|
|||
"_bool".to_string()
|
||||
} else if t.is_bytearray() {
|
||||
"_bytearray".to_string()
|
||||
} else if t.is_bls381_12_g1() {
|
||||
"_bls381_12_g1".to_string()
|
||||
} else if t.is_bls381_12_g2() {
|
||||
"_bls381_12_g2".to_string()
|
||||
} else if t.is_ml_result() {
|
||||
"_ml_result".to_string()
|
||||
} else if t.is_map() {
|
||||
let mut full_type = vec!["_map".to_string()];
|
||||
let pair_type = &t.get_inner_types()[0];
|
||||
|
@ -1305,7 +1311,7 @@ pub fn convert_constants_to_data(constants: Vec<Rc<UplcConstant>>) -> Vec<UplcCo
|
|||
UplcConstant::Bls12_381G2Element(b) => UplcConstant::Data(PlutusData::BoundedBytes(
|
||||
b.deref().clone().compress().into(),
|
||||
)),
|
||||
UplcConstant::Bls12_381MlResult(_) => unreachable!("Bls12_381MlResult not supported"),
|
||||
UplcConstant::Bls12_381MlResult(_) => panic!("Bls12_381MlResult not supported"),
|
||||
};
|
||||
new_constants.push(constant);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue