From 9d9510bcd13574d3431d514b6d4aa27674cea24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Ludue=C3=B1a?= Date: Thu, 12 Feb 2026 16:22:37 -0300 Subject: [PATCH] feat: coercion of expressions on cardano publish block --- crates/tx3-lang/src/cardano.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/tx3-lang/src/cardano.rs b/crates/tx3-lang/src/cardano.rs index 036ab79f..877aaca3 100644 --- a/crates/tx3-lang/src/cardano.rs +++ b/crates/tx3-lang/src/cardano.rs @@ -711,9 +711,18 @@ impl IntoLower for CardanoPublishBlockField { ctx: &crate::lowering::Context, ) -> Result { match self { - CardanoPublishBlockField::To(x) => Ok(("to".to_string(), x.into_lower(ctx)?)), - CardanoPublishBlockField::Amount(x) => Ok(("amount".to_string(), x.into_lower(ctx)?)), - CardanoPublishBlockField::Datum(x) => Ok(("datum".to_string(), x.into_lower(ctx)?)), + CardanoPublishBlockField::To(x) => { + let ctx = ctx.enter_address_expr(); + Ok(("to".to_string(), x.into_lower(&ctx)?)) + } + CardanoPublishBlockField::Amount(x) => { + let ctx = ctx.enter_asset_expr(); + Ok(("amount".to_string(), x.into_lower(&ctx)?)) + } + CardanoPublishBlockField::Datum(x) => { + let ctx = ctx.enter_datum_expr(); + Ok(("datum".to_string(), x.into_lower(&ctx)?)) + } CardanoPublishBlockField::Version(x) => Ok(("version".to_string(), x.into_lower(ctx)?)), CardanoPublishBlockField::Script(x) => Ok(("script".to_string(), x.into_lower(ctx)?)), }