pub enum ExecutableDeployItem {
ModuleBytes {
module_bytes: Bytes,
args: RuntimeArgs,
},
StoredContractByHash {
hash: ContractHash,
entry_point: String,
args: RuntimeArgs,
},
StoredContractByName {
name: String,
entry_point: String,
args: RuntimeArgs,
},
StoredVersionedContractByHash {
hash: ContractPackageHash,
version: Option<ContractVersion>,
entry_point: String,
args: RuntimeArgs,
},
StoredVersionedContractByName {
name: String,
version: Option<ContractVersion>,
entry_point: String,
args: RuntimeArgs,
},
Transfer {
args: RuntimeArgs,
},
}
Expand description
The executable component of a Deploy
.
Variants§
ModuleBytes
Executable specified as raw bytes that represent Wasm code and an instance of
RuntimeArgs
.
Fields
args: RuntimeArgs
Runtime arguments.
StoredContractByHash
Stored contract referenced by its AddressableEntityHash
, entry point and an instance of
RuntimeArgs
.
StoredContractByName
Stored contract referenced by a named key existing in the signer’s account context, entry
point and an instance of RuntimeArgs
.
Fields
args: RuntimeArgs
Runtime arguments.
StoredVersionedContractByHash
Stored versioned contract referenced by its PackageHash
, entry point and an
instance of RuntimeArgs
.
Fields
hash: ContractPackageHash
Contract package hash
version: Option<ContractVersion>
An optional version of the contract to call. It will default to the highest enabled version if no value is specified.
args: RuntimeArgs
Runtime arguments.
StoredVersionedContractByName
Stored versioned contract referenced by a named key existing in the signer’s account
context, entry point and an instance of RuntimeArgs
.
Fields
version: Option<ContractVersion>
An optional version of the contract to call. It will default to the highest enabled version if no value is specified.
args: RuntimeArgs
Runtime arguments.
Transfer
A native transfer which does not contain or reference a Wasm code.
Fields
args: RuntimeArgs
Runtime arguments.
Implementations§
Source§impl ExecutableDeployItem
impl ExecutableDeployItem
Sourcepub fn new_module_bytes(module_bytes: Bytes, args: RuntimeArgs) -> Self
pub fn new_module_bytes(module_bytes: Bytes, args: RuntimeArgs) -> Self
Returns a new ExecutableDeployItem::ModuleBytes
.
Sourcepub fn new_standard_payment<A: Into<U512>>(amount: A) -> Self
pub fn new_standard_payment<A: Into<U512>>(amount: A) -> Self
Returns a new ExecutableDeployItem::ModuleBytes
suitable for use as standard payment code
of a Deploy
.
Sourcepub fn new_stored_contract_by_hash(
hash: ContractHash,
entry_point: String,
args: RuntimeArgs,
) -> Self
pub fn new_stored_contract_by_hash( hash: ContractHash, entry_point: String, args: RuntimeArgs, ) -> Self
Returns a new ExecutableDeployItem::StoredContractByHash
.
Sourcepub fn new_stored_contract_by_name(
name: String,
entry_point: String,
args: RuntimeArgs,
) -> Self
pub fn new_stored_contract_by_name( name: String, entry_point: String, args: RuntimeArgs, ) -> Self
Returns a new ExecutableDeployItem::StoredContractByName
.
Sourcepub fn new_stored_versioned_contract_by_hash(
hash: ContractPackageHash,
version: Option<ContractVersion>,
entry_point: String,
args: RuntimeArgs,
) -> Self
pub fn new_stored_versioned_contract_by_hash( hash: ContractPackageHash, version: Option<ContractVersion>, entry_point: String, args: RuntimeArgs, ) -> Self
Returns a new ExecutableDeployItem::StoredVersionedContractByHash
.
Sourcepub fn new_stored_versioned_contract_by_name(
name: String,
version: Option<ContractVersion>,
entry_point: String,
args: RuntimeArgs,
) -> Self
pub fn new_stored_versioned_contract_by_name( name: String, version: Option<ContractVersion>, entry_point: String, args: RuntimeArgs, ) -> Self
Returns a new ExecutableDeployItem::StoredVersionedKeyContractByName
.
Sourcepub fn new_transfer<A: Into<U512>, T: Into<TransferTarget>>(
amount: A,
maybe_source: Option<URef>,
target: T,
maybe_transfer_id: Option<u64>,
) -> Self
pub fn new_transfer<A: Into<U512>, T: Into<TransferTarget>>( amount: A, maybe_source: Option<URef>, target: T, maybe_transfer_id: Option<u64>, ) -> Self
Returns a new ExecutableDeployItem
suitable for use as session code for a transfer.
If maybe_source
is None, the account’s main purse is used as the source.
Sourcepub fn entry_point_name(&self) -> &str
pub fn entry_point_name(&self) -> &str
Returns the entry point name.
Sourcepub fn identifier(&self) -> ExecutableDeployItemIdentifier
pub fn identifier(&self) -> ExecutableDeployItemIdentifier
Returns the identifier of the ExecutableDeployItem
.
Sourcepub fn contract_identifier(&self) -> Option<AddressableEntityIdentifier>
pub fn contract_identifier(&self) -> Option<AddressableEntityIdentifier>
Returns the identifier of the contract in the deploy item, if present.
Sourcepub fn contract_package_identifier(&self) -> Option<PackageIdentifier>
pub fn contract_package_identifier(&self) -> Option<PackageIdentifier>
Returns the identifier of the contract package in the deploy item, if present.
Sourcepub fn args(&self) -> &RuntimeArgs
pub fn args(&self) -> &RuntimeArgs
Returns the runtime arguments.
Sourcepub fn payment_amount(&self, conv_rate: u8) -> Option<Gas>
pub fn payment_amount(&self, conv_rate: u8) -> Option<Gas>
Returns the payment amount from args (if any) as Gas.
Sourcepub fn is_transfer(&self) -> bool
pub fn is_transfer(&self) -> bool
Returns true
if this deploy item is a native transfer.
Sourcepub fn is_standard_payment(&self, phase: Phase) -> bool
pub fn is_standard_payment(&self, phase: Phase) -> bool
Returns true
if this deploy item is a standard payment.
Sourcepub fn is_by_name(&self) -> bool
pub fn is_by_name(&self) -> bool
Returns true
if the deploy item is a contract identified by its name.
Sourcepub fn by_name(&self) -> Option<String>
pub fn by_name(&self) -> Option<String>
Returns the name of the contract or contract package, if the deploy item is identified by name.
Sourcepub fn is_stored_contract(&self) -> bool
pub fn is_stored_contract(&self) -> bool
Returns true
if the deploy item is a stored contract.
Sourcepub fn is_stored_contract_package(&self) -> bool
pub fn is_stored_contract_package(&self) -> bool
Returns true
if the deploy item is a stored contract package.
Sourcepub fn is_module_bytes(&self) -> bool
pub fn is_module_bytes(&self) -> bool
Returns true
if the deploy item is ModuleBytes
.
Trait Implementations§
Source§impl Clone for ExecutableDeployItem
impl Clone for ExecutableDeployItem
Source§fn clone(&self) -> ExecutableDeployItem
fn clone(&self) -> ExecutableDeployItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl DataSize for ExecutableDeployItem
impl DataSize for ExecutableDeployItem
Source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
true
, the type has a heap size that can vary at runtime, depending on the actual value.Source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
IS_DYNAMIC
is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.Source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Source§impl Debug for ExecutableDeployItem
impl Debug for ExecutableDeployItem
Source§impl<'de> Deserialize<'de> for ExecutableDeployItem
impl<'de> Deserialize<'de> for ExecutableDeployItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ExecutableDeployItem
impl Display for ExecutableDeployItem
Source§impl Distribution<ExecutableDeployItem> for Standard
Available on crate feature testing
only.
impl Distribution<ExecutableDeployItem> for Standard
testing
only.Source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> ExecutableDeployItem
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> ExecutableDeployItem
T
, using rng
as the source of randomness.Source§fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
T
, using rng
as
the source of randomness. Read moreSource§impl FromBytes for ExecutableDeployItem
impl FromBytes for ExecutableDeployItem
Source§impl Hash for ExecutableDeployItem
impl Hash for ExecutableDeployItem
Source§impl JsonSchema for ExecutableDeployItem
impl JsonSchema for ExecutableDeployItem
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§impl Ord for ExecutableDeployItem
impl Ord for ExecutableDeployItem
Source§fn cmp(&self, other: &ExecutableDeployItem) -> Ordering
fn cmp(&self, other: &ExecutableDeployItem) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ExecutableDeployItem
impl PartialEq for ExecutableDeployItem
Source§impl PartialOrd for ExecutableDeployItem
impl PartialOrd for ExecutableDeployItem
Source§impl Serialize for ExecutableDeployItem
impl Serialize for ExecutableDeployItem
Source§impl ToBytes for ExecutableDeployItem
impl ToBytes for ExecutableDeployItem
Source§fn write_bytes(&self, writer: &mut Vec<u8>) -> Result<(), Error>
fn write_bytes(&self, writer: &mut Vec<u8>) -> Result<(), Error>
&self
into a mutable writer
.Source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Vec<u8>
which would be returned from a successful call to
to_bytes()
or into_bytes()
. The data is not actually serialized, so this call is
relatively cheap.impl Eq for ExecutableDeployItem
impl StructuralPartialEq for ExecutableDeployItem
Auto Trait Implementations§
impl Freeze for ExecutableDeployItem
impl RefUnwindSafe for ExecutableDeployItem
impl Send for ExecutableDeployItem
impl Sync for ExecutableDeployItem
impl Unpin for ExecutableDeployItem
impl UnwindSafe for ExecutableDeployItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more