mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 06:27:58 +00:00
Rename node-runtime to node-kitchensink-runtime (#11930)
* Rename node=runtime to kithensink-runtime * Undo md formatting
This commit is contained in:
@@ -87,7 +87,7 @@ pallet-asset-tx-payment = { version = "4.0.0-dev", path = "../../../frame/transa
|
||||
pallet-im-online = { version = "4.0.0-dev", default-features = false, path = "../../../frame/im-online" }
|
||||
|
||||
# node-specific dependencies
|
||||
node-runtime = { version = "3.0.0-dev", path = "../runtime" }
|
||||
kitchensink-runtime = { version = "3.0.0-dev", path = "../runtime" }
|
||||
node-rpc = { version = "3.0.0-dev", path = "../rpc" }
|
||||
node-primitives = { version = "2.0.0", path = "../primitives" }
|
||||
node-executor = { version = "3.0.0-dev", path = "../executor" }
|
||||
@@ -159,10 +159,10 @@ cli = [
|
||||
"substrate-build-script-utils",
|
||||
"try-runtime-cli",
|
||||
]
|
||||
runtime-benchmarks = ["node-runtime/runtime-benchmarks", "frame-benchmarking-cli"]
|
||||
runtime-benchmarks = ["kitchensink-runtime/runtime-benchmarks", "frame-benchmarking-cli"]
|
||||
# Enable features that allow the runtime to be tried and debugged. Name might be subject to change
|
||||
# in the near future.
|
||||
try-runtime = ["node-runtime/try-runtime", "try-runtime-cli"]
|
||||
try-runtime = ["kitchensink-runtime/try-runtime", "try-runtime-cli"]
|
||||
|
||||
[[bench]]
|
||||
name = "transaction_pool"
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput};
|
||||
|
||||
use kitchensink_runtime::{constants::currency::*, BalancesCall};
|
||||
use node_cli::service::{create_extrinsic, FullClient};
|
||||
use node_runtime::{constants::currency::*, BalancesCall};
|
||||
use sc_block_builder::{BlockBuilderProvider, BuiltBlock, RecordProof};
|
||||
use sc_client_api::execution_extensions::ExecutionStrategies;
|
||||
use sc_consensus::{
|
||||
@@ -121,9 +121,9 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
|
||||
}
|
||||
|
||||
fn extrinsic_set_time(now: u64) -> OpaqueExtrinsic {
|
||||
node_runtime::UncheckedExtrinsic {
|
||||
kitchensink_runtime::UncheckedExtrinsic {
|
||||
signature: None,
|
||||
function: node_runtime::Call::Timestamp(pallet_timestamp::Call::set { now }),
|
||||
function: kitchensink_runtime::Call::Timestamp(pallet_timestamp::Call::set { now }),
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ use std::time::Duration;
|
||||
|
||||
use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput};
|
||||
use futures::{future, StreamExt};
|
||||
use kitchensink_runtime::{constants::currency::*, BalancesCall, SudoCall};
|
||||
use node_cli::service::{create_extrinsic, fetch_nonce, FullClient, TransactionPool};
|
||||
use node_primitives::AccountId;
|
||||
use node_runtime::{constants::currency::*, BalancesCall, SudoCall};
|
||||
use sc_client_api::execution_extensions::ExecutionStrategies;
|
||||
use sc_service::{
|
||||
config::{
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
use crate::service::{create_extrinsic, FullClient};
|
||||
|
||||
use kitchensink_runtime::{BalancesCall, SystemCall};
|
||||
use node_primitives::{AccountId, Balance};
|
||||
use node_runtime::{BalancesCall, SystemCall};
|
||||
use sc_cli::Result;
|
||||
use sp_inherents::{InherentData, InherentDataProvider};
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
use grandpa_primitives::AuthorityId as GrandpaId;
|
||||
use hex_literal::hex;
|
||||
use node_runtime::{
|
||||
use kitchensink_runtime::{
|
||||
constants::currency::*, wasm_binary_unwrap, AuthorityDiscoveryConfig, BabeConfig,
|
||||
BalancesConfig, Block, CouncilConfig, DemocracyConfig, ElectionsConfig, GrandpaConfig,
|
||||
ImOnlineConfig, IndicesConfig, MaxNominations, NominationPoolsConfig, SessionConfig,
|
||||
@@ -40,8 +40,8 @@ use sp_runtime::{
|
||||
Perbill,
|
||||
};
|
||||
|
||||
pub use kitchensink_runtime::GenesisConfig;
|
||||
pub use node_primitives::{AccountId, Balance, Signature};
|
||||
pub use node_runtime::GenesisConfig;
|
||||
|
||||
type AccountPublic = <Signature as Verify>::Signer;
|
||||
|
||||
@@ -343,7 +343,7 @@ pub fn testnet_genesis(
|
||||
sudo: SudoConfig { key: Some(root_key) },
|
||||
babe: BabeConfig {
|
||||
authorities: vec![],
|
||||
epoch_config: Some(node_runtime::BABE_GENESIS_EPOCH_CONFIG),
|
||||
epoch_config: Some(kitchensink_runtime::BABE_GENESIS_EPOCH_CONFIG),
|
||||
},
|
||||
im_online: ImOnlineConfig { keys: vec![] },
|
||||
authority_discovery: AuthorityDiscoveryConfig { keys: vec![] },
|
||||
|
||||
@@ -23,9 +23,9 @@ use crate::{
|
||||
Cli, Subcommand,
|
||||
};
|
||||
use frame_benchmarking_cli::*;
|
||||
use kitchensink_runtime::{ExistentialDeposit, RuntimeApi};
|
||||
use node_executor::ExecutorDispatch;
|
||||
use node_primitives::Block;
|
||||
use node_runtime::{ExistentialDeposit, RuntimeApi};
|
||||
use sc_cli::{ChainSpec, Result, RuntimeVersion, SubstrateCli};
|
||||
use sc_service::PartialComponents;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
@@ -75,7 +75,7 @@ impl SubstrateCli for Cli {
|
||||
}
|
||||
|
||||
fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
|
||||
&node_runtime::VERSION
|
||||
&kitchensink_runtime::VERSION
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
use codec::Encode;
|
||||
use frame_system_rpc_runtime_api::AccountNonceApi;
|
||||
use futures::prelude::*;
|
||||
use kitchensink_runtime::RuntimeApi;
|
||||
use node_executor::ExecutorDispatch;
|
||||
use node_primitives::Block;
|
||||
use node_runtime::RuntimeApi;
|
||||
use sc_client_api::{BlockBackend, ExecutorProvider};
|
||||
use sc_consensus_babe::{self, SlotProportion};
|
||||
use sc_executor::NativeElseWasmExecutor;
|
||||
@@ -68,41 +68,43 @@ pub fn fetch_nonce(client: &FullClient, account: sp_core::sr25519::Pair) -> u32
|
||||
pub fn create_extrinsic(
|
||||
client: &FullClient,
|
||||
sender: sp_core::sr25519::Pair,
|
||||
function: impl Into<node_runtime::Call>,
|
||||
function: impl Into<kitchensink_runtime::Call>,
|
||||
nonce: Option<u32>,
|
||||
) -> node_runtime::UncheckedExtrinsic {
|
||||
) -> kitchensink_runtime::UncheckedExtrinsic {
|
||||
let function = function.into();
|
||||
let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed");
|
||||
let best_hash = client.chain_info().best_hash;
|
||||
let best_block = client.chain_info().best_number;
|
||||
let nonce = nonce.unwrap_or_else(|| fetch_nonce(client, sender.clone()));
|
||||
|
||||
let period = node_runtime::BlockHashCount::get()
|
||||
let period = kitchensink_runtime::BlockHashCount::get()
|
||||
.checked_next_power_of_two()
|
||||
.map(|c| c / 2)
|
||||
.unwrap_or(2) as u64;
|
||||
let tip = 0;
|
||||
let extra: node_runtime::SignedExtra = (
|
||||
frame_system::CheckNonZeroSender::<node_runtime::Runtime>::new(),
|
||||
frame_system::CheckSpecVersion::<node_runtime::Runtime>::new(),
|
||||
frame_system::CheckTxVersion::<node_runtime::Runtime>::new(),
|
||||
frame_system::CheckGenesis::<node_runtime::Runtime>::new(),
|
||||
frame_system::CheckEra::<node_runtime::Runtime>::from(generic::Era::mortal(
|
||||
let extra: kitchensink_runtime::SignedExtra = (
|
||||
frame_system::CheckNonZeroSender::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckSpecVersion::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckTxVersion::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckGenesis::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckEra::<kitchensink_runtime::Runtime>::from(generic::Era::mortal(
|
||||
period,
|
||||
best_block.saturated_into(),
|
||||
)),
|
||||
frame_system::CheckNonce::<node_runtime::Runtime>::from(nonce),
|
||||
frame_system::CheckWeight::<node_runtime::Runtime>::new(),
|
||||
pallet_asset_tx_payment::ChargeAssetTxPayment::<node_runtime::Runtime>::from(tip, None),
|
||||
frame_system::CheckNonce::<kitchensink_runtime::Runtime>::from(nonce),
|
||||
frame_system::CheckWeight::<kitchensink_runtime::Runtime>::new(),
|
||||
pallet_asset_tx_payment::ChargeAssetTxPayment::<kitchensink_runtime::Runtime>::from(
|
||||
tip, None,
|
||||
),
|
||||
);
|
||||
|
||||
let raw_payload = node_runtime::SignedPayload::from_raw(
|
||||
let raw_payload = kitchensink_runtime::SignedPayload::from_raw(
|
||||
function.clone(),
|
||||
extra.clone(),
|
||||
(
|
||||
(),
|
||||
node_runtime::VERSION.spec_version,
|
||||
node_runtime::VERSION.transaction_version,
|
||||
kitchensink_runtime::VERSION.spec_version,
|
||||
kitchensink_runtime::VERSION.transaction_version,
|
||||
genesis_hash,
|
||||
best_hash,
|
||||
(),
|
||||
@@ -112,10 +114,10 @@ pub fn create_extrinsic(
|
||||
);
|
||||
let signature = raw_payload.using_encoded(|e| sender.sign(e));
|
||||
|
||||
node_runtime::UncheckedExtrinsic::new_signed(
|
||||
kitchensink_runtime::UncheckedExtrinsic::new_signed(
|
||||
function,
|
||||
sp_runtime::AccountId32::from(sender.public()).into(),
|
||||
node_runtime::Signature::Sr25519(signature),
|
||||
kitchensink_runtime::Signature::Sr25519(signature),
|
||||
extra,
|
||||
)
|
||||
}
|
||||
@@ -565,11 +567,11 @@ pub fn new_full(
|
||||
mod tests {
|
||||
use crate::service::{new_full_base, NewFullBase};
|
||||
use codec::Encode;
|
||||
use node_primitives::{Block, DigestItem, Signature};
|
||||
use node_runtime::{
|
||||
use kitchensink_runtime::{
|
||||
constants::{currency::CENTS, time::SLOT_DURATION},
|
||||
Address, BalancesCall, Call, UncheckedExtrinsic,
|
||||
};
|
||||
use node_primitives::{Block, DigestItem, Signature};
|
||||
use sc_client_api::BlockBackend;
|
||||
use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy};
|
||||
use sc_consensus_babe::{BabeIntermediate, CompatibleDigestItem, INTERMEDIATE_KEY};
|
||||
|
||||
Reference in New Issue
Block a user