(&mut self, transaction: Bytes)
| 104 | } |
| 105 | |
| 106 | pub(crate) async fn send_raw_transaction(&mut self, transaction: Bytes) -> Result<H256> { |
| 107 | let signed_transaction: SignedTransaction = bincode::deserialize(&transaction)?; |
| 108 | let transaction: Transaction = signed_transaction.clone().try_into()?; |
| 109 | let transaction_hash = transaction.transaction_hash()?; |
| 110 | |
| 111 | Transaction::verify(signed_transaction, transaction.from).map_err(|e| { |
| 112 | ChainError::TransactionNotVerified(format!("{}: {}", transaction_hash, e)) |
| 113 | })?; |
| 114 | |
| 115 | self.send_transaction(transaction.into()).await |
| 116 | } |
| 117 | |
| 118 | pub(crate) async fn process_transactions(&mut self) -> Result<()> { |
| 119 | // Bulk drain the current queue to fit into the new block |
no test coverage detected