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§
Sourcefn new_from_sender_signature(
tx_data: TransactionData,
tx_signature: Signature,
) -> SenderSignedData
fn new_from_sender_signature( tx_data: TransactionData, tx_signature: Signature, ) -> SenderSignedData
Creates a new SenderSignedData with a single sender signature.
Sourcefn add_signature(&mut self, new_signature: Signature)
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.
Sourcefn get_signer_sig_mapping(
&self,
) -> IotaResult<BTreeMap<Address, &UserSignature>>
fn get_signer_sig_mapping( &self, ) -> IotaResult<BTreeMap<Address, &UserSignature>>
Returns a mapping from the address each signature commits to, to the signature itself.
Sourcefn has_multisig(&self) -> bool
fn has_multisig(&self) -> bool
Returns true if any signature is a multisig.
Sourcefn transaction_mut_for_testing(&mut self) -> &mut TransactionData
fn transaction_mut_for_testing(&mut self) -> &mut TransactionData
Returns a mutable reference to the transaction. Testing only.
Sourcefn tx_signatures_mut_for_testing(&mut self) -> &mut Vec<UserSignature>
fn tx_signatures_mut_for_testing(&mut self) -> &mut Vec<UserSignature>
Returns a mutable reference to the signatures. Testing only.
Sourcefn serialized_size(&self) -> IotaResult<usize>
fn serialized_size(&self) -> IotaResult<usize>
Returns the BCS serialized size in bytes.
Sourcefn validity_check(
&self,
context: &TxValidityCheckContext<'_>,
) -> Result<usize, IotaError>
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.
Sourcefn collect_all_input_object_kind_for_reading(
&self,
) -> IotaResult<Vec<InputObjectKind>>
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.
Sourcefn split_input_objects_into_groups_for_reading(
&self,
input_objects: InputObjects,
) -> IotaResult<(InputObjects, Vec<(InputObjects, ObjectReadResult)>)>
fn split_input_objects_into_groups_for_reading( &self, input_objects: InputObjects, ) -> IotaResult<(InputObjects, Vec<(InputObjects, ObjectReadResult)>)>
Splits the provided input objects into groups:
- Input objects required by the transaction itself; may contain duplicates if an IOTA coin is used both as an input and a gas coin.
- A list of input objects required by each
MoveAuthenticator( including the object to authenticate) + the object to authenticate.
Checks if SenderSignedData contains at least one shared object.
This function checks shared objects from the MoveAuthenticators if
any.
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.
Sourcefn input_objects(&self) -> IotaResult<Vec<InputObjectKind>>
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.
Sourcefn uses_randomness(&self) -> bool
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.