Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Oct 19, 2024
1 parent 49213f2 commit 133b3b7
Show file tree
Hide file tree
Showing 21 changed files with 790 additions and 735 deletions.
18 changes: 9 additions & 9 deletions Cargo.lock

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

14 changes: 13 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,19 @@ readme = "README.md"

[[bin]]
name = "rgb-schemata"
required-features = ["fs"]
required-features = ["fs", "log"]

[[example]]
name = "rgb20"
required-features = ["fs", "log"]

[[example]]
name = "rgb21"
required-features = ["fs", "log"]

[[example]]
name = "rgb25"
required-features = ["fs", "log"]

[lib]
name = "schemata"
Expand Down
7 changes: 3 additions & 4 deletions examples/rgb20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ fn main() {
// Reading contract state through the interface from the stock:
let contract = stock.contract_iface_class::<Rgb20>(contract_id).unwrap();
let allocations = contract.allocations(&FilterIncludeAll);
eprintln!("\nThe issued contract data:");
eprintln!("{}", serde_json::to_string(&contract.spec()).unwrap());
eprintln!("{}", contract.spec());

for Output { seal, state, witness, .. } in allocations {
let witness = witness.as_ref().map(XWitnessId::to_string).unwrap_or("~".to_owned());
eprintln!("amount {state}, owner {seal}, witness {witness}");
eprintln!("state {state}, owner {seal}, witness {witness}");
}
eprintln!("totalSupply={}", contract.total_supply());
eprintln!("totalSupply {}", contract.total_supply());
}
11 changes: 9 additions & 2 deletions examples/rgb21.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ use ifaces::rgb21::{EmbeddedMedia, NftAllocation, TokenData, TokenIndex};
use ifaces::stl::*;
use ifaces::{IssuerWrapper, Rgb21};
use rgbstd::containers::{ConsignmentExt, FileContent, Kit};
use rgbstd::interface::{FilterIncludeAll, Output};
use rgbstd::persistence::Stock;
use rgbstd::{GenesisSeal, XChain};
use rgbstd::{GenesisSeal, XChain, XWitnessId};
use schemata::UniqueDigitalAsset;
use schemata::dumb::NoResolver;
use sha2::{Digest, Sha256};
Expand Down Expand Up @@ -77,5 +78,11 @@ fn main() {

// Reading contract state through the interface from the stock:
let contract = stock.contract_iface_class::<Rgb21>(contract_id).unwrap();
eprintln!("{}", serde_json::to_string(&contract.spec()).unwrap());
let allocations = contract.allocations(&FilterIncludeAll);

eprintln!("{}", contract.spec());
for Output { seal, state, witness, .. } in allocations {
let witness = witness.as_ref().map(XWitnessId::to_string).unwrap_or("~".to_owned());
eprintln!("state ({state}), owner {seal}, witness {witness}");
}
}
13 changes: 9 additions & 4 deletions examples/rgb25.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ fn main() {
// Reading contract state through the interface from the stock:
let contract = stock.contract_iface_class::<Rgb25>(contract_id).unwrap();
let allocations = contract.allocations(&FilterIncludeAll);
eprintln!("\nThe issued contract data:");
eprintln!("{}", contract.name());
eprint!("name {}, details ", contract.name());
if let Some(details) = contract.details() {
eprint!("{details}");
} else {
eprint!("~");
}
eprintln!(", precision {}", contract.precision());

for Output { seal, state, witness, .. } in allocations {
let witness = witness.as_ref().map(XWitnessId::to_string).unwrap_or("~".to_owned());
eprintln!("amount {state}, owner {seal}, witness {witness}");
eprintln!("state {state}, owner {seal}, witness {witness}");
}
eprintln!("totalSupply={}", contract.total_issued_supply());
eprintln!("totalSupply {}", contract.total_issued_supply());
}
Binary file modified schemata/CollectibleFungibleAsset.rgb
Binary file not shown.
Loading

0 comments on commit 133b3b7

Please sign in to comment.