mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Use TypedLaneId instead of LaneId (#1738)
* TypedLaneId -> LaneId * fix benchmarks compilation
This commit is contained in:
committed by
Bastian Köcher
parent
41daa32acb
commit
03425b33ae
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user