From 81748337c2d0ca0bfee59cc40162a4e7857f6f9e Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 14 Nov 2023 15:11:34 +0100 Subject: [PATCH] chore: API improvements from RGB std lib --- Cargo.lock | 2 +- cli/src/command.rs | 28 +++++++++------------------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ad8e88..e069553 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1556,7 +1556,7 @@ dependencies = [ [[package]] name = "rgb-std" version = "0.11.0-beta.1" -source = "git+https://github.com/RGB-WG/rgb-std?branch=master#3955dcb4313eb932a9197057b2d4bec8271f1510" +source = "git+https://github.com/RGB-WG/rgb-std?branch=master#0f2632494d59cfdf8b4b40ee7a13ce6572d5c291" dependencies = [ "amplify", "baid58", diff --git a/cli/src/command.rs b/cli/src/command.rs index cc9ec73..428db73 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -322,26 +322,20 @@ impl Exec for RgbArgs { println!(" {}:", owned.name); if let Ok(allocations) = contract.fungible(owned.name.clone(), &runtime) { for allocation in allocations { - print!(" amount={}, utxo={}", allocation.value, allocation.owner,); - match allocation.witness { - Some(witness) => { - println!(", witness={witness} # owned by the wallet") - } - None => println!(" # no witness"), - }; + print!( + " amount={}, utxo={}, witness={} # owned by the wallet", + allocation.value, allocation.owner, allocation.witness + ); } } if let Ok(allocations) = contract.fungible(owned.name.clone(), &FilterExclude(&runtime)) { for allocation in allocations { - print!(" amount={}, utxo={}", allocation.value, allocation.owner); - match allocation.witness { - Some(witness) => { - println!(", witness={witness} # owner unknown") - } - None => println!(" # no witness"), - }; + print!( + " amount={}, utxo={}, witness={} # owner unknown", + allocation.value, allocation.owner, allocation.witness + ); } } // TODO: Print out other types of state @@ -474,11 +468,7 @@ impl Exec for RgbArgs { .as_u64() .expect("fungible state must be an integer"); builder = builder - .add_fungible_state( - field_name, - SealDefinition::Bitcoin(seal), - amount, - ) + .add_fungible_state(field_name, seal, amount) .expect("invalid global state data"); } StateType::Structured => todo!(),