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 16, 2025
1 parent a4f2000 commit f994c22
Show file tree
Hide file tree
Showing 16 changed files with 489 additions and 483 deletions.
12 changes: 6 additions & 6 deletions asset/armored_contract.default
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-----BEGIN RGB CONSIGNMENT-----
Id: rgb:csg:$blNid3w-jkBINzD-wj3eCLQ-kdSrif6-Donf!F3-1QyYvIg#side-spring-edition
Id: rgb:csg:0sCIhkNw-GRQtg8H-bp4EFPC-xlm0mDn-FlVdl06-YyX5zLU#motel-content-david
Version: 2
Type: contract
Contract: rgb:31DhW!cn-Z7NDAZf-wVo3A3B-extB9ap-49EOL2L-fKxo2Sg
Contract: rgb:SwzXUHHv-xhZA212-b!y8b$O-CL!cYzN-x7bX8fG-xuB4Wh4
Schema: rgb:sch:CyqM42yAdM1moWyNZPQedAYt73BM$k9z$dKLUXY1voA#cello-global-deluxe
Check-SHA256: 0a32f938d4058057d96b462eed4b16437f46e26b6298fdb1cdb223fe60f1185c
Check-SHA256: 72d536d20946509eecc8b5ecd313f752e64656f305c4f1843ec5a33883cd66e2

