Skip to content

Commit

Permalink
Add branch to get the earliest block in block_number_to_u256 (#2212)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrPing authored Jul 26, 2023
1 parent 68a9bf4 commit 8ef0c7f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ain-grpc/src/rpc/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,18 @@ impl MetachainRPCModule {
.get_block_by_number(&U256::from(n))
.map(|block| block.header.number)
}
BlockNumber::Earliest => {
self.handler
.storage
.get_block_by_number(&U256::zero())
.map(|block| block.header.number)
}
_ => {
self.handler
.storage
.get_latest_block()
.map(|block| block.header.number)
}
// BlockNumber::Earliest => todo!(),
// BlockNumber::Pending => todo!(),
// BlockNumber::Safe => todo!(),
// BlockNumber::Finalized => todo!(),
Expand Down

0 comments on commit 8ef0c7f

Please sign in to comment.