Struct diem_types::transaction::RawTransaction
source · pub struct RawTransaction { /* private fields */ }
Expand description
RawTransaction is the portion of a transaction that a client signs.
Implementations§
source§impl RawTransaction
impl RawTransaction
sourcepub fn new(
sender: AccountAddress,
sequence_number: u64,
payload: TransactionPayload,
max_gas_amount: u64,
gas_unit_price: u64,
gas_currency_code: String,
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, gas_currency_code: String, 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,
gas_currency_code: String,
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, gas_currency_code: String, 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,
gas_currency_code: String,
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, gas_currency_code: String, 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,
gas_currency_code: String,
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, gas_currency_code: String, 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.
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 multi_sign_for_testing( self, private_key: &Ed25519PrivateKey, public_key: Ed25519PublicKey ) -> Result<SignatureCheckedTransaction>
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§
source§impl Arbitrary for RawTransaction
impl Arbitrary for RawTransaction
§type Parameters = ()
type Parameters = ()
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.source§fn arbitrary_with(_args: ()) -> Self::Strategy
fn arbitrary_with(_args: ()) -> Self::Strategy
§type Strategy = BoxedStrategy<RawTransaction>
type Strategy = BoxedStrategy<RawTransaction>
Strategy
used to generate values of type Self
.source§impl Clone for RawTransaction
impl Clone for RawTransaction
source§fn clone(&self) -> RawTransaction
fn clone(&self) -> RawTransaction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl CryptoHash for RawTransaction
impl CryptoHash for RawTransaction
source§impl Debug for RawTransaction
impl Debug for RawTransaction
source§impl<'de> Deserialize<'de> for RawTransaction
impl<'de> Deserialize<'de> for RawTransaction
source§fn 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>,
source§impl Hash for RawTransaction
impl Hash for RawTransaction
source§impl PartialEq<RawTransaction> for RawTransaction
impl PartialEq<RawTransaction> for RawTransaction
source§fn eq(&self, other: &RawTransaction) -> bool
fn eq(&self, other: &RawTransaction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl 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§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.