Skip to content

Commit

Permalink
fix(interop): skip conway certs in u5c (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Aug 3, 2024
1 parent be681fe commit 3e2c657
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions pallas-utxorpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,26 @@ impl<C: LedgerContext> Mapper<C> {
x: &trv::MultiEraCert,
tx: &trv::MultiEraTx,
order: u32,
) -> Option<u5c::Certificate> {
match x {
pallas_traverse::MultiEraCert::AlonzoCompatible(x) => {
self.map_alonzo_cert(x, tx, order).into()
}
pallas_traverse::MultiEraCert::Conway(_) => {
// TODO: add conway certificates in spec
None
}
_ => None,
}
}

pub fn map_alonzo_cert(
&self,
x: &pallas_primitives::alonzo::Certificate,
tx: &trv::MultiEraTx,
order: u32,
) -> u5c::Certificate {
let inner = match x.as_alonzo().unwrap() {
let inner = match x {
babbage::Certificate::StakeRegistration(a) => {
u5c::certificate::Certificate::StakeRegistration(self.map_stake_credential(a))
}
Expand Down Expand Up @@ -562,7 +580,7 @@ impl<C: LedgerContext> Mapper<C> {
.certs()
.iter()
.enumerate()
.map(|(order, x)| self.map_cert(x, tx, order as u32))
.filter_map(|(order, x)| self.map_cert(x, tx, order as u32))
.collect(),
withdrawals: tx
.withdrawals_sorted_set()
Expand Down

0 comments on commit 3e2c657

Please sign in to comment.