pub struct Consignment<const TRANSFER: bool> {
pub version: ContainerVer,
pub transfer: bool,
pub terminals: SmallOrdMap<BundleId, SecretSeals>,
pub genesis: Genesis,
pub bundles: LargeVec<WitnessBundle>,
pub schema: Schema,
pub types: TypeSystem,
pub scripts: Confined<BTreeSet<Lib>, 0, CONSIGNMENT_MAX_LIBS>,
}
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.
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.
terminals: SmallOrdMap<BundleId, SecretSeals>
Set of secret seals which are history terminals.
genesis: Genesis
Genesis data.
bundles: LargeVec<WitnessBundle>
All bundled state transitions contained in the consignment, together with their witness data.
schema: Schema
Schema (plus root schema, if any) under which contract is issued.
types: TypeSystem
Type system covering all types used in schema.
scripts: Confined<BTreeSet<Lib>, 0, CONSIGNMENT_MAX_LIBS>
Collection of scripts used across consignment.
Implementations§
Source§impl<const TRANSFER: bool> Consignment<TRANSFER>
impl<const TRANSFER: bool> Consignment<TRANSFER>
pub fn consignment_id(&self) -> ConsignmentId
pub fn schema_id(&self) -> SchemaId
pub fn reveal_terminal_seals<E>( self, f: impl Fn(SecretSeal) -> Result<Option<GraphSeal>, E>, ) -> Result<Self, E>
pub fn into_contract(self) -> Contract
pub fn replace_transitions_input_ops(&self) -> BTreeSet<OpId>
pub fn validate( self, resolver: &impl ResolveWitness, chain_net: ChainNet, safe_height: Option<NonZeroU32>, trusted_typesystem: TypeSystem, ) -> Result<ValidConsignment<TRANSFER>, Status>
pub fn validate_with_opids( self, resolver: &impl ResolveWitness, chain_net: ChainNet, safe_height: Option<NonZeroU32>, trusted_typesystem: TypeSystem, trusted_op_seals: BTreeSet<OpId>, ) -> Result<ValidConsignment<TRANSFER>, Status>
Sourcepub fn modify_bundle<F>(&mut self, witness_id: Txid, modifier: F) -> boolwhere
F: Fn(&mut WitnessBundle),
pub fn modify_bundle<F>(&mut self, witness_id: Txid, modifier: F) -> boolwhere
F: Fn(&mut WitnessBundle),
Modify a bundle in the consignment if it exists
Trait Implementations§
Source§impl<const TRANSFER: bool> Clone for Consignment<TRANSFER>
impl<const TRANSFER: bool> Clone for Consignment<TRANSFER>
Source§fn clone(&self) -> Consignment<TRANSFER>
fn clone(&self) -> Consignment<TRANSFER>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<const TRANSFER: bool> CommitEncode for Consignment<TRANSFER>
impl<const TRANSFER: bool> CommitEncode for Consignment<TRANSFER>
Source§type CommitmentId = ConsignmentId
type CommitmentId = ConsignmentId
Source§fn commit_encode(&self, e: &mut CommitEngine)
fn commit_encode(&self, e: &mut CommitEngine)
std::io::Write
writer instance