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§
sourcefn input_asset_ids(&self) -> IntoIter<&AssetId>
fn input_asset_ids(&self) -> IntoIter<&AssetId>
Returns the assets’ ids used in the inputs in the order of inputs.
sourcefn input_asset_ids_unique(&self) -> IntoIter<&AssetId>
fn input_asset_ids_unique(&self) -> IntoIter<&AssetId>
Returns unique assets’ ids used in the inputs.
sourcefn input_contracts(&self) -> IntoIter<&ContractId>
fn input_contracts(&self) -> IntoIter<&ContractId>
Returns ids of all Input::Contract
that are present in the inputs.
sourcefn check_predicate_owners(&self, parameters: &ConsensusParameters) -> bool
fn check_predicate_owners(&self, parameters: &ConsensusParameters) -> bool
Checks that all owners of inputs in the predicates are valid.
sourcefn add_unsigned_coin_input(
&mut self,
utxo_id: UtxoId,
owner: &PublicKey,
amount: Word,
asset_id: AssetId,
tx_pointer: TxPointer,
maturity: BlockHeight
)
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.
sourcefn add_unsigned_message_input(
&mut self,
sender: Address,
recipient: Address,
nonce: Nonce,
amount: Word,
data: Vec<u8>
)
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.
sourcefn prepare_init_script(&mut self) -> &mut Self
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.
sourcefn prepare_init_predicate(&mut self) -> &mut Self
fn prepare_init_predicate(&mut self) -> &mut Self
Prepare the transaction for VM initialization for predicate verification