From 98e1ab76aa3d4864eb314feb09799a4929731afa Mon Sep 17 00:00:00 2001 From: Dkwcs Date: Thu, 4 Jul 2024 15:29:11 +0300 Subject: [PATCH] fefactor(iota-framework): minor comments have been added. Test refactor --- .../iota-framework/docs/iota-system/iota_system_state_inner.md | 3 +++ .../packages/iota-system/sources/iota_system_state_inner.move | 3 +++ .../packages/iota-system/tests/rewards_distribution_tests.move | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/iota-framework/docs/iota-system/iota_system_state_inner.md b/crates/iota-framework/docs/iota-system/iota_system_state_inner.md index 4a1fde94513..50244ddedff 100644 --- a/crates/iota-framework/docs/iota-system/iota_system_state_inner.md +++ b/crates/iota-framework/docs/iota-system/iota_system_state_inner.md @@ -2177,7 +2177,9 @@ gas coins. 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, @@ -2186,6 +2188,7 @@ gas coins. ); 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, diff --git a/crates/iota-framework/packages/iota-system/sources/iota_system_state_inner.move b/crates/iota-framework/packages/iota-system/sources/iota_system_state_inner.move index dd8262aca43..6ad532bda21 100644 --- a/crates/iota-framework/packages/iota-system/sources/iota_system_state_inner.move +++ b/crates/iota-framework/packages/iota-system/sources/iota_system_state_inner.move @@ -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, @@ -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, diff --git a/crates/iota-framework/packages/iota-system/tests/rewards_distribution_tests.move b/crates/iota-framework/packages/iota-system/tests/rewards_distribution_tests.move index 618913bb1f8..f05f30f2dd3 100644 --- a/crates/iota-framework/packages/iota-system/tests/rewards_distribution_tests.move +++ b/crates/iota-framework/packages/iota-system/tests/rewards_distribution_tests.move @@ -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.