diff --git a/crates/uplc/src/flat.rs b/crates/uplc/src/flat.rs index d7a44a85..4ee52881 100644 --- a/crates/uplc/src/flat.rs +++ b/crates/uplc/src/flat.rs @@ -240,10 +240,16 @@ fn encode_constant_value(x: &Constant, e: &mut Encoder) -> Result<(), en::Error> } Constant::ProtoPair(_, _, a, b) => { encode_constant_value(a, e)?; - encode_constant_value(b, e)?; - Ok(()) + + encode_constant_value(b, e) + } + Constant::Data(data) => { + let cbor = data + .encode_fragment() + .map_err(|err| en::Error::Message(err.to_string()))?; + + cbor.encode(e) } - Constant::Data(_) => todo!(), } } @@ -263,7 +269,7 @@ fn encode_type(typ: &Type, bytes: &mut Vec) { encode_type(type1, bytes); encode_type(type2, bytes); } - Type::Data => todo!(), + Type::Data => bytes.push(8), } }