From f6094aa61bb7d1f06ebf289e59cff87e6e5e2b3e Mon Sep 17 00:00:00 2001 From: Carlos Souza Date: Wed, 29 Oct 2025 16:31:11 -0400 Subject: [PATCH 1/2] Allow non-Alonzo era when missing total collateral This field is optional according to the CDDL. --- crates/cardano/src/roll/epochs.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/cardano/src/roll/epochs.rs b/crates/cardano/src/roll/epochs.rs index 37acef31..6ef3897f 100644 --- a/crates/cardano/src/roll/epochs.rs +++ b/crates/cardano/src/roll/epochs.rs @@ -123,11 +123,12 @@ impl dolos_core::EntityDelta for NoncesUpdate { // and Alonzo txs don't even have the total collateral field. This is why we // need to compute it by looking at collateral inputs and collateral return. // Pallas hides this from us by providing the "consumes" / "produces" facade. +// Note: This can be called for transactions from any era (Alonzo, Babbage, Conway) +// when total_collateral is not set. fn compute_collateral_value( tx: &MultiEraTx, utxos: &HashMap, ) -> Result { - debug_assert!(tx.era() == Era::Alonzo); debug_assert!(!tx.is_valid()); let mut total = 0; From 2cc252313234efed5e1d4e4f098218e3c97f3766 Mon Sep 17 00:00:00 2001 From: Carlos Souza Date: Wed, 29 Oct 2025 16:36:32 -0400 Subject: [PATCH 2/2] Remove unused import --- crates/cardano/src/roll/epochs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cardano/src/roll/epochs.rs b/crates/cardano/src/roll/epochs.rs index 6ef3897f..83446812 100644 --- a/crates/cardano/src/roll/epochs.rs +++ b/crates/cardano/src/roll/epochs.rs @@ -10,7 +10,7 @@ use pallas::{ }, Epoch, }, - traverse::{fees::compute_byron_fee, Era, MultiEraBlock, MultiEraCert, MultiEraTx}, + traverse::{fees::compute_byron_fee, MultiEraBlock, MultiEraCert, MultiEraTx}, }, }; use serde::{Deserialize, Serialize};