pub fn create_signed_txn(
        &self,
        payload: TransactionPayload,
        sequence_number: u64,
        max_gas_amount: u64,
        gas_unit_price: u64,
    ) -> SignedTransaction {
        let raw_txn = match payload {
            TransactionPayload::Program(program) => RawTransaction::new(
                *self.address(),
                sequence_number,
                program,
                max_gas_amount,
                gas_unit_price,
                Duration::from_secs(u64::max_value()),
            ),
            TransactionPayload::WriteSet(writeset) => {
                RawTransaction::new_write_set(*self.address(), sequence_number, writeset)
            }
            TransactionPayload::Module(module) => RawTransaction::new_module(
                *self.address(),
                sequence_number,
                module,
                max_gas_amount,
                gas_unit_price,
                Duration::from_secs(u64::max_value()),
            ),
            TransactionPayload::Script(script) => RawTransaction::new_script(
                *self.address(),
                sequence_number,
                script,
                max_gas_amount,
                gas_unit_price,
                Duration::from_secs(u64::max_value()),
            ),
        };

        raw_txn
            .sign(&self.privkey, self.pubkey.clone())
            .unwrap()
            .into_inner()
    }
/// Returns a [`SignedTransaction`] with a payload and this account as the sender.
///
/// This is the most generic way to create a transaction for testing.
/// Max gas amount and gas unit price are ignored for WriteSet transactions.
Returns a [`SignedTransaction`] with a payload and this account as the sender.
This is the most generic way to create a transaction for testing.
Max gas amount and gas unit price are ignored for WriteSet transactions.
Returns a [ ` SignedTransaction ` ] with a payload and this account as the sender . This is the most generic way to create a transaction for testing . Max gas amount and gas unit price are ignored for WriteSet transactions .
pub fn create_signed_txn(
        &self,
        payload: TransactionPayload,
        sequence_number: u64,
        max_gas_amount: u64,
        gas_unit_price: u64,
    ) -> SignedTransaction {
        let raw_txn = match payload {
            TransactionPayload::Program(program) => RawTransaction::new(
                *self.address(),
                sequence_number,
                program,
                max_gas_amount,
                gas_unit_price,
                Duration::from_secs(u64::max_value()),
            ),
            TransactionPayload::WriteSet(writeset) => {
                RawTransaction::new_write_set(*self.address(), sequence_number, writeset)
            }
            TransactionPayload::Module(module) => RawTransaction::new_module(
                *self.address(),
                sequence_number,
                module,
                max_gas_amount,
                gas_unit_price,
                Duration::from_secs(u64::max_value()),
            ),
            TransactionPayload::Script(script) => RawTransaction::new_script(
                *self.address(),
                sequence_number,
                script,
                max_gas_amount,
                gas_unit_price,
                Duration::from_secs(u64::max_value()),
            ),
        };
        raw_txn
            .sign(&self.privkey, self.pubkey.clone())
            .unwrap()
            .into_inner()
    }
pub fn create_signed_txn ( & self , payload : TransactionPayload , sequence_number : u64 , max_gas_amount : u64 , gas_unit_price : u64 , ) -> SignedTransaction { let raw_txn = match payload { TransactionPayload :: Program ( program ) => RawTransaction :: new ( * self . address ( ) , sequence_number , program , max_gas_amount , gas_unit_price , Duration :: from_secs ( u64 :: max_value ( ) ) , ) , TransactionPayload :: WriteSet ( writeset ) => { RawTransaction :: new_write_set ( * self . address ( ) , sequence_number , writeset ) } TransactionPayload :: Module ( module ) => RawTransaction :: new_module ( * self . address ( ) , sequence_number , module , max_gas_amount , gas_unit_price , Duration :: from_secs ( u64 :: max_value ( ) ) , ) , TransactionPayload :: Script ( script ) => RawTransaction :: new_script ( * self . address ( ) , sequence_number , script , max_gas_amount , gas_unit_price , Duration :: from_secs ( u64 :: max_value ( ) ) , ) , } ; raw_txn . sign ( & self . privkey , self . pubkey . clone ( ) ) . unwrap ( ) . into_inner ( ) }
Returns a [`SignedTransaction`] with a payload and this account as the sender.
Returns a [ ` SignedTransaction ` ] with a payload and this account as the sender .
&self
payload
TransactionPayload
sequence_number
u64
max_gas_amount
u64
gas_unit_price
u64