mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +00:00
Soft deprecate GenesisConfig (#14210)
* soft deprecate genesisconfig * temporarily add a deprecation attr * update tests * update mocks * update genesis config * update genesis config * update genesis config * update genesis config * remove deprecation warning * update deprecation comment --------- Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -39,7 +39,7 @@ use sp_runtime::{
|
||||
Perbill,
|
||||
};
|
||||
|
||||
pub use kitchensink_runtime::GenesisConfig;
|
||||
pub use kitchensink_runtime::RuntimeGenesisConfig;
|
||||
pub use node_primitives::{AccountId, Balance, Signature};
|
||||
|
||||
type AccountPublic = <Signature as Verify>::Signer;
|
||||
@@ -62,7 +62,7 @@ pub struct Extensions {
|
||||
}
|
||||
|
||||
/// Specialized `ChainSpec`.
|
||||
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig, Extensions>;
|
||||
pub type ChainSpec = sc_service::GenericChainSpec<RuntimeGenesisConfig, Extensions>;
|
||||
/// Flaming Fir testnet generator
|
||||
pub fn flaming_fir_config() -> Result<ChainSpec, String> {
|
||||
ChainSpec::from_json_bytes(&include_bytes!("../res/flaming-fir.json")[..])
|
||||
@@ -77,7 +77,7 @@ fn session_keys(
|
||||
SessionKeys { grandpa, babe, im_online, authority_discovery }
|
||||
}
|
||||
|
||||
fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
fn staging_testnet_config_genesis() -> RuntimeGenesisConfig {
|
||||
#[rustfmt::skip]
|
||||
// stash, controller, session-key
|
||||
// generated with secret:
|
||||
@@ -229,7 +229,7 @@ pub fn authority_keys_from_seed(
|
||||
)
|
||||
}
|
||||
|
||||
/// Helper function to create GenesisConfig for testing
|
||||
/// Helper function to create RuntimeGenesisConfig for testing
|
||||
pub fn testnet_genesis(
|
||||
initial_authorities: Vec<(
|
||||
AccountId,
|
||||
@@ -242,7 +242,7 @@ pub fn testnet_genesis(
|
||||
initial_nominators: Vec<AccountId>,
|
||||
root_key: AccountId,
|
||||
endowed_accounts: Option<Vec<AccountId>>,
|
||||
) -> GenesisConfig {
|
||||
) -> RuntimeGenesisConfig {
|
||||
let mut endowed_accounts: Vec<AccountId> = endowed_accounts.unwrap_or_else(|| {
|
||||
vec![
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
@@ -294,7 +294,7 @@ pub fn testnet_genesis(
|
||||
const ENDOWMENT: Balance = 10_000_000 * DOLLARS;
|
||||
const STASH: Balance = ENDOWMENT / 1000;
|
||||
|
||||
GenesisConfig {
|
||||
RuntimeGenesisConfig {
|
||||
system: SystemConfig { code: wasm_binary_unwrap().to_vec() },
|
||||
balances: BalancesConfig {
|
||||
balances: endowed_accounts.iter().cloned().map(|x| (x, ENDOWMENT)).collect(),
|
||||
@@ -381,7 +381,7 @@ pub fn testnet_genesis(
|
||||
}
|
||||
}
|
||||
|
||||
fn development_config_genesis() -> GenesisConfig {
|
||||
fn development_config_genesis() -> RuntimeGenesisConfig {
|
||||
testnet_genesis(
|
||||
vec![authority_keys_from_seed("Alice")],
|
||||
vec![],
|
||||
@@ -406,7 +406,7 @@ pub fn development_config() -> ChainSpec {
|
||||
)
|
||||
}
|
||||
|
||||
fn local_testnet_genesis() -> GenesisConfig {
|
||||
fn local_testnet_genesis() -> RuntimeGenesisConfig {
|
||||
testnet_genesis(
|
||||
vec![authority_keys_from_seed("Alice"), authority_keys_from_seed("Bob")],
|
||||
vec![],
|
||||
@@ -438,7 +438,7 @@ pub(crate) mod tests {
|
||||
use sc_service_test;
|
||||
use sp_runtime::BuildStorage;
|
||||
|
||||
fn local_testnet_genesis_instant_single() -> GenesisConfig {
|
||||
fn local_testnet_genesis_instant_single() -> RuntimeGenesisConfig {
|
||||
testnet_genesis(
|
||||
vec![authority_keys_from_seed("Alice")],
|
||||
vec![],
|
||||
|
||||
Reference in New Issue
Block a user