Restore a runtime which compiles

Adds BABE, GRANDPA, to the runtime definition and a few stubs for not yet
implemented interfaces.
This commit is contained in:
Luke Parker
2025-09-21 13:16:43 -04:00
parent d373d2a4c9
commit e63acf3f67
23 changed files with 517 additions and 1136 deletions

View File

@@ -18,10 +18,10 @@ workspace = true
[dependencies]
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false }
sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false }
frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false }
frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false }
frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false }
frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false }
serai-abi = { path = "../abi", default-features = false, features = ["substrate"] }
serai-core-pallet = { path = "../core", default-features = false }
@@ -29,7 +29,7 @@ serai-core-pallet = { path = "../core", default-features = false }
[dev-dependencies]
borsh = { version = "1", default-features = false, features = ["std", "derive", "de_strict_order"] }
sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false, features = ["std"] }
sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false, features = ["std"] }
[features]
std = [

View File

@@ -49,10 +49,12 @@ mod pallet {
/// The instance used to represent coins on the Serai network.
///
/// This would either be SRI itself or the sriXYZ coins swappable via pools.
#[derive(Default)]
pub struct CoinsInstance;
/// The instance used to represent liquidity tokens on the Serai network.
///
/// Coin::XYZ would be considered as the liquidity token for the Coin::SRI - Coin::XYZ pool.
#[derive(Default)]
pub struct LiquidityTokensInstance;
/// The configuration of this pallet.
@@ -66,7 +68,7 @@ mod pallet {
/// The genesis state to use for this pallet.
#[pallet::genesis_config]
#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode)]
#[derive(Clone, Debug)]
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
/// The balances to initiate the state with.
///
@@ -76,10 +78,9 @@ mod pallet {
/// PhantomData to bind `I`.
pub _instance: PhantomData<I>,
}
impl<T: Config<I>, I: 'static> Default for GenesisConfig<T, I> {
fn default() -> Self {
GenesisConfig { accounts: Default::default(), _instance: Default::default() }
Self { accounts: Default::default(), _instance: PhantomData }
}
}