mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 12:11:09 +00:00
Per-lane rewards in pallet-bridge-relayers (#1665)
* per-lane rewards in pallet-bridge-relayers * add lane id to RewardPaid event * clippy * fix benchmarks
This commit is contained in:
committed by
Bastian Köcher
parent
c03d99cd09
commit
ea98118031
@@ -18,7 +18,9 @@
|
||||
|
||||
use crate as pallet_bridge_relayers;
|
||||
|
||||
use bp_messages::{source_chain::ForbidOutboundMessages, target_chain::ForbidInboundMessages};
|
||||
use bp_messages::{
|
||||
source_chain::ForbidOutboundMessages, target_chain::ForbidInboundMessages, LaneId,
|
||||
};
|
||||
use bp_relayers::PaymentProcedure;
|
||||
use frame_support::{parameter_types, weights::RuntimeDbWeight};
|
||||
use sp_core::H256;
|
||||
@@ -124,6 +126,9 @@ impl pallet_bridge_relayers::Config for TestRuntime {
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
/// Message lane that we're using in tests.
|
||||
pub const TEST_LANE_ID: LaneId = [0, 0, 0, 0];
|
||||
|
||||
/// Regular relayer that may receive rewards.
|
||||
pub const REGULAR_RELAYER: AccountId = 1;
|
||||
|
||||
@@ -136,7 +141,11 @@ pub struct TestPaymentProcedure;
|
||||
impl PaymentProcedure<AccountId, Balance> for TestPaymentProcedure {
|
||||
type Error = ();
|
||||
|
||||
fn pay_reward(relayer: &AccountId, _reward: Balance) -> Result<(), Self::Error> {
|
||||
fn pay_reward(
|
||||
relayer: &AccountId,
|
||||
_lane_id: LaneId,
|
||||
_reward: Balance,
|
||||
) -> Result<(), Self::Error> {
|
||||
match *relayer {
|
||||
FAILING_RELAYER => Err(()),
|
||||
_ => Ok(()),
|
||||
|
||||
Reference in New Issue
Block a user