diff --git a/Cargo.lock b/Cargo.lock index 60158c23..040ef4f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -668,7 +668,7 @@ dependencies = [ [[package]] name = "rgb-core" version = "0.11.0-beta.9" -source = "git+https://github.com/RGB-WG/rgb-core?branch=feat/fungible-nonconf#e92e5b176886b3f04d8cfbb41714ab8f7d0b8046" +source = "git+https://github.com/RGB-WG/rgb-core?branch=feat/fungible-nonconf#9c6f3fee4ac573380c0ed8658d644fc5a7cfc533" dependencies = [ "aluvm", "amplify", diff --git a/src/interface/builder.rs b/src/interface/builder.rs index 4905aca1..76eff309 100644 --- a/src/interface/builder.rs +++ b/src/interface/builder.rs @@ -252,6 +252,16 @@ impl ContractBuilder { Ok(self) } + pub fn add_rights( + mut self, + name: impl Into, + seal: impl Into>, + attach: Option, + ) -> Result { + self.builder = self.builder.add_rights(name, seal, attach)?; + Ok(self) + } + pub fn add_owned_state( mut self, name: impl Into, @@ -513,6 +523,16 @@ impl TransitionBuilder { Ok(self) } + pub fn add_rights( + mut self, + name: impl Into, + seal: impl Into>, + attach: Option, + ) -> Result { + self.builder = self.builder.add_rights(name, seal, attach)?; + Ok(self) + } + pub fn fulfill_owned_state( mut self, type_id: AssignmentType, @@ -758,6 +778,18 @@ impl OperationBuilder { Ok(self) } + fn add_rights( + self, + name: impl Into, + seal: impl Into>, + attach: Option, + ) -> Result { + let type_id = self.assignments_type(name)?; + let mut state = State::default(); + state.attach = attach; + self.add_owned_state_raw(type_id, seal, state) + } + fn add_owned_state( self, name: impl Into,