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

Function collect_txs

fendermint/eth/api/src/mpool.rs:152–162  ·  view source on GitHub ↗

Collect the identifiers of the transactions in the block.

(block: &Block, chain_id: &ChainID)

Source from the content-addressed store, hash-verified

150
151/// Collect the identifiers of the transactions in the block.
152fn collect_txs(block: &Block, chain_id: &ChainID) -> Vec<(et::TxHash, Address, Nonce)> {
153 let mut txs = Vec::new();
154 for tx in &block.data {
155 if let Ok(ChainMessage::Signed(msg)) = fvm_ipld_encoding::from_slice(tx) {
156 if let Ok(Some(DomainHash::Eth(h))) = msg.domain_hash(chain_id) {
157 txs.push((et::TxHash::from(h), msg.message.from, msg.message.sequence))
158 }
159 }
160 }
161 txs
162}
163
164/// Fetch the chain ID from the API; do it in a loop until it succeeds.
165async fn get_chain_id(client: &FendermintClient<HybridClient>) -> ChainID {

Callers 1

tx_cache_clearing_loopFunction · 0.85

Calls 1

domain_hashMethod · 0.45

Tested by

no test coverage detected