Trait fuel_tx::Executable

source ·
pub trait Executable: Inputs + Outputs + Witnesses {
    // Provided methods
    fn input_asset_ids(&self) -> IntoIter<&AssetId> { ... }
    fn input_asset_ids_unique(&self) -> IntoIter<&AssetId> { ... }
    fn input_contracts(&self) -> IntoIter<&ContractId> { ... }
    fn check_predicate_owners(&self, parameters: &ConsensusParameters) -> bool { ... }
    fn add_unsigned_coin_input(
        &mut self,
        utxo_id: UtxoId,
        owner: &PublicKey,
        amount: Word,
        asset_id: AssetId,
        tx_pointer: TxPointer,
        maturity: BlockHeight
    ) { ... }
    fn add_unsigned_message_input(
        &mut self,
        sender: Address,
        recipient: Address,
        nonce: Nonce,
        amount: Word,
        data: Vec<u8>
    ) { ... }
    fn prepare_init_script(&mut self) -> &mut Self { ... }
    fn prepare_init_predicate(&mut self) -> &mut Self { ... }
}

Provided Methods§

source

fn input_asset_ids(&self) -> IntoIter<&AssetId>

Returns the assets’ ids used in the inputs in the order of inputs.

source

fn input_asset_ids_unique(&self) -> IntoIter<&AssetId>

Returns unique assets’ ids used in the inputs.

source

fn input_contracts(&self) -> IntoIter<&ContractId>

Returns ids of all Input::Contract that are present in the inputs.

source

fn check_predicate_owners(&self, parameters: &ConsensusParameters) -> bool

Checks that all owners of inputs in the predicates are valid.

source

fn add_unsigned_coin_input( &mut self, utxo_id: UtxoId, owner: &PublicKey, amount: Word, asset_id: AssetId, tx_pointer: TxPointer, maturity: BlockHeight )

Append a new unsigned coin input to the transaction.

When the transaction is constructed, Signable::sign_inputs should be called for every secret key used with this method.

The production of the signatures can be done only after the full transaction skeleton is built because the input of the hash message is the ID of the final transaction.

source

fn add_unsigned_message_input( &mut self, sender: Address, recipient: Address, nonce: Nonce, amount: Word, data: Vec<u8> )

Append a new unsigned message input to the transaction.

When the transaction is constructed, Signable::sign_inputs should be called for every secret key used with this method.

The production of the signatures can be done only after the full transaction skeleton is built because the input of the hash message is the ID of the final transaction.

source

fn prepare_init_script(&mut self) -> &mut Self

Prepare the transaction for VM initialization for script execution

note: Fields dependent on storage/state such as balance and state roots, or tx pointers, should already set by the client beforehand.

source

fn prepare_init_predicate(&mut self) -> &mut Self

Prepare the transaction for VM initialization for predicate verification

Implementors§