Get the next sequence number (nonce) of an account.
(client: &impl QueryClient, addr: &Address)
| 499 | |
| 500 | /// Get the next sequence number (nonce) of an account. |
| 501 | async fn sequence(client: &impl QueryClient, addr: &Address) -> anyhow::Result<u64> { |
| 502 | let state = client |
| 503 | .actor_state(&addr, FvmQueryHeight::default()) |
| 504 | .await |
| 505 | .context("failed to get actor state")?; |
| 506 | |
| 507 | match state.value { |
| 508 | Some((_id, state)) => Ok(state.sequence), |
| 509 | None => Err(anyhow!("cannot find actor {addr}")), |
| 510 | } |
| 511 | } |
| 512 | |
| 513 | /// Create an instance of the statically typed contract client. |
| 514 | fn delorean_contract(contract_eth_addr: &str) -> DeloreanContract<MockProvider> { |
no test coverage detected