Use TypedLaneId instead of LaneId (#1738)

* TypedLaneId -> LaneId

* fix benchmarks compilation
This commit is contained in:
Svyatoslav Nikolsky
2022-12-30 12:09:19 +03:00
committed by Bastian Köcher
parent 41daa32acb
commit 03425b33ae
20 changed files with 65 additions and 50 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ pub trait Config: crate::Config {
benchmarks! {
// Benchmark `claim_rewards` call.
claim_rewards {
let lane = [0, 0, 0, 0];
let lane = LaneId([0, 0, 0, 0]);
let relayer: T::AccountId = whitelisted_caller();
let reward = T::Reward::from(REWARD_AMOUNT);
+4 -4
View File
@@ -244,9 +244,9 @@ mod tests {
run_test(|| {
let lane0_rewards_account =
PayLaneRewardFromAccount::lane_rewards_account([0, 0, 0, 0]);
PayLaneRewardFromAccount::lane_rewards_account(LaneId([0, 0, 0, 0]));
let lane1_rewards_account =
PayLaneRewardFromAccount::lane_rewards_account([0, 0, 0, 1]);
PayLaneRewardFromAccount::lane_rewards_account(LaneId([0, 0, 0, 1]));
Balances::mint_into(&lane0_rewards_account, 100).unwrap();
Balances::mint_into(&lane1_rewards_account, 100).unwrap();
@@ -254,12 +254,12 @@ mod tests {
assert_eq!(Balances::balance(&lane1_rewards_account), 100);
assert_eq!(Balances::balance(&1), 0);
PayLaneRewardFromAccount::pay_reward(&1, [0, 0, 0, 0], 100).unwrap();
PayLaneRewardFromAccount::pay_reward(&1, LaneId([0, 0, 0, 0]), 100).unwrap();
assert_eq!(Balances::balance(&lane0_rewards_account), 0);
assert_eq!(Balances::balance(&lane1_rewards_account), 100);
assert_eq!(Balances::balance(&1), 100);
PayLaneRewardFromAccount::pay_reward(&1, [0, 0, 0, 1], 100).unwrap();
PayLaneRewardFromAccount::pay_reward(&1, LaneId([0, 0, 0, 1]), 100).unwrap();
assert_eq!(Balances::balance(&lane0_rewards_account), 0);
assert_eq!(Balances::balance(&lane1_rewards_account), 0);
assert_eq!(Balances::balance(&1), 200);
+1 -1
View File
@@ -96,7 +96,7 @@ impl pallet_bridge_relayers::Config for TestRuntime {
}
/// Message lane that we're using in tests.
pub const TEST_LANE_ID: LaneId = [0, 0, 0, 0];
pub const TEST_LANE_ID: LaneId = LaneId([0, 0, 0, 0]);
/// Regular relayer that may receive rewards.
pub const REGULAR_RELAYER: AccountId = 1;