Skip to main content

SenderSignedTransactionAPI

Trait SenderSignedTransactionAPI 

Source
pub trait SenderSignedTransactionAPI {
Show 14 methods // Required methods fn new_from_sender_signature( tx_data: TransactionData, tx_signature: Signature, ) -> SenderSignedData; fn add_signature(&mut self, new_signature: Signature); fn get_signer_sig_mapping( &self, ) -> IotaResult<BTreeMap<Address, &UserSignature>>; fn has_multisig(&self) -> bool; fn transaction_mut_for_testing(&mut self) -> &mut TransactionData; fn tx_signatures_mut_for_testing(&mut self) -> &mut Vec<UserSignature>; fn serialized_size(&self) -> IotaResult<usize>; fn validity_check( &self, context: &TxValidityCheckContext<'_>, ) -> Result<usize, IotaError>; fn collect_all_input_object_kind_for_reading( &self, ) -> IotaResult<Vec<InputObjectKind>>; fn split_input_objects_into_groups_for_reading( &self, input_objects: InputObjects, ) -> IotaResult<(InputObjects, Vec<(InputObjects, ObjectReadResult)>)>; fn contains_shared_object(&self) -> bool; fn shared_input_objects(&self) -> Vec<SharedObjectReference>; fn input_objects(&self) -> IotaResult<Vec<InputObjectKind>>; fn uses_randomness(&self) -> bool;
}
Expand description

API for accessing and constructing SenderSignedData.

This trait provides node-internal methods on the SDK’s SenderSignedTransaction, which carries the transaction data together with the signatures of all transaction participants. A non-participant signature must not be present, and the signature order does not matter.

Required Methods§

Source

fn new_from_sender_signature( tx_data: TransactionData, tx_signature: Signature, ) -> SenderSignedData

Creates a new SenderSignedData with a single sender signature.

Source

fn add_signature(&mut self, new_signature: Signature)

Adds a signature. Does not check the validity of the signature or perform any de-dup checks.

Source

fn get_signer_sig_mapping( &self, ) -> IotaResult<BTreeMap<Address, &UserSignature>>

Returns a mapping from the address each signature commits to, to the signature itself.

Source

fn has_multisig(&self) -> bool

Returns true if any signature is a multisig.

Source

fn transaction_mut_for_testing(&mut self) -> &mut TransactionData

Returns a mutable reference to the transaction. Testing only.

Source

fn tx_signatures_mut_for_testing(&mut self) -> &mut Vec<UserSignature>

Returns a mutable reference to the signatures. Testing only.

Source

fn serialized_size(&self) -> IotaResult<usize>

Returns the BCS serialized size in bytes.

Source

fn validity_check( &self, context: &TxValidityCheckContext<'_>, ) -> Result<usize, IotaError>

Validate untrusted user transaction, including its size, input count, command count, etc. Returns the certificate serialised bytes size.

Source

fn collect_all_input_object_kind_for_reading( &self, ) -> IotaResult<Vec<InputObjectKind>>

Returns all unique input objects including those from MoveAuthenticators if any for reading.

Although some shared objects(with a different mutability flag, for example) can be duplicated in the transaction and authenticators, we load them independently to make it possible to analyze the inputs in the transaction checkers.

Source

fn split_input_objects_into_groups_for_reading( &self, input_objects: InputObjects, ) -> IotaResult<(InputObjects, Vec<(InputObjects, ObjectReadResult)>)>

Splits the provided input objects into groups:

  1. Input objects required by the transaction itself; may contain duplicates if an IOTA coin is used both as an input and a gas coin.
  2. A list of input objects required by each MoveAuthenticator( including the object to authenticate) + the object to authenticate.
Source

fn contains_shared_object(&self) -> bool

Checks if SenderSignedData contains at least one shared object. This function checks shared objects from the MoveAuthenticators if any.

Source

fn shared_input_objects(&self) -> Vec<SharedObjectReference>

Returns an iterator over all shared input objects related to this transaction, including those from MoveAuthenticators if any.

If a shared object appears with the same version but different mutability, only one instance which is mutable is returned.

Panics if there are shared objects with the same ID but different initial versions.

Source

fn input_objects(&self) -> IotaResult<Vec<InputObjectKind>>

Returns an iterator over all input objects related to this transaction, including those from the MoveAuthenticators if any.

If an IOTA coin is used both as an input and as a gas coin, it will appear two times in the returned iterator.

If a shared object appears both in the transaction and authenticator with different mutability, only one instance which is mutable is returned.

Shared objects with the same ID but different versions are not allowed.

Source

fn uses_randomness(&self) -> bool

Checks if SenderSignedData contains the Random object as an input. This function checks shared objects from the MoveAuthenticators if any.

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.

Implementors§