Skip to content

Commit

Permalink
change staking target extrinsic, closes #1570 (#1623)
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonwells committed Jul 12, 2024
1 parent 75602c6 commit acf73fb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pallets/capacity/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ impl pallet_capacity::Config for Test {
type RewardPoolEachEra = ConstU64<10_000>;
type RewardPercentCap = TestRewardCap;
type RewardPoolChunkLength = ConstU32<3>;
type StakingRewardsPastErasMax = ConstU32<5>;
type ChangeStakingTargetThawEras = ConstU32<5>;
}

fn initialize_reward_pool() {
Expand Down
2 changes: 1 addition & 1 deletion pallets/capacity/src/tests/other_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn set_target_details_is_successful() {

assert_eq!(Capacity::get_target_for(&staker, target), None);

let mut target_details = StakingTargetDetails::<BalanceOf<Test>>::default();
let mut target_details = StakingTargetDetails::<Test>::default();
target_details.amount = 10;
target_details.capacity = 10;

Expand Down
6 changes: 3 additions & 3 deletions pallets/capacity/src/tests/unstaking_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ fn unstake_happy_path() {

assert_eq!(
staking_target_details,
StakingTargetDetails::<BalanceOf<Test>> {
amount: BalanceOf::<Test>::from(60u32),
capacity: BalanceOf::<Test>::from(6u32),
StakingTargetDetails::<Test> {
amount: BalanceOf::<Test>::from(60u64),
capacity: BalanceOf::<Test>::from(6u64),
}
);

Expand Down
1 change: 1 addition & 0 deletions pallets/frequency-tx-payment/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ impl pallet_capacity::Config for Test {
type EraLength = ConstU32<5>;
type ProviderBoostHistoryLimit = ConstU32<6>;
type RewardsProvider = Capacity;
type ChangeStakingTargetThawEras = ConstU32<1>;
type MaxRetargetsPerRewardEra = ConstU32<5>;
type RewardPoolEachEra = ConstU64<10_000>;
type RewardPercentCap = TestRewardCap;
Expand Down
1 change: 1 addition & 0 deletions runtime/frequency/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ impl pallet_capacity::Config for Runtime {
type EraLength = CapacityRewardEraLength;
type ProviderBoostHistoryLimit = ConstU32<30u32>;
type RewardsProvider = Capacity;
type ChangeStakingTargetThawEras = CapacityChangeStakingTargetThawEras;
type MaxRetargetsPerRewardEra = ConstU32<16>;
// Value determined by desired inflation rate limits for chosen economic model
type RewardPoolEachEra = ConstU128<{ currency::CENTS.saturating_mul(172_602_740u128) }>;
Expand Down

0 comments on commit acf73fb

Please sign in to comment.