Skip to content

Commit

Permalink
refactor: Rename BlockContext.block -> BlockContext.block_number
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-herasme committed Jul 23, 2024
1 parent 8c237ad commit 5c09682
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ghost-crab/src/block_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ use std::time::Duration;
pub struct BlockContext {
pub provider: CacheProvider,
pub templates: TemplateManager,
pub block: u64,
pub block_number: u64,
}

impl BlockContext {
pub async fn block(&self) -> Result<Option<Block>, TransportError> {
self.provider.get_block_by_number(BlockNumberOrTag::Number(self.block), false).await
self.provider.get_block_by_number(BlockNumberOrTag::Number(self.block_number), false).await
}
}

Expand Down Expand Up @@ -67,7 +67,7 @@ pub async fn process_blocks(

tokio::spawn(async move {
handler
.handle(BlockContext { provider, templates, block: current_block })
.handle(BlockContext { provider, templates, block_number: current_block })
.await;
});
}
Expand All @@ -76,7 +76,9 @@ pub async fn process_blocks(
let provider = provider.clone();
let templates = templates.clone();

handler.handle(BlockContext { provider, templates, block: current_block }).await;
handler
.handle(BlockContext { provider, templates, block_number: current_block })
.await;
}
}

Expand Down

0 comments on commit 5c09682

Please sign in to comment.