Skip to content

Commit

Permalink
whatver
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Dec 17, 2024
1 parent c7f8826 commit e5c3553
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Up @@ -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"))
}

Expand Down Expand Up @@ -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"));
}
}

Expand All @@ -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")
);
}
}

Expand Down
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"
Expand All @@ -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.