pub(in crate::eth_sender) fn create_signed_tx(
    id: i64,
    eth_sender: &ETHSender<MockEthereum, MockDatabase>,
    operation: &Operation,
    deadline_block: u64,
    nonce: i64,
) -> ETHOperation {
    let mut options = Options::default();
    options.nonce = Some(nonce.into());

    let raw_tx = eth_sender.operation_to_raw_tx(&operation);
    let signed_tx = eth_sender
        .ethereum
        .sign_prepared_tx(raw_tx.clone(), options)
        .unwrap();

    let op_type = match operation.action {
        Action::Commit => OperationType::Commit,
        Action::Verify { .. } => OperationType::Verify,
    };

    ETHOperation {
        id,
        op_type,
        op: Some(operation.clone()),
        nonce: signed_tx.nonce,
        last_deadline_block: deadline_block,
        last_used_gas_price: signed_tx.gas_price,
        used_tx_hashes: vec![signed_tx.hash],
        encoded_tx_data: raw_tx,
        confirmed: false,
        final_hash: None,
    }
}
/// Behaves the same as `ETHSender::sign_new_tx`, but does not affect nonce.
/// This method should be used to create expected tx copies which won't affect
/// the internal `ETHSender` state.
Behaves the same as `ETHSender::sign_new_tx`, but does not affect nonce.
This method should be used to create expected tx copies which won't affect
the internal `ETHSender` state.
Behaves the same as ` ETHSender :: sign_new_tx ` but does not affect nonce . This method should be used to create expected tx copies which won ' t affect the internal ` ETHSender ` state .
pub(in crate::eth_sender) fn create_signed_tx(
    id: i64,
    eth_sender: &ETHSender<MockEthereum, MockDatabase>,
    operation: &Operation,
    deadline_block: u64,
    nonce: i64,
) -> ETHOperation {
    let mut options = Options::default();
    options.nonce = Some(nonce.into());
    let raw_tx = eth_sender.operation_to_raw_tx(&operation);
    let signed_tx = eth_sender
        .ethereum
        .sign_prepared_tx(raw_tx.clone(), options)
        .unwrap();
    let op_type = match operation.action {
        Action::Commit => OperationType::Commit,
        Action::Verify { .. } => OperationType::Verify,
    };
    ETHOperation {
        id,
        op_type,
        op: Some(operation.clone()),
        nonce: signed_tx.nonce,
        last_deadline_block: deadline_block,
        last_used_gas_price: signed_tx.gas_price,
        used_tx_hashes: vec![signed_tx.hash],
        encoded_tx_data: raw_tx,
        confirmed: false,
        final_hash: None,
    }
}
pub ( in crate :: eth_sender ) fn create_signed_tx ( id : i64 , eth_sender : & ETHSender < MockEthereum , MockDatabase > , operation : & Operation , deadline_block : u64 , nonce : i64 , ) -> ETHOperation { let mut options = Options :: default ( ) ; options . nonce = Some ( nonce . into ( ) ) ; let raw_tx = eth_sender . operation_to_raw_tx ( & operation ) ; let signed_tx = eth_sender . ethereum . sign_prepared_tx ( raw_tx . clone ( ) , options ) . unwrap ( ) ; let op_type = match operation . action { Action :: Commit => OperationType :: Commit , Action :: Verify { .. } => OperationType :: Verify , } ; ETHOperation { id , op_type , op : Some ( operation . clone ( ) ) , nonce : signed_tx . nonce , last_deadline_block : deadline_block , last_used_gas_price : signed_tx . gas_price , used_tx_hashes : vec ! [ signed_tx hash ] , encoded_tx_data : raw_tx , confirmed : false , final_hash : None , } }
Behaves the same as `ETHSender::sign_new_tx`, but does not affect nonce.
Behaves the same as ` ETHSender :: sign_new_tx ` but does not affect nonce .
id
i64
eth_sender
&ETHSender<MockEthereum, MockDatabase>
operation
&Operation
deadline_block
u64
nonce
i64