Skip to content

Commit

Permalink
address review: add layer1 to Genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedberg committed Jan 17, 2025
1 parent 49c9890 commit f6064e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions examples/rgb21.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rgbstd::containers::{ConsignmentExt, FileContent, Kit};
use rgbstd::invoice::Precision;
use rgbstd::persistence::Stock;
use rgbstd::stl::{AssetSpec, Attachment, ContractTerms, MediaType, RicardianContract};
use rgbstd::{Allocation, GenesisSeal, TokenIndex, XChain};
use rgbstd::{Allocation, GenesisSeal, Layer1, TokenIndex, XChain};
use schemata::dumb::NoResolver;
use schemata::UniqueDigitalAsset;
use sha2::{Digest, Sha256};
Expand All @@ -21,7 +21,7 @@ fn main() {
let spec = AssetSpec::new("TEST", "Test uda", Precision::Indivisible);
let beneficiary_txid =
Txid::from_hex("14295d5bb1a191cdb6286dc0944df938421e3dfcbf0811353ccac4100c2068c5").unwrap();
let beneficiary = XChain::Bitcoin(GenesisSeal::rand(beneficiary_txid, 1));
let beneficiary = XChain::Bitcoin(GenesisSeal::new_random(beneficiary_txid, 1));

let index = TokenIndex::from_inner(2);

Expand Down Expand Up @@ -54,6 +54,7 @@ fn main() {
"ssi:anonymous",
UniqueDigitalAsset::schema().schema_id(),
"RGB21Unique",
Layer1::Bitcoin,
).expect("schema fails to implement RGB21 interface")

.add_global_state("tokens", token_data)
Expand Down
3 changes: 2 additions & 1 deletion src/nia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ mod test {
NonInflatableAsset::issue_impl(),
NonInflatableAsset::types(),
NonInflatableAsset::scripts(),
Layer1::Bitcoin,
)
.add_global_state("spec", spec)
.unwrap()
Expand All @@ -301,7 +302,7 @@ mod test {

assert_eq!(
contract.contract_id().to_string(),
s!("rgb:XO8d$U!l-i2N5GHH-Rh6TONM-95aiue5-qpA3GQZ-97brf7o")
s!("rgb:y$51nuKy-djIYOpk-opwThoC-owoPvrv-UOqil6d-e0ZWcps")
);
}
}

0 comments on commit f6064e2

Please sign in to comment.