MCPcopy Create free account
hub / github.com/consensus-shipyard/ipc / get_commit_signed_header

Function get_commit_signed_header

fendermint/eth/api/src/apis/eth.rs:1202–1217  ·  view source on GitHub ↗

Obtain the precommit signed header from cometbft

(
    data: JsonRpcData<C>,
    Params((block_number,)): Params<(et::BlockNumber,)>,
)

Source from the content-addressed store, hash-verified

1200
1201/// Obtain the precommit signed header from cometbft
1202pub async fn get_commit_signed_header<C>(
1203 data: JsonRpcData<C>,
1204 Params((block_number,)): Params<(et::BlockNumber,)>,
1205) -> JsonRpcResult<et::Bytes>
1206where
1207 C: Client + Sync + Send,
1208{
1209 let h = block_number
1210 .as_number()
1211 .ok_or_else(|| anyhow!("invalid block #{}", block_number))?
1212 .as_u32();
1213 let query_response = data.tm().commit(tendermint::block::Height::from(h)).await?;
1214
1215 let header = ipc_provider::manager::cometbft::SignedHeader::from(query_response.signed_header);
1216 Ok(et::Bytes::from(header.encode()))
1217}
1218
1219pub async fn get_state_root<C>(
1220 data: JsonRpcData<C>,

Callers

nothing calls this directly

Calls 3

tmMethod · 0.80
commitMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected