(module: &mut RpcModule<Context>)
| 64 | } |
| 65 | |
| 66 | pub(crate) fn eth_get_transaction_count(module: &mut RpcModule<Context>) -> Result<()> { |
| 67 | module.register_async_method("eth_getTransactionCount", |params, blockchain| async move { |
| 68 | let account = params.one::<Account>()?; |
| 69 | let count = blockchain |
| 70 | .lock() |
| 71 | .await |
| 72 | .accounts |
| 73 | .get_account(&account) |
| 74 | .map_err(|e| Error::Custom(e.to_string()))? |
| 75 | .nonce; |
| 76 | |
| 77 | Ok(to_hex(count)) |
| 78 | })?; |
| 79 | |
| 80 | Ok(()) |
| 81 | } |
| 82 | |
| 83 | pub(crate) fn eth_get_balance_by_block(module: &mut RpcModule<Context>) -> Result<()> { |
| 84 | module.register_async_method( |
no test coverage detected