Skip to content

Commit

Permalink
chore: API improvements from RGB std lib
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Nov 14, 2023
1 parent c9a0c21 commit 8174833
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 9 additions & 19 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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!(),
Expand Down

0 comments on commit 8174833

Please sign in to comment.