0ssI2000000000000000000000000000000000000000000000000000000D0CRI`I$>^aZh38Qb#nj#
0000000000000000000000d59ZDjxe00000000dDb8~4rVQz13d2MfXa{vGU00000000000000000000
0000000000000
0ssI2000000000000000000000000000000000000000000000000000000D0CRI`I$>^aZh38Qb#nj!
0RR91000000000000000000C|VQpmq000000000D0CRI`I$>^aZh38Qb#nj!00000000000000000000
00000000000000

-----END RGB CONSIGNMENT-----
12 changes: 6 additions & 6 deletions asset/armored_transfer.default
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-----BEGIN RGB CONSIGNMENT-----
Id: rgb:csg:JXymB3w6-XU7sxmP-ngFQ3qE-LAJEmUI-RnNW!4Y-4f$MLeY#june-freedom-student
Id: rgb:csg:i1egsjUj-5U$kACt-fMH2bob-yto!diP-QQ5ODB3-KHHPJWE#gibson-falcon-loyal
Version: 2
Type: transfer
Contract: rgb:31DhW!cn-Z7NDAZf-wVo3A3B-extB9ap-49EOL2L-fKxo2Sg
Contract: rgb:SwzXUHHv-xhZA212-b!y8b$O-CL!cYzN-x7bX8fG-xuB4Wh4
Schema: rgb:sch:CyqM42yAdM1moWyNZPQedAYt73BM$k9z$dKLUXY1voA#cello-global-deluxe
Check-SHA256: b91d5446e24bb8012efe23ec776472fc71ac52310b618c37c9b86e4b80e64901
Check-SHA256: 39cc195bda52e9fa0036694ca3c54f4c44e60e89333bb8d33032e4a84cca64a4

0s#O3000000000000000000000000000000000000000000000000000000D0CRI`I$>^aZh38Qb#nj#
0000000000000000000000d59ZDjxe00000000dDb8~4rVQz13d2MfXa{vGU00000000000000000000
0000000000000
0s#O3000000000000000000000000000000000000000000000000000000D0CRI`I$>^aZh38Qb#nj!
0RR91000000000000000000C|VQpmq000000000D0CRI`I$>^aZh38Qb#nj!00000000000000000000
00000000000000

-----END RGB CONSIGNMENT-----
Binary file modified asset/contract.default
Binary file not shown.
Binary file modified asset/transfer.default
Binary file not shown.
2 changes: 2 additions & 0 deletions src/containers/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ mod test {
flags: Default::default(),
timestamp: Default::default(),
issuer: Default::default(),
layer1: Default::default(),
testnet: Default::default(),
close_method: CloseMethod::TapretFirst,
asset_tags: Default::default(),
Expand Down Expand Up @@ -371,6 +372,7 @@ mod test {
flags: Default::default(),
timestamp: Default::default(),
issuer: Default::default(),
layer1: Default::default(),
testnet: Default::default(),
close_method: CloseMethod::TapretFirst,
asset_tags: Default::default(),
Expand Down
15 changes: 8 additions & 7 deletions src/interface/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub struct ContractBuilder {
close_method: CloseMethod,
scripts: Scripts,
issuer: Identity,
layer_1: Layer1,
layer1: Layer1,
}

impl ContractBuilder {
Expand All @@ -161,15 +161,15 @@ impl ContractBuilder {
iimpl: IfaceImpl,
types: TypeSystem,
scripts: Scripts,
layer_1: Layer1,
layer1: Layer1,
) -> Self {
Self {
builder: OperationBuilder::with(iface, schema, iimpl, types),
testnet: true,
close_method,
scripts,
issuer,
layer_1,
layer1,
}
}

Expand All @@ -182,15 +182,15 @@ impl ContractBuilder {
iimpl: IfaceImpl,
types: TypeSystem,
scripts: Scripts,
layer_1: Layer1,
layer1: Layer1,
) -> Self {
Self {
builder: OperationBuilder::deterministic(iface, schema, iimpl, types),
testnet: true,
close_method,
scripts,
issuer,
layer_1,
layer1,
}
}

Expand All @@ -202,8 +202,8 @@ impl ContractBuilder {
}

pub fn check_layer1(&self, layer1: Layer1) -> Result<(), BuilderError> {
if self.layer_1 != layer1 {
return Err(BuilderError::Layer1Mismatch(layer1, self.layer_1));
if self.layer1 != layer1 {
return Err(BuilderError::Layer1Mismatch(layer1, self.layer1));
}
Ok(())
}
Expand Down Expand Up @@ -390,6 +390,7 @@ impl ContractBuilder {
schema_id: schema.schema_id(),
flags: none!(),
timestamp,
layer1: self.layer1,
testnet: self.testnet,
close_method: self.close_method,
asset_tags,
Expand Down
4 changes: 2 additions & 2 deletions src/persistence/stash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ impl<P: StashProvider> Stash<P> {
issuer: Identity,
schema_id: SchemaId,
iface: impl Into<IfaceRef>,
layer_1: Layer1,
layer1: Layer1,
) -> Result<ContractBuilder, StashError<P>> {
let schema_ifaces = self.schema(schema_id)?;
let iface = self.iface(iface)?;
Expand All @@ -342,7 +342,7 @@ impl<P: StashProvider> Stash<P> {
iimpl.clone(),
types,
scripts,
layer_1,
layer1,
);
Ok(builder)
}
Expand Down
4 changes: 2 additions & 2 deletions src/persistence/stock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,11 @@ impl<S: StashProvider, H: StateProvider, P: IndexProvider> Stock<S, H, P> {
issuer: impl Into<Identity>,
schema_id: SchemaId,
iface: impl Into<IfaceRef>,
layer_1: Layer1,
layer1: Layer1,
) -> Result<ContractBuilder, StockError<S, H, P>> {
Ok(self
.stash
.contract_builder(close_method, issuer.into(), schema_id, iface, layer_1)?)
.contract_builder(close_method, issuer.into(), schema_id, iface, layer1)?)
}

pub fn transition_builder(
Expand Down
4 changes: 2 additions & 2 deletions src/stl/stl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use crate::LIB_NAME_RGB_STD;
/// Strict types id for the library providing standard data types which may be
/// used in RGB smart contracts.
pub const LIB_ID_RGB_STORAGE: &str =
"stl:ws!Tl2OD-HJ8vcNz-f$qeC!f-iQSNkS6-K$$UW9R-JBIakGI#promise-jester-mustang";
"stl:riWbSAvz-$R!WH7W-cXOb0nf-5Nn8rYj-Jaq9Pd8-GtpFRr8#recycle-escape-ranger";

/// Strict types id for the library providing standard data types which may be
/// used in RGB smart contracts.
Expand All @@ -50,7 +50,7 @@ pub const LIB_ID_RGB_CONTRACT: &str =

/// Strict types id for the library representing of RGB StdLib data types.
pub const LIB_ID_RGB_STD: &str =
"stl:ipipNOri-h1j79oh-xW7x0KN-xEKHwhN-0V8uZb2-eQh9nOs#norway-infant-volcano";
"stl:8Sk$bD4g-Ht8IZn$-ol51UGT-1jy7Ycx-8COvLbS-tVQN!II#history-madrid-needle";

fn _rgb_std_stl() -> Result<TypeLib, CompileError> {
LibBuilder::new(libname!(LIB_NAME_RGB_STD), tiny_bset! {
Expand Down
Loading

0 comments on commit f994c22

Please sign in to comment.