Skip to content

Commit 7aec4ad

Browse files
committed
chore: update IfaceWrappers
1 parent 5acc09c commit 7aec4ad

File tree

5 files changed

+57
-7
lines changed

5 files changed

+57
-7
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ wasm-bindgen-test = "0.3"
4747

4848
[package.metadata.docs.rs]
4949
features = ["all"]
50+
51+
[patch.crates-io]
52+
rgb-invoice = { git = "https://github.com/RGB-WG/rgb-std", branch = "develop" }
53+
rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "develop" }

src/rgb20/wrapper.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ use rgbstd::interface::{
2828
use rgbstd::invoice::{Amount, Precision};
2929
use rgbstd::persistence::ContractStateRead;
3030
use rgbstd::stl::{AssetSpec, ContractTerms, Details};
31-
use rgbstd::{AssetTag, XWitnessId};
31+
use rgbstd::{AssetTag, ContractId, SchemaId, XWitnessId};
32+
use rgbstd::vm::WitnessOrd;
3233
use strict_encoding::InvalidRString;
3334

3435
use super::{Inflation, PrimaryIssue, Rgb20, Rgb20Info};
@@ -105,6 +106,21 @@ impl<S: ContractStateRead> IfaceWrapper<S> for Rgb20Wrapper<S> {
105106
replaced: self.total_replaced_supply(),
106107
}
107108
}
109+
110+
#[inline]
111+
fn contract_id(&self) -> ContractId {
112+
self.0.contract_id()
113+
}
114+
115+
#[inline]
116+
fn schema_id(&self) -> SchemaId {
117+
self.0.state.schema_id()
118+
}
119+
120+
#[inline]
121+
fn witness_info(&self, witness_id: XWitnessId) -> Option<WitnessOrd> {
122+
self.0.state.witness_info(witness_id)
123+
}
108124
}
109125

110126
impl<S: ContractStateRead> Rgb20Wrapper<S> {

src/rgb21/wrapper.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ use rgbstd::interface::{
2424
};
2525
use rgbstd::persistence::ContractStateRead;
2626
use rgbstd::stl::{bp_tx_stl, rgb_contract_stl, AssetSpec, ContractTerms};
27-
use rgbstd::Allocation;
27+
use rgbstd::{Allocation, ContractId, SchemaId, XWitnessId};
28+
use rgbstd::vm::WitnessOrd;
2829
use strict_types::stl::std_stl;
2930
use strict_types::{CompileError, LibBuilder, TypeLib};
3031

@@ -72,6 +73,21 @@ impl<S: ContractStateRead> IfaceWrapper<S> for Rgb21Wrapper<S> {
7273
}
7374

7475
fn info(&self) -> Self::Info { todo!() }
76+
77+
#[inline]
78+
fn contract_id(&self) -> ContractId {
79+
self.0.contract_id()
80+
}
81+
82+
#[inline]
83+
fn schema_id(&self) -> SchemaId {
84+
self.0.state.schema_id()
85+
}
86+
87+
#[inline]
88+
fn witness_info(&self, witness_id: XWitnessId) -> Option<WitnessOrd> {
89+
self.0.state.witness_info(witness_id)
90+
}
7591
}
7692

7793
impl<S: ContractStateRead> Rgb21Wrapper<S> {

src/rgb25/wrapper.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ use rgbstd::interface::{
2525
use rgbstd::invoice::{Amount, Precision};
2626
use rgbstd::persistence::ContractStateRead;
2727
use rgbstd::stl::{ContractTerms, Details, Name};
28-
use rgbstd::AssetTag;
28+
use rgbstd::{AssetTag, ContractId, SchemaId, XWitnessId};
29+
use rgbstd::vm::WitnessOrd;
2930
use strict_encoding::InvalidRString;
3031

3132
use super::{Issue, Rgb25, Rgb25Info};
@@ -55,6 +56,21 @@ impl<S: ContractStateRead> IfaceWrapper<S> for Rgb25Wrapper<S> {
5556
}
5657

5758
fn info(&self) -> Self::Info { todo!() }
59+
60+
#[inline]
61+
fn contract_id(&self) -> ContractId {
62+
self.0.contract_id()
63+
}
64+
65+
#[inline]
66+
fn schema_id(&self) -> SchemaId {
67+
self.0.state.schema_id()
68+
}
69+
70+
#[inline]
71+
fn witness_info(&self, witness_id: XWitnessId) -> Option<WitnessOrd> {
72+
self.0.state.witness_info(witness_id)
73+
}
5874
}
5975

6076
impl<S: ContractStateRead> Rgb25Wrapper<S> {

0 commit comments

Comments
 (0)