Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
TalDerei committed Jan 30, 2025
1 parent 9ddcb1d commit 8777097
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/core/component/distributions/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ trait DistributionManager: StateWriteExt {
let current_epoch = self.get_current_epoch().await?;
let num_blocks = current_block_height
.checked_sub(current_epoch.start_height)
.unwrap_or_else(|| panic!("epoch start height is less than or equal to current block height (epoch_start={}, current_height={}", current_epoch.start_height, current_block_height));
.unwrap_or_else(|| panic!("epoch start height is greater than current block height (epoch_start={}, current_height={}", current_epoch.start_height, current_block_height));

// TODO(erwan): Will make the distribution chain param an `Amount`
// in a subsequent PR. Want to avoid conflicts with other in-flight changes.
Expand All @@ -86,7 +86,7 @@ trait DistributionManager: StateWriteExt {

let new_staking_issuance_for_epoch = staking_issuance_per_block
.checked_mul(num_blocks as u128) /* Safe to cast a `u64` to `u128` */
.expect("infaillible unless issuance is pathological");
.expect("infallible unless issuance is pathological");

tracing::debug!(
?new_staking_issuance_for_epoch,
Expand All @@ -111,7 +111,7 @@ trait DistributionManager: StateWriteExt {
let current_epoch = self.get_current_epoch().await?;
let epoch_length = current_block_height
.checked_sub(current_epoch.start_height)
.unwrap_or_else(|| panic!("epoch start height is less than or equal to current block height (epoch_start={}, current_height={}", current_epoch.start_height, current_block_height));
.unwrap_or_else(|| panic!("epoch start height is greater than current block height (epoch_start={}, current_height={}", current_epoch.start_height, current_block_height));

let lqt_block_reward_rate = self
.get_distributions_params()
Expand All @@ -126,7 +126,7 @@ trait DistributionManager: StateWriteExt {

let total_pool_size_for_epoch = lqt_block_reward_rate
.checked_mul(epoch_length as u64)
.expect("infaillible unless issuance is pathological");
.expect("infallible unless issuance is pathological");

tracing::debug!(
?total_pool_size_for_epoch,
Expand Down

0 comments on commit 8777097

Please sign in to comment.