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

Function sequence

fendermint/rpc/examples/transfer.rs:124–134  ·  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

122
123/// Get the next sequence number (nonce) of an account.
124async fn sequence(client: &impl QueryClient, addr: &Address) -> anyhow::Result<u64> {
125 let state = client
126 .actor_state(&addr, FvmQueryHeight::default())
127 .await
128 .context("failed to get actor state")?;
129
130 match state.value {
131 Some((_id, state)) => Ok(state.sequence),
132 None => Err(anyhow!("cannot find actor {addr}")),
133 }
134}

Callers 1

mainFunction · 0.70

Calls 2

contextMethod · 0.80
actor_stateMethod · 0.45

Tested by

no test coverage detected