/// Craft a generic signed transaction request.
Craft a generic signed transaction request.
Craft a generic signed transaction request .
fn gen_submit_transaction_request<T: TransactionSigner>(
    program: Program,
    sender_account: &mut AccountData,
    signer: &T,
) -> Result<LoadRequest> {
    OP_COUNTER.inc("requested_txns");
    // If generation fails here, sequence number will not be increased,
    // so it is fine to continue later generation.
    let signed_txn = create_signed_txn(
        signer,
        program,
        sender_account.address,
        sender_account.sequence_number,
        MAX_GAS_AMOUNT,
        GAS_UNIT_PRICE,
        TXN_EXPIRATION,
    )
    .or_else(|e| {
        OP_COUNTER.inc("sign_failed_txns");
        Err(e)
    })?;
    let mut req = SubmitTransactionRequest::new();
    req.set_signed_txn(signed_txn.into_proto());
    sender_account.sequence_number += 1;
    OP_COUNTER.inc("created_txns");
    Ok(LoadRequest::WriteRequest(req))
}
fn gen_submit_transaction_request < T : TransactionSigner > ( program : Program , sender_account : & mut AccountData , signer : & T , ) -> Result < LoadRequest > { OP_COUNTER . inc ( " " ) ; // If generation fails here, sequence number will not be increased, // so it is fine to continue later generation. let signed_txn = create_signed_txn ( signer , program , sender_account . address , sender_account . sequence_number , MAX_GAS_AMOUNT , GAS_UNIT_PRICE , TXN_EXPIRATION , ) . or_else ( | e | { OP_COUNTER . inc ( " " ) ; Err ( e ) } ) ? ; let mut req = SubmitTransactionRequest :: new ( ) ; req . set_signed_txn ( signed_txn . into_proto ( ) ) ; sender_account . sequence_number += 1 ; OP_COUNTER . inc ( " " ) ; Ok ( LoadRequest :: WriteRequest ( req ) ) }
Craft a generic signed transaction request.
Craft a generic signed transaction request .
program
Program
sender_account
&mut AccountData
signer
&T