Struct diem_types::transaction::RawTransaction [−][src]
pub struct RawTransaction { /* fields omitted */ }Expand description
RawTransaction is the portion of a transaction that a client signs.
Implementations
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
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.
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
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.
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
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.
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
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_module_bundle(
sender: AccountAddress,
sequence_number: u64,
modules: ModuleBundle,
max_gas_amount: u64,
gas_unit_price: u64,
gas_currency_code: String,
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,
gas_currency_code: String,
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
pub 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.
pub 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>
Return the sender of this transaction.
Return the signing message for creating transaction signature.
Trait Implementations
type Parameters = ()
type Parameters = ()
The type of parameters that arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default. Read more
type Strategy = BoxedStrategy<Self>
type Strategy = BoxedStrategy<Self>
type Hasher = RawTransactionHasher
type Hasher = RawTransactionHasher
The associated Hasher type which comes with a unique salt for this type.
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>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
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
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
type Output = T
type Output = T
Should always be Self
Generates a hash used only for tests.