Skip to content

Commit c5812c1

Browse files
committed
Feat/reward pool history (#1710)
The goal of this PR is to implement storage of reward pool history. Closes #1710
1 parent 31a1049 commit c5812c1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

pallets/capacity/src/tests/testing_utils.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use super::mock::*;
22
use frame_support::{assert_ok, traits::Hooks};
33

4+
use common_primitives::capacity::StakingType;
45
#[allow(unused)]
56
use sp_runtime::traits::SignedExtension;
67

@@ -89,3 +90,23 @@ pub fn setup_provider(
8990
assert_eq!(account_staking_type, staking_type);
9091
}
9192
}
93+
pub fn setup_provider(
94+
staker: &u64,
95+
target: &MessageSourceId,
96+
amount: &u64,
97+
staking_type: StakingType,
98+
) {
99+
let provider_name = String::from("Cst-") + target.to_string().as_str();
100+
register_provider(*target, provider_name);
101+
if amount.gt(&0u64) {
102+
assert_ok!(Capacity::stake(
103+
RuntimeOrigin::signed(staker.clone()),
104+
*target,
105+
*amount,
106+
staking_type.clone()
107+
));
108+
let target = Capacity::get_target_for(staker, target).unwrap();
109+
assert_eq!(target.amount, *amount);
110+
assert_eq!(target.staking_type, staking_type);
111+
}
112+
}

0 commit comments

Comments
 (0)