git.delta.rocks / unique-network / refs/commits / e0583227d919

difftreelog

Substrate nft v2. 4 tests added

str-mv2020-05-06parent: #c03cc94.patch.diff
in: master

16 files changed

modifiedCargo.lockdiffbeforeafterboth
2511 "thiserror",2511 "thiserror",
2512]2512]
2513
2514[[package]]
2515name = "nft"
2516version = "2.0.0-alpha.6"
2517dependencies = [
2518 "futures 0.3.4",
2519 "log",
2520 "nft-runtime",
2521 "sc-basic-authorship",
2522 "sc-cli",
2523 "sc-client",
2524 "sc-client-api",
2525 "sc-consensus-aura",
2526 "sc-executor",
2527 "sc-finality-grandpa",
2528 "sc-network",
2529 "sc-service",
2530 "sc-transaction-pool",
2531 "sp-consensus",
2532 "sp-consensus-aura",
2533 "sp-core",
2534 "sp-finality-grandpa",
2535 "sp-inherents",
2536 "sp-runtime",
2537 "sp-transaction-pool",
2538 "structopt",
2539 "substrate-build-script-utils",
2540]
2541
2542[[package]]
2543name = "nft-runtime"
2544version = "2.0.0-alpha.6"
2545dependencies = [
2546 "frame-executive",
2547 "frame-support",
2548 "frame-system",
2549 "pallet-aura",
2550 "pallet-balances",
2551 "pallet-grandpa",
2552 "pallet-nft",
2553 "pallet-randomness-collective-flip",
2554 "pallet-sudo",
2555 "pallet-timestamp",
2556 "pallet-transaction-payment",
2557 "parity-scale-codec",
2558 "serde",
2559 "sp-api",
2560 "sp-block-builder",
2561 "sp-consensus-aura",
2562 "sp-core",
2563 "sp-inherents",
2564 "sp-io",
2565 "sp-offchain",
2566 "sp-runtime",
2567 "sp-session",
2568 "sp-std",
2569 "sp-transaction-pool",
2570 "sp-version",
2571 "substrate-wasm-builder-runner",
2572]
25132573
2514[[package]]2574[[package]]
2515name = "nix"2575name = "nix"
2524 "void",2584 "void",
2525]2585]
2526
2527[[package]]
2528name = "node-template"
2529version = "2.0.0-alpha.6"
2530dependencies = [
2531 "futures 0.3.4",
2532 "log",
2533 "node-template-runtime",
2534 "sc-basic-authorship",
2535 "sc-cli",
2536 "sc-client",
2537 "sc-client-api",
2538 "sc-consensus-aura",
2539 "sc-executor",
2540 "sc-finality-grandpa",
2541 "sc-network",
2542 "sc-service",
2543 "sc-transaction-pool",
2544 "sp-consensus",
2545 "sp-consensus-aura",
2546 "sp-core",
2547 "sp-finality-grandpa",
2548 "sp-inherents",
2549 "sp-runtime",
2550 "sp-transaction-pool",
2551 "structopt",
2552 "substrate-build-script-utils",
2553]
2554
2555[[package]]
2556name = "node-template-runtime"
2557version = "2.0.0-alpha.6"
2558dependencies = [
2559 "frame-executive",
2560 "frame-support",
2561 "frame-system",
2562 "pallet-aura",
2563 "pallet-balances",
2564 "pallet-grandpa",
2565 "pallet-randomness-collective-flip",
2566 "pallet-sudo",
2567 "pallet-template",
2568 "pallet-timestamp",
2569 "pallet-transaction-payment",
2570 "parity-scale-codec",
2571 "serde",
2572 "sp-api",
2573 "sp-block-builder",
2574 "sp-consensus-aura",
2575 "sp-core",
2576 "sp-inherents",
2577 "sp-io",
2578 "sp-offchain",
2579 "sp-runtime",
2580 "sp-session",
2581 "sp-std",
2582 "sp-transaction-pool",
2583 "sp-version",
2584 "substrate-wasm-builder-runner",
2585]
25862586
2587[[package]]2587[[package]]
2588name = "nodrop"2588name = "nodrop"
2801 "sp-std",2801 "sp-std",
2802]2802]
2803
2804[[package]]
2805name = "pallet-nft"
2806version = "2.0.0-alpha.6"
2807dependencies = [
2808 "frame-support",
2809 "frame-system",
2810 "parity-scale-codec",
2811 "sp-core",
2812 "sp-io",
2813 "sp-runtime",
2814 "sp-std",
2815]
28032816
2804[[package]]2817[[package]]
2805name = "pallet-randomness-collective-flip"2818name = "pallet-randomness-collective-flip"
2849 "sp-std",2862 "sp-std",
2850]2863]
2851
2852[[package]]
2853name = "pallet-template"
2854version = "2.0.0-alpha.6"
2855dependencies = [
2856 "frame-support",
2857 "frame-system",
2858 "parity-scale-codec",
2859 "sp-core",
2860 "sp-io",
2861 "sp-runtime",
2862 "sp-std",
2863]
28642864
2865[[package]]2865[[package]]
2866name = "pallet-timestamp"2866name = "pallet-timestamp"
modifiedCargo.tomldiffbeforeafterboth
1[workspace]1[workspace]
2members = [2members = [
3 'node',3 'node',
4 'pallets/template',4 'pallets/nft',
5 'runtime',5 'runtime',
6]6]
7[profile.release]7[profile.release]
modifiednode/Cargo.tomldiffbeforeafterboth
1[package]1[package]
2authors = ['Anonymous']2authors = ['Anonymous']
3build = 'build.rs'3build = 'build.rs'
4description = 'Substrate Node template'4description = 'Substrate Node nft'
5edition = '2018'5edition = '2018'
6homepage = 'https://substrate.dev'6homepage = 'https://substrate.dev'
7license = 'Unlicense'7license = 'Unlicense'
8name = 'node-template'8name = 'nft'
9repository = 'https://github.com/paritytech/substrate/'9repository = 'https://github.com/paritytech/substrate/'
10version = '2.0.0-alpha.6'10version = '2.0.0-alpha.6'
1111
17log = '0.4.8'17log = '0.4.8'
18structopt = '0.3.8'18structopt = '0.3.8'
1919
20[dependencies.node-template-runtime]20[dependencies.nft-runtime]
21path = '../runtime'21path = '../runtime'
22version = '2.0.0-alpha.6'22version = '2.0.0-alpha.6'
2323
75version = '2.0.0-alpha.6'75version = '2.0.0-alpha.6'
7676
77[[bin]]77[[bin]]
78name = 'node-template'78name = 'nft'
7979
modifiednode/src/chain_spec.rsdiffbeforeafterboth
1use sp_core::{Pair, Public, sr25519};1use sp_core::{Pair, Public, sr25519};
2use node_template_runtime::{2use nft_runtime::{
3 AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig,3 AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig,
4 SudoConfig, SystemConfig, WASM_BINARY, Signature4 SudoConfig, SystemConfig, WASM_BINARY, Signature
5};5};
modifiednode/src/command.rsdiffbeforeafterboth
74 runner.run_node(74 runner.run_node(
75 service::new_light,75 service::new_light,
76 service::new_full,76 service::new_full,
77 node_template_runtime::VERSION77 nft_runtime::VERSION
78 )78 )
79 }79 }
80 }80 }
modifiednode/src/service.rsdiffbeforeafterboth
4use std::time::Duration;4use std::time::Duration;
5use sc_client::LongestChain;5use sc_client::LongestChain;
6use sc_client_api::ExecutorProvider;6use sc_client_api::ExecutorProvider;
7use node_template_runtime::{self, opaque::Block, RuntimeApi};7use nft_runtime::{self, opaque::Block, RuntimeApi};
8use sc_service::{error::{Error as ServiceError}, AbstractService, Configuration, ServiceBuilder};8use sc_service::{error::{Error as ServiceError}, AbstractService, Configuration, ServiceBuilder};
9use sp_inherents::InherentDataProviders;9use sp_inherents::InherentDataProviders;
10use sc_executor::native_executor_instance;10use sc_executor::native_executor_instance;
15// Our native executor instance.15// Our native executor instance.
16native_executor_instance!(16native_executor_instance!(
17 pub Executor,17 pub Executor,
18 node_template_runtime::api::dispatch,18 nft_runtime::api::dispatch,
19 node_template_runtime::native_version,19 nft_runtime::native_version,
20);20);
2121
22/// Starts a `ServiceBuilder` for a full service.22/// Starts a `ServiceBuilder` for a full service.
30 let inherent_data_providers = sp_inherents::InherentDataProviders::new();30 let inherent_data_providers = sp_inherents::InherentDataProviders::new();
3131
32 let builder = sc_service::ServiceBuilder::new_full::<32 let builder = sc_service::ServiceBuilder::new_full::<
33 node_template_runtime::opaque::Block, node_template_runtime::RuntimeApi, crate::service::Executor33 nft_runtime::opaque::Block, nft_runtime::RuntimeApi, crate::service::Executor
34 >($config)?34 >($config)?
35 .with_select_chain(|_config, backend| {35 .with_select_chain(|_config, backend| {
36 Ok(sc_client::LongestChain::new(backend.clone()))36 Ok(sc_client::LongestChain::new(backend.clone()))
addedpallets/nft/Cargo.tomldiffbeforeafterboth

no changes

addedpallets/nft/src/lib.rsdiffbeforeafterboth

no changes

addedpallets/nft/src/mock.rsdiffbeforeafterboth

no changes

addedpallets/nft/src/tests.rsdiffbeforeafterboth

no changes

deletedpallets/template/Cargo.tomldiffbeforeafterboth

no changes

deletedpallets/template/src/lib.rsdiffbeforeafterboth

no changes

deletedpallets/template/src/mock.rsdiffbeforeafterboth

no changes

deletedpallets/template/src/tests.rsdiffbeforeafterboth

no changes

modifiedruntime/Cargo.tomldiffbeforeafterboth
95package = 'frame-system'95package = 'frame-system'
96version = '2.0.0-alpha.6'96version = '2.0.0-alpha.6'
9797
98[dependencies.template]98[dependencies.nft]
99default-features = false99default-features = false
100package = 'pallet-template'100package = 'pallet-nft'
101path = '../pallets/template'101path = '../pallets/nft'
102version = '2.0.0-alpha.6'102version = '2.0.0-alpha.6'
103103
104[dependencies.timestamp]104[dependencies.timestamp]
120edition = '2018'120edition = '2018'
121homepage = 'https://substrate.dev'121homepage = 'https://substrate.dev'
122license = 'Unlicense'122license = 'Unlicense'
123name = 'node-template-runtime'123name = 'nft-runtime'
124repository = 'https://github.com/paritytech/substrate/'124repository = 'https://github.com/paritytech/substrate/'
125version = '2.0.0-alpha.6'125version = '2.0.0-alpha.6'
126126
154 'system/std',154 'system/std',
155 'timestamp/std',155 'timestamp/std',
156 'transaction-payment/std',156 'transaction-payment/std',
157 'template/std',157 'nft/std',
158]158]
159159
modifiedruntime/src/lib.rsdiffbeforeafterboth
38};38};
3939
40/// Importing a template pallet40/// Importing a template pallet
41pub use template;41pub use nft;
4242
43/// An index to a block.43/// An index to a block.
44pub type BlockNumber = u32;44pub type BlockNumber = u32;
9292
93/// This runtime version.93/// This runtime version.
94pub const VERSION: RuntimeVersion = RuntimeVersion {94pub const VERSION: RuntimeVersion = RuntimeVersion {
95 spec_name: create_runtime_str!("node-template"),95 spec_name: create_runtime_str!("nft"),
96 impl_name: create_runtime_str!("node-template"),96 impl_name: create_runtime_str!("nft"),
97 authoring_version: 1,97 authoring_version: 1,
98 spec_version: 1,98 spec_version: 1,
99 impl_version: 1,99 impl_version: 1,
222}222}
223223
224/// Used for the module template in `./template.rs`224/// Used for the module template in `./template.rs`
225impl template::Trait for Runtime {225impl nft::Trait for Runtime {
226 type Event = Event;226 type Event = Event;
227}227}
228228
241 TransactionPayment: transaction_payment::{Module, Storage},241 TransactionPayment: transaction_payment::{Module, Storage},
242 Sudo: sudo::{Module, Call, Config<T>, Storage, Event<T>},242 Sudo: sudo::{Module, Call, Config<T>, Storage, Event<T>},
243 // Used for the module template in `./template.rs`243 // Used for the module template in `./template.rs`
244 TemplateModule: template::{Module, Call, Storage, Event<T>},244 Nft: nft::{Module, Call, Storage, Event<T>},
245 }245 }
246);246);
247247