Move generic CLI logic to different crate (#2885)

* Move generic CLI logic to separate crate

* Move and rename `CliChain` trait definition

Move it to `relay-substrate-client`

* Move generic cli logic to substrate-relay-helper

* Fix docs warnings
This commit is contained in:
Serban Iorga
2024-03-20 09:45:43 +01:00
committed by Bastian Köcher
parent bfce7a250f
commit 3643f721d4
63 changed files with 1746 additions and 1438 deletions
@@ -16,6 +16,7 @@
use crate::calls::UtilityCall;
use crate::SimpleRuntimeVersion;
use bp_header_chain::ChainWithGrandpa as ChainWithGrandpaBase;
use bp_messages::ChainWithMessages as ChainWithMessagesBase;
use bp_runtime::{
@@ -58,6 +59,16 @@ pub trait Chain: ChainBase + Clone {
type Call: Clone + Codec + Debug + Send + Sync;
}
/// Bridge-supported network definition.
///
/// Used to abstract away CLI commands.
pub trait ChainWithRuntimeVersion: Chain {
/// Current version of the chain runtime, known to relay.
///
/// can be `None` if relay is not going to submit transactions to that chain.
const RUNTIME_VERSION: Option<SimpleRuntimeVersion>;
}
/// Substrate-based relay chain that supports parachains.
///
/// We assume that the parachains are supported using `runtime_parachains::paras` pallet.
+3 -3
View File
@@ -35,9 +35,9 @@ use std::time::Duration;
pub use crate::{
chain::{
AccountKeyPairOf, BlockWithJustification, CallOf, Chain, ChainWithBalances,
ChainWithGrandpa, ChainWithMessages, ChainWithTransactions, ChainWithUtilityPallet,
FullRuntimeUtilityPallet, MockedRuntimeUtilityPallet, Parachain, RelayChain, SignParam,
TransactionStatusOf, UnsignedTransaction, UtilityPallet,
ChainWithGrandpa, ChainWithMessages, ChainWithRuntimeVersion, ChainWithTransactions,
ChainWithUtilityPallet, FullRuntimeUtilityPallet, MockedRuntimeUtilityPallet, Parachain,
RelayChain, SignParam, TransactionStatusOf, UnsignedTransaction, UtilityPallet,
},
client::{
is_ancient_block, ChainRuntimeVersion, Client, OpaqueGrandpaAuthoritiesSet,