Skip to content

Commit

Permalink
fix: disambiguate the l2 block range start and recorded height start
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc committed Jan 8, 2025
1 parent 8a544b9 commit 53a96cf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/services/gas_price_service/src/v1/da_source_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,25 +184,25 @@ mod tests {

// given
let l2_height = 10;
let starting_recorded_height = 2;
let l2_block_range_start = 2;
let expected_recorded_height = 9;
let unexpected_costs = DaBlockCosts {
let costs = DaBlockCosts {
bundle_id: 1,
l2_blocks: starting_recorded_height..=expected_recorded_height,
l2_blocks: l2_block_range_start..=expected_recorded_height,
bundle_size_bytes: 1024 * 128,
blob_cost_wei: 2,
};
let notifier = Arc::new(tokio::sync::Notify::new());
let da_block_costs_source =
DummyDaBlockCosts::new(Ok(unexpected_costs.clone()), notifier.clone());
DummyDaBlockCosts::new(Ok(costs.clone()), notifier.clone());
let latest_l2_height = latest_l2_height(l2_height);
let (sender, mut receiver) =
tokio::sync::broadcast::channel(DA_BLOCK_COSTS_CHANNEL_SIZE);
let mut service = DaSourceService::new_with_sender(
da_block_costs_source,
Some(Duration::from_millis(1)),
latest_l2_height,
starting_recorded_height.into(),
(l2_block_range_start - 1).into(), /* we want to start polling from before the l2 block range */
sender,
);
let mut watcher = StateWatcher::started();
Expand Down

0 comments on commit 53a96cf

Please sign in to comment.