diff --git a/auction/Cargo.toml b/auction/Cargo.toml index a12a0a3a6bff96689e6eccbb4abb245dcaaad3ac..1ba4d8c9f91a78722a081473f46ef154f1c4dcad 100644 --- a/auction/Cargo.toml +++ b/auction/Cargo.toml @@ -10,17 +10,17 @@ edition = "2018" [dependencies] serde = { version = "1.0.111", optional = true } codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } -sp-runtime = { version = "2.0.0-rc6", default-features = false } -sp-io = { version = "2.0.0-rc6", default-features = false } -sp-std = { version = "2.0.0-rc6", default-features = false } +sp-runtime = { version = "2.0.0", default-features = false } +sp-io = { version = "2.0.0", default-features = false } +sp-std = { version = "2.0.0", default-features = false } -frame-support = { version = "2.0.0-rc6", default-features = false } -frame-system = { version = "2.0.0-rc6", default-features = false } +frame-support = { version = "2.0.0", default-features = false } +frame-system = { version = "2.0.0", default-features = false } orml-traits = { path = "../traits", version = "0.2.1-dev", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc6", default-features = false } +sp-core = { version = "2.0.0", default-features = false } clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 diff --git a/auction/src/mock.rs b/auction/src/mock.rs index 8eaaf1519238a9beb508621b2d10e5b13f22e68d..9e5ba5943283c7136f9411ddbda08c4daa54ada8 100644 --- a/auction/src/mock.rs +++ b/auction/src/mock.rs @@ -54,7 +54,7 @@ impl frame_system::Trait for Runtime { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); diff --git a/authority/Cargo.toml b/authority/Cargo.toml index 2515fb441ea007149abefd29d63c91f347ef1990..7215976817494f3c605f21f52c6ba0573a1a66e8 100644 --- a/authority/Cargo.toml +++ b/authority/Cargo.toml @@ -10,18 +10,18 @@ edition = "2018" [dependencies] serde = { version = "1.0.111", optional = true } codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } -sp-runtime = { version = "2.0.0-rc6", default-features = false } -sp-io = { version = "2.0.0-rc6", default-features = false } -sp-std = { version = "2.0.0-rc6", default-features = false } +sp-runtime = { version = "2.0.0", default-features = false } +sp-io = { version = "2.0.0", default-features = false } +sp-std = { version = "2.0.0", default-features = false } -frame-support = { version = "2.0.0-rc6", default-features = false } -frame-system = { version = "2.0.0-rc6", default-features = false } +frame-support = { version = "2.0.0", default-features = false } +frame-system = { version = "2.0.0", default-features = false } orml-traits = { path = "../traits", version = "0.2.1-dev", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc6", default-features = false } -pallet-scheduler = { version = "2.0.0-rc6" } +sp-core = { version = "2.0.0", default-features = false } +pallet-scheduler = { version = "2.0.0" } clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 [features] diff --git a/authority/src/mock.rs b/authority/src/mock.rs index d058bc0729c366f537b083295e49148ebb18361c..b9064560e74f62f321cbff5898de5aa00bd64f88 100644 --- a/authority/src/mock.rs +++ b/authority/src/mock.rs @@ -43,7 +43,7 @@ impl frame_system::Trait for Runtime { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); @@ -65,6 +65,7 @@ impl pallet_scheduler::Trait for Runtime { type Call = Call; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot<u128>; + type MaxScheduledPerBlock = (); type WeightInfo = (); } diff --git a/benchmarking/Cargo.toml b/benchmarking/Cargo.toml index a48fcbc015d2edf60adb1ee143025e2d6e7531ad..602de58b7d06843263933ae026047f775c864045 100644 --- a/benchmarking/Cargo.toml +++ b/benchmarking/Cargo.toml @@ -10,14 +10,14 @@ edition = "2018" [dependencies] paste = "0.1.16" codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } -sp-api = { version = "2.0.0-rc6", default-features = false } -sp-runtime-interface = { version = "2.0.0-rc6", default-features = false } -sp-runtime = { version = "2.0.0-rc6", default-features = false } -sp-std = { version = "2.0.0-rc6", default-features = false } -sp-io = { version = "2.0.0-rc6", default-features = false } -frame-support = { version = "2.0.0-rc6", default-features = false } -frame-system = { version = "2.0.0-rc6", default-features = false } -frame-benchmarking = { version = "2.0.0-rc6", default-features = false } +sp-api = { version = "2.0.0", default-features = false } +sp-runtime-interface = { version = "2.0.0", default-features = false } +sp-runtime = { version = "2.0.0", default-features = false } +sp-std = { version = "2.0.0", default-features = false } +sp-io = { version = "2.0.0", default-features = false } +frame-support = { version = "2.0.0", default-features = false } +frame-system = { version = "2.0.0", default-features = false } +frame-benchmarking = { version = "2.0.0", default-features = false } [dev-dependencies] hex-literal = "0.2.1" diff --git a/benchmarking/src/lib.rs b/benchmarking/src/lib.rs index c118957085c5a52dcbd7aeafee0a3de27d927b4e..8a8a6eeabbf7663db2cce92aabefd811f893494b 100644 --- a/benchmarking/src/lib.rs +++ b/benchmarking/src/lib.rs @@ -149,7 +149,7 @@ pub use sp_runtime::traits::Zero; /// } /// ``` /// -/// These `verify` blocks will not execute when running your actual benchmarks! +/// These `verify` blocks will not affect your benchmark results! /// /// You can construct benchmark tests like so: /// @@ -578,7 +578,11 @@ macro_rules! benchmark_backend { ] } - fn instance(&self, components: &[($crate::BenchmarkParameter, u32)]) + fn instance( + &self, + components: &[($crate::BenchmarkParameter, u32)], + verify: bool + ) -> Result<Box<dyn FnOnce() -> Result<(), &'static str>>, &'static str> { $( @@ -588,7 +592,8 @@ macro_rules! benchmark_backend { // Prepare instance let $param = components.iter() .find(|&c| c.0 == $crate::BenchmarkParameter::$param) - .unwrap().1; + .ok_or("Could not find component in benchmark preparation.")? + .1; )* $( let $pre_id : $pre_ty = $pre_ex; @@ -596,28 +601,13 @@ macro_rules! benchmark_backend { $( $param_instancer ; )* $( $post )* - Ok(Box::new(move || -> Result<(), &'static str> { $eval; Ok(()) })) - } - - fn verify(&self, components: &[($crate::BenchmarkParameter, u32)]) - -> Result<Box<dyn FnOnce() -> Result<(), &'static str>>, &'static str> - { - $( - let $common = $common_from; - )* - $( - // Prepare instance - let $param = components.iter() - .find(|&c| c.0 == $crate::BenchmarkParameter::$param) - .unwrap().1; - )* - $( - let $pre_id : $pre_ty = $pre_ex; - )* - $( $param_instancer ; )* - $( $post )* - - Ok(Box::new(move || -> Result<(), &'static str> { $eval; $postcode; Ok(()) })) + Ok(Box::new(move || -> Result<(), &'static str> { + $eval; + if verify { + $postcode; + } + Ok(()) + })) } } }; @@ -663,26 +653,18 @@ macro_rules! selected_benchmark { } } - fn instance(&self, components: &[($crate::BenchmarkParameter, u32)]) + fn instance( + &self, + components: &[($crate::BenchmarkParameter, u32)], + verify: bool + ) -> Result<Box<dyn FnOnce() -> Result<(), &'static str>>, &'static str> { match self { $( Self::$bench => < $bench as $crate::BenchmarkingSetup<$runtime $(, $bench_inst)? > - >::instance(&$bench, components), - )* - } - } - - fn verify(&self, components: &[($crate::BenchmarkParameter, u32)]) - -> Result<Box<dyn FnOnce() -> Result<(), &'static str>>, &'static str> - { - match self { - $( - Self::$bench => < - $bench as $crate::BenchmarkingSetup<$runtime $(, $bench_inst)? > - >::verify(&$bench, components), + >::instance(&$bench, components, verify), )* } } @@ -719,7 +701,8 @@ macro_rules! impl_benchmark { highest_range_values: &[u32], steps: &[u32], repeat: u32, - whitelist: &[$crate::TrackedStorageKey] + whitelist: &[$crate::TrackedStorageKey], + verify: bool, ) -> Result<Vec<$crate::BenchmarkResults>, &'static str> { // Map the input to the selected benchmark. let extrinsic = sp_std::str::from_utf8(extrinsic) @@ -729,6 +712,11 @@ macro_rules! impl_benchmark { _ => return Err("Could not find extrinsic."), }; + let mut results: Vec<$crate::BenchmarkResults> = Vec::new(); + if repeat == 0 { + return Ok(results); + } + // Add whitelist to DB $crate::benchmarking::set_whitelist(whitelist.to_vec()); @@ -739,15 +727,15 @@ macro_rules! impl_benchmark { let components = < SelectedBenchmark as $crate::BenchmarkingSetup<$runtime $(, $instance)?> >::components(&selected_benchmark); - let mut results: Vec<$crate::BenchmarkResults> = Vec::new(); // Default number of steps for a component. let mut prev_steps = 10; let repeat_benchmark = | repeat: u32, - c: Vec<($crate::BenchmarkParameter, u32)>, + c: &[($crate::BenchmarkParameter, u32)], results: &mut Vec<$crate::BenchmarkResults>, + verify: bool, | -> Result<(), &'static str> { // Run the benchmark `repeat` times. for _ in 0..repeat { @@ -755,7 +743,7 @@ macro_rules! impl_benchmark { // benchmark. let closure_to_benchmark = < SelectedBenchmark as $crate::BenchmarkingSetup<$runtime $(, $instance)?> - >::instance(&selected_benchmark, &c)?; + >::instance(&selected_benchmark, c, verify)?; // Set the block number to at least 1 so events are deposited. if $crate::Zero::is_zero(&frame_system::Module::<$runtime>::block_number()) { @@ -769,43 +757,47 @@ macro_rules! impl_benchmark { // Reset the read/write counter so we don't count operations in the setup process. $crate::benchmarking::reset_read_write_count(); - // Time the extrinsic logic. - frame_support::debug::trace!( - target: "benchmark", - "Start Benchmark: {:?}", c - ); - - let start_extrinsic = $crate::benchmarking::current_time(); - closure_to_benchmark()?; - let finish_extrinsic = $crate::benchmarking::current_time(); - let elapsed_extrinsic = finish_extrinsic - start_extrinsic; - // Commit the changes to get proper write count - $crate::benchmarking::commit_db(); - frame_support::debug::trace!( - target: "benchmark", - "End Benchmark: {} ns", elapsed_extrinsic - ); - let read_write_count = $crate::benchmarking::read_write_count(); - frame_support::debug::trace!( - target: "benchmark", - "Read/Write Count {:?}", read_write_count - ); - - // Time the storage root recalculation. - let start_storage_root = $crate::benchmarking::current_time(); - $crate::storage_root(); - let finish_storage_root = $crate::benchmarking::current_time(); - let elapsed_storage_root = finish_storage_root - start_storage_root; - - results.push($crate::BenchmarkResults { - components: c.clone(), - extrinsic_time: elapsed_extrinsic, - storage_root_time: elapsed_storage_root, - reads: read_write_count.0, - repeat_reads: read_write_count.1, - writes: read_write_count.2, - repeat_writes: read_write_count.3, - }); + if verify { + closure_to_benchmark()?; + } else { + // Time the extrinsic logic. + frame_support::debug::trace!( + target: "benchmark", + "Start Benchmark: {:?}", c + ); + + let start_extrinsic = $crate::benchmarking::current_time(); + closure_to_benchmark()?; + let finish_extrinsic = $crate::benchmarking::current_time(); + let elapsed_extrinsic = finish_extrinsic - start_extrinsic; + // Commit the changes to get proper write count + $crate::benchmarking::commit_db(); + frame_support::debug::trace!( + target: "benchmark", + "End Benchmark: {} ns", elapsed_extrinsic + ); + let read_write_count = $crate::benchmarking::read_write_count(); + frame_support::debug::trace!( + target: "benchmark", + "Read/Write Count {:?}", read_write_count + ); + + // Time the storage root recalculation. + let start_storage_root = $crate::benchmarking::current_time(); + $crate::storage_root(); + let finish_storage_root = $crate::benchmarking::current_time(); + let elapsed_storage_root = finish_storage_root - start_storage_root; + + results.push($crate::BenchmarkResults { + components: c.to_vec(), + extrinsic_time: elapsed_extrinsic, + storage_root_time: elapsed_storage_root, + reads: read_write_count.0, + repeat_reads: read_write_count.1, + writes: read_write_count.2, + repeat_writes: read_write_count.3, + }); + } // Wipe the DB back to the genesis state. $crate::benchmarking::wipe_db(); @@ -815,7 +807,11 @@ macro_rules! impl_benchmark { }; if components.is_empty() { - repeat_benchmark(repeat, Default::default(), &mut results)?; + if verify { + // If `--verify` is used, run the benchmark once to verify it would complete. + repeat_benchmark(repeat, Default::default(), &mut Vec::new(), true)?; + } + repeat_benchmark(repeat, Default::default(), &mut results, false)?; } else { // Select the component we will be benchmarking. Each component will be benchmarked. for (idx, (name, low, high)) in components.iter().enumerate() { @@ -851,7 +847,11 @@ macro_rules! impl_benchmark { ) .collect(); - repeat_benchmark(repeat, c, &mut results)?; + if verify { + // If `--verify` is used, run the benchmark once to verify it would complete. + repeat_benchmark(1, &c, &mut Vec::new(), true)?; + } + repeat_benchmark(repeat, &c, &mut results, false)?; } } } @@ -883,17 +883,17 @@ macro_rules! impl_benchmark_test { let execute_benchmark = | c: Vec<($crate::BenchmarkParameter, u32)> | -> Result<(), &'static str> { - // Set up the verification state + // Set up the benchmark, return execution + verification function. let closure_to_verify = < SelectedBenchmark as $crate::BenchmarkingSetup<$runtime, _> - >::verify(&selected_benchmark, &c)?; + >::instance(&selected_benchmark, &c, true)?; // Set the block number to at least 1 so events are deposited. if $crate::Zero::is_zero(&frame_system::Module::<$runtime>::block_number()) { frame_system::Module::<$runtime>::set_block_number(1u8.into()); } - // Run verification + // Run execution + verification closure_to_verify()?; // Reset the state @@ -935,7 +935,7 @@ macro_rules! impl_benchmark_test { /// First create an object that holds in the input parameters for the benchmark: /// /// ```ignore -/// let params = (&pallet, &benchmark, &lowest_range_values, &highest_range_values, &steps, repeat, &whitelist); +/// let params = (&config, &whitelist); /// ``` /// /// The `whitelist` is a parameter you pass to control the DB read/write @@ -979,18 +979,29 @@ macro_rules! impl_benchmark_test { macro_rules! add_benchmark { ( $params:ident, $batches:ident, $name:ident, $( $location:tt )* ) => ( let name_string = stringify!($name).as_bytes(); - let (pallet, benchmark, lowest_range_values, highest_range_values, steps, repeat, whitelist, extra) = $params; + let (config, whitelist) = $params; + let $crate::BenchmarkConfig { + pallet, + benchmark, + lowest_range_values, + highest_range_values, + steps, + repeat, + verify, + extra, + } = config; if &pallet[..] == &name_string[..] || &pallet[..] == &b"*"[..] { if &pallet[..] == &b"*"[..] || &benchmark[..] == &b"*"[..] { - for benchmark in $( $location )*::Benchmark::benchmarks(extra).into_iter() { + for benchmark in $( $location )*::benchmarks(*extra).into_iter() { $batches.push($crate::BenchmarkBatch { results: $( $location )*::Benchmark::run_benchmark( benchmark, &lowest_range_values[..], &highest_range_values[..], &steps[..], - repeat, + *repeat, whitelist, + *verify, )?, pallet: name_string.to_vec(), benchmark: benchmark.to_vec(), @@ -1003,8 +1014,9 @@ macro_rules! add_benchmark { &lowest_range_values[..], &highest_range_values[..], &steps[..], - repeat, + *repeat, whitelist, + *verify )?, pallet: name_string.to_vec(), benchmark: benchmark.clone(), diff --git a/benchmarking/src/tests.rs b/benchmarking/src/tests.rs index b3683fcaf81136c59ba8b4ed71c14ea61ce5bccf..3ee9b5e8b30d9824af431497922455a00d6a9449 100644 --- a/benchmarking/src/tests.rs +++ b/benchmarking/src/tests.rs @@ -73,7 +73,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = (); type AvailableBlockRatio = (); type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); @@ -155,9 +155,12 @@ fn benchmarks_macro_works() { let components = <SelectedBenchmark as BenchmarkingSetup<Test>>::components(&selected_benchmark); assert_eq!(components, vec![(BenchmarkParameter::b, 1, 1000)]); - let closure = - <SelectedBenchmark as BenchmarkingSetup<Test>>::instance(&selected_benchmark, &[(BenchmarkParameter::b, 1)]) - .expect("failed to create closure"); + let closure = <SelectedBenchmark as BenchmarkingSetup<Test>>::instance( + &selected_benchmark, + &[(BenchmarkParameter::b, 1)], + true, + ) + .expect("failed to create closure"); new_test_ext().execute_with(|| { assert_eq!(closure(), Ok(())); @@ -171,9 +174,12 @@ fn benchmarks_macro_rename_works() { let components = <SelectedBenchmark as BenchmarkingSetup<Test>>::components(&selected_benchmark); assert_eq!(components, vec![(BenchmarkParameter::b, 1, 1000)]); - let closure = - <SelectedBenchmark as BenchmarkingSetup<Test>>::instance(&selected_benchmark, &[(BenchmarkParameter::b, 1)]) - .expect("failed to create closure"); + let closure = <SelectedBenchmark as BenchmarkingSetup<Test>>::instance( + &selected_benchmark, + &[(BenchmarkParameter::b, 1)], + true, + ) + .expect("failed to create closure"); new_test_ext().execute_with(|| { assert_ok!(closure()); @@ -187,9 +193,12 @@ fn benchmarks_macro_works_for_non_dispatchable() { let components = <SelectedBenchmark as BenchmarkingSetup<Test>>::components(&selected_benchmark); assert_eq!(components, vec![(BenchmarkParameter::x, 1, 10000)]); - let closure = - <SelectedBenchmark as BenchmarkingSetup<Test>>::instance(&selected_benchmark, &[(BenchmarkParameter::x, 1)]) - .expect("failed to create closure"); + let closure = <SelectedBenchmark as BenchmarkingSetup<Test>>::instance( + &selected_benchmark, + &[(BenchmarkParameter::x, 1)], + true, + ) + .expect("failed to create closure"); assert_eq!(closure(), Ok(())); } @@ -199,12 +208,26 @@ fn benchmarks_macro_verify_works() { // Check postcondition for benchmark `set_value` is valid. let selected_benchmark = SelectedBenchmark::set_value; + let closure = <SelectedBenchmark as BenchmarkingSetup<Test>>::instance( + &selected_benchmark, + &[(BenchmarkParameter::b, 1)], + true, + ) + .expect("failed to create closure"); + + new_test_ext().execute_with(|| { + assert_ok!(closure()); + }); + + // Check postcondition for benchmark `bad_verify` is invalid. + let selected = SelectedBenchmark::bad_verify; + let closure = - <SelectedBenchmark as BenchmarkingSetup<Test>>::verify(&selected_benchmark, &[(BenchmarkParameter::b, 1)]) + <SelectedBenchmark as BenchmarkingSetup<Test>>::instance(&selected, &[(BenchmarkParameter::x, 10000)], true) .expect("failed to create closure"); new_test_ext().execute_with(|| { - assert_ok!(closure()); + assert_err!(closure(), "You forgot to sort!"); }); } diff --git a/currencies/Cargo.toml b/currencies/Cargo.toml index 968464884d4ec8e9ca2fbca6a5d3bb3eb8bedfec..90dc0dc76a95fc54e61d3076a5ff8d648235f80c 100644 --- a/currencies/Cargo.toml +++ b/currencies/Cargo.toml @@ -10,18 +10,18 @@ edition = "2018" [dependencies] serde = { version = "1.0.111", optional = true } codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } -sp-runtime = { version = "2.0.0-rc6", default-features = false } -sp-io = { version = "2.0.0-rc6", default-features = false } -sp-std = { version = "2.0.0-rc6", default-features = false } +sp-runtime = { version = "2.0.0", default-features = false } +sp-io = { version = "2.0.0", default-features = false } +sp-std = { version = "2.0.0", default-features = false } -frame-support = { version = "2.0.0-rc6", default-features = false } -frame-system = { version = "2.0.0-rc6", default-features = false } +frame-support = { version = "2.0.0", default-features = false } +frame-system = { version = "2.0.0", default-features = false } orml-traits = { path = "../traits", version = "0.2.1-dev", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc6", default-features = false } -pallet-balances = "2.0.0-rc6" +sp-core = { version = "2.0.0", default-features = false } +pallet-balances = "2.0.0" tokens = { package = "orml-tokens", path = "../tokens" } clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 diff --git a/currencies/src/mock.rs b/currencies/src/mock.rs index 14f8c79972a14bd43bae4919e02cac1e9876b538..4a98f0fd3274f37710cd47702a9ffe08ee93d275 100644 --- a/currencies/src/mock.rs +++ b/currencies/src/mock.rs @@ -55,7 +55,7 @@ impl frame_system::Trait for Runtime { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = pallet_balances::AccountData<u64>; type OnNewAccount = (); type OnKilledAccount = (); @@ -81,6 +81,7 @@ impl pallet_balances::Trait for Runtime { type Event = TestEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = frame_system::Module<Runtime>; + type MaxLocks = (); type WeightInfo = (); } diff --git a/gradually-update/Cargo.toml b/gradually-update/Cargo.toml index 87ea2d542435aa02f02586aacb1fe8cbda8df328..6a580abefb4f82f6c4287bffa3455d8901bf5ba1 100644 --- a/gradually-update/Cargo.toml +++ b/gradually-update/Cargo.toml @@ -9,12 +9,12 @@ edition = "2018" [dependencies] codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } -frame-support = { version = "2.0.0-rc6", default-features = false } -frame-system = { version = "2.0.0-rc6", default-features = false } -sp-io = { version = "2.0.0-rc6", default-features = false } -sp-std = { version = "2.0.0-rc6", default-features = false } -sp-core = { version = "2.0.0-rc6", default-features = false } -sp-runtime = { version = "2.0.0-rc6", default-features = false } +frame-support = { version = "2.0.0", default-features = false } +frame-system = { version = "2.0.0", default-features = false } +sp-io = { version = "2.0.0", default-features = false } +sp-std = { version = "2.0.0", default-features = false } +sp-core = { version = "2.0.0", default-features = false } +sp-runtime = { version = "2.0.0", default-features = false } [features] default = ["std"] diff --git a/gradually-update/src/mock.rs b/gradually-update/src/mock.rs index 33a46518436c7f4f573d915a8b3a1664f3631551..3e350d14908d01b028d0cc7b33e51e72edd8abb7 100644 --- a/gradually-update/src/mock.rs +++ b/gradually-update/src/mock.rs @@ -53,7 +53,7 @@ impl frame_system::Trait for Runtime { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); diff --git a/gradually-update/src/tests.rs b/gradually-update/src/tests.rs index 7717934873d97f5d5206feb0de6bf4e6d48d4472..db025b252a6af1558a3a5a3c9859f0ef3ec2b94f 100644 --- a/gradually-update/src/tests.rs +++ b/gradually-update/src/tests.rs @@ -141,7 +141,7 @@ fn add_on_finalize_should_work() { per_block: vec![1], }; assert_ok!(GraduallyUpdateModule::gradually_update(Origin::root(), update.clone())); - assert_eq!(storage_get(&update.key), vec![]); + assert_eq!(storage_get(&update.key), Vec::<u8>::new()); GraduallyUpdateModule::on_finalize(10); assert_eq!(storage_get(&update.key), vec![10]); @@ -231,7 +231,7 @@ fn u32_should_work() { per_block: 1u32.encode(), }; assert_ok!(GraduallyUpdateModule::gradually_update(Origin::root(), update.clone())); - assert_eq!(storage_get(&update.key), vec![]); + assert_eq!(storage_get(&update.key), Vec::<u8>::new()); GraduallyUpdateModule::on_finalize(10); assert_eq!(storage_get(&update.key), vec![10, 0, 0, 0]); GraduallyUpdateModule::on_finalize(15); @@ -252,7 +252,7 @@ fn u128_should_work() { per_block: 1u128.encode(), }; assert_ok!(GraduallyUpdateModule::gradually_update(Origin::root(), update.clone())); - assert_eq!(storage_get(&update.key), vec![]); + assert_eq!(storage_get(&update.key), Vec::<u8>::new()); GraduallyUpdateModule::on_finalize(10); assert_eq!( storage_get(&update.key), @@ -285,7 +285,7 @@ fn permill_should_work() { per_block: Permill::from_percent(1).encode(), }; assert_ok!(GraduallyUpdateModule::gradually_update(Origin::root(), update.clone())); - assert_eq!(storage_get(&update.key), vec![]); + assert_eq!(storage_get(&update.key), Vec::<u8>::new()); GraduallyUpdateModule::on_finalize(10); assert_eq!(storage_get(&update.key), vec![160, 134, 1, 0]); GraduallyUpdateModule::on_finalize(15); @@ -306,7 +306,7 @@ fn fixedu128_should_work() { per_block: FixedU128::saturating_from_rational(1, 1).encode(), }; assert_ok!(GraduallyUpdateModule::gradually_update(Origin::root(), update.clone())); - assert_eq!(storage_get(&update.key), vec![]); + assert_eq!(storage_get(&update.key), Vec::<u8>::new()); GraduallyUpdateModule::on_finalize(10); assert_eq!( storage_get(&update.key), diff --git a/oracle/Cargo.toml b/oracle/Cargo.toml index 8436623802535054bc428abc23d5212113c88614..1cdd27f995ea4e84427f9a846d14c00a0b7447bd 100644 --- a/oracle/Cargo.toml +++ b/oracle/Cargo.toml @@ -11,19 +11,19 @@ edition = "2018" serde = { version = "1.0.111", optional = true } codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } -sp-application-crypto = { version = "2.0.0-rc6", default-features = false } -sp-io = { version = "2.0.0-rc6", default-features = false } -sp-runtime = { version = "2.0.0-rc6", default-features = false } -sp-std = { version = "2.0.0-rc6", default-features = false } +sp-application-crypto = { version = "2.0.0", default-features = false } +sp-io = { version = "2.0.0", default-features = false } +sp-runtime = { version = "2.0.0", default-features = false } +sp-std = { version = "2.0.0", default-features = false } -frame-support = { version = "2.0.0-rc6", default-features = false } -frame-system = { version = "2.0.0-rc6", default-features = false } +frame-support = { version = "2.0.0", default-features = false } +frame-system = { version = "2.0.0", default-features = false } orml-traits = { path = "../traits", version = "0.2.1-dev", default-features = false } orml-utilities = { path = "../utilities", version = "0.2.1-dev", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc6", default-features = false } +sp-core = { version = "2.0.0", default-features = false } clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 diff --git a/oracle/rpc/Cargo.toml b/oracle/rpc/Cargo.toml index f960b1f870f7ef7b7fbe3d9f1b4958fc67d1d79b..877c5952316d9cbb42956c31481f9056032b4a33 100644 --- a/oracle/rpc/Cargo.toml +++ b/oracle/rpc/Cargo.toml @@ -9,7 +9,7 @@ codec = { package = "parity-scale-codec", version = "1.3.0" } jsonrpc-core = "14.0.5" jsonrpc-core-client = "14.0.5" jsonrpc-derive = "14.0.5" -sp-runtime = { version = "2.0.0-rc6" } -sp-api = { version = "2.0.0-rc6" } -sp-blockchain = { version = "2.0.0-rc6" } +sp-runtime = { version = "2.0.0" } +sp-api = { version = "2.0.0" } +sp-blockchain = { version = "2.0.0" } orml-oracle-rpc-runtime-api = { path = "runtime-api" } diff --git a/oracle/rpc/runtime-api/Cargo.toml b/oracle/rpc/runtime-api/Cargo.toml index 131ab9fba495230a1c75634654500b14f248d41a..d662817f0e9080fc1a840e95b9793ec243a29faf 100644 --- a/oracle/rpc/runtime-api/Cargo.toml +++ b/oracle/rpc/runtime-api/Cargo.toml @@ -6,8 +6,8 @@ edition = "2018" [dependencies] codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] } -sp-api = { default-features = false, version = "2.0.0-rc6" } -sp-std = { default-features = false, version = "2.0.0-rc6" } +sp-api = { default-features = false, version = "2.0.0" } +sp-std = { default-features = false, version = "2.0.0" } [features] default = ["std"] diff --git a/oracle/src/mock.rs b/oracle/src/mock.rs index 8ee954819d42db4f24b5be5c1967d2d2d1ff394e..0f9c380aaf792cb262a2f2afa2dfff9d70c897de 100644 --- a/oracle/src/mock.rs +++ b/oracle/src/mock.rs @@ -64,7 +64,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); diff --git a/rewards/Cargo.toml b/rewards/Cargo.toml index e218970d8a8f29ddc4319d335b4f5642464065a7..2b94388304235a2d6369611065da87807fc4302f 100644 --- a/rewards/Cargo.toml +++ b/rewards/Cargo.toml @@ -10,15 +10,15 @@ edition = "2018" [dependencies] serde = { version = "1.0.111", optional = true } codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } -sp-runtime = { version = "2.0.0-rc6", default-features = false } -sp-io = { version = "2.0.0-rc6", default-features = false } -sp-std = { version = "2.0.0-rc6", default-features = false } -frame-support = { version = "2.0.0-rc6", default-features = false } -frame-system = { version = "2.0.0-rc6", default-features = false } +sp-runtime = { version = "2.0.0", default-features = false } +sp-io = { version = "2.0.0", default-features = false } +sp-std = { version = "2.0.0", default-features = false } +frame-support = { version = "2.0.0", default-features = false } +frame-system = { version = "2.0.0", default-features = false } orml-traits = { path = "../traits", version = "0.2.1-dev", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc6", default-features = false } +sp-core = { version = "2.0.0", default-features = false } clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 [features] diff --git a/rewards/src/mock.rs b/rewards/src/mock.rs index c71a22dcd6cf591288258b4a2b0a445cc742a9cd..6be5c56921f3905ed2c9db24e14aef363948e1a1 100644 --- a/rewards/src/mock.rs +++ b/rewards/src/mock.rs @@ -54,7 +54,7 @@ impl frame_system::Trait for Runtime { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); diff --git a/tokens/Cargo.toml b/tokens/Cargo.toml index 5d1b6dc78037d3c75ee8d3c4afe153656ef5d2b8..f206ae9f1630a2769a6d085ca17bca153c9c14a8 100644 --- a/tokens/Cargo.toml +++ b/tokens/Cargo.toml @@ -10,19 +10,19 @@ edition = "2018" [dependencies] serde = { version = "1.0.111", optional = true } codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } -sp-runtime = { version = "2.0.0-rc6", default-features = false } -sp-io = { version = "2.0.0-rc6", default-features = false } -sp-std = { version = "2.0.0-rc6", default-features = false } +sp-runtime = { version = "2.0.0", default-features = false } +sp-io = { version = "2.0.0", default-features = false } +sp-std = { version = "2.0.0", default-features = false } -frame-support = { version = "2.0.0-rc6", default-features = false } -frame-system = { version = "2.0.0-rc6", default-features = false } +frame-support = { version = "2.0.0", default-features = false } +frame-system = { version = "2.0.0", default-features = false } orml-traits = { path = "../traits", version = "0.2.1-dev", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc6", default-features = false } -pallet-treasury = { version = "2.0.0-rc6" } -pallet-elections-phragmen = { version = "2.0.0-rc6" } +sp-core = { version = "2.0.0", default-features = false } +pallet-treasury = { version = "2.0.0" } +pallet-elections-phragmen = { version = "2.0.0" } clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index 82ad6c6ee8fe5c0835b6e947d9f35d3f6cadb25f..f84a5c7c3257b3253ce0c8d952ad360f95d617aa 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -843,6 +843,7 @@ where GetCurrencyId: Get<T::CurrencyId>, { type Moment = T::BlockNumber; + type MaxLocks = (); fn set_lock(id: LockIdentifier, who: &T::AccountId, amount: Self::Balance, _reasons: WithdrawReasons) { Module::<T>::set_lock(id, GetCurrencyId::get(), who, amount) diff --git a/tokens/src/mock.rs b/tokens/src/mock.rs index 87ce8a61831af2fb1c1be7ad84286b38762de03d..a215005d068a7e476c6b6d954568cc4ae092a9cd 100644 --- a/tokens/src/mock.rs +++ b/tokens/src/mock.rs @@ -62,7 +62,7 @@ impl frame_system::Trait for Runtime { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); @@ -130,7 +130,7 @@ parameter_types! { pub const TipCountdown: u64 = 1; pub const TipFindersFee: Percent = Percent::from_percent(20); pub const TipReportDepositBase: u64 = 1; - pub const TipReportDepositPerByte: u64 = 1; + pub const DataDepositPerByte: u64 = 1; pub const SpendPeriod: u64 = 2; pub const Burn: Permill = Permill::from_percent(50); pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry"); @@ -146,14 +146,20 @@ impl pallet_treasury::Trait for Runtime { type TipCountdown = TipCountdown; type TipFindersFee = TipFindersFee; type TipReportDepositBase = TipReportDepositBase; - type TipReportDepositPerByte = TipReportDepositPerByte; + type DataDepositPerByte = DataDepositPerByte; type Event = TestEvent; - type ProposalRejection = (); + type OnSlash = (); type ProposalBond = ProposalBond; type ProposalBondMinimum = ProposalBondMinimum; type SpendPeriod = SpendPeriod; type Burn = Burn; type BurnDestination = (); // Just gets burned. + type BountyDepositBase = (); + type BountyDepositPayoutDelay = (); + type BountyUpdatePeriod = (); + type BountyCuratorDeposit = (); + type BountyValueMinimum = (); + type MaximumReasonLength = (); type WeightInfo = (); } @@ -339,7 +345,7 @@ impl ExtBuilder { if self.treasury_genesis { pallet_treasury::GenesisConfig::default() - .assimilate_storage::<Runtime>(&mut t) + .assimilate_storage::<Runtime, _>(&mut t) .unwrap(); pallet_elections_phragmen::GenesisConfig::<Runtime> { diff --git a/traits/Cargo.toml b/traits/Cargo.toml index 425cf00817e27ebeec21ed89b3a240e121b51b19..bac6a2331c110a10545de66e5d1a0b671324c168 100644 --- a/traits/Cargo.toml +++ b/traits/Cargo.toml @@ -10,12 +10,12 @@ edition = "2018" [dependencies] serde = { version = "1.0.111", optional = true } codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } -sp-runtime = { version = "2.0.0-rc6", default-features = false } -sp-io = { version = "2.0.0-rc6", default-features = false } -sp-std = { version = "2.0.0-rc6", default-features = false } +sp-runtime = { version = "2.0.0", default-features = false } +sp-io = { version = "2.0.0", default-features = false } +sp-std = { version = "2.0.0", default-features = false } num-traits = { version = "0.2.11", default-features = false } impl-trait-for-tuples = "0.1.3" -frame-support = { version = "2.0.0-rc6", default-features = false } +frame-support = { version = "2.0.0", default-features = false } [dev-dependencies] clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 diff --git a/utilities/Cargo.toml b/utilities/Cargo.toml index 19758b3035cb880ffa84fbdd9cebbf488bc7836c..61d28f33aca9bc264abbe98864487065f3fd9000 100644 --- a/utilities/Cargo.toml +++ b/utilities/Cargo.toml @@ -10,14 +10,14 @@ edition = "2018" [dependencies] serde = { version = "1.0.111", optional = true } codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } -frame-support = { version = "2.0.0-rc6", default-features = false } -sp-runtime = { version = "2.0.0-rc6", default-features = false } -sp-std = { version = "2.0.0-rc6", default-features = false } -sp-io = { version = "2.0.0-rc6", default-features = false } +frame-support = { version = "2.0.0", default-features = false } +sp-runtime = { version = "2.0.0", default-features = false } +sp-std = { version = "2.0.0", default-features = false } +sp-io = { version = "2.0.0", default-features = false } [dev-dependencies] serde_json = "1.0.53" -frame-system = { version = "2.0.0-rc6" } +frame-system = { version = "2.0.0" } clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 diff --git a/vesting/Cargo.toml b/vesting/Cargo.toml index 991c13c388b0879ae92299a1bc97f57bd0db08d0..a5d137b14aad3616cd39fffff00581b54bb9627c 100644 --- a/vesting/Cargo.toml +++ b/vesting/Cargo.toml @@ -10,16 +10,16 @@ edition = "2018" [dependencies] serde = { version = "1.0.111", optional = true } codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } -sp-runtime = { version = "2.0.0-rc6", default-features = false } -sp-io = { version = "2.0.0-rc6", default-features = false } -sp-std = { version = "2.0.0-rc6", default-features = false } +sp-runtime = { version = "2.0.0", default-features = false } +sp-io = { version = "2.0.0", default-features = false } +sp-std = { version = "2.0.0", default-features = false } -frame-support = { version = "2.0.0-rc6", default-features = false } -frame-system = { version = "2.0.0-rc6", default-features = false } +frame-support = { version = "2.0.0", default-features = false } +frame-system = { version = "2.0.0", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc6", default-features = false } -pallet-balances = "2.0.0-rc6" +sp-core = { version = "2.0.0", default-features = false } +pallet-balances = "2.0.0" clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 diff --git a/vesting/src/mock.rs b/vesting/src/mock.rs index fef0683082ec95069baaa3e534707a80f6eb5da8..55f2ef21972aabaa86558656c94d33f5f98e0137 100644 --- a/vesting/src/mock.rs +++ b/vesting/src/mock.rs @@ -52,7 +52,7 @@ impl frame_system::Trait for Runtime { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = pallet_balances::AccountData<u64>; type OnNewAccount = (); type OnKilledAccount = (); @@ -78,6 +78,7 @@ impl pallet_balances::Trait for Runtime { type Event = TestEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = frame_system::Module<Runtime>; + type MaxLocks = (); type WeightInfo = (); } pub type PalletBalances = pallet_balances::Module<Runtime>;