diff --git a/.gitignore b/.gitignore index ea8c4bf7..5519fc3c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +*.flat \ No newline at end of file diff --git a/crates/flat/src/decode.rs b/crates/flat/src/decode.rs index e74ecc7f..e633896d 100644 --- a/crates/flat/src/decode.rs +++ b/crates/flat/src/decode.rs @@ -7,6 +7,7 @@ pub trait Decode<'b>: Sized { impl Decode<'_> for Filler { fn decode(d: &mut Decoder) -> Result { d.filler()?; + Ok(Filler::FillerEnd) } } diff --git a/crates/flat/src/encode.rs b/crates/flat/src/encode.rs index 13a5a21e..0bed9ff9 100644 --- a/crates/flat/src/encode.rs +++ b/crates/flat/src/encode.rs @@ -79,6 +79,7 @@ impl Encode for &[u8] { impl Encode for Box { fn encode(&self, e: &mut Encoder) -> Result<(), String> { self.as_ref().encode(e)?; + Ok(()) } } diff --git a/crates/uplc/example/plutus-core b/crates/uplc/example/integer.uplc similarity index 100% rename from crates/uplc/example/plutus-core rename to crates/uplc/example/integer.uplc diff --git a/crates/uplc/src/ast.rs b/crates/uplc/src/ast.rs index fb72287f..957fa1bf 100644 --- a/crates/uplc/src/ast.rs +++ b/crates/uplc/src/ast.rs @@ -34,7 +34,6 @@ pub enum Term { #[derive(Debug, Clone, PartialEq)] pub enum Constant { - // TODO: figure out the right size for this // tag: 0 Integer(isize), // tag: 1 diff --git a/crates/uplc/src/flat.rs b/crates/uplc/src/flat.rs index d6a4a34a..662992a7 100644 --- a/crates/uplc/src/flat.rs +++ b/crates/uplc/src/flat.rs @@ -261,6 +261,7 @@ mod test { let flat_encoded = vec![ 0b00001011, 0b00010110, 0b00100001, 0b01001000, 0b00000101, 0b10000001, ]; + let expected_program = Program { version: (11, 22, 33), term: Term::Constant(Constant::Integer(11)),