Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreOssun committed Nov 16, 2023
1 parent 6b22734 commit 0077580
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pallets/block-rewards-hybrid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ pub mod pallet {
Self::tvl_percentage() / distro_params.ideal_dapps_staking_tvl * adjustable_balance
};

let staker_reward = base_staker_balance + adjustable_staker_part;
let staker_reward = base_staker_balance.saturating_add(adjustable_staker_part);

Rewards {
treasury_reward,
Expand Down
14 changes: 7 additions & 7 deletions pallets/block-rewards-hybrid/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ fn reward_distribution_config_not_consistent() {
}

#[test]
pub fn set_configuration_fails() {
fn set_configuration_fails() {
ExternalityBuilder::build().execute_with(|| {
// 1
assert_noop!(
Expand All @@ -142,7 +142,7 @@ pub fn set_configuration_fails() {
}

#[test]
pub fn set_configuration_is_ok() {
fn set_configuration_is_ok() {
ExternalityBuilder::build().execute_with(|| {
// custom config so it differs from the default one
let reward_config = RewardDistributionConfig {
Expand Down Expand Up @@ -171,7 +171,7 @@ pub fn set_configuration_is_ok() {
}

#[test]
pub fn inflation_and_total_issuance_as_expected() {
fn inflation_and_total_issuance_as_expected() {
ExternalityBuilder::build().execute_with(|| {
let init_issuance = <TestRuntime as Config>::Currency::total_issuance();

Expand All @@ -190,7 +190,7 @@ pub fn inflation_and_total_issuance_as_expected() {
}

#[test]
pub fn reward_distribution_as_expected() {
fn reward_distribution_as_expected() {
ExternalityBuilder::build().execute_with(|| {
// Ensure that initially, all beneficiaries have no free balance
let init_balance_snapshot = FreeBalanceSnapshot::new();
Expand Down Expand Up @@ -236,7 +236,7 @@ pub fn reward_distribution_as_expected() {
}

#[test]
pub fn non_distributed_reward_amount_is_burned() {
fn non_distributed_reward_amount_is_burned() {
ExternalityBuilder::build().execute_with(|| {
// Ensure that initially, all beneficiaries have no free balance
let init_balance_snapshot = FreeBalanceSnapshot::new();
Expand Down Expand Up @@ -278,7 +278,7 @@ pub fn non_distributed_reward_amount_is_burned() {
}

#[test]
pub fn reward_distribution_no_adjustable_part() {
fn reward_distribution_no_adjustable_part() {
ExternalityBuilder::build().execute_with(|| {
let reward_config = RewardDistributionConfig {
treasury_percent: Perbill::from_percent(10),
Expand Down Expand Up @@ -312,7 +312,7 @@ pub fn reward_distribution_no_adjustable_part() {
}

#[test]
pub fn reward_distribution_all_zero_except_one() {
fn reward_distribution_all_zero_except_one() {
ExternalityBuilder::build().execute_with(|| {
let reward_config = RewardDistributionConfig {
treasury_percent: Perbill::zero(),
Expand Down

0 comments on commit 0077580

Please sign in to comment.