Relayers pallet: extend payment source id (#1907)

* Add Chain::ID const

* Relayers pallet: extend payment source id

* Addressed code review comments

* Fix benchmarks

* Fix dashboards

* Renamings

* Fix compilation
This commit is contained in:
Serban Iorga
2023-02-28 11:31:54 +02:00
committed by Bastian Köcher
parent f31b5d8634
commit f5fee288b9
37 changed files with 375 additions and 137 deletions
+4 -2
View File
@@ -18,8 +18,8 @@ use crate::calls::UtilityCall;
use bp_messages::MessageNonce;
use bp_runtime::{
Chain as ChainBase, EncodedOrDecodedCall, HashOf, Parachain as ParachainBase, TransactionEra,
TransactionEraOf, UnderlyingChainProvider,
Chain as ChainBase, ChainId, EncodedOrDecodedCall, HashOf, Parachain as ParachainBase,
TransactionEra, TransactionEraOf, UnderlyingChainProvider,
};
use codec::{Codec, Encode};
use jsonrpsee::core::{DeserializeOwned, Serialize};
@@ -35,6 +35,8 @@ use std::{fmt::Debug, time::Duration};
/// Substrate-based chain from minimal relay-client point of view.
pub trait Chain: ChainBase + Clone {
/// Chain id.
const ID: ChainId;
/// Chain name.
const NAME: &'static str;
/// Identifier of the basic token of the chain (if applicable).
@@ -22,6 +22,7 @@
#![cfg(any(feature = "test-helpers", test))]
use crate::{Chain, ChainWithBalances};
use bp_runtime::ChainId;
use frame_support::weights::Weight;
use std::time::Duration;
@@ -50,6 +51,7 @@ impl bp_runtime::Chain for TestChain {
}
impl Chain for TestChain {
const ID: ChainId = *b"test";
const NAME: &'static str = "Test";
const TOKEN_ID: Option<&'static str> = None;
const BEST_FINALIZED_HEADER_ID_METHOD: &'static str = "TestMethod";