Update to v2.0.0 🎉 (#88)
parent
fcd577e817
commit
24da7670a9
File diff suppressed because it is too large
Load Diff
168
node/Cargo.toml
168
node/Cargo.toml
|
@ -7,141 +7,51 @@ homepage = 'https://substrate.dev'
|
||||||
license = 'Unlicense'
|
license = 'Unlicense'
|
||||||
name = 'node-template'
|
name = 'node-template'
|
||||||
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
||||||
version = '2.0.0-rc6'
|
version = '2.0.0'
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
|
||||||
targets = ['x86_64-unknown-linux-gnu']
|
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = 'node-template'
|
name = 'node-template'
|
||||||
|
|
||||||
[dependencies.node-template-runtime]
|
[package.metadata.docs.rs]
|
||||||
path = '../runtime'
|
targets = ['x86_64-unknown-linux-gnu']
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.pallet-transaction-payment-rpc]
|
[build-dependencies]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
substrate-build-script-utils = '2.0.0'
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sc-basic-authorship]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '0.8.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sc-cli]
|
|
||||||
features = ['wasmtime']
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '0.8.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sc-client-api]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sc-consensus]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '0.8.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sc-consensus-aura]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '0.8.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sc-executor]
|
|
||||||
features = ['wasmtime']
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '0.8.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sc-finality-grandpa]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '0.8.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sc-rpc]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sc-rpc-api]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '0.8.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sc-service]
|
|
||||||
features = ['wasmtime']
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '0.8.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sc-transaction-pool]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-api]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-block-builder]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-blockchain]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-consensus]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '0.8.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-consensus-aura]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '0.8.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-core]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-finality-grandpa]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-inherents]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-runtime]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-transaction-pool]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.substrate-frame-rpc-system]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
jsonrpc-core = '14.0.3'
|
jsonrpc-core = '15.0.0'
|
||||||
structopt = '0.3.8'
|
structopt = '0.3.8'
|
||||||
|
|
||||||
[build-dependencies.substrate-build-script-utils]
|
# local dependencies
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
node-template-runtime = { path = '../runtime', version = '2.0.0' }
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
# Substrate dependencies
|
||||||
|
frame-benchmarking = '2.0.0'
|
||||||
|
frame-benchmarking-cli = '2.0.0'
|
||||||
|
pallet-transaction-payment-rpc = '2.0.0'
|
||||||
|
sc-basic-authorship = '0.8.0'
|
||||||
|
sc-cli = { features = ['wasmtime'], version = '0.8.0' }
|
||||||
|
sc-client-api = '2.0.0'
|
||||||
|
sc-consensus = '0.8.0'
|
||||||
|
sc-consensus-aura = '0.8.0'
|
||||||
|
sc-executor = { features = ['wasmtime'], version = '0.8.0' }
|
||||||
|
sc-finality-grandpa = '0.8.0'
|
||||||
|
sc-rpc = '2.0.0'
|
||||||
|
sc-rpc-api = '0.8.0'
|
||||||
|
sc-service = { features = ['wasmtime'], version = '0.8.0' }
|
||||||
|
sc-transaction-pool = '2.0.0'
|
||||||
|
sp-api = '2.0.0'
|
||||||
|
sp-block-builder = '2.0.0'
|
||||||
|
sp-blockchain = '2.0.0'
|
||||||
|
sp-consensus = '0.8.0'
|
||||||
|
sp-consensus-aura = '0.8.0'
|
||||||
|
sp-core = '2.0.0'
|
||||||
|
sp-finality-grandpa = '2.0.0'
|
||||||
|
sp-inherents = '2.0.0'
|
||||||
|
sp-runtime = '2.0.0'
|
||||||
|
sp-transaction-pool = '2.0.0'
|
||||||
|
substrate-frame-rpc-system = '2.0.0'
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = []
|
||||||
|
runtime-benchmarks = ['node-template-runtime/runtime-benchmarks']
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use sc_cli::{RunCmd, Subcommand};
|
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
|
use sc_cli::RunCmd;
|
||||||
|
|
||||||
#[derive(Debug, StructOpt)]
|
#[derive(Debug, StructOpt)]
|
||||||
pub struct Cli {
|
pub struct Cli {
|
||||||
|
@ -9,3 +9,31 @@ pub struct Cli {
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
pub run: RunCmd,
|
pub run: RunCmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, StructOpt)]
|
||||||
|
pub enum Subcommand {
|
||||||
|
/// Build a chain specification.
|
||||||
|
BuildSpec(sc_cli::BuildSpecCmd),
|
||||||
|
|
||||||
|
/// Validate blocks.
|
||||||
|
CheckBlock(sc_cli::CheckBlockCmd),
|
||||||
|
|
||||||
|
/// Export blocks.
|
||||||
|
ExportBlocks(sc_cli::ExportBlocksCmd),
|
||||||
|
|
||||||
|
/// Export the state of a given block into a chain spec.
|
||||||
|
ExportState(sc_cli::ExportStateCmd),
|
||||||
|
|
||||||
|
/// Import blocks.
|
||||||
|
ImportBlocks(sc_cli::ImportBlocksCmd),
|
||||||
|
|
||||||
|
/// Remove the whole chain.
|
||||||
|
PurgeChain(sc_cli::PurgeChainCmd),
|
||||||
|
|
||||||
|
/// Revert the chain to a previous state.
|
||||||
|
Revert(sc_cli::RevertCmd),
|
||||||
|
|
||||||
|
/// The custom benchmark subcommmand benchmarking runtime pallets.
|
||||||
|
#[structopt(name = "benchmark", about = "Benchmark runtime pallets.")]
|
||||||
|
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
|
||||||
|
}
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use crate::chain_spec;
|
use crate::{chain_spec, service};
|
||||||
use crate::cli::Cli;
|
use crate::cli::{Cli, Subcommand};
|
||||||
use crate::service;
|
|
||||||
use sc_cli::{SubstrateCli, RuntimeVersion, Role, ChainSpec};
|
use sc_cli::{SubstrateCli, RuntimeVersion, Role, ChainSpec};
|
||||||
use sc_service::PartialComponents;
|
use sc_service::PartialComponents;
|
||||||
use crate::service::new_partial;
|
use node_template_runtime::Block;
|
||||||
|
|
||||||
impl SubstrateCli for Cli {
|
impl SubstrateCli for Cli {
|
||||||
fn impl_name() -> String {
|
fn impl_name() -> String {
|
||||||
|
@ -66,15 +65,65 @@ impl SubstrateCli for Cli {
|
||||||
pub fn run() -> sc_cli::Result<()> {
|
pub fn run() -> sc_cli::Result<()> {
|
||||||
let cli = Cli::from_args();
|
let cli = Cli::from_args();
|
||||||
|
|
||||||
match cli.subcommand {
|
match &cli.subcommand {
|
||||||
Some(ref subcommand) => {
|
Some(Subcommand::BuildSpec(cmd)) => {
|
||||||
let runner = cli.create_runner(subcommand)?;
|
let runner = cli.create_runner(cmd)?;
|
||||||
runner.run_subcommand(subcommand, |config| {
|
runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
|
||||||
let PartialComponents { client, backend, task_manager, import_queue, .. }
|
},
|
||||||
= new_partial(&config)?;
|
Some(Subcommand::CheckBlock(cmd)) => {
|
||||||
Ok((client, backend, import_queue, task_manager))
|
let runner = cli.create_runner(cmd)?;
|
||||||
|
runner.async_run(|config| {
|
||||||
|
let PartialComponents { client, task_manager, import_queue, ..}
|
||||||
|
= service::new_partial(&config)?;
|
||||||
|
Ok((cmd.run(client, import_queue), task_manager))
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
Some(Subcommand::ExportBlocks(cmd)) => {
|
||||||
|
let runner = cli.create_runner(cmd)?;
|
||||||
|
runner.async_run(|config| {
|
||||||
|
let PartialComponents { client, task_manager, ..}
|
||||||
|
= service::new_partial(&config)?;
|
||||||
|
Ok((cmd.run(client, config.database), task_manager))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
Some(Subcommand::ExportState(cmd)) => {
|
||||||
|
let runner = cli.create_runner(cmd)?;
|
||||||
|
runner.async_run(|config| {
|
||||||
|
let PartialComponents { client, task_manager, ..}
|
||||||
|
= service::new_partial(&config)?;
|
||||||
|
Ok((cmd.run(client, config.chain_spec), task_manager))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
Some(Subcommand::ImportBlocks(cmd)) => {
|
||||||
|
let runner = cli.create_runner(cmd)?;
|
||||||
|
runner.async_run(|config| {
|
||||||
|
let PartialComponents { client, task_manager, import_queue, ..}
|
||||||
|
= service::new_partial(&config)?;
|
||||||
|
Ok((cmd.run(client, import_queue), task_manager))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
Some(Subcommand::PurgeChain(cmd)) => {
|
||||||
|
let runner = cli.create_runner(cmd)?;
|
||||||
|
runner.sync_run(|config| cmd.run(config.database))
|
||||||
|
},
|
||||||
|
Some(Subcommand::Revert(cmd)) => {
|
||||||
|
let runner = cli.create_runner(cmd)?;
|
||||||
|
runner.async_run(|config| {
|
||||||
|
let PartialComponents { client, task_manager, backend, ..}
|
||||||
|
= service::new_partial(&config)?;
|
||||||
|
Ok((cmd.run(client, backend), task_manager))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
Some(Subcommand::Benchmark(cmd)) => {
|
||||||
|
if cfg!(feature = "runtime-benchmarks") {
|
||||||
|
let runner = cli.create_runner(cmd)?;
|
||||||
|
|
||||||
|
runner.sync_run(|config| cmd.run::<Block, service::Executor>(config))
|
||||||
|
} else {
|
||||||
|
Err("Benchmarking wasn't enabled when building the node. \
|
||||||
|
You can enable it with `--features runtime-benchmarks`.".into())
|
||||||
|
}
|
||||||
|
},
|
||||||
None => {
|
None => {
|
||||||
let runner = cli.create_runner(&cli.run)?;
|
let runner = cli.create_runner(&cli.run)?;
|
||||||
runner.run_node_until_exit(|config| match config.role {
|
runner.run_node_until_exit(|config| match config.role {
|
||||||
|
|
|
@ -16,6 +16,7 @@ native_executor_instance!(
|
||||||
pub Executor,
|
pub Executor,
|
||||||
node_template_runtime::api::dispatch,
|
node_template_runtime::api::dispatch,
|
||||||
node_template_runtime::native_version,
|
node_template_runtime::native_version,
|
||||||
|
frame_benchmarking::benchmarking::HostFunctions,
|
||||||
);
|
);
|
||||||
|
|
||||||
type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;
|
type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;
|
||||||
|
|
|
@ -6,46 +6,26 @@ homepage = 'https://substrate.dev'
|
||||||
license = 'Unlicense'
|
license = 'Unlicense'
|
||||||
name = 'pallet-template'
|
name = 'pallet-template'
|
||||||
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
||||||
version = '2.0.0-rc6'
|
version = '2.0.0'
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ['x86_64-unknown-linux-gnu']
|
targets = ['x86_64-unknown-linux-gnu']
|
||||||
|
|
||||||
|
# alias "parity-scale-code" to "codec"
|
||||||
[dependencies.codec]
|
[dependencies.codec]
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ['derive']
|
features = ['derive']
|
||||||
package = 'parity-scale-codec'
|
package = 'parity-scale-codec'
|
||||||
version = '1.3.4'
|
version = '1.3.4'
|
||||||
|
|
||||||
[dependencies.frame-support]
|
[dependencies]
|
||||||
default-features = false
|
frame-support = { default-features = false, version = '2.0.0' }
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
frame-system = { default-features = false, version = '2.0.0' }
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.frame-system]
|
[dev-dependencies]
|
||||||
default-features = false
|
sp-core = { default-features = false, version = '2.0.0' }
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
sp-io = { default-features = false, version = '2.0.0' }
|
||||||
tag = 'v2.0.0-rc6'
|
sp-runtime = { default-features = false, version = '2.0.0' }
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dev-dependencies.sp-core]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dev-dependencies.sp-io]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dev-dependencies.sp-runtime]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ['std']
|
default = ['std']
|
||||||
|
|
|
@ -42,7 +42,7 @@ impl system::Trait for Test {
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
type MaximumBlockLength = MaximumBlockLength;
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type ModuleToIndex = ();
|
type PalletInfo = ();
|
||||||
type AccountData = ();
|
type AccountData = ();
|
||||||
type OnNewAccount = ();
|
type OnNewAccount = ();
|
||||||
type OnKilledAccount = ();
|
type OnKilledAccount = ();
|
||||||
|
|
|
@ -5,170 +5,70 @@ homepage = 'https://substrate.dev'
|
||||||
license = 'Unlicense'
|
license = 'Unlicense'
|
||||||
name = 'node-template-runtime'
|
name = 'node-template-runtime'
|
||||||
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
||||||
version = '2.0.0-rc6'
|
version = '2.0.0'
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ['x86_64-unknown-linux-gnu']
|
targets = ['x86_64-unknown-linux-gnu']
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
wasm-builder-runner = { package = 'substrate-wasm-builder-runner', version = '1.0.5' }
|
||||||
|
|
||||||
|
# alias "parity-scale-code" to "codec"
|
||||||
[dependencies.codec]
|
[dependencies.codec]
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ['derive']
|
features = ['derive']
|
||||||
package = 'parity-scale-codec'
|
package = 'parity-scale-codec'
|
||||||
version = '1.3.4'
|
version = '1.3.4'
|
||||||
|
|
||||||
[dependencies.frame-executive]
|
[dependencies]
|
||||||
default-features = false
|
hex-literal = { optional = true, version = '0.3.1' }
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
serde = { features = ['derive'], optional = true, version = '1.0.101' }
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.frame-support]
|
# local dependencies
|
||||||
default-features = false
|
pallet-template = { path = '../pallets/template', default-features = false, version = '2.0.0' }
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.frame-system]
|
# Substrate dependencies
|
||||||
default-features = false
|
frame-benchmarking = { default-features = false, optional = true, version = '2.0.0' }
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
frame-executive = { default-features = false, version = '2.0.0' }
|
||||||
tag = 'v2.0.0-rc6'
|
frame-support = { default-features = false, version = '2.0.0' }
|
||||||
version = '2.0.0-rc6'
|
frame-system = { default-features = false, version = '2.0.0' }
|
||||||
|
frame-system-benchmarking = { default-features = false, optional = true, version = '2.0.0' }
|
||||||
[dependencies.frame-system-rpc-runtime-api]
|
frame-system-rpc-runtime-api = { default-features = false, version = '2.0.0' }
|
||||||
default-features = false
|
pallet-aura = { default-features = false, version = '2.0.0' }
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
pallet-balances = { default-features = false, version = '2.0.0' }
|
||||||
tag = 'v2.0.0-rc6'
|
pallet-grandpa = { default-features = false, version = '2.0.0' }
|
||||||
version = '2.0.0-rc6'
|
pallet-randomness-collective-flip = { default-features = false, version = '2.0.0' }
|
||||||
|
pallet-sudo = { default-features = false, version = '2.0.0' }
|
||||||
[dependencies.pallet-aura]
|
pallet-timestamp = { default-features = false, version = '2.0.0' }
|
||||||
default-features = false
|
pallet-transaction-payment = { default-features = false, version = '2.0.0' }
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
pallet-transaction-payment-rpc-runtime-api = { default-features = false, version = '2.0.0' }
|
||||||
tag = 'v2.0.0-rc6'
|
sp-api = { default-features = false, version = '2.0.0' }
|
||||||
version = '2.0.0-rc6'
|
sp-block-builder = { default-features = false, version = '2.0.0' }
|
||||||
|
sp-consensus-aura = { default-features = false, version = '0.8.0' }
|
||||||
[dependencies.pallet-balances]
|
sp-core = { default-features = false, version = '2.0.0' }
|
||||||
default-features = false
|
sp-inherents = { default-features = false, version = '2.0.0' }
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
sp-offchain = { default-features = false, version = '2.0.0' }
|
||||||
tag = 'v2.0.0-rc6'
|
sp-runtime = { default-features = false, version = '2.0.0' }
|
||||||
version = '2.0.0-rc6'
|
sp-session = { default-features = false, version = '2.0.0' }
|
||||||
|
sp-std = { default-features = false, version = '2.0.0' }
|
||||||
[dependencies.pallet-grandpa]
|
sp-transaction-pool = { default-features = false, version = '2.0.0' }
|
||||||
default-features = false
|
sp-version = { default-features = false, version = '2.0.0' }
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.pallet-randomness-collective-flip]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.pallet-sudo]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.pallet-timestamp]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.pallet-transaction-payment]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.pallet-transaction-payment-rpc-runtime-api]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.serde]
|
|
||||||
features = ['derive']
|
|
||||||
optional = true
|
|
||||||
version = '1.0.101'
|
|
||||||
|
|
||||||
[dependencies.sp-api]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-block-builder]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-consensus-aura]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '0.8.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-core]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-inherents]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-offchain]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-runtime]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-session]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-std]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-transaction-pool]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.sp-version]
|
|
||||||
default-features = false
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[dependencies.template]
|
|
||||||
default-features = false
|
|
||||||
package = 'pallet-template'
|
|
||||||
path = '../pallets/template'
|
|
||||||
version = '2.0.0-rc6'
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ['std']
|
default = ['std']
|
||||||
|
runtime-benchmarks = [
|
||||||
|
'hex-literal',
|
||||||
|
'frame-benchmarking',
|
||||||
|
'frame-support/runtime-benchmarks',
|
||||||
|
'frame-system-benchmarking',
|
||||||
|
'frame-system/runtime-benchmarks',
|
||||||
|
'pallet-balances/runtime-benchmarks',
|
||||||
|
'pallet-timestamp/runtime-benchmarks',
|
||||||
|
'sp-runtime/runtime-benchmarks',
|
||||||
|
]
|
||||||
std = [
|
std = [
|
||||||
'codec/std',
|
'codec/std',
|
||||||
|
'serde',
|
||||||
'frame-executive/std',
|
'frame-executive/std',
|
||||||
'frame-support/std',
|
'frame-support/std',
|
||||||
'frame-system/std',
|
'frame-system/std',
|
||||||
|
@ -178,10 +78,10 @@ std = [
|
||||||
'pallet-grandpa/std',
|
'pallet-grandpa/std',
|
||||||
'pallet-randomness-collective-flip/std',
|
'pallet-randomness-collective-flip/std',
|
||||||
'pallet-sudo/std',
|
'pallet-sudo/std',
|
||||||
|
'pallet-template/std',
|
||||||
'pallet-timestamp/std',
|
'pallet-timestamp/std',
|
||||||
'pallet-transaction-payment/std',
|
'pallet-transaction-payment/std',
|
||||||
'pallet-transaction-payment-rpc-runtime-api/std',
|
'pallet-transaction-payment-rpc-runtime-api/std',
|
||||||
'serde',
|
|
||||||
'sp-api/std',
|
'sp-api/std',
|
||||||
'sp-block-builder/std',
|
'sp-block-builder/std',
|
||||||
'sp-consensus-aura/std',
|
'sp-consensus-aura/std',
|
||||||
|
@ -193,11 +93,4 @@ std = [
|
||||||
'sp-std/std',
|
'sp-std/std',
|
||||||
'sp-transaction-pool/std',
|
'sp-transaction-pool/std',
|
||||||
'sp-version/std',
|
'sp-version/std',
|
||||||
'template/std',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[build-dependencies.wasm-builder-runner]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
package = 'substrate-wasm-builder-runner'
|
|
||||||
tag = 'v2.0.0-rc6'
|
|
||||||
version = '1.0.5'
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ pub use frame_support::{
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Import the template pallet.
|
/// Import the template pallet.
|
||||||
pub use template;
|
pub use pallet_template;
|
||||||
|
|
||||||
/// An index to a block.
|
/// An index to a block.
|
||||||
pub type BlockNumber = u32;
|
pub type BlockNumber = u32;
|
||||||
|
@ -181,7 +181,7 @@ impl frame_system::Trait for Runtime {
|
||||||
/// Converts a module to the index of the module in `construct_runtime!`.
|
/// Converts a module to the index of the module in `construct_runtime!`.
|
||||||
///
|
///
|
||||||
/// This type is being generated by `construct_runtime!`.
|
/// This type is being generated by `construct_runtime!`.
|
||||||
type ModuleToIndex = ModuleToIndex;
|
type PalletInfo = PalletInfo;
|
||||||
/// What to do if a new account is created.
|
/// What to do if a new account is created.
|
||||||
type OnNewAccount = ();
|
type OnNewAccount = ();
|
||||||
/// What to do if an account is fully reaped from the system.
|
/// What to do if an account is fully reaped from the system.
|
||||||
|
@ -211,6 +211,8 @@ impl pallet_grandpa::Trait for Runtime {
|
||||||
)>>::IdentificationTuple;
|
)>>::IdentificationTuple;
|
||||||
|
|
||||||
type HandleEquivocation = ();
|
type HandleEquivocation = ();
|
||||||
|
|
||||||
|
type WeightInfo = ();
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
|
@ -227,9 +229,11 @@ impl pallet_timestamp::Trait for Runtime {
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const ExistentialDeposit: u128 = 500;
|
pub const ExistentialDeposit: u128 = 500;
|
||||||
|
pub const MaxLocks: u32 = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_balances::Trait for Runtime {
|
impl pallet_balances::Trait for Runtime {
|
||||||
|
type MaxLocks = MaxLocks;
|
||||||
/// The type for recording an account's balance.
|
/// The type for recording an account's balance.
|
||||||
type Balance = Balance;
|
type Balance = Balance;
|
||||||
/// The ubiquitous event type.
|
/// The ubiquitous event type.
|
||||||
|
@ -257,8 +261,8 @@ impl pallet_sudo::Trait for Runtime {
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Configure the pallet template in pallets/template.
|
/// Configure the template pallet in pallets/template.
|
||||||
impl template::Trait for Runtime {
|
impl pallet_template::Trait for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +282,7 @@ construct_runtime!(
|
||||||
TransactionPayment: pallet_transaction_payment::{Module, Storage},
|
TransactionPayment: pallet_transaction_payment::{Module, Storage},
|
||||||
Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},
|
Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},
|
||||||
// Include the custom logic from the template pallet in the runtime.
|
// Include the custom logic from the template pallet in the runtime.
|
||||||
TemplateModule: template::{Module, Call, Storage, Event<T>},
|
TemplateModule: pallet_template::{Module, Call, Storage, Event<T>},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -423,7 +427,7 @@ impl_runtime_apis! {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {
|
impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {
|
||||||
fn account_nonce(account: AccountId) -> Index {
|
fn account_nonce(account: AccountId) -> Index {
|
||||||
System::account_nonce(account)
|
System::account_nonce(account)
|
||||||
|
@ -438,4 +442,39 @@ impl_runtime_apis! {
|
||||||
TransactionPayment::query_info(uxt, len)
|
TransactionPayment::query_info(uxt, len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "runtime-benchmarks")]
|
||||||
|
impl frame_benchmarking::Benchmark<Block> for Runtime {
|
||||||
|
fn dispatch_benchmark(
|
||||||
|
config: frame_benchmarking::BenchmarkConfig
|
||||||
|
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
|
||||||
|
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
|
||||||
|
|
||||||
|
use frame_system_benchmarking::Module as SystemBench;
|
||||||
|
impl frame_system_benchmarking::Trait for Runtime {}
|
||||||
|
|
||||||
|
let whitelist: Vec<TrackedStorageKey> = vec![
|
||||||
|
// Block Number
|
||||||
|
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),
|
||||||
|
// Total Issuance
|
||||||
|
hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),
|
||||||
|
// Execution Phase
|
||||||
|
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),
|
||||||
|
// Event Count
|
||||||
|
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),
|
||||||
|
// System Events
|
||||||
|
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
|
||||||
|
];
|
||||||
|
|
||||||
|
let mut batches = Vec::<BenchmarkBatch>::new();
|
||||||
|
let params = (&config, &whitelist);
|
||||||
|
|
||||||
|
add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
|
||||||
|
add_benchmark!(params, batches, pallet_balances, Balances);
|
||||||
|
add_benchmark!(params, batches, pallet_timestamp, Timestamp);
|
||||||
|
|
||||||
|
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
|
||||||
|
Ok(batches)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue