chore(utxorpc): update spec to v0.14 and update redeemer mapper (#559)

Co-authored-by: ricomiles <ricoquiblat@gmail.com>
This commit is contained in:
Santiago Carmuega 2024-12-14 16:16:42 -03:00 committed by GitHub
parent e2aa8139fc
commit ac66eb9473
4 changed files with 49 additions and 1 deletions

View file

@ -1,5 +1,6 @@
use std::borrow::Cow;
use pallas_codec::minicbor;
use pallas_primitives::{alonzo, conway};
use crate::MultiEraRedeemer;
@ -78,4 +79,11 @@ impl<'b> MultiEraRedeemer<'b> {
})),
)
}
pub fn encode(&self) -> Vec<u8> {
match self {
MultiEraRedeemer::AlonzoCompatible(x) => minicbor::to_vec(x).unwrap(),
MultiEraRedeemer::Conway(k, v) => minicbor::to_vec((k, v)).unwrap(),
}
}
}