Skip to content

Commit b3d9ed2

Browse files
committed
debug
1 parent 49213f2 commit b3d9ed2

21 files changed

+708
-653
lines changed

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,19 @@ readme = "README.md"
1414

1515
[[bin]]
1616
name = "rgb-schemata"
17-
required-features = ["fs"]
17+
required-features = ["fs", "log"]
18+
19+
[[example]]
20+
name = "rgb20"
21+
required-features = ["fs", "log"]
22+
23+
[[example]]
24+
name = "rgb21"
25+
required-features = ["fs", "log"]
26+
27+
[[example]]
28+
name = "rgb25"
29+
required-features = ["fs", "log"]
1830

1931
[lib]
2032
name = "schemata"

examples/rgb20.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ fn main() {
3333
// Reading contract state through the interface from the stock:
3434
let contract = stock.contract_iface_class::<Rgb20>(contract_id).unwrap();
3535
let allocations = contract.allocations(&FilterIncludeAll);
36-
eprintln!("\nThe issued contract data:");
37-
eprintln!("{}", serde_json::to_string(&contract.spec()).unwrap());
36+
eprintln!("{}", contract.spec());
3837

3938
for Output { seal, state, witness, .. } in allocations {
4039
let witness = witness.as_ref().map(XWitnessId::to_string).unwrap_or("~".to_owned());
41-
eprintln!("amount {state}, owner {seal}, witness {witness}");
40+
eprintln!("state {state}, owner {seal}, witness {witness}");
4241
}
43-
eprintln!("totalSupply={}", contract.total_supply());
42+
eprintln!("totalSupply {}", contract.total_supply());
4443
}

examples/rgb21.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ use ifaces::rgb21::{EmbeddedMedia, NftAllocation, TokenData, TokenIndex};
88
use ifaces::stl::*;
99
use ifaces::{IssuerWrapper, Rgb21};
1010
use rgbstd::containers::{ConsignmentExt, FileContent, Kit};
11+
use rgbstd::interface::{FilterIncludeAll, Output};
1112
use rgbstd::persistence::Stock;
12-
use rgbstd::{GenesisSeal, XChain};
13+
use rgbstd::{GenesisSeal, XChain, XWitnessId};
1314
use schemata::UniqueDigitalAsset;
1415
use schemata::dumb::NoResolver;
1516
use sha2::{Digest, Sha256};
@@ -77,5 +78,11 @@ fn main() {
7778

7879
// Reading contract state through the interface from the stock:
7980
let contract = stock.contract_iface_class::<Rgb21>(contract_id).unwrap();
80-
eprintln!("{}", serde_json::to_string(&contract.spec()).unwrap());
81+
let allocations = contract.allocations(&FilterIncludeAll);
82+
83+
eprintln!("{}", contract.spec());
84+
for Output { seal, state, witness, .. } in allocations {
85+
let witness = witness.as_ref().map(XWitnessId::to_string).unwrap_or("~".to_owned());
86+
eprintln!("state ({state}), owner {seal}, witness {witness}");
87+
}
8188
}

examples/rgb25.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ fn main() {
4141
// Reading contract state through the interface from the stock:
4242
let contract = stock.contract_iface_class::<Rgb25>(contract_id).unwrap();
4343
let allocations = contract.allocations(&FilterIncludeAll);
44-
eprintln!("\nThe issued contract data:");
45-
eprintln!("{}", contract.name());
44+
eprint!("name {}, details ", contract.name());
45+
if let Some(details) = contract.details() {
46+
eprint!("{details}");
47+
} else {
48+
eprint!("~");
49+
}
50+
eprintln!(", precision {}", contract.precision());
4651

4752
for Output { seal, state, witness, .. } in allocations {
4853
let witness = witness.as_ref().map(XWitnessId::to_string).unwrap_or("~".to_owned());
49-
eprintln!("amount {state}, owner {seal}, witness {witness}");
54+
eprintln!("state {state}, owner {seal}, witness {witness}");
5055
}
51-
eprintln!("totalSupply={}", contract.total_issued_supply());
56+
eprintln!("totalSupply {}", contract.total_issued_supply());
5257
}

schemata/CollectibleFungibleAsset.rgb

120 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)