V3.0.0+monthly 2021 09+1 (#234)

* update to monthly-2021-09+1

* name docs -> doc, correct versions

* use monthly-2021-09+1 tag

* nix instruction

* fmt
main
Dan Shields 2021-09-07 09:26:25 -06:00 committed by GitHub
parent cd936fca4d
commit bf528143a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 1009 additions and 1573 deletions

2293
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,9 @@
[profile.release]
panic = 'unwind'
[workspace]
members = [
'node',
'pallets/template',
'runtime',
]
[profile.release]
panic = 'unwind'

View File

@ -6,17 +6,20 @@ A fresh FRAME-based [Substrate](https://www.substrate.io/) node, ready for hacki
## Getting Started
Follow the steps below to get started with the Node Template, or get it up and running right from your browser
in just a few clicks using [Playground](https://playground.substrate.dev/) :hammer_and_wrench:
Follow the steps below to get started with the Node Template, or get it up and running right from
your browser in just a few clicks using [Playground](https://playground.substrate.dev/)
:hammer_and_wrench:
### Using Nix
Install [nix](https://nixos.org/) and optionally [direnv](https://github.com/direnv/direnv) and [lorri](https://github.com/target/lorri) for a fully plug
and play experience for setting up the development environment. To get all the correct dependencies activate direnv `direnv allow` and lorri `lorri shell`.
Install [nix](https://nixos.org/) and optionally [direnv](https://github.com/direnv/direnv) and
[lorri](https://github.com/target/lorri) for a fully plug and play experience for setting up the
development environment. To get all the correct dependencies activate direnv `direnv allow` and
lorri `lorri shell`.
### Rust Setup
First, complete the [basic Rust setup instructions](./docs/rust-setup.md).
First, complete the [basic Rust setup instructions](./doc/rust-setup.md).
### Run
@ -73,12 +76,14 @@ RUST_BACKTRACE=1 ./target/release/node-template -ldebug --dev
### Connect with Polkadot-JS Apps Front-end
Once the node template is running locally, you can connect it with **Polkadot-JS Apps** front-end
to interact with your chain. [Click here](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944) connecting the Apps to your local node template.
to interact with your chain. [Click
here](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944) connecting the Apps to your
local node template.
### Multi-Node Local Testnet
If you want to see the multi-node consensus algorithm in action, refer to
[our Start a Private Network tutorial](https://substrate.dev/docs/en/tutorials/start-a-private-network/).
If you want to see the multi-node consensus algorithm in action, refer to our
[Start a Private Network tutorial](https://substrate.dev/docs/en/tutorials/start-a-private-network/).
## Template Structure
@ -183,7 +188,8 @@ Then run the following command to start a single node development chain.
```
This command will firstly compile your code, and then start a local development network. You can
also replace the default command (`cargo build --release && ./target/release/node-template --dev --ws-external`)
also replace the default command
(`cargo build --release && ./target/release/node-template --dev --ws-external`)
by appending your own. A few useful ones are as follow.
```bash

View File

@ -1,5 +1,6 @@
[package]
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
build = 'build.rs'
description = 'A fresh FRAME-based Substrate node, ready for hacking.'
edition = '2018'
homepage = 'https://substrate.dev'
@ -7,168 +8,163 @@ license = 'Unlicense'
name = 'node-template'
publish = false
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
version = '3.0.0-monthly-2021-08'
build = 'build.rs'
version = '3.0.0-monthly-2021-09+1'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
[[bin]]
name = 'node-template'
[build-dependencies.substrate-build-script-utils]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '3.0.0'
[dependencies]
jsonrpc-core = '18.0.0'
structopt = '0.3.8'
[dependencies.node-template-runtime]
path = '../runtime'
version = '3.0.0-monthly-2021-08'
[dependencies]
jsonrpc-core = '15.1.0'
structopt = '0.3.8'
version = '3.0.0-monthly-2021-09+1'
[dependencies.frame-benchmarking]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.frame-benchmarking-cli]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.pallet-transaction-payment-rpc]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sc-basic-authorship]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '0.10.0-dev'
[dependencies.sc-cli]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '0.10.0-dev'
[dependencies.sc-client-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sc-consensus]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '0.10.0-dev'
[dependencies.sc-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '0.10.0-dev'
[dependencies.sc-executor]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '0.10.0-dev'
[dependencies.sc-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '0.10.0-dev'
[dependencies.sc-keystore]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sc-rpc]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sc-rpc-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '0.10.0-dev'
[dependencies.sc-service]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '0.10.0-dev'
[dependencies.sc-telemetry]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sc-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sc-transaction-pool-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-block-builder]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-blockchain]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-consensus]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '0.10.0-dev'
[dependencies.sp-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '0.10.0-dev'
[dependencies.sp-core]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
version = '4.0.0-dev'
[dependencies.sp-inherents]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-runtime]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-timestamp]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.substrate-frame-rpc-system]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[features]

View File

@ -119,7 +119,7 @@ pub fn run() -> sc_cli::Result<()> {
if cfg!(feature = "runtime-benchmarks") {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run::<Block, service::Executor>(config))
runner.sync_run(|config| cmd.run::<Block, service::ExecutorDispatch>(config))
} else {
Err("Benchmarking wasn't enabled when building the node. You can enable it with \
`--features runtime-benchmarks`."

View File

@ -3,8 +3,7 @@
use node_template_runtime::{self, opaque::Block, RuntimeApi};
use sc_client_api::{ExecutorProvider, RemoteBackend};
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
use sc_executor::native_executor_instance;
pub use sc_executor::NativeExecutor;
pub use sc_executor::NativeElseWasmExecutor;
use sc_finality_grandpa::SharedVoterState;
use sc_keystore::LocalKeystore;
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
@ -14,14 +13,22 @@ use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
use std::{sync::Arc, time::Duration};
// Our native executor instance.
native_executor_instance!(
pub Executor,
node_template_runtime::api::dispatch,
node_template_runtime::native_version,
frame_benchmarking::benchmarking::HostFunctions,
);
pub struct ExecutorDispatch;
type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;
impl sc_executor::NativeExecutionDispatch for ExecutorDispatch {
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
node_template_runtime::api::dispatch(method, data)
}
fn native_version() -> sc_executor::NativeVersion {
node_template_runtime::native_version()
}
}
type FullClient =
sc_service::TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<ExecutorDispatch>>;
type FullBackend = sc_service::TFullBackend<Block>;
type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
@ -62,10 +69,17 @@ pub fn new_partial(
})
.transpose()?;
let executor = NativeElseWasmExecutor::<ExecutorDispatch>::new(
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
);
let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, Executor>(
sc_service::new_full_parts::<Block, RuntimeApi, _>(
&config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
)?;
let client = Arc::new(client);
@ -162,6 +176,10 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
}
config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config());
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
));
let (network, system_rpc_tx, network_starter) =
sc_service::build_network(sc_service::BuildNetworkParams {
@ -172,6 +190,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
import_queue,
on_demand: None,
block_announce_validator_builder: None,
warp_sync: Some(warp_sync),
})?;
if config.offchain_worker.enabled {
@ -198,7 +217,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
let deps =
crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe };
crate::rpc::create_full(deps)
Ok(crate::rpc::create_full(deps))
})
};
@ -325,10 +344,17 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
})
.transpose()?;
let executor = NativeElseWasmExecutor::<ExecutorDispatch>::new(
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
);
let (client, backend, keystore_container, mut task_manager, on_demand) =
sc_service::new_light_parts::<Block, RuntimeApi, Executor>(
sc_service::new_light_parts::<Block, RuntimeApi, _>(
&config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
)?;
let mut telemetry = telemetry.map(|(worker, telemetry)| {
@ -380,6 +406,11 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
telemetry: telemetry.as_ref().map(|x| x.handle()),
})?;
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
));
let (network, system_rpc_tx, network_starter) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
@ -389,6 +420,7 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
import_queue,
on_demand: Some(on_demand.clone()),
block_announce_validator_builder: None,
warp_sync: Some(warp_sync),
})?;
if config.offchain_worker.enabled {
@ -425,7 +457,7 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
transaction_pool,
task_manager: &mut task_manager,
on_demand: Some(on_demand),
rpc_extensions_builder: Box::new(|_, _| ()),
rpc_extensions_builder: Box::new(|_, _| Ok(())),
config,
client,
keystore: keystore_container.sync_keystore(),

View File

@ -1,37 +1,34 @@
[package]
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
description = 'Substrate FRAME pallet template for defining custom runtime logic.'
description = 'FRAME pallet template for defining custom runtime logic.'
edition = '2018'
homepage = 'https://substrate.dev'
license = 'Unlicense'
name = 'pallet-template'
publish = false
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
version = '3.0.0-monthly-2021-08'
readme = 'README.md'
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
version = '3.0.0-monthly-2021-09+1'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
[dev-dependencies.serde]
version = '1.0.126'
[dev-dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dev-dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dev-dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.codec]
@ -44,19 +41,19 @@ version = '2.0.0'
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[features]

View File

@ -28,7 +28,7 @@ parameter_types! {
}
impl system::Config for Test {
type BaseCallFilter = frame_support::traits::AllowAll;
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();

View File

@ -1,13 +1,12 @@
[package]
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
description = 'Substrate FRAME based template for composing and building WASM runtimes.'
edition = '2018'
homepage = 'https://substrate.dev'
license = 'Unlicense'
name = 'node-template-runtime'
publish = false
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
version = '3.0.0-monthly-2021-08'
version = '3.0.0-monthly-2021-09+1'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
@ -15,11 +14,11 @@ targets = ['x86_64-unknown-linux-gnu']
[dependencies.pallet-template]
default-features = false
path = '../pallets/template'
version = '3.0.0-monthly-2021-08'
version = '3.0.0-monthly-2021-09+1'
[build-dependencies.substrate-wasm-builder]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '5.0.0-dev'
[dependencies.codec]
@ -32,38 +31,38 @@ version = '2.0.0'
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.frame-executive]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.frame-system-benchmarking]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.frame-system-rpc-runtime-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.hex-literal]
@ -73,115 +72,115 @@ version = '0.3.1'
[dependencies.pallet-aura]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.pallet-balances]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.pallet-grandpa]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.pallet-randomness-collective-flip]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.pallet-sudo]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.pallet-timestamp]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.pallet-transaction-payment]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.pallet-transaction-payment-rpc-runtime-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-block-builder]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-consensus-aura]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '0.10.0-dev'
[dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-inherents]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-offchain]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-session]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-transaction-pool]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[dependencies.sp-version]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
tag = 'monthly-2021-09+1'
version = '4.0.0-dev'
[features]

