Skip to content

Commit

Permalink
traces
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Nov 13, 2023
1 parent 718c42a commit b201f0a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/rpc/src/eth/block.rs
Expand Up @@ -116,6 +116,7 @@ where
.await?
{
Some(id) => {
log::info!(">>>> Block number: {:?} id: {:?}", number, id);
let substrate_hash = client
.expect_block_hash_from_id(&id)
.map_err(|_| internal_err(format!("Expect block number from id: {}", id)))?;
Expand All @@ -129,8 +130,10 @@ where

let base_fee = client.runtime_api().gas_price(substrate_hash).ok();

log::info!(">>>> Block/statuses: {:?}/{:?}", block, statuses);
match (block, statuses) {
(Some(block), Some(statuses)) => {
log::info!(">>>> Matched in Some/Some");
let hash = H256::from(keccak_256(&rlp::encode(&block.header)));
let mut rich_block = rich_block_build(
block,
Expand All @@ -153,7 +156,9 @@ where
Ok(Some(rich_block))
}
_ => {
log::info!(">>>> Matched in _");
if let BlockNumber::Num(block_number) = number {
log::info!(">>>> Inner block number: {:?}", block_number);
let eth_block = empty_block_from(block_number.into());
let eth_hash = H256::from_slice(
keccak_256(&rlp::encode(&eth_block.header)).as_slice(),
Expand All @@ -167,6 +172,7 @@ where
false,
)))
} else {
log::info!(">>>> Returning None but this should not happen");
Ok(None)
}
}
Expand Down

0 comments on commit b201f0a

Please sign in to comment.