Struct aptos_types::transaction::RawTransaction
source · [−]pub struct RawTransaction { /* private fields */ }Expand description
RawTransaction is the portion of a transaction that a client signs.
Implementations
sourceimpl RawTransaction
impl RawTransaction
sourcepub fn new(
sender: AccountAddress,
sequence_number: u64,
payload: TransactionPayload,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId
) -> Self
pub fn new(
sender: AccountAddress,
sequence_number: u64,
payload: TransactionPayload,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId
) -> Self
Create a new RawTransaction with a payload.
It can be either to publish a module, to execute a script, or to issue a writeset transaction.
sourcepub fn new_script(
sender: AccountAddress,
sequence_number: u64,
script: Script,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId
) -> Self
pub fn new_script(
sender: AccountAddress,
sequence_number: u64,
script: Script,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId
) -> Self
Create a new RawTransaction with a script.
A script transaction contains only code to execute. No publishing is allowed in scripts.
sourcepub fn new_script_function(
sender: AccountAddress,
sequence_number: u64,
script_function: ScriptFunction,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId
) -> Self
pub fn new_script_function(
sender: AccountAddress,
sequence_number: u64,
script_function: ScriptFunction,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId
) -> Self
Create a new RawTransaction with a script function.
A script transaction contains only code to execute. No publishing is allowed in scripts.
sourcepub fn new_module(
sender: AccountAddress,
sequence_number: u64,
module: Module,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId
) -> Self
pub fn new_module(
sender: AccountAddress,
sequence_number: u64,
module: Module,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId
) -> Self
Create a new RawTransaction with a module to publish.
A module transaction is the only way to publish code. Only one module per transaction can be published.
sourcepub fn new_module_bundle(
sender: AccountAddress,
sequence_number: u64,
modules: ModuleBundle,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId
) -> Self
pub fn new_module_bundle(
sender: AccountAddress,
sequence_number: u64,
modules: ModuleBundle,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId
) -> Self
Create a new RawTransaction with a list of modules to publish.
A module transaction is the only way to publish code. Multiple modules per transaction can be published.
pub fn new_write_set(
sender: AccountAddress,
sequence_number: u64,
write_set: WriteSet,
chain_id: ChainId
) -> Self
pub fn new_change_set(
sender: AccountAddress,
sequence_number: u64,
change_set: ChangeSet,
chain_id: ChainId
) -> Self
pub fn new_writeset_script(
sender: AccountAddress,
sequence_number: u64,
script: Script,
signer: AccountAddress,
chain_id: ChainId
) -> Self
sourcepub fn sign(
self,
private_key: &Ed25519PrivateKey,
public_key: Ed25519PublicKey
) -> Result<SignatureCheckedTransaction>
pub fn sign(
self,
private_key: &Ed25519PrivateKey,
public_key: Ed25519PublicKey
) -> Result<SignatureCheckedTransaction>
Signs the given RawTransaction. Note that this consumes the RawTransaction and turns it
into a SignatureCheckedTransaction.
For a transaction that has just been signed, its signature is expected to be valid.
sourcepub fn sign_multi_agent(
self,
sender_private_key: &Ed25519PrivateKey,
secondary_signers: Vec<AccountAddress>,
secondary_private_keys: Vec<&Ed25519PrivateKey>
) -> Result<SignatureCheckedTransaction>
pub fn sign_multi_agent(
self,
sender_private_key: &Ed25519PrivateKey,
secondary_signers: Vec<AccountAddress>,
secondary_private_keys: Vec<&Ed25519PrivateKey>
) -> Result<SignatureCheckedTransaction>
Signs the given multi-agent RawTransaction, which is a transaction with secondary
signers in addition to a sender. The private keys of the sender and the
secondary signers are used to sign the transaction.
The order and length of the secondary keys provided here have to match the order and
length of the secondary_signers.
pub fn into_payload(self) -> TransactionPayload
pub fn format_for_client(
&self,
get_transaction_name: impl Fn(&[u8]) -> String
) -> String
sourcepub fn sender(&self) -> AccountAddress
pub fn sender(&self) -> AccountAddress
Return the sender of this transaction.
Trait Implementations
sourceimpl Clone for RawTransaction
impl Clone for RawTransaction
sourcefn clone(&self) -> RawTransaction
fn clone(&self) -> RawTransaction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl CryptoHash for RawTransaction
impl CryptoHash for RawTransaction
type Hasher = RawTransactionHasher
type Hasher = RawTransactionHasher
The associated Hasher type which comes with a unique salt for this type.
sourceimpl Debug for RawTransaction
impl Debug for RawTransaction
sourceimpl<'de> Deserialize<'de> for RawTransaction
impl<'de> Deserialize<'de> for RawTransaction
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Hash for RawTransaction
impl Hash for RawTransaction
sourceimpl PartialEq<RawTransaction> for RawTransaction
impl PartialEq<RawTransaction> for RawTransaction
sourcefn eq(&self, other: &RawTransaction) -> bool
fn eq(&self, other: &RawTransaction) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &RawTransaction) -> bool
fn ne(&self, other: &RawTransaction) -> bool
This method tests for !=.
sourceimpl Serialize for RawTransaction
impl Serialize for RawTransaction
impl Eq for RawTransaction
impl StructuralEq for RawTransaction
impl StructuralPartialEq for RawTransaction
Auto Trait Implementations
impl RefUnwindSafe for RawTransaction
impl Send for RawTransaction
impl Sync for RawTransaction
impl Unpin for RawTransaction
impl UnwindSafe for RawTransaction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
impl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
sourcefn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more