From e660c6204549aa8c16510354b01b92261c131d0d Mon Sep 17 00:00:00 2001 From: sofia-bobbiesi Date: Tue, 11 Nov 2025 17:48:37 -0300 Subject: [PATCH 1/7] refactor: replace Expect enum with ExpectUtxo struct for improved clarity --- src/commands/test.rs | 90 ++++++++++++-------------------------------- 1 file changed, 25 insertions(+), 65 deletions(-) diff --git a/src/commands/test.rs b/src/commands/test.rs index bcf6760..3ef0e5b 100644 --- a/src/commands/test.rs +++ b/src/commands/test.rs @@ -30,7 +30,7 @@ struct Test { file: PathBuf, wallets: Vec, transactions: Vec, - expect: Vec, + expect: Vec, } #[derive(Debug, Serialize, Deserialize)] @@ -48,53 +48,17 @@ struct Transaction { } #[derive(Debug, Serialize, Deserialize)] -#[serde(tag = "type")] -enum Expect { - Balance(ExpectBalance), - // TODO: improve expect adding more options +struct ExpectUtxo { + from: String, + datum_equals: Option, + min_amount: Option>, } #[derive(Debug, Serialize, Deserialize)] -struct ExpectBalance { - wallet: String, - amount: ExpectAmount, -} - -#[derive(Debug, Serialize, Deserialize)] -#[serde(untagged)] -enum ExpectAmount { - Absolute(u64), - Aprox(ExpectAmountAprox), -} - -impl ExpectAmount { - pub fn matches(&self, value: u64) -> bool { - match self { - ExpectAmount::Absolute(x) => x.eq(&value), - ExpectAmount::Aprox(x) => { - let lower = x.target.saturating_sub(x.threshold); - let upper = x.target + x.threshold; - value >= lower && value <= upper - } - } - } -} - -#[derive(Debug, Serialize, Deserialize)] -struct ExpectAmountAprox { - target: u64, - threshold: u64, -} - -impl Display for ExpectAmount { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - ExpectAmount::Absolute(value) => write!(f, "{value}"), - ExpectAmount::Aprox(value) => { - write!(f, "target: ~{} (+/- {})", value.target, value.threshold) - } - } - } +struct ExpectMinAmount { + policy: Option, + name: Option, + amount: u64, } fn ensure_test_home(test: &Test, hashable: &[u8]) -> Result { @@ -233,26 +197,22 @@ pub fn run(args: Args, _config: &Config, profile: &ProfileConfig) -> Result<()> } for expect in test.expect.iter() { - match expect { - Expect::Balance(expect) => { - let balance = crate::spawn::cshell::wallet_balance(&test_home, &expect.wallet)?; - - let r#match = expect.amount.matches(balance.coin); - - if !r#match { - failed = true; - - eprintln!( - "Test Failed: `{}` Balance did not match the expected result.", - expect.wallet - ); - eprintln!("Expected: {}", expect.amount); - eprintln!("Received: {}", balance.coin); - - eprintln!("Hint: Check the tx3 file or the test file."); - } - } - } + // let balance = crate::spawn::cshell::wallet_balance(&test_home, &expect.from)?; + todo!(); + // let r#match = expect.amount.matches(balance.coin); + + // if !r#match { + // failed = true; + + // eprintln!( + // "Test Failed: `{}` Balance did not match the expected result.", + // expect.from + // ); + // eprintln!("Expected: {}", expect.amount); + // eprintln!("Received: {}", balance.coin); + + // eprintln!("Hint: Check the tx3 file or the test file."); + // } } if !failed { From 67ff373db27adde9c92f6a4105776ca9ec2bd509 Mon Sep 17 00:00:00 2001 From: sofia-bobbiesi Date: Tue, 11 Nov 2025 17:49:35 -0300 Subject: [PATCH 2/7] test: add unit test for parsing ExpectUtxo from TOML configuration --- src/commands/test.rs | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/commands/test.rs b/src/commands/test.rs index 3ef0e5b..1023b13 100644 --- a/src/commands/test.rs +++ b/src/commands/test.rs @@ -171,6 +171,76 @@ fn trigger_transaction( Ok(()) } +#[cfg(test)] +mod tests { + use super::*; + use std::path::PathBuf; + + #[test] + fn parse_expect_utxo_toml() { + let toml = r#" + file = "./main.tx3" + + [[wallets]] + name = "oracle" + balance = 10000000 + + [[wallets]] + name = "operator" + balance = 5000000 + + [[transactions]] + description = "Simple Oracle" + template = "create" + signers = ["operator"] + args = { rate = 42, operator = "@operator", oracle = "@oracle" } + + [[expect]] + from = "@oracle" + datum_equals = 42 + + [[expect.min_amount]] + amount = 123 + + [[expect.min_amount]] + policy = "xyz" + name = "abc" + amount = 456 + "#; + + let parsed: Test = toml::from_str(toml).expect("parse toml"); + + assert_eq!(parsed.file, PathBuf::from("./main.tx3")); + assert_eq!(parsed.wallets.len(), 2); + + assert_eq!(parsed.transactions.len(), 1); + + assert_eq!(parsed.expect.len(), 1); + let e = &parsed.expect[0]; + assert_eq!(e.from, "@oracle"); + + assert!(e.datum_equals.is_some()); + let datum = e.datum_equals.as_ref().unwrap(); + match datum { + serde_json::Value::Number(n) => { + assert_eq!(n.as_i64(), Some(42)); + } + other => panic!("unexpected datum kind: {other:?}"), + } + + assert!(e.min_amount.is_some()); + let mins = e.min_amount.as_ref().unwrap(); + assert_eq!(mins.len(), 2); + + assert_eq!(mins[0].amount, 123); + assert!(mins[0].policy.is_none() && mins[0].name.is_none()); + + assert_eq!(mins[1].policy.as_ref().unwrap(), "xyz"); + assert_eq!(mins[1].name.as_ref().unwrap(), "abc"); + assert_eq!(mins[1].amount, 456); + } +} + pub fn run(args: Args, _config: &Config, profile: &ProfileConfig) -> Result<()> { println!("== Starting tests ==\n"); let test_content = std::fs::read_to_string(args.path).into_diagnostic()?; From 3bc53e1530dfde1ce36cfed609d6322e29969075 Mon Sep 17 00:00:00 2001 From: sofia-bobbiesi Date: Wed, 12 Nov 2025 11:50:24 -0300 Subject: [PATCH 3/7] fix: change min_amount from Option> to Vec for consistency --- src/commands/test.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/commands/test.rs b/src/commands/test.rs index 1023b13..1921906 100644 --- a/src/commands/test.rs +++ b/src/commands/test.rs @@ -51,7 +51,7 @@ struct Transaction { struct ExpectUtxo { from: String, datum_equals: Option, - min_amount: Option>, + min_amount: Vec, } #[derive(Debug, Serialize, Deserialize)] @@ -228,8 +228,7 @@ mod tests { other => panic!("unexpected datum kind: {other:?}"), } - assert!(e.min_amount.is_some()); - let mins = e.min_amount.as_ref().unwrap(); + let mins = &e.min_amount; assert_eq!(mins.len(), 2); assert_eq!(mins[0].amount, 123); From d5d1d437bc87a4e6e590af8701dc61986e4965fc Mon Sep 17 00:00:00 2001 From: sofia-bobbiesi Date: Fri, 14 Nov 2025 10:26:50 -0300 Subject: [PATCH 4/7] feat: implement expect_utxo function for validating UTXO expectations --- src/commands/build.rs | 1 + src/commands/expect.rs | 144 +++++++++++++++++++++++++++++++++++++++++ src/commands/mod.rs | 1 + src/commands/test.rs | 36 +++-------- src/spawn/cshell.rs | 79 ++++++++++++++++++++++ 5 files changed, 234 insertions(+), 27 deletions(-) create mode 100644 src/commands/expect.rs diff --git a/src/commands/build.rs b/src/commands/build.rs index 07a406d..97e5c23 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -162,6 +162,7 @@ impl Display for Tx3Type { ir::Type::List => write!(f, "list"), ir::Type::Map => write!(f, "map"), ir::Type::Custom(name) => write!(f, "custom({})", name), + _ => unreachable!(), } } } diff --git a/src/commands/expect.rs b/src/commands/expect.rs new file mode 100644 index 0000000..26597ee --- /dev/null +++ b/src/commands/expect.rs @@ -0,0 +1,144 @@ +use std::path::Path; + +use miette::Result; + +use crate::spawn::cshell; + +// Import Expect types from the `test` module +use crate::commands::test::ExpectUtxo; + +/// Run all checks for a slice of `ExpectUtxo` expectations. +/// Returns `Ok(true)` when any expectation failed, `Ok(false)` when all passed. +/// +/// +pub fn expect_utxo(expects: &[ExpectUtxo], test_home: &Path) -> Result { + let mut failed_any = false; + + for expect in expects.iter() { + let mut failed = false; + + // // Resolve wallet name or address to an expected testnet address. + // let wallets = cshell::wallet_list(&test_home)?; + // let expected_wallet = wallets + // .iter() + // .find(|w| w.name == expect.from.trim_start_matches('@')) + // .or_else(|| wallets.iter().find(|w| w.addresses.testnet == expect.from)); + + // if expected_wallet.is_none() { + // failed = true; + // eprintln!("Test Failed: Wallet `{}` not found.", expect.from); + // eprintln!("Hint: Check the wallet name in the test file."); + // if failed { + // // mark overall failure and continue to next expectation + // // (keeps behaviour similar to original inline checks) + // } + // continue; + // } + + let utxos = cshell::wallet_utxos(&test_home, &expect.from)?; + + // Validate ownership: ensure returned UTXOs belong to expected address + for utxo in &utxos { + if utxo.address != expect.from { + failed = true; + eprintln!( + "Test Failed: UTXO with address `{}` does not belong to wallet `{}`.", + utxo.address, expect.from + ); + eprintln!("Expected address: {}", expect.from); + eprintln!("Hint: Check the wallet_utxos implementation."); + } + } + + // Scenario 1: No datum_equals and no min_amount -> just check that at least one UTXO exists + if expect.datum_equals.is_none() && expect.min_amount.is_empty() { + if utxos.is_empty() { + failed = true; + eprintln!("Test Failed: No UTXOs found for wallet `{}`.", expect.from); + } + if failed { + failed_any = true; + } + continue; + } + + // Find UTXOs that match the datum if specified + let matching_utxos: Vec<_> = if let Some(expected_datum) = &expect.datum_equals { + utxos + .iter() + .filter(|utxo| { + if let Some(datum) = &utxo.datum { + match expected_datum { + serde_json::Value::String(s) => hex::encode(&datum.hash) == *s, + _ => false, + } + } else { + false + } + }) + .collect() + } else { + // If no datum_equals specified, consider all UTXOs + utxos.iter().collect() + }; + + for min_req in &expect.min_amount { + let total_amount: u64 = + if let (Some(policy), Some(name)) = (&min_req.policy, &min_req.name) { + // Check for specific asset + matching_utxos + .iter() + .flat_map(|utxo| utxo.assets.iter()) + .map(|bal| { + let policy_hex = hex::encode(&bal.policy_id); + if policy_hex == *policy { + bal.assets + .iter() + .filter(|asset| String::from_utf8_lossy(&asset.name) == *name) + .map(|asset| asset.output_coin.parse::().unwrap_or(0)) + .sum::() + } else { + 0u64 + } + }) + .sum() + } else { + // Check for lovelace + matching_utxos + .iter() + .map(|utxo| utxo.coin.parse::().unwrap_or(0)) + .sum() + }; + + if total_amount < min_req.amount { + failed = true; + + let asset_desc = + if let (Some(policy), Some(name)) = (&min_req.policy, &min_req.name) { + format!("asset {}.{}", policy, name) + } else { + "lovelace".to_string() + }; + + eprintln!( + "Test Failed: `{}` UTXOs {} have insufficient {}.", + expect.from, + if expect.datum_equals.is_some() { + "with matching datum" + } else { + "" + }, + asset_desc + ); + eprintln!("Expected minimum: {}", min_req.amount); + eprintln!("Found: {}", total_amount); + } + } + + if failed { + failed_any = true; + } + } + + Ok(failed_any) +} diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 763f5a0..3bc06f0 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -2,6 +2,7 @@ pub mod bindgen; pub mod build; pub mod check; pub mod devnet; +pub mod expect; pub mod init; pub mod inspect; pub mod publish; diff --git a/src/commands/test.rs b/src/commands/test.rs index 1921906..6f443af 100644 --- a/src/commands/test.rs +++ b/src/commands/test.rs @@ -1,6 +1,5 @@ use std::{ collections::HashMap, - fmt::Display, path::{Path, PathBuf}, thread::sleep, time::Duration, @@ -48,17 +47,17 @@ struct Transaction { } #[derive(Debug, Serialize, Deserialize)] -struct ExpectUtxo { - from: String, - datum_equals: Option, - min_amount: Vec, +pub(crate) struct ExpectUtxo { + pub(crate) from: String, + pub(crate) datum_equals: Option, + pub(crate) min_amount: Vec, } #[derive(Debug, Serialize, Deserialize)] -struct ExpectMinAmount { - policy: Option, - name: Option, - amount: u64, +pub(crate) struct ExpectMinAmount { + pub(crate) policy: Option, + pub(crate) name: Option, + pub(crate) amount: u64, } fn ensure_test_home(test: &Test, hashable: &[u8]) -> Result { @@ -265,24 +264,7 @@ pub fn run(args: Args, _config: &Config, profile: &ProfileConfig) -> Result<()> sleep(Duration::from_secs(BLOCK_PRODUCTION_INTERVAL_SECONDS)); } - for expect in test.expect.iter() { - // let balance = crate::spawn::cshell::wallet_balance(&test_home, &expect.from)?; - todo!(); - // let r#match = expect.amount.matches(balance.coin); - - // if !r#match { - // failed = true; - - // eprintln!( - // "Test Failed: `{}` Balance did not match the expected result.", - // expect.from - // ); - // eprintln!("Expected: {}", expect.amount); - // eprintln!("Received: {}", balance.coin); - - // eprintln!("Hint: Check the tx3 file or the test file."); - // } - } + failed |= crate::commands::expect::expect_utxo(&test.expect, &test_home)?; if !failed { println!("Test Passed\n"); diff --git a/src/spawn/cshell.rs b/src/spawn/cshell.rs index 9b4771e..9da8ccd 100644 --- a/src/spawn/cshell.rs +++ b/src/spawn/cshell.rs @@ -37,6 +37,43 @@ pub struct OutputBalance { pub coin: u64, } +// #[derive(Debug, Deserialize)] +// pub struct UtxoRef { +// pub hash: String, +// pub index: u64, +// } + +#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] +pub struct Asset { + #[serde(with = "hex::serde")] + pub name: Vec, + pub output_coin: String, +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] +pub struct Datum { + #[serde(with = "hex::serde")] + pub hash: Vec, +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] +pub struct UtxoAsset { + #[serde(with = "hex::serde")] + pub policy_id: Vec, + pub assets: Vec, +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] +pub struct UTxO { + #[serde(with = "hex::serde")] + pub tx: Vec, + pub tx_index: u64, + pub address: String, + pub coin: String, // To avoid overflow + pub assets: Vec, + pub datum: Option, +} + pub fn initialize_config(root: &Path) -> miette::Result { let config_path = root.join("cshell.toml"); @@ -285,6 +322,48 @@ pub fn wallet_balance(home: &Path, wallet_name: &str) -> miette::Result miette::Result> { + dbg!(wallet_name); + let mut cmd = new_generic_command(home)?; + let output = cmd + .args([ + "wallet", + "balance", + wallet_name, + "--detail", + "--output-format", + "json", + ]) + .stdout(Stdio::piped()) + .output() + .into_diagnostic() + .context("running CShell wallet utxos")?; + + if !output.status.success() { + bail!("CShell failed to get wallet utxos"); + } + + match serde_json::from_slice::>(&output.stdout) { + Ok(list) => Ok(list), + Err(_) => { + let v: serde_json::Value = serde_json::from_slice(&output.stdout).into_diagnostic()?; + if let Some(utxos_val) = v.get("utxos") { + let list: Vec = + serde_json::from_value(utxos_val.clone()).into_diagnostic()?; + Ok(list) + } else { + // As a last resort try to deserialize any array value at top-level + if v.is_array() { + let list: Vec = serde_json::from_value(v).into_diagnostic()?; + Ok(list) + } else { + bail!("unexpected CShell wallet balance output shape") + } + } + } + } +} + pub fn explorer(home: &Path) -> miette::Result { let mut cmd = new_generic_command(home)?; From 3a7c9d5e3a5230399d035dbf82cd1eba86612485 Mon Sep 17 00:00:00 2001 From: sofia-bobbiesi Date: Fri, 14 Nov 2025 14:41:50 -0300 Subject: [PATCH 5/7] refactor: remove commented-out code --- src/commands/expect.rs | 31 +++---------------------------- src/spawn/cshell.rs | 1 - 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/src/commands/expect.rs b/src/commands/expect.rs index 26597ee..6f7bcb9 100644 --- a/src/commands/expect.rs +++ b/src/commands/expect.rs @@ -17,27 +17,9 @@ pub fn expect_utxo(expects: &[ExpectUtxo], test_home: &Path) -> Result { for expect in expects.iter() { let mut failed = false; - // // Resolve wallet name or address to an expected testnet address. - // let wallets = cshell::wallet_list(&test_home)?; - // let expected_wallet = wallets - // .iter() - // .find(|w| w.name == expect.from.trim_start_matches('@')) - // .or_else(|| wallets.iter().find(|w| w.addresses.testnet == expect.from)); - - // if expected_wallet.is_none() { - // failed = true; - // eprintln!("Test Failed: Wallet `{}` not found.", expect.from); - // eprintln!("Hint: Check the wallet name in the test file."); - // if failed { - // // mark overall failure and continue to next expectation - // // (keeps behaviour similar to original inline checks) - // } - // continue; - // } - let utxos = cshell::wallet_utxos(&test_home, &expect.from)?; - // Validate ownership: ensure returned UTXOs belong to expected address + // Validate ownership for utxo in &utxos { if utxo.address != expect.from { failed = true; @@ -50,7 +32,6 @@ pub fn expect_utxo(expects: &[ExpectUtxo], test_home: &Path) -> Result { } } - // Scenario 1: No datum_equals and no min_amount -> just check that at least one UTXO exists if expect.datum_equals.is_none() && expect.min_amount.is_empty() { if utxos.is_empty() { failed = true; @@ -121,14 +102,8 @@ pub fn expect_utxo(expects: &[ExpectUtxo], test_home: &Path) -> Result { }; eprintln!( - "Test Failed: `{}` UTXOs {} have insufficient {}.", - expect.from, - if expect.datum_equals.is_some() { - "with matching datum" - } else { - "" - }, - asset_desc + "Test Failed: wallet `{}` with insufficient {}.", + expect.from, asset_desc ); eprintln!("Expected minimum: {}", min_req.amount); eprintln!("Found: {}", total_amount); diff --git a/src/spawn/cshell.rs b/src/spawn/cshell.rs index 9da8ccd..552465a 100644 --- a/src/spawn/cshell.rs +++ b/src/spawn/cshell.rs @@ -352,7 +352,6 @@ pub fn wallet_utxos(home: &Path, wallet_name: &str) -> miette::Result> serde_json::from_value(utxos_val.clone()).into_diagnostic()?; Ok(list) } else { - // As a last resort try to deserialize any array value at top-level if v.is_array() { let list: Vec = serde_json::from_value(v).into_diagnostic()?; Ok(list) From e16b40e6bba5be2ce9555f17e78e366500ed3ef7 Mon Sep 17 00:00:00 2001 From: sofia-bobbiesi Date: Fri, 14 Nov 2025 15:34:57 -0300 Subject: [PATCH 6/7] refactor: remove validation from expect_utxo function and improve formatting --- src/commands/expect.rs | 13 ------------- src/spawn/dolos.rs | 39 +++++++++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/commands/expect.rs b/src/commands/expect.rs index 6f7bcb9..469ba38 100644 --- a/src/commands/expect.rs +++ b/src/commands/expect.rs @@ -19,19 +19,6 @@ pub fn expect_utxo(expects: &[ExpectUtxo], test_home: &Path) -> Result { let utxos = cshell::wallet_utxos(&test_home, &expect.from)?; - // Validate ownership - for utxo in &utxos { - if utxo.address != expect.from { - failed = true; - eprintln!( - "Test Failed: UTXO with address `{}` does not belong to wallet `{}`.", - utxo.address, expect.from - ); - eprintln!("Expected address: {}", expect.from); - eprintln!("Hint: Check the wallet_utxos implementation."); - } - } - if expect.datum_equals.is_none() && expect.min_amount.is_empty() { if utxos.is_empty() { failed = true; diff --git a/src/spawn/dolos.rs b/src/spawn/dolos.rs index e638715..b4cb26e 100644 --- a/src/spawn/dolos.rs +++ b/src/spawn/dolos.rs @@ -64,10 +64,11 @@ fn initialize_wal_store(data_dir: &Path) -> miette::Result<()> { } fn initialize_ledger_store(data_dir: &Path) -> miette::Result { - let state: dolos_redb::state::LedgerStore = dolos_redb::state::LedgerStore::open(&data_dir.join("ledger"), None) - .map_err(dolos_core::StateError::from) - .into_diagnostic() - .context("creating ledger store")?; + let state: dolos_redb::state::LedgerStore = + dolos_redb::state::LedgerStore::open(&data_dir.join("ledger"), None) + .map_err(dolos_core::StateError::from) + .into_diagnostic() + .context("creating ledger store")?; Ok(state) } @@ -81,8 +82,10 @@ fn initialize_chain_store(data_dir: &Path) -> miette::Result)>) -> miette::Result> { - use dolos_cardano::pallas::ledger::traverse::{MultiEraOutput, Era}; +fn calculate_deltas( + initial_utxos: &Vec<(String, Vec)>, +) -> miette::Result> { + use dolos_cardano::pallas::ledger::traverse::{Era, MultiEraOutput}; let eras = vec![Era::Conway, Era::Babbage, Era::Alonzo, Era::Byron]; @@ -90,12 +93,17 @@ fn calculate_deltas(initial_utxos: &Vec<(String, Vec)>) -> miette::Result() + let utxo_id = address + .split('#') + .nth(1) + .unwrap_or_default() + .parse::() .into_diagnostic() .context("parsing tx id")?; @@ -113,7 +121,9 @@ fn calculate_deltas(initial_utxos: &Vec<(String, Vec)>) -> miette::Result)>) -> miette::Result)>) -> miette::Result<()> { - +fn initialize_initial_utxos( + home_dir: &Path, + initial_utxos: &Vec<(String, Vec)>, +) -> miette::Result<()> { let data_dir = initialize_data_dir(home_dir)?; initialize_wal_store(&data_dir)?; @@ -134,12 +146,14 @@ fn initialize_initial_utxos(home_dir: &Path, initial_utxos: &Vec<(String, Vec Date: Fri, 14 Nov 2025 16:22:56 -0300 Subject: [PATCH 7/7] fix: streamline UTXO failure handling in expect_utxo function --- src/commands/expect.rs | 5 +---- src/spawn/cshell.rs | 7 ------- src/spawn/dolos.rs | 2 -- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/commands/expect.rs b/src/commands/expect.rs index 469ba38..c4603f5 100644 --- a/src/commands/expect.rs +++ b/src/commands/expect.rs @@ -21,11 +21,8 @@ pub fn expect_utxo(expects: &[ExpectUtxo], test_home: &Path) -> Result { if expect.datum_equals.is_none() && expect.min_amount.is_empty() { if utxos.is_empty() { - failed = true; - eprintln!("Test Failed: No UTXOs found for wallet `{}`.", expect.from); - } - if failed { failed_any = true; + eprintln!("Test Failed: No UTXOs found for wallet `{}`.", expect.from); } continue; } diff --git a/src/spawn/cshell.rs b/src/spawn/cshell.rs index 552465a..8992aa1 100644 --- a/src/spawn/cshell.rs +++ b/src/spawn/cshell.rs @@ -37,12 +37,6 @@ pub struct OutputBalance { pub coin: u64, } -// #[derive(Debug, Deserialize)] -// pub struct UtxoRef { -// pub hash: String, -// pub index: u64, -// } - #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] pub struct Asset { #[serde(with = "hex::serde")] @@ -323,7 +317,6 @@ pub fn wallet_balance(home: &Path, wallet_name: &str) -> miette::Result miette::Result> { - dbg!(wallet_name); let mut cmd = new_generic_command(home)?; let output = cmd .args([ diff --git a/src/spawn/dolos.rs b/src/spawn/dolos.rs index b4cb26e..c96b87d 100644 --- a/src/spawn/dolos.rs +++ b/src/spawn/dolos.rs @@ -93,7 +93,6 @@ fn calculate_deltas( println!("Applying initial UTxOs..."); - dbg!(initial_utxos); for (address, bytes) in initial_utxos { let utxo_hash = hex::decode(address.split('#').nth(0).unwrap_or_default()) .into_diagnostic() @@ -189,7 +188,6 @@ pub fn initialize_config( let config_path = save_config(home, "dolos.toml", DOLOS_TEMPLATE)?; - dbg!(initial_utxos); initialize_initial_utxos(home, initial_utxos)?; Ok(config_path)