(
&mut self,
transaction_request: TransactionRequest,
)
| 85 | } |
| 86 | |
| 87 | pub(crate) async fn send_transaction( |
| 88 | &mut self, |
| 89 | transaction_request: TransactionRequest, |
| 90 | ) -> Result<H256> { |
| 91 | let mut transaction: Transaction = transaction_request.try_into()?; |
| 92 | let account = self.accounts.get_account(&transaction.from)?; |
| 93 | let nonce = transaction.nonce.unwrap_or_else(|| account.nonce + 1_u64); |
| 94 | |
| 95 | transaction.nonce = Some(nonce); |
| 96 | |
| 97 | // regenerate the transaction hash with the nonce in place |
| 98 | let transaction_hash = transaction.hash()?; |
| 99 | |
| 100 | // add to the transaction mempool |
| 101 | self.transactions.lock().await.send_transaction(transaction); |
| 102 | |
| 103 | Ok(transaction_hash) |
| 104 | } |
| 105 | |
| 106 | pub(crate) async fn send_raw_transaction(&mut self, transaction: Bytes) -> Result<H256> { |
| 107 | let signed_transaction: SignedTransaction = bincode::deserialize(&transaction)?; |
no test coverage detected