View File

@ -144,7 +144,7 @@ parameter_types! {
impl frame_system::Config for Runtime {
/// The basic call filter to use in dispatchable.
type BaseCallFilter = frame_support::traits::AllowAll;
type BaseCallFilter = frame_support::traits::Everything;
/// Block & extrinsics weights: base values and limits.
type BlockWeights = BlockWeights;
/// The maximum length of a block (in bytes).
@ -197,6 +197,7 @@ impl pallet_randomness_collective_flip::Config for Runtime {}
impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
}
impl pallet_grandpa::Config for Runtime {
@ -402,6 +403,10 @@ impl_runtime_apis! {
Grandpa::grandpa_authorities()
}
fn current_set_id() -> fg_primitives::SetId {
Grandpa::current_set_id()
}
fn submit_report_equivocation_unsigned_extrinsic(
_equivocation_proof: fg_primitives::EquivocationProof<
<Block as BlockT>::Hash,
@ -446,14 +451,30 @@ impl_runtime_apis! {
#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
let mut list = Vec::<BenchmarkList>::new();
list_benchmark!(list, extra, frame_system, SystemBench::<Runtime>);
list_benchmark!(list, extra, pallet_balances, Balances);
list_benchmark!(list, extra, pallet_timestamp, Timestamp);
list_benchmark!(list, extra, pallet_template, TemplateModule);
let storage_info = AllPalletsWithSystem::storage_info();
return (list, storage_info)
}
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<
(Vec<frame_benchmarking::BenchmarkBatch>, Vec<StorageInfo>),
sp_runtime::RuntimeString,
> {
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
impl frame_system_benchmarking::Config for Runtime {}
@ -471,8 +492,6 @@ impl_runtime_apis! {
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
];
let storage_info = AllPalletsWithSystem::storage_info();
let mut batches = Vec::<BenchmarkBatch>::new();
let params = (&config, &whitelist);
@ -482,7 +501,7 @@ impl_runtime_apis! {
add_benchmark!(params, batches, pallet_template, TemplateModule);
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
Ok((batches, storage_info))
Ok(batches)
}
}
}

View File

@ -7,8 +7,9 @@ imports_granularity = "Crate"
reorder_imports = true
# Consistency
newline_style = "Unix"
normalize_comments = true
normalize_doc_attributes = true
# Format comments
comment_width = 100
wrap_comments = true
# Misc
chain_width = 80
spaces_around_ranges = false