From d80cac5b422fe17eeeea43a4d6822c4beea12791 Mon Sep 17 00:00:00 2001 From: Alexsander Falcucci Date: Thu, 21 Dec 2023 23:15:34 +0100 Subject: [PATCH] refactor: improve test robustness and broaden platform support - refactor the 'values' struct initialization to include type conversions for the 'address' field in the testing module of the 'pallas_observer.rs' file. --- mithril-common/src/chain_observer/pallas_observer.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mithril-common/src/chain_observer/pallas_observer.rs b/mithril-common/src/chain_observer/pallas_observer.rs index 659cbbba5e3..2bf55f82463 100644 --- a/mithril-common/src/chain_observer/pallas_observer.rs +++ b/mithril-common/src/chain_observer/pallas_observer.rs @@ -264,10 +264,13 @@ mod tests { let datum = hex::decode(hex_datum).unwrap().into(); let tag = TagWrap::<_, 24>::new(datum); let inline_datum = Some((1_u16, tag)); + + let address: Address = + Address::from_bech32("addr_test1vr80076l3x5uw6n94nwhgmv7ssgy6muzf47ugn6z0l92rhg2mgtu0") + .unwrap(); + let address: Addr = address.to_vec().into(); let values = localstate::queries_v16::Values { - address: b"addr_test1vr80076l3x5uw6n94nwhgmv7ssgy6muzf47ugn6z0l92rhg2mgtu0" - .to_vec() - .into(), + address, amount: Value::Coin(lovelace), inline_datum, };