mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 23:31:04 +00:00
Relayer reward metric (#1742)
* use StorageDoubleMapKeyProvider in RelayerRewards * add metrics * clippy * fixed alerts that have caused missing dashboards * fix metric name * fix metric name again * add new metrics to the RialtoParachain <> Millau maintenance dashboard * remove obsolete dashboard
This commit is contained in:
committed by
Bastian Köcher
parent
b06cd924e9
commit
d7b131646c
@@ -20,8 +20,10 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use bp_messages::LaneId;
|
||||
use bp_runtime::StorageDoubleMapKeyProvider;
|
||||
use frame_support::{Blake2_128Concat, Identity};
|
||||
use sp_runtime::{
|
||||
codec::{Decode, Encode},
|
||||
codec::{Codec, Decode, Encode, EncodeLike},
|
||||
traits::AccountIdConversion,
|
||||
};
|
||||
use sp_std::{fmt::Debug, marker::PhantomData};
|
||||
@@ -65,6 +67,24 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Can be use to access the runtime storage key within the `RelayerRewards` map of the relayers
|
||||
/// pallet.
|
||||
pub struct RelayerRewardsKeyProvider<AccountId, Reward>(PhantomData<(AccountId, Reward)>);
|
||||
|
||||
impl<AccountId, Reward> StorageDoubleMapKeyProvider for RelayerRewardsKeyProvider<AccountId, Reward>
|
||||
where
|
||||
AccountId: Codec + EncodeLike,
|
||||
Reward: Codec + EncodeLike,
|
||||
{
|
||||
const MAP_NAME: &'static str = "RelayerRewards";
|
||||
|
||||
type Hasher1 = Blake2_128Concat;
|
||||
type Key1 = AccountId;
|
||||
type Hasher2 = Identity;
|
||||
type Key2 = LaneId;
|
||||
type Value = Reward;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user