fix(interop): skip conway certs in u5c (#498)

This commit is contained in:
Santiago Carmuega 2024-08-03 10:46:14 -03:00 committed by GitHub
parent be681fed92
commit 3e2c657f20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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))
}
@ -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()