pub trait ExecutableTransaction: Default + Clone + Chargeable + Executable + IntoChecked + EstimatePredicates + UniqueIdentifier + Maturity + Inputs + Outputs + Witnesses + Into<Transaction> + SizedBytes + SerializableVec {
    // Required methods
    fn as_script(&self) -> Option<&Script>;
    fn as_script_mut(&mut self) -> Option<&mut Script>;
    fn as_create(&self) -> Option<&Create>;
    fn as_create_mut(&mut self) -> Option<&mut Create>;
    fn transaction_type() -> Word;

    // Provided methods
    fn output_to_mem(&mut self, idx: usize, buf: &mut [u8]) -> Result<usize> { ... }
    fn replace_variable_output(
        &mut self,
        idx: usize,
        output: Output
    ) -> Result<(), PanicReason> { ... }
    fn update_outputs<I>(
        &mut self,
        params: &ConsensusParameters,
        revert: bool,
        remaining_gas: Word,
        initial_balances: &InitialBalances,
        balances: &I
    ) -> Result<(), CheckError>
       where I: for<'a> Index<&'a AssetId, Output = Word> { ... }
    fn find_output_contract(&self, input: usize) -> Option<(usize, &Output)> { ... }
}
Expand description

The definition of the executable transaction supported by the Interpreter.

Required Methods§

source

fn as_script(&self) -> Option<&Script>

Casts the Self transaction into &Script if any.

source

fn as_script_mut(&mut self) -> Option<&mut Script>

Casts the Self transaction into &mut Script if any.

source

fn as_create(&self) -> Option<&Create>

Casts the Self transaction into &Create if any.

source

fn as_create_mut(&mut self) -> Option<&mut Create>

Casts the Self transaction into &mut Create if any.

source

fn transaction_type() -> Word

Returns the type of the transaction like Transaction::Create or Transaction::Script.

Provided Methods§

source

fn output_to_mem(&mut self, idx: usize, buf: &mut [u8]) -> Result<usize>

Dumps the Output by the idx into the buf buffer.

source

fn replace_variable_output( &mut self, idx: usize, output: Output ) -> Result<(), PanicReason>

Replaces the Output::Variable with the output(should be also Output::Variable) by the idx index.

source

fn update_outputs<I>( &mut self, params: &ConsensusParameters, revert: bool, remaining_gas: Word, initial_balances: &InitialBalances, balances: &I ) -> Result<(), CheckError>where I: for<'a> Index<&'a AssetId, Output = Word>,

Update change and variable outputs.

revert will signal if the execution was reverted. It will refund the unused gas cost to the base asset and reset output changes to their initial_balances.

remaining_gas expects the raw content of $ggas

initial_balances contains the initial state of the free balances

balances will contain the current state of the free balances

source

fn find_output_contract(&self, input: usize) -> Option<(usize, &Output)>

Finds Output::Contract corresponding to the input index.

Implementations on Foreign Types§

source§

impl ExecutableTransaction for Script

source§

impl ExecutableTransaction for Create

Implementors§