Skip to content

Commit

Permalink
feat: hydrate event context block
Browse files Browse the repository at this point in the history
  • Loading branch information
crisog committed Aug 1, 2024
1 parent 54c1fea commit 825d58b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ghost-crab/src/event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ pub struct EventContext {
}

impl EventContext {
pub async fn block(&self) -> Result<Option<Block>, TransportError> {
pub async fn block(&self, hydrate: bool) -> Result<Option<Block>, TransportError> {
match self.log.block_number {
Some(block_number) => {
self.provider
.get_block_by_number(BlockNumberOrTag::Number(block_number), false)
.get_block_by_number(BlockNumberOrTag::Number(block_number), hydrate)
.await
}
None => Err(TransportError::local_usage_str("Error occurred while fetching the current block number within an EventHandler. The log.block_number value is None.")),
Expand Down

0 comments on commit 825d58b

Please sign in to comment.