mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
[big refactor] Remove crate aliasing. (#4395)
* Rename: Phase 1. * Unify codec. * Fixing: Phase 2 * Fixing: Phase 3. * Fixing: Phase 4. * Fixing: Phase 5. * Fixing: Phase 6. * Fixing: Phase 7. * Fixing: Phase 8. Tests * Fixing: Phase 9. Tests!!! * Fixing: Phase 10. Moar tests! * Finally done! * More fixes. * Rename primitives:: to sp_core:: * Apply renames in finality-grandpa. * Fix benches. * Fix benches 2. * Revert node-template. * Fix frame-system in our modules.
This commit is contained in:
committed by
Gavin Wood
parent
f14d98a439
commit
8778ca7dc8
@@ -19,18 +19,18 @@
|
||||
use sp_runtime::BuildStorage;
|
||||
|
||||
/// Re-export test-client utilities.
|
||||
pub use test_client::*;
|
||||
pub use substrate_test_client::*;
|
||||
|
||||
/// Call executor for `node-runtime` `TestClient`.
|
||||
pub type Executor = sc_executor::NativeExecutor<node_executor::Executor>;
|
||||
|
||||
/// Default backend type.
|
||||
pub type Backend = client_db::Backend<node_primitives::Block>;
|
||||
pub type Backend = sc_client_db::Backend<node_primitives::Block>;
|
||||
|
||||
/// Test client type.
|
||||
pub type Client = client::Client<
|
||||
pub type Client = sc_client::Client<
|
||||
Backend,
|
||||
client::LocalCallExecutor<Backend, Executor>,
|
||||
sc_client::LocalCallExecutor<Backend, Executor>,
|
||||
node_primitives::Block,
|
||||
node_runtime::RuntimeApi,
|
||||
>;
|
||||
@@ -41,7 +41,7 @@ pub struct GenesisParameters {
|
||||
support_changes_trie: bool,
|
||||
}
|
||||
|
||||
impl test_client::GenesisInit for GenesisParameters {
|
||||
impl substrate_test_client::GenesisInit for GenesisParameters {
|
||||
fn genesis_storage(&self) -> Storage {
|
||||
crate::genesis::config(self.support_changes_trie, None).build_storage().unwrap()
|
||||
}
|
||||
@@ -56,8 +56,8 @@ pub trait TestClientBuilderExt: Sized {
|
||||
fn build(self) -> Client;
|
||||
}
|
||||
|
||||
impl TestClientBuilderExt for test_client::TestClientBuilder<
|
||||
client::LocalCallExecutor<Backend, Executor>,
|
||||
impl TestClientBuilderExt for substrate_test_client::TestClientBuilder<
|
||||
sc_client::LocalCallExecutor<Backend, Executor>,
|
||||
Backend,
|
||||
GenesisParameters,
|
||||
> {
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
//! Genesis Configuration.
|
||||
|
||||
use crate::keyring::*;
|
||||
use keyring::{Ed25519Keyring, Sr25519Keyring};
|
||||
use sp_keyring::{Ed25519Keyring, Sr25519Keyring};
|
||||
use node_runtime::{
|
||||
GenesisConfig, BalancesConfig, SessionConfig, StakingConfig, SystemConfig,
|
||||
GrandpaConfig, IndicesConfig, ContractsConfig, WASM_BINARY,
|
||||
};
|
||||
use node_runtime::constants::currency::*;
|
||||
use primitives::ChangesTrieConfiguration;
|
||||
use sp_core::ChangesTrieConfiguration;
|
||||
use sp_runtime::Perbill;
|
||||
|
||||
|
||||
@@ -37,10 +37,10 @@ pub fn config(support_changes_trie: bool, code: Option<&[u8]>) -> GenesisConfig
|
||||
}) } else { None },
|
||||
code: code.map(|x| x.to_vec()).unwrap_or_else(|| WASM_BINARY.to_vec()),
|
||||
}),
|
||||
indices: Some(IndicesConfig {
|
||||
pallet_indices: Some(IndicesConfig {
|
||||
ids: vec![alice(), bob(), charlie(), dave(), eve(), ferdie()],
|
||||
}),
|
||||
balances: Some(BalancesConfig {
|
||||
pallet_balances: Some(BalancesConfig {
|
||||
balances: vec![
|
||||
(alice(), 111 * DOLLARS),
|
||||
(bob(), 100 * DOLLARS),
|
||||
@@ -51,7 +51,7 @@ pub fn config(support_changes_trie: bool, code: Option<&[u8]>) -> GenesisConfig
|
||||
],
|
||||
vesting: vec![],
|
||||
}),
|
||||
session: Some(SessionConfig {
|
||||
pallet_session: Some(SessionConfig {
|
||||
keys: vec![
|
||||
(alice(), to_session_keys(
|
||||
&Ed25519Keyring::Alice,
|
||||
@@ -67,12 +67,12 @@ pub fn config(support_changes_trie: bool, code: Option<&[u8]>) -> GenesisConfig
|
||||
)),
|
||||
]
|
||||
}),
|
||||
staking: Some(StakingConfig {
|
||||
pallet_staking: Some(StakingConfig {
|
||||
current_era: 0,
|
||||
stakers: vec![
|
||||
(dave(), alice(), 111 * DOLLARS, staking::StakerStatus::Validator),
|
||||
(eve(), bob(), 100 * DOLLARS, staking::StakerStatus::Validator),
|
||||
(ferdie(), charlie(), 100 * DOLLARS, staking::StakerStatus::Validator)
|
||||
(dave(), alice(), 111 * DOLLARS, pallet_staking::StakerStatus::Validator),
|
||||
(eve(), bob(), 100 * DOLLARS, pallet_staking::StakerStatus::Validator),
|
||||
(ferdie(), charlie(), 100 * DOLLARS, pallet_staking::StakerStatus::Validator)
|
||||
],
|
||||
validator_count: 3,
|
||||
minimum_validator_count: 0,
|
||||
@@ -80,21 +80,21 @@ pub fn config(support_changes_trie: bool, code: Option<&[u8]>) -> GenesisConfig
|
||||
invulnerables: vec![alice(), bob(), charlie()],
|
||||
.. Default::default()
|
||||
}),
|
||||
contracts: Some(ContractsConfig {
|
||||
pallet_contracts: Some(ContractsConfig {
|
||||
current_schedule: Default::default(),
|
||||
gas_price: 1 * MILLICENTS,
|
||||
}),
|
||||
babe: Some(Default::default()),
|
||||
grandpa: Some(GrandpaConfig {
|
||||
pallet_babe: Some(Default::default()),
|
||||
pallet_grandpa: Some(GrandpaConfig {
|
||||
authorities: vec![],
|
||||
}),
|
||||
im_online: Some(Default::default()),
|
||||
authority_discovery: Some(Default::default()),
|
||||
democracy: Some(Default::default()),
|
||||
collective_Instance1: Some(Default::default()),
|
||||
collective_Instance2: Some(Default::default()),
|
||||
membership_Instance1: Some(Default::default()),
|
||||
sudo: Some(Default::default()),
|
||||
treasury: Some(Default::default()),
|
||||
pallet_im_online: Some(Default::default()),
|
||||
pallet_authority_discovery: Some(Default::default()),
|
||||
pallet_democracy: Some(Default::default()),
|
||||
pallet_collective_Instance1: Some(Default::default()),
|
||||
pallet_collective_Instance2: Some(Default::default()),
|
||||
pallet_membership_Instance1: Some(Default::default()),
|
||||
pallet_sudo: Some(Default::default()),
|
||||
pallet_treasury: Some(Default::default()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//! Test accounts.
|
||||
|
||||
use keyring::{AccountKeyring, Sr25519Keyring, Ed25519Keyring};
|
||||
use sp_keyring::{AccountKeyring, Sr25519Keyring, Ed25519Keyring};
|
||||
use node_primitives::{AccountId, Balance, Index};
|
||||
use node_runtime::{CheckedExtrinsic, UncheckedExtrinsic, SessionKeys, SignedExtra};
|
||||
use sp_runtime::generic::Era;
|
||||
@@ -66,12 +66,12 @@ pub fn to_session_keys(
|
||||
/// Returns transaction extra.
|
||||
pub fn signed_extra(nonce: Index, extra_fee: Balance) -> SignedExtra {
|
||||
(
|
||||
system::CheckVersion::new(),
|
||||
system::CheckGenesis::new(),
|
||||
system::CheckEra::from(Era::mortal(256, 0)),
|
||||
system::CheckNonce::from(nonce),
|
||||
system::CheckWeight::new(),
|
||||
transaction_payment::ChargeTransactionPayment::from(extra_fee),
|
||||
frame_system::CheckVersion::new(),
|
||||
frame_system::CheckGenesis::new(),
|
||||
frame_system::CheckEra::from(Era::mortal(256, 0)),
|
||||
frame_system::CheckNonce::from(nonce),
|
||||
frame_system::CheckWeight::new(),
|
||||
pallet_transaction_payment::ChargeTransactionPayment::from(extra_fee),
|
||||
Default::default(),
|
||||
)
|
||||
}
|
||||
@@ -90,7 +90,7 @@ pub fn sign(xt: CheckedExtrinsic, version: u32, genesis_hash: [u8; 32]) -> Unche
|
||||
}
|
||||
}).into();
|
||||
UncheckedExtrinsic {
|
||||
signature: Some((indices::address::Address::Id(signed), signature, extra)),
|
||||
signature: Some((pallet_indices::address::Address::Id(signed), signature, extra)),
|
||||
function: payload.0,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user