Struct diem_sdk::types::transaction::RawTransaction
pub struct RawTransaction { /* private fields */ }
Expand description
RawTransaction is the portion of a transaction that a client signs.
Implementations§
§impl RawTransaction
impl RawTransaction
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
) -> RawTransaction
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 ) -> RawTransaction
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.
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
) -> RawTransaction
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 ) -> RawTransaction
Create a new RawTransaction
with a script.
A script transaction contains only code to execute. No publishing is allowed in scripts.
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
) -> RawTransaction
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 ) -> RawTransaction
Create a new RawTransaction
with a script function.
A script transaction contains only code to execute. No publishing is allowed in scripts.
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
) -> RawTransaction
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 ) -> RawTransaction
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 ) -> RawTransaction
pub fn new_change_set( sender: AccountAddress, sequence_number: u64, change_set: ChangeSet, chain_id: ChainId ) -> RawTransaction
pub fn new_writeset_script( sender: AccountAddress, sequence_number: u64, script: Script, signer: AccountAddress, chain_id: ChainId ) -> RawTransaction
pub fn sign(
self,
private_key: &Ed25519PrivateKey,
public_key: Ed25519PublicKey
) -> Result<SignatureCheckedTransaction, Error>
pub fn sign( self, private_key: &Ed25519PrivateKey, public_key: Ed25519PublicKey ) -> Result<SignatureCheckedTransaction, Error>
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.
pub fn sign_multi_agent(
self,
sender_private_key: &Ed25519PrivateKey,
secondary_signers: Vec<AccountAddress, Global>,
secondary_private_keys: Vec<&Ed25519PrivateKey, Global>
) -> Result<SignatureCheckedTransaction, Error>
pub fn sign_multi_agent( self, sender_private_key: &Ed25519PrivateKey, secondary_signers: Vec<AccountAddress, Global>, secondary_private_keys: Vec<&Ed25519PrivateKey, Global> ) -> Result<SignatureCheckedTransaction, Error>
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, Error>
pub fn into_payload(self) -> TransactionPayload
pub fn format_for_client( &self, get_transaction_name: impl Fn(&[u8]) -> String ) -> String
pub fn sender(&self) -> AccountAddress
pub fn sender(&self) -> AccountAddress
Return the sender of this transaction.
Trait Implementations§
§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
.§fn arbitrary_with(_args: ()) -> <RawTransaction as Arbitrary>::Strategy
fn arbitrary_with(_args: ()) -> <RawTransaction as Arbitrary>::Strategy
§type Strategy = BoxedStrategy<RawTransaction>
type Strategy = BoxedStrategy<RawTransaction>
Strategy
used to generate values of type Self
.§impl Clone for RawTransaction
impl Clone for RawTransaction
§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 more§impl CryptoHash for RawTransaction
impl CryptoHash for RawTransaction
§impl Debug for RawTransaction
impl Debug for RawTransaction
§impl<'de> Deserialize<'de> for RawTransaction
impl<'de> Deserialize<'de> for RawTransaction
§fn deserialize<__D>(
__deserializer: __D
) -> Result<RawTransaction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<RawTransaction, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
§impl Hash for RawTransaction
impl Hash for RawTransaction
§impl PartialEq<RawTransaction> for RawTransaction
impl PartialEq<RawTransaction> for RawTransaction
§fn eq(&self, other: &RawTransaction) -> bool
fn eq(&self, other: &RawTransaction) -> bool
self
and other
values to be equal, and is used
by ==
.§impl Serialize for RawTransaction
impl Serialize for RawTransaction
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
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.