MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / sequence

Function sequence

fendermint/testing/delorean-cli/src/main.rs:501–511  ·  view source on GitHub ↗

Get the next sequence number (nonce) of an account.

(client: &impl QueryClient, addr: &Address)

Source from the content-addressed store, hash-verified

499
500/// Get the next sequence number (nonce) of an account.
501async 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.
514fn delorean_contract(contract_eth_addr: &str) -> DeloreanContract<MockProvider> {

Callers 1

mainFunction · 0.70

Calls 2

contextMethod · 0.80
actor_stateMethod · 0.45

Tested by

no test coverage detected