StateTransitionActionTransformer

Trait StateTransitionActionTransformer 

Source
pub trait StateTransitionActionTransformer {
    // Required method
    fn transform_into_action<C: CoreRPCLike>(
        &self,
        platform: &PlatformRef<'_, C>,
        block_info: &BlockInfo,
        remaining_address_input_balances: &Option<BTreeMap<PlatformAddress, (AddressNonce, Credits)>>,
        validation_mode: ValidationMode,
        execution_context: &mut StateTransitionExecutionContext,
        tx: TransactionArg<'_, '_>,
    ) -> Result<ConsensusValidationResult<StateTransitionAction>, Error>;
}
Expand description

A trait for validating state transitions within a blockchain.

Required Methods§

Source

fn transform_into_action<C: CoreRPCLike>( &self, platform: &PlatformRef<'_, C>, block_info: &BlockInfo, remaining_address_input_balances: &Option<BTreeMap<PlatformAddress, (AddressNonce, Credits)>>, validation_mode: ValidationMode, execution_context: &mut StateTransitionExecutionContext, tx: TransactionArg<'_, '_>, ) -> Result<ConsensusValidationResult<StateTransitionAction>, Error>

A trait for transforming a raw TransactionArg into a typed StateTransitionAction.

This is primarily intended for testing, internal tooling, and controlled validation flows. In production, the transformation is normally performed within validate_state, and this method should not be invoked directly.

§Versioning Note

This trait is intentionally not versioned. If the structure of transform_into_action ever needs to change, a new trait should be introduced rather than modifying this one to preserve API stability.

§Type Parameters
§Arguments
  • platform – A platform reference implementing CoreRPCLike.
  • block_info – Information about the current block.
  • remaining_address_input_balances – A map of input addresses to their (nonce, balance) tuples used during partial validation.
  • validation_mode – The current validation mode controlling the strictness of checks.
  • execution_context – The execution context for the state transition.
  • tx – The raw transaction argument to be transformed.
§Returns

A Result containing:

  • ConsensusValidationResult<StateTransitionAction> on success, or
  • Error if the action could not be created or validated.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl StateTransitionActionTransformer for StateTransition

Source§

fn transform_into_action<C: CoreRPCLike>( &self, platform: &PlatformRef<'_, C>, block_info: &BlockInfo, remaining_address_input_balances: &Option<BTreeMap<PlatformAddress, (AddressNonce, Credits)>>, validation_mode: ValidationMode, execution_context: &mut StateTransitionExecutionContext, tx: TransactionArg<'_, '_>, ) -> Result<ConsensusValidationResult<StateTransitionAction>, Error>

Source§

impl StateTransitionActionTransformer for DataContractCreateTransition

Source§

fn transform_into_action<C: CoreRPCLike>( &self, platform: &PlatformRef<'_, C>, block_info: &BlockInfo, _remaining_address_input_balances: &Option<BTreeMap<PlatformAddress, (AddressNonce, Credits)>>, validation_mode: ValidationMode, execution_context: &mut StateTransitionExecutionContext, _tx: TransactionArg<'_, '_>, ) -> Result<ConsensusValidationResult<StateTransitionAction>, Error>

Source§

impl StateTransitionActionTransformer for DataContractUpdateTransition

Source§

fn transform_into_action<C: CoreRPCLike>( &self, platform: &PlatformRef<'_, C>, block_info: &BlockInfo, _remaining_address_input_balances: &Option<BTreeMap<PlatformAddress, (AddressNonce, Credits)>>, validation_mode: ValidationMode, execution_context: &mut StateTransitionExecutionContext, _tx: TransactionArg<'_, '_>, ) -> Result<ConsensusValidationResult<StateTransitionAction>, Error>

Source§

impl StateTransitionActionTransformer for BatchTransition

Source§

fn transform_into_action<C: CoreRPCLike>( &self, platform: &PlatformRef<'_, C>, block_info: &BlockInfo, _remaining_address_input_balances: &Option<BTreeMap<PlatformAddress, (AddressNonce, Credits)>>, validation_mode: ValidationMode, _execution_context: &mut StateTransitionExecutionContext, tx: TransactionArg<'_, '_>, ) -> Result<ConsensusValidationResult<StateTransitionAction>, Error>

Source§

impl StateTransitionActionTransformer for IdentityCreditTransferToAddressesTransition

Source§

fn transform_into_action<C: CoreRPCLike>( &self, platform: &PlatformRef<'_, C>, _block_info: &BlockInfo, _remaining_address_input_balances: &Option<BTreeMap<PlatformAddress, (AddressNonce, Credits)>>, _validation_mode: ValidationMode, _execution_context: &mut StateTransitionExecutionContext, _tx: TransactionArg<'_, '_>, ) -> Result<ConsensusValidationResult<StateTransitionAction>, Error>

Source§

impl StateTransitionActionTransformer for IdentityCreditTransferTransition

Source§

fn transform_into_action<C: CoreRPCLike>( &self, platform: &PlatformRef<'_, C>, _block_info: &BlockInfo, _remaining_address_input_balances: &Option<BTreeMap<PlatformAddress, (AddressNonce, Credits)>>, _validation_mode: ValidationMode, _execution_context: &mut StateTransitionExecutionContext, _tx: TransactionArg<'_, '_>, ) -> Result<ConsensusValidationResult<StateTransitionAction>, Error>

Source§

impl StateTransitionActionTransformer for IdentityCreditWithdrawalTransition

Source§

fn transform_into_action<C: CoreRPCLike>( &self, platform: &PlatformRef<'_, C>, block_info: &BlockInfo, _remaining_address_input_balances: &Option<BTreeMap<PlatformAddress, (AddressNonce, Credits)>>, _validation_mode: ValidationMode, execution_context: &mut StateTransitionExecutionContext, tx: TransactionArg<'_, '_>, ) -> Result<ConsensusValidationResult<StateTransitionAction>, Error>

Source§

impl StateTransitionActionTransformer for IdentityUpdateTransition

Source§

fn transform_into_action<C: CoreRPCLike>( &self, platform: &PlatformRef<'_, C>, _block_info: &BlockInfo, _remaining_address_input_balances: &Option<BTreeMap<PlatformAddress, (AddressNonce, Credits)>>, _validation_mode: ValidationMode, _execution_context: &mut StateTransitionExecutionContext, _tx: TransactionArg<'_, '_>, ) -> Result<ConsensusValidationResult<StateTransitionAction>, Error>

Source§

impl StateTransitionActionTransformer for MasternodeVoteTransition

Source§

fn transform_into_action<C: CoreRPCLike>( &self, platform: &PlatformRef<'_, C>, _block_info: &BlockInfo, _remaining_address_input_balances: &Option<BTreeMap<PlatformAddress, (AddressNonce, Credits)>>, validation_mode: ValidationMode, _execution_context: &mut StateTransitionExecutionContext, tx: TransactionArg<'_, '_>, ) -> Result<ConsensusValidationResult<StateTransitionAction>, Error>

Implementors§