pub struct Consignment<const TYPE: bool> {
pub version: ContainerVer,
pub transfer: bool,
pub schema: SubSchema,
pub ifaces: TinyOrdMap<IfaceId, IfacePair>,
pub supplements: TinyOrdSet<ContractSuppl>,
pub genesis: Genesis,
pub terminals: SmallOrdMap<BundleId, Terminal>,
pub bundles: LargeVec<AnchoredBundle>,
pub extensions: LargeVec<Extension>,
pub attachments: SmallOrdMap<AttachId, MediumBlob>,
pub signatures: TinyOrdMap<ContentId, ContentSigs>,
/* private fields */
}
Expand description
Consignment represents contract-specific data, always starting with genesis, which must be valid under client-side-validation rules (i.e. internally consistent and properly committed into the commitment layer, like bitcoin blockchain or current state of the lightning channel).
All consignments-related procedures, including validation or merging
consignments data into stash or schema-specific data storage, must start
with endpoints
and process up to the genesis. If any of the nodes within
the consignments are not part of the paths connecting endpoints with the
genesis, consignments validation will return
[validation::Warning::ExcessiveNode
] warning.
Fields§
§version: ContainerVer
Version.
transfer: bool
Specifies whether the consignment contains information about state transfer (true), or it is just a consignment with an information about a contract.
schema: SubSchema
Schema (plus root schema, if any) under which contract is issued.
ifaces: TinyOrdMap<IfaceId, IfacePair>
Interfaces supported by the contract.
supplements: TinyOrdSet<ContractSuppl>
Known supplements.
genesis: Genesis
Genesis data.
terminals: SmallOrdMap<BundleId, Terminal>
Set of seals which are history terminals.
bundles: LargeVec<AnchoredBundle>
Data on all anchored state transitions contained in the consignments.
extensions: LargeVec<Extension>
Data on all state extensions contained in the consignments.
attachments: SmallOrdMap<AttachId, MediumBlob>
Data containers coming with this consignment. For the purposes of in-memory consignments we are restricting the size of the containers to 24 bit value (RGB allows containers up to 32-bit values in size).
signatures: TinyOrdMap<ContentId, ContentSigs>
Signatures on the pieces of content which are the part of the consignment.
Implementations§
Source§impl<const TYPE: bool> Consignment<TYPE>
impl<const TYPE: bool> Consignment<TYPE>
Sourcepub fn new(schema: SubSchema, genesis: Genesis) -> Self
pub fn new(schema: SubSchema, genesis: Genesis) -> Self
§Panics
If the provided schema is not the one which is used by genesis.
pub fn schema_id(&self) -> SchemaId
pub fn root_schema_id(&self) -> Option<SchemaId>
pub fn contract_id(&self) -> ContractId
pub fn anchored_bundle(&self, bundle_id: BundleId) -> Option<&AnchoredBundle>
pub fn validation_status(&self) -> Option<&Status>
pub fn into_validation_status(self) -> Option<Status>
pub fn update_history<R: ResolveHeight>( &self, history: Option<&ContractHistory>, resolver: &mut R, ) -> Result<ContractHistory, R::Error>
pub fn reveal_bundle_seal(&mut self, bundle_id: BundleId, revealed: GraphSeal)
pub fn into_contract(self) -> Contract
Source§impl Consignment<true>
impl Consignment<true>
pub fn transfer_id(&self) -> TransferId
Source§impl<const TYPE: bool> Consignment<TYPE>
impl<const TYPE: bool> Consignment<TYPE>
pub fn validate<R: ResolveTx>( self, resolver: &mut R, ) -> Result<Consignment<TYPE>, Consignment<TYPE>>
Trait Implementations§
Source§impl<const TYPE: bool> Clone for Consignment<TYPE>
impl<const TYPE: bool> Clone for Consignment<TYPE>
Source§fn clone(&self) -> Consignment<TYPE>
fn clone(&self) -> Consignment<TYPE>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<const TYPE: bool> ConsignmentApi for Consignment<TYPE>
impl<const TYPE: bool> ConsignmentApi for Consignment<TYPE>
type BundleIter<'container> = Iter<'container, AnchoredBundle> where Self: 'container
fn schema(&self) -> &SubSchema
Source§fn operation(&self, opid: OpId) -> Option<OpRef<'_>>
fn operation(&self, opid: OpId) -> Option<OpRef<'_>>
None
otherwise