Skip to content

Commit

Permalink
feat: flat decoding seems to be working well
Browse files Browse the repository at this point in the history
  • Loading branch information
rvcas committed Oct 8, 2024
1 parent 9eb19d5 commit 5811b67
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/uplc/src/flat/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ impl<'a, 'b> minicbor::decode::Decode<'b, Ctx<'a>> for &'a PlutusData<'a> {

Ok(PlutusData::list(ctx.arena, fields))
}
minicbor::data::Type::U8
| minicbor::data::Type::U16
| minicbor::data::Type::U32
| minicbor::data::Type::U64
| minicbor::data::Type::I8
| minicbor::data::Type::I16
| minicbor::data::Type::I32
| minicbor::data::Type::I64
| minicbor::data::Type::Int => {
let i: i128 = decoder.int()?.into();

Ok(PlutusData::integer_from(ctx.arena, i))
}
any => {
let e = minicbor::decode::Error::message(format!(
"bad cbor data type ({any:?}) for plutus data"
Expand Down

0 comments on commit 5811b67

Please sign in to comment.