Skip to content

Commit

Permalink
fefactor(iota-framework): minor comments have been added. Test refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Dkwcs committed Jul 4, 2024
1 parent 66c9573 commit 98e1ab7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,9 @@ gas coins.
leftover_staking_rewards.join(computation_reward);
<b>let</b> leftover_storage_fund_inflow = leftover_staking_rewards.value();

// Burning leftover rewards
self.iota_treasury_cap.burn_balance(leftover_staking_rewards, ctx);

<b>let</b> refunded_storage_rebate =
self.<a href="storage_fund.md#0x3_storage_fund">storage_fund</a>.<a href="iota_system_state_inner.md#0x3_iota_system_state_inner_advance_epoch">advance_epoch</a>(
storage_reward,
Expand All @@ -2186,6 +2188,7 @@ gas coins.
);

<a href="../iota-framework/event.md#0x2_event_emit">event::emit</a>(
//TODO: Add additional information (e.g., how much was burned, how much was leftover, etc.)
<a href="iota_system_state_inner.md#0x3_iota_system_state_inner_SystemEpochInfoEvent">SystemEpochInfoEvent</a> {
epoch: self.epoch,
protocol_version: self.protocol_version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,9 @@ module iota_system::iota_system_state_inner {
leftover_staking_rewards.join(computation_reward);
let leftover_storage_fund_inflow = leftover_staking_rewards.value();

// Burning leftover rewards
self.iota_treasury_cap.burn_balance(leftover_staking_rewards, ctx);

let refunded_storage_rebate =
self.storage_fund.advance_epoch(
storage_reward,
Expand All @@ -929,6 +931,7 @@ module iota_system::iota_system_state_inner {
);

event::emit(
//TODO: Add additional information (e.g., how much was burned, how much was leftover, etc.)
SystemEpochInfoEvent {
epoch: self.epoch,
protocol_version: self.protocol_version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ module iota_system::rewards_distribution_tests {
report_validator(VALIDATOR_ADDR_4, VALIDATOR_ADDR_1, scenario);

advance_epoch_with_reward_amounts_and_slashing_rates(
1000, 1000, 10_000, scenario
1000, 500, 10_000, scenario
);

// All validators should have 0 rewards added so their stake stays the same.
Expand Down

0 comments on commit 98e1ab7

Please sign in to comment.