pub struct Consignment<const TRANSFER: bool> {
pub version: ContainerVer,
pub transfer: bool,
pub terminals: Confined<BTreeMap<BundleId, SecretSeals>, amplify::::collection::confinement::SmallOrdMap::{constant#0}, amplify::::collection::confinement::SmallOrdMap::{constant#1}>,
pub genesis: Genesis,
pub bundles: Confined<Vec<WitnessBundle>, amplify::::collection::confinement::LargeVec::{constant#0}, amplify::::collection::confinement::LargeVec::{constant#1}>,
pub schema: Schema,
pub types: TypeSystem,
pub scripts: Confined<BTreeSet<Lib>, 0, rgbstd::::containers::consignment::Consignment::{constant#0}>,
}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: ContainerVerVersion.
transfer: boolSpecifies whether the consignment contains information about state transfer (true), or it is just a consignment with an information about a contract.
terminals: Confined<BTreeMap<BundleId, SecretSeals>, amplify::::collection::confinement::SmallOrdMap::{constant#0}, amplify::::collection::confinement::SmallOrdMap::{constant#1}>Set of secret seals which are history terminals.
genesis: GenesisGenesis data.
bundles: Confined<Vec<WitnessBundle>, amplify::::collection::confinement::LargeVec::{constant#0}, amplify::::collection::confinement::LargeVec::{constant#1}>All bundled state transitions contained in the consignment, together with their witness data.
schema: SchemaSchema (plus root schema, if any) under which contract is issued.
types: TypeSystemType system covering all types used in schema.
scripts: Confined<BTreeSet<Lib>, 0, rgbstd::::containers::consignment::Consignment::{constant#0}>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<BlindSeal<TxPtr>>, E>, ) -> Result<Consignment<TRANSFER>, E>
pub fn into_contract(self) -> Consignment<false>
pub fn replace_transitions_input_ops(&self) -> BTreeSet<OpId>
pub fn validate( self, resolver: &impl ResolveWitness, validation_config: &ValidationConfig, ) -> Result<ValidConsignment<TRANSFER>, ValidationError>
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 instanceSource§impl<const TRANSFER: bool> ConsignmentApi for Consignment<TRANSFER>
impl<const TRANSFER: bool> ConsignmentApi for Consignment<TRANSFER>
Source§fn types(&self) -> &TypeSystem
fn types(&self) -> &TypeSystem
Source§fn scripts(&self) -> impl Iterator<Item = &Lib>
fn scripts(&self) -> impl Iterator<Item = &Lib>
Source§fn bundles_info(
&self,
) -> impl Iterator<Item = (&TransitionBundle, &Anchor<DbcProof>, Txid)>
fn bundles_info( &self, ) -> impl Iterator<Item = (&TransitionBundle, &Anchor<DbcProof>, Txid)>
Source§fn bundle_ids<'iter>(&self) -> impl Iterator<Item = BundleId> + 'iter
fn bundle_ids<'iter>(&self) -> impl Iterator<Item = BundleId> + 'iter
Source§impl<const TRANSFER: bool> ConsignmentExt for Consignment<TRANSFER>
impl<const TRANSFER: bool> ConsignmentExt for Consignment<TRANSFER>
Source§impl<const TRANSFER: bool> Debug for Consignment<TRANSFER>
impl<const TRANSFER: bool> Debug for Consignment<TRANSFER>
Source§impl<'de, const TRANSFER: bool> Deserialize<'de> for Consignment<TRANSFER>
impl<'de, const TRANSFER: bool> Deserialize<'de> for Consignment<TRANSFER>
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Consignment<TRANSFER>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Consignment<TRANSFER>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<const TRANSFER: bool> Display for Consignment<TRANSFER>
impl<const TRANSFER: bool> Display for Consignment<TRANSFER>
Source§impl FileContent for Consignment<false>
impl FileContent for Consignment<false>
fn load(data: impl Read) -> Result<Self, LoadError>
fn save(&self, writer: impl Write) -> Result<(), Error>
fn load_file(path: impl AsRef<Path>) -> Result<Self, LoadError>
fn save_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
fn load_armored(path: impl AsRef<Path>) -> Result<Self, LoadError>
fn save_armored(&self, path: impl AsRef<Path>) -> Result<(), Error>
Source§impl FileContent for Consignment<true>
impl FileContent for Consignment<true>
fn load(data: impl Read) -> Result<Self, LoadError>
fn save(&self, writer: impl Write) -> Result<(), Error>
fn load_file(path: impl AsRef<Path>) -> Result<Self, LoadError>
fn save_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
fn load_armored(path: impl AsRef<Path>) -> Result<Self, LoadError>
fn save_armored(&self, path: impl AsRef<Path>) -> Result<(), Error>
Source§impl From<Consignment<false>> for UniversalFile
impl From<Consignment<false>> for UniversalFile
Source§fn from(v: Consignment<false>) -> UniversalFile
fn from(v: Consignment<false>) -> UniversalFile
Source§impl From<Consignment<true>> for UniversalFile
impl From<Consignment<true>> for UniversalFile
Source§fn from(v: Consignment<true>) -> UniversalFile
fn from(v: Consignment<true>) -> UniversalFile
Source§impl<const TRANSFER: bool> FromStr for Consignment<TRANSFER>
impl<const TRANSFER: bool> FromStr for Consignment<TRANSFER>
Source§type Err = ConsignmentParseError
type Err = ConsignmentParseError
Source§fn from_str(
s: &str,
) -> Result<Consignment<TRANSFER>, <Consignment<TRANSFER> as FromStr>::Err>
fn from_str( s: &str, ) -> Result<Consignment<TRANSFER>, <Consignment<TRANSFER> as FromStr>::Err>
s to return a value of this type. Read more