Skip to main content

SenderSignedTransactionAPI

Trait SenderSignedTransactionAPI 

Source
pub trait SenderSignedTransactionAPI {
Show 14 methods // Required methods fn new_from_sender_signature( tx: Transaction, tx_signature: SimpleSignature, ) -> SenderSignedTransaction; fn add_signature(&mut self, new_signature: SimpleSignature); fn get_signer_sig_mapping( &self, ) -> IotaResult<BTreeMap<Address, &UserSignature>>; fn has_multisig(&self) -> bool; fn transaction_mut_for_testing(&mut self) -> &mut Transaction; 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, include_type_arg_packages: bool, ) -> 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, include_type_arg_packages: bool, ) -> IotaResult<Vec<InputObjectKind>>; fn uses_randomness(&self) -> bool;
}
Expand description

API for accessing and constructing [SenderSignedTransaction].

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: Transaction, tx_signature: SimpleSignature, ) -> SenderSignedTransaction

Creates a new [SenderSignedTransaction] with a single sender signature.

Source

fn add_signature(&mut self, new_signature: SimpleSignature)

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 Transaction

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, include_type_arg_packages: bool, ) -> IotaResult<Vec<InputObjectKind>>

Returns all unique input objects including those from MoveAuthenticators if any for reading, with the packages named by their type arguments if include_type_arg_packages is set, in the order the transaction and then each authenticator name them.

Although some shared objects (with a different mutability flag, for example) can be duplicated in the transaction and authenticators, each of their distinct kinds is returned, to make it possible to analyze the inputs in the transaction checkers. A caller that reads the inputs must read such an object once for all its kinds: the checkers assert that all kinds of one object got the same read result.

Source

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

Splits the provided input objects, read for the kinds Self::collect_all_input_object_kind_for_reading returns, 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, and the packages named by its type arguments that were read and that the transaction does not name itself) + the object to authenticate.
Source

fn contains_shared_object(&self) -> bool

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

Unlike Self::shared_input_objects, it does not combine the shared objects of the transaction and its authenticators, so it does not panic when two of them name the same object with different initial versions.

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, include_type_arg_packages: bool, ) -> 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.

The packages named by the MoveAuthenticators’ type arguments are included if include_type_arg_packages is set, each only if no other input has its id.

Source

fn uses_randomness(&self) -> bool

Checks if [SenderSignedTransaction] 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".

Implementations on Foreign Types§

Source§

impl SenderSignedTransactionAPI for SenderSignedTransaction

Source§

fn new_from_sender_signature( tx: Transaction, tx_signature: SimpleSignature, ) -> SenderSignedTransaction

Source§

fn add_signature(&mut self, new_signature: SimpleSignature)

Source§

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

Source§

fn has_multisig(&self) -> bool

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn contains_shared_object(&self) -> bool

Source§

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

Source§

fn input_objects( &self, include_type_arg_packages: bool, ) -> IotaResult<Vec<InputObjectKind>>

Source§

fn uses_randomness(&self) -> bool

Implementors§