pub enum BatchTransitionAction {
V0(BatchTransitionActionV0),
}Expand description
documents batch transition action
Variants§
V0(BatchTransitionActionV0)
v0
Implementations§
Source§impl BatchTransitionAction
impl BatchTransitionAction
Sourcepub fn transitions(&self) -> &Vec<BatchedTransitionAction>
pub fn transitions(&self) -> &Vec<BatchedTransitionAction>
transitions
Sourcepub fn transitions_mut(&mut self) -> &mut Vec<BatchedTransitionAction>
pub fn transitions_mut(&mut self) -> &mut Vec<BatchedTransitionAction>
transitions
Sourcepub fn transitions_take(&mut self) -> Vec<BatchedTransitionAction>
pub fn transitions_take(&mut self) -> Vec<BatchedTransitionAction>
transitions
Sourcepub fn transitions_owned(self) -> Vec<BatchedTransitionAction>
pub fn transitions_owned(self) -> Vec<BatchedTransitionAction>
transitions owned
Sourcepub fn set_transitions(&mut self, transitions: Vec<BatchedTransitionAction>)
pub fn set_transitions(&mut self, transitions: Vec<BatchedTransitionAction>)
set transitions
Sourcepub fn user_fee_increase(&self) -> UserFeeIncrease
pub fn user_fee_increase(&self) -> UserFeeIncrease
fee multiplier
Sourcepub fn contract_group_memberships(
&self,
contract_id: &Identifier,
) -> Option<&ResolvedContractGroupMemberships>
pub fn contract_group_memberships( &self, contract_id: &Identifier, ) -> Option<&ResolvedContractGroupMemberships>
The group memberships the transformer resolved for a contract the batch touches
Sourcepub fn set_contract_group_memberships(
&mut self,
contract_id: Identifier,
resolved: ResolvedContractGroupMemberships,
)
pub fn set_contract_group_memberships( &mut self, contract_id: Identifier, resolved: ResolvedContractGroupMemberships, )
Records the group memberships of a contract the batch touches
Sourcepub fn lapsed_suspensions(&self) -> &BTreeSet<Identifier>
pub fn lapsed_suspensions(&self) -> &BTreeSet<Identifier>
The contracts on which the batch sweeps its owner’s lapsed suspension when it executes
Sourcepub fn moderators_pot_settlements(&self) -> &[ModeratorsPotSettlement]
pub fn moderators_pot_settlements(&self) -> &[ModeratorsPotSettlement]
The settles of moderators pots the batch forces before it changes a seated team
Sourcepub fn take_moderators_pot_settlements(
&mut self,
) -> Vec<ModeratorsPotSettlement>
pub fn take_moderators_pot_settlements( &mut self, ) -> Vec<ModeratorsPotSettlement>
Takes the settles of moderators pots out of the batch, for its conversion to operations
Sourcepub fn set_moderators_pot_settlements(
&mut self,
settlements: Vec<ModeratorsPotSettlement>,
)
pub fn set_moderators_pot_settlements( &mut self, settlements: Vec<ModeratorsPotSettlement>, )
Records the settles of moderators pots the batch forces before it changes a seated team
Source§impl BatchTransitionAction
impl BatchTransitionAction
Sourcepub fn all_used_balances(&self) -> Result<Option<Credits>, ProtocolError>
pub fn all_used_balances(&self) -> Result<Option<Credits>, ProtocolError>
The sum of all purchases amount and all conflicting index collateral voting funds
Sourcepub fn gas_sponsor(&self) -> Option<&ResolvedGasSponsor>
pub fn gas_sponsor(&self) -> Option<&ResolvedGasSponsor>
The contract owner the batch transformer resolved as the gas sponsor, if any
Sourcepub fn declared_action_fees(
&self,
) -> Vec<(Identifier, Identifier, ActionFeePricing, DocumentActionFee)>
pub fn declared_action_fees( &self, ) -> Vec<(Identifier, Identifier, ActionFeePricing, DocumentActionFee)>
The fee each document transition of the batch owes for its action, before the fee multiplier, with the contract it goes to, that contract’s owner, and how it is priced: what its document type declares, with the moderators part it agreed to when that is a discount the contract’s seated moderation charter gives (advanced structure validation refuses any other). A transition that became a nonce bump declares nothing: only an action that executes is charged.
Sourcepub fn contracts_with_moderators_discounts(&self) -> BTreeSet<Identifier>
pub fn contracts_with_moderators_discounts(&self) -> BTreeSet<Identifier>
The elected contracts on whose moderated document types some document transition of the batch agrees to a discounted moderators part (protocol version 14): the contracts whose seated moderation charter the batch transformer reads the moderators share of.
Records the moderators share of the seated moderation charter of contract_id, None
when no charter is seated on it
Sourcepub fn action_fee_multiplier_permille(&self) -> Option<FeeMultiplier>
pub fn action_fee_multiplier_permille(&self) -> Option<FeeMultiplier>
The fee multiplier, in permille, of the epoch the batch executes in, as the batch transformer read it (protocol version 14). Only read when some document transition of the batch declares an action fee priced by it.
Sourcepub fn set_action_fee_multiplier_permille(
&mut self,
multiplier: Option<FeeMultiplier>,
)
pub fn set_action_fee_multiplier_permille( &mut self, multiplier: Option<FeeMultiplier>, )
Records the fee multiplier of the epoch the batch executes in
Sourcepub fn resolved_action_fees(
&self,
) -> Result<Vec<ResolvedDocumentActionFee>, ProtocolError>
pub fn resolved_action_fees( &self, ) -> Result<Vec<ResolvedDocumentActionFee>, ProtocolError>
The action fees the batch owes: what its document transitions declare, priced.
They are read off the transitions as they are now, not as the transformer built them. State validation replaces a transition that fails with a nonce bump after the transformer ran, and a bump declares nothing, so a fee is only ever owed for an action that executes.
Sourcepub fn validate_action_fee_agreements(
&self,
) -> Result<Result<(), ConsensusError>, ProtocolError>
pub fn validate_action_fee_agreements( &self, ) -> Result<Result<(), ConsensusError>, ProtocolError>
Whether every document transition that owes an action fee agreed to it: the transition names the amounts and the pricing its document type declares, or, on a document type an elected contract moderates, the declared owner part and pricing with the share of the declared moderators part the contract’s seated moderation charter takes; and, for a fee priced by the fee multiplier, accepts the multiplier of the epoch the batch executes in. The inner error is the consensus error of the first transition that did not. Everything it is judged against travels on the action (the charter’s share as the transformer read it), so this reads no state.
Sourcepub fn set_gas_sponsor(&mut self, gas_sponsor: Option<ResolvedGasSponsor>)
pub fn set_gas_sponsor(&mut self, gas_sponsor: Option<ResolvedGasSponsor>)
Records the contract owner who sponsors the batch’s gas, with their balance
Sourcepub fn resolve_gas_payer(&self) -> Result<GasPayer, ConsensusError>
pub fn resolve_gas_payer(&self) -> Result<GasPayer, ConsensusError>
Who pays the gas of the batch, or the consensus error explaining why the batch’s requests cannot be honoured: a transition asking for more than its document type’s token cost offers, or a batch whose transitions do not all name the same payer.
Sourcepub fn all_purchases_amount(&self) -> Result<Option<Credits>, ProtocolError>
pub fn all_purchases_amount(&self) -> Result<Option<Credits>, ProtocolError>
The sum of all purchases amounts for all purchase transitions in the batch
Sourcepub fn all_conflicting_index_collateral_voting_funds(
&self,
) -> Result<Option<Credits>, ProtocolError>
pub fn all_conflicting_index_collateral_voting_funds( &self, ) -> Result<Option<Credits>, ProtocolError>
The sum of all conflicting index collateral voting funds for all document create transitions in the batch
Sourcepub fn combined_security_level_requirement(
&self,
) -> Result<Vec<SecurityLevel>, ProtocolError>
pub fn combined_security_level_requirement( &self, ) -> Result<Vec<SecurityLevel>, ProtocolError>
Determines the security level requirements for the batch transition action.
This method performs the following steps:
- Retrieves all document types associated with the state transitions (STs) in the batch.
- For each document type, fetches its schema to determine its security level requirement.
- If the schema specifies a security level, that is used.
- Otherwise, a default security level is used.
The method then determines the highest security level (which corresponds to the lowest
integer value of the SecurityLevel enum) across all documents affected by the state transitions.
This highest level becomes the signature requirement for the entire batch transition action.
§Returns
- Returns a
Resultcontaining aVec<SecurityLevel>which is the list of security levels required for the batch transition action. - Returns an
Errof typeProtocolErrorif any error occurs during the process.
§Examples
// Assuming `batch_transition_action` is an instance of `DocumentsBatchTransitionAction`
let required_levels = batch_transition_action.contract_based_security_level_requirement()?;Trait Implementations§
Source§impl Clone for BatchTransitionAction
impl Clone for BatchTransitionAction
Source§fn clone(&self) -> BatchTransitionAction
fn clone(&self) -> BatchTransitionAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BatchTransitionAction
impl Debug for BatchTransitionAction
Source§impl DriveHighLevelOperationConverter for BatchTransitionAction
impl DriveHighLevelOperationConverter for BatchTransitionAction
Source§fn into_high_level_drive_operations<'b>(
self,
epoch: &Epoch,
platform_version: &PlatformVersion,
) -> Result<Vec<DriveOperation<'b>>, Error>
fn into_high_level_drive_operations<'b>( self, epoch: &Epoch, platform_version: &PlatformVersion, ) -> Result<Vec<DriveOperation<'b>>, Error>
Source§impl From<BatchTransitionAction> for StateTransitionAction
impl From<BatchTransitionAction> for StateTransitionAction
Source§fn from(value: BatchTransitionAction) -> Self
fn from(value: BatchTransitionAction) -> Self
Source§impl From<BatchTransitionActionV0> for BatchTransitionAction
impl From<BatchTransitionActionV0> for BatchTransitionAction
Source§fn from(value: BatchTransitionActionV0) -> Self
fn from(value: BatchTransitionActionV0) -> Self
Auto Trait Implementations§
impl Freeze for BatchTransitionAction
impl RefUnwindSafe for BatchTransitionAction
impl Send for BatchTransitionAction
impl Sync for BatchTransitionAction
impl Unpin for BatchTransitionAction
impl UnsafeUnpin for BatchTransitionAction
impl UnwindSafe for BatchTransitionAction
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> CostsExt for T
impl<T> CostsExt for T
§fn wrap_with_cost(self, cost: OperationCost) -> CostContext<Self>where
Self: Sized,
fn wrap_with_cost(self, cost: OperationCost) -> CostContext<Self>where
Self: Sized,
CostContext object with provided costs.§fn wrap_fn_cost(
self,
f: impl FnOnce(&Self) -> OperationCost,
) -> CostContext<Self>where
Self: Sized,
fn wrap_fn_cost(
self,
f: impl FnOnce(&Self) -> OperationCost,
) -> CostContext<Self>where
Self: Sized,
CostContext object with costs computed using the
value getting wrapped.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T, U> IntoOnNetwork<U> for Twhere
U: FromOnNetwork<T>,
impl<T, U> IntoOnNetwork<U> for Twhere
U: FromOnNetwork<T>,
§fn into_on_network(self, network: Network) -> U
fn into_on_network(self, network: Network) -> U
Calls U::from_on_network(self).
§impl<T, U> IntoPlatformVersioned<U> for Twhere
U: FromPlatformVersioned<T>,
impl<T, U> IntoPlatformVersioned<U> for Twhere
U: FromPlatformVersioned<T>,
§fn into_platform_versioned(self, platform_version: &PlatformVersion) -> U
fn into_platform_versioned(self, platform_version: &PlatformVersion) -> U
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.