pub struct TransactionV1Config {
pub native_mint_lane: TransactionLaneDefinition,
pub native_auction_lane: TransactionLaneDefinition,
pub install_upgrade_lane: TransactionLaneDefinition,
/* private fields */
}std only.Expand description
Configuration values associated with V1 Transactions.
Fields§
§native_mint_lane: TransactionLaneDefinitionLane configuration of the native mint interaction.
native_auction_lane: TransactionLaneDefinitionLane configuration for the native auction interaction.
install_upgrade_lane: TransactionLaneDefinitionLane configuration for the install/upgrade interaction.
Implementations§
Source§impl TransactionV1Config
impl TransactionV1Config
Sourcepub fn new(
native_mint_lane: TransactionLaneDefinition,
native_auction_lane: TransactionLaneDefinition,
install_upgrade_lane: TransactionLaneDefinition,
wasm_lanes: Vec<TransactionLaneDefinition>,
) -> Self
pub fn new( native_mint_lane: TransactionLaneDefinition, native_auction_lane: TransactionLaneDefinition, install_upgrade_lane: TransactionLaneDefinition, wasm_lanes: Vec<TransactionLaneDefinition>, ) -> Self
Cretaes a new instance of TransactionV1Config
Sourcepub fn random(rng: &mut TestRng) -> Self
Available on crate feature testing only.
pub fn random(rng: &mut TestRng) -> Self
testing only.Generates a random instance using a TestRng.
Sourcepub fn get_max_serialized_length(&self, lane_id: u8) -> u64
pub fn get_max_serialized_length(&self, lane_id: u8) -> u64
Returns the max serialized length of a transaction for the given lane.
Sourcepub fn get_max_args_length(&self, lane_id: u8) -> u64
pub fn get_max_args_length(&self, lane_id: u8) -> u64
Returns the max number of runtime args
Sourcepub fn get_max_transaction_gas_limit(&self, lane_id: u8) -> u64
pub fn get_max_transaction_gas_limit(&self, lane_id: u8) -> u64
Returns the max gas limit of a transaction for the given lane.
Sourcepub fn get_max_transaction_count(&self, lane_id: u8) -> u64
pub fn get_max_transaction_count(&self, lane_id: u8) -> u64
Returns the max transactions count for the given lane.
Sourcepub fn get_max_wasm_transaction_count(&self) -> u64
pub fn get_max_wasm_transaction_count(&self) -> u64
Returns the maximum number of Wasm based transactions across wasm lanes.
Sourcepub fn is_supported(&self, lane_id: u8) -> bool
pub fn is_supported(&self, lane_id: u8) -> bool
Are the given transaction parameters supported.
Sourcepub fn get_supported_lanes(&self) -> Vec<u8> ⓘ
pub fn get_supported_lanes(&self) -> Vec<u8> ⓘ
Returns the list of currently supported lane identifiers.
Sourcepub fn with_count_limits(
self,
mint: Option<u64>,
auction: Option<u64>,
install: Option<u64>,
large: Option<u64>,
) -> Self
Available on crate feature testing only.
pub fn with_count_limits( self, mint: Option<u64>, auction: Option<u64>, install: Option<u64>, large: Option<u64>, ) -> Self
testing only.Returns the transaction v1 configuration with the specified lane limits.
Sourcepub fn get_max_block_count(&self) -> u64
pub fn get_max_block_count(&self) -> u64
Returns the max total count for all transactions across all lanes allowed in a block.
Sourcepub fn is_predefined_lane(&self, lane: u8) -> bool
pub fn is_predefined_lane(&self, lane: u8) -> bool
Returns true if the lane identifier is for one of the predefined lanes.
Sourcepub fn get_wasm_lane_id_by_size(
&self,
transaction_size: u64,
additional_computation_factor: u8,
runtime_args_size: u64,
) -> Option<u8>
pub fn get_wasm_lane_id_by_size( &self, transaction_size: u64, additional_computation_factor: u8, runtime_args_size: u64, ) -> Option<u8>
Returns a wasm lane id based on the transaction size adjusted by maybe_additional_computation_factor if necessary.
pub fn get_lane_by_id(&self, lane_id: u8) -> Option<&TransactionLaneDefinition>
pub fn get_wasm_lane_id_by_payment_limited( &self, gas_limit: u64, transaction_size: u64, runtime_args_size: u64, ) -> Option<u8>
pub fn wasm_lanes(&self) -> &Vec<TransactionLaneDefinition>
pub fn set_wasm_lanes(&mut self, wasm_lanes: Vec<TransactionLaneDefinition>)
testing only.pub fn get_max_wasm_lane_by_gas_limit( &self, ) -> Option<TransactionLaneDefinition>
testing only.Trait Implementations§
Source§impl Clone for TransactionV1Config
impl Clone for TransactionV1Config
Source§fn clone(&self) -> TransactionV1Config
fn clone(&self) -> TransactionV1Config
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DataSize for TransactionV1Config
impl DataSize for TransactionV1Config
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 TransactionV1Config
impl Debug for TransactionV1Config
Source§impl Default for TransactionV1Config
impl Default for TransactionV1Config
Source§impl<'de> Deserialize<'de> for TransactionV1Config
impl<'de> Deserialize<'de> for TransactionV1Config
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 FromBytes for TransactionV1Config
impl FromBytes for TransactionV1Config
Source§impl PartialEq for TransactionV1Config
impl PartialEq for TransactionV1Config
Source§impl Serialize for TransactionV1Config
impl Serialize for TransactionV1Config
Source§impl ToBytes for TransactionV1Config
impl ToBytes for TransactionV1Config
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 TransactionV1Config
Auto Trait Implementations§
impl !Freeze for TransactionV1Config
impl RefUnwindSafe for TransactionV1Config
impl Send for TransactionV1Config
impl Sync for TransactionV1Config
impl Unpin for TransactionV1Config
impl UnwindSafe for TransactionV1Config
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> 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