Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
whatver
Browse files Browse the repository at this point in the history
dr-orlovsky committed Dec 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent c7f8826 commit e5c3553
Showing 4 changed files with 27 additions and 10 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -123,6 +123,6 @@ bp-electrum = { git = "https://github.com/BP-WG/bp-electrum-client", branch = "v
bp-esplora = { git = "https://github.com/BP-WG/bp-esplora-client", branch = "v0.12" }
bp-wallet = { git = "https://github.com/BP-WG/bp-wallet", branch = "v0.12" }
rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "v0.12" }
#rgb-std = { path = "../rgb-std" }
rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "v0.12" }
rgb-std = { path = "../rgb-std" }
#rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "v0.12" }

29 changes: 22 additions & 7 deletions cli/src/cmd.rs
Original file line number Diff line number Diff line change
@@ -229,7 +229,7 @@ impl Args {
}

fn wallet_file(&self, name: Option<&str>) -> PathBuf {
let mut path = self.data_dir.join(self.seal.to_string());
let path = self.data_dir.join(self.seal.to_string());
path.join(name.unwrap_or("default"))
}

@@ -320,8 +320,9 @@ impl Args {

Cmd::Contracts => {
let mound = self.mound();
for contract_id in mound.contract_ids() {
println!("{contract_id}");
for info in mound.contracts_info() {
println!("---");
println!("{}", serde_yaml::to_string(&info).expect("unable to generate YAML"));
}
}

@@ -331,12 +332,26 @@ impl Args {
contract,
} => {
for (contract_id, state) in self.runtime(wallet.as_deref()).state(*contract) {
println!("====");
println!("Contract Id: {contract_id}");
println!("---");
println!("Global state");
println!("---");
println!(
"{}",
serde_yaml::to_string(&state.immutable).expect("unable to generate YAML")
);
println!(
"{}",
serde_yaml::to_string(&state.computed).expect("unable to generate YAML")
);
println!("---");
println!("Contract ID: {contract_id}");
println!("Owned state");
println!("---");
let state = serde_yaml::to_string(state).expect("unable to generate YAML");
println!("{state}");
println!();
println!(
"{}",
serde_yaml::to_string(&state.owned).expect("unable to generate YAML")
);
}
}

3 changes: 3 additions & 0 deletions examples/script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -x

cargo build --workspace --all-targets --all-features || exit 1
export RUST_BACKTRACE=1
RGB="./target/debug/rgb -d examples/data"
@@ -8,3 +10,4 @@ rm -rf examples/data/bcor/DemoToken.contract

$RGB --seal bcor issue -w alice examples/Demo.yaml
$RGB contracts
$RGB --seal bcor state -w alice

0 comments on commit e5c3553

Please sign in to comment.