pub trait Operation {
    // Required methods
    fn op_type(&self) -> OpType;
    fn full_type(&self) -> OpFullType;
    fn id(&self) -> OpId;
    fn contract_id(&self) -> ContractId;
    fn transition_type(&self) -> Option<u16>;
    fn extension_type(&self) -> Option<u16>;
    fn metadata(
        &self
    ) -> &Confined<Vec<u8, Global>, amplify::::collection::confinement::SmallBlob::{constant#0}, amplify::::collection::confinement::SmallBlob::{constant#1}> ;
    fn globals(&self) -> &GlobalState;
    fn valencies(
        &self
    ) -> &Confined<BTreeSet<u16, Global>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>;
    fn assignments(&self) -> AssignmentsRef<'_>;
    fn assignments_by_type(
        &self,
        t: u16
    ) -> Option<TypedAssigns<BlindSeal<TxPtr>>>;
    fn inputs(
        &self
    ) -> Confined<BTreeSet<Input, Global>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>;
}
Expand description

RGB contract operation API, defined as trait

Implemented by all contract operation types (see OpType):

  • Genesis (Genesis)
  • State transitions ([Transitions])
  • Public state extensions ([Extensions])

Required Methods§

source

fn op_type(&self) -> OpType

Returns type of the operation (see OpType). Unfortunately, this can’t be just a const, since it will break our ability to convert concrete Node types into &dyn Node (entities implementing traits with const definitions can’t be made into objects)

source

fn full_type(&self) -> OpFullType

Returns full contract operation type information

source

fn id(&self) -> OpId

Returns OpId, which is a hash of this operation commitment serialization

source

fn contract_id(&self) -> ContractId

Returns ContractId this operation belongs to.

source

fn transition_type(&self) -> Option<u16>

Returns Option::Some(TransitionType) for transitions or Option::None for genesis and extension operation types

source

fn extension_type(&self) -> Option<u16>

Returns Option::Some(ExtensionType) for extension nodes or Option::None for genesis and state transitions

source

fn metadata( &self ) -> &Confined<Vec<u8, Global>, amplify::::collection::confinement::SmallBlob::{constant#0}, amplify::::collection::confinement::SmallBlob::{constant#1}>

Returns metadata associated with the operation, if any.

source

fn globals(&self) -> &GlobalState

Returns reference to a full set of metadata (in form of GlobalState wrapper structure) for the contract operation.

source

fn valencies( &self ) -> &Confined<BTreeSet<u16, Global>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>

source

fn assignments(&self) -> AssignmentsRef<'_>

source

fn assignments_by_type(&self, t: u16) -> Option<TypedAssigns<BlindSeal<TxPtr>>>

source

fn inputs( &self ) -> Confined<BTreeSet<Input, Global>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>

For genesis and public state extensions always returns an empty list. While public state extension do have parent nodes, they do not contain indexed rights.

Implementors§