diff --git a/chain/rust/src/transaction/utils.rs b/chain/rust/src/transaction/utils.rs index f0642cdf..2266f7c0 100644 --- a/chain/rust/src/transaction/utils.rs +++ b/chain/rust/src/transaction/utils.rs @@ -48,6 +48,13 @@ impl TransactionOutput { } } + pub fn set_address(&mut self, new_address: Address) { + match self { + Self::AlonzoFormatTxOut(tx_out) => tx_out.address = new_address, + Self::ConwayFormatTxOut(tx_out) => tx_out.address = new_address, + } + } + pub fn amount(&self) -> &Value { match self { Self::AlonzoFormatTxOut(tx_out) => &tx_out.amount, diff --git a/chain/wasm/src/transaction/utils.rs b/chain/wasm/src/transaction/utils.rs index 5d2ddffc..b2036f01 100644 --- a/chain/wasm/src/transaction/utils.rs +++ b/chain/wasm/src/transaction/utils.rs @@ -31,6 +31,10 @@ impl TransactionOutput { self.0.address().clone().into() } + pub fn set_address(&mut self, addr: &Address) { + self.0.set_address(addr.clone().into()) + } + pub fn amount(&self) -> Value { self.0.amount().clone().into() }