(module: &mut RpcModule<Context>)
| 126 | } |
| 127 | |
| 128 | pub(crate) fn eth_send_raw_transaction(module: &mut RpcModule<Context>) -> Result<()> { |
| 129 | module.register_async_method( |
| 130 | "eth_sendRawTransaction", |
| 131 | move |params, blockchain| async move { |
| 132 | let raw_transaction = params.one::<Bytes>()?; |
| 133 | let transaction_hash = blockchain |
| 134 | .lock() |
| 135 | .await |
| 136 | .send_raw_transaction(raw_transaction) |
| 137 | .await |
| 138 | .map_err(|e| Error::Custom(e.to_string()))?; |
| 139 | |
| 140 | Ok(transaction_hash) |
| 141 | }, |
| 142 | )?; |
| 143 | |
| 144 | Ok(()) |
| 145 | } |
| 146 | |
| 147 | pub(crate) fn eth_get_transaction_receipt(module: &mut RpcModule<Context>) -> Result<()> { |
| 148 | module.register_async_method( |
no test coverage detected