mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 21:11:07 +00:00
Fix node-template (#3924)
* fix node-template Use MultiSignature to maintain compatibility with substrate-node Reset version to 1 Remove unused const * fix chain_spec * line width
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
use primitives::{Pair, Public};
|
||||
use primitives::{Pair, Public, sr25519};
|
||||
use runtime::{
|
||||
AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig,
|
||||
SudoConfig, IndicesConfig, SystemConfig, WASM_BINARY,
|
||||
SudoConfig, IndicesConfig, SystemConfig, WASM_BINARY, Signature
|
||||
};
|
||||
use aura_primitives::sr25519::{AuthorityId as AuraId};
|
||||
use grandpa_primitives::{AuthorityId as GrandpaId};
|
||||
use substrate_service;
|
||||
use sr_primitives::traits::{Verify, IdentifyAccount};
|
||||
|
||||
// Note this is the URL for the telemetry server
|
||||
//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
|
||||
@@ -31,8 +32,17 @@ pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Pu
|
||||
.public()
|
||||
}
|
||||
|
||||
type AccountPublic = <Signature as Verify>::Signer;
|
||||
|
||||
/// Helper function to generate an account ID from seed
|
||||
pub fn get_account_id_from_seed<TPublic: Public>(seed: &str) -> AccountId where
|
||||
AccountPublic: From<<TPublic::Pair as Pair>::Public>
|
||||
{
|
||||
AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()
|
||||
}
|
||||
|
||||
/// Helper function to generate an authority key for Aura
|
||||
pub fn get_authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) {
|
||||
pub fn get_authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) {
|
||||
(
|
||||
get_from_seed::<AuraId>(s),
|
||||
get_from_seed::<GrandpaId>(s),
|
||||
@@ -49,12 +59,12 @@ impl Alternative {
|
||||
|| testnet_genesis(vec![
|
||||
get_authority_keys_from_seed("Alice"),
|
||||
],
|
||||
get_from_seed::<AccountId>("Alice"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
vec![
|
||||
get_from_seed::<AccountId>("Alice"),
|
||||
get_from_seed::<AccountId>("Bob"),
|
||||
get_from_seed::<AccountId>("Alice//stash"),
|
||||
get_from_seed::<AccountId>("Bob//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
|
||||
],
|
||||
true),
|
||||
vec![],
|
||||
@@ -69,21 +79,21 @@ impl Alternative {
|
||||
|| testnet_genesis(vec![
|
||||
get_authority_keys_from_seed("Alice"),
|
||||
get_authority_keys_from_seed("Bob"),
|
||||
],
|
||||
get_from_seed::<AccountId>("Alice"),
|
||||
],
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
vec![
|
||||
get_from_seed::<AccountId>("Alice"),
|
||||
get_from_seed::<AccountId>("Bob"),
|
||||
get_from_seed::<AccountId>("Charlie"),
|
||||
get_from_seed::<AccountId>("Dave"),
|
||||
get_from_seed::<AccountId>("Eve"),
|
||||
get_from_seed::<AccountId>("Ferdie"),
|
||||
get_from_seed::<AccountId>("Alice//stash"),
|
||||
get_from_seed::<AccountId>("Bob//stash"),
|
||||
get_from_seed::<AccountId>("Charlie//stash"),
|
||||
get_from_seed::<AccountId>("Dave//stash"),
|
||||
get_from_seed::<AccountId>("Eve//stash"),
|
||||
get_from_seed::<AccountId>("Ferdie//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
|
||||
],
|
||||
true),
|
||||
vec![],
|
||||
@@ -105,7 +115,7 @@ impl Alternative {
|
||||
}
|
||||
|
||||
fn testnet_genesis(initial_authorities: Vec<(AuraId, GrandpaId)>,
|
||||
root_key: AccountId,
|
||||
root_key: AccountId,
|
||||
endowed_accounts: Vec<AccountId>,
|
||||
_enable_println: bool) -> GenesisConfig {
|
||||
GenesisConfig {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use substrate_client::LongestChain;
|
||||
use futures::prelude::*;
|
||||
use runtime::{self, GenesisConfig, opaque::Block, RuntimeApi};
|
||||
use substrate_service::{error::{Error as ServiceError}, AbstractService, Configuration, ServiceBuilder};
|
||||
use transaction_pool::{self, txpool::{Pool as TransactionPool}};
|
||||
|
||||
Reference in New Issue
Block a user