diff --git a/auction/Cargo.toml b/auction/Cargo.toml index c700bc5a2affef01d7714969d8a9310fbd889b3f..820ea4d4061f997e502c6aacfe1518cc29c03fcf 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-rc5", default-features = false } -sp-io = { version = "2.0.0-rc5", default-features = false } -sp-std = { version = "2.0.0-rc5", 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-rc5", default-features = false } -frame-system = { version = "2.0.0-rc5", default-features = false } +frame-support = { version = "2.0.0-rc6", default-features = false } +frame-system = { version = "2.0.0-rc6", default-features = false } orml-traits = { path = "../traits", version = "0.1.3-dev", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc5", default-features = false } +sp-core = { version = "2.0.0-rc6", default-features = false } clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 diff --git a/authority/Cargo.toml b/authority/Cargo.toml index 8237dc3260c3c8569e96c28c3a207945672e8886..3c99d71bea6e28fa6cb01f3629f359f90247c27a 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-rc5", default-features = false } -sp-io = { version = "2.0.0-rc5", default-features = false } -sp-std = { version = "2.0.0-rc5", 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-rc5", default-features = false } -frame-system = { version = "2.0.0-rc5", default-features = false } +frame-support = { version = "2.0.0-rc6", default-features = false } +frame-system = { version = "2.0.0-rc6", default-features = false } orml-traits = { path = "../traits", version = "0.1.3-dev", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc5", default-features = false } -pallet-scheduler = { version = "2.0.0-rc5" } +sp-core = { version = "2.0.0-rc6", default-features = false } +pallet-scheduler = { version = "2.0.0-rc6" } clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 [features] diff --git a/benchmarking/Cargo.toml b/benchmarking/Cargo.toml index 71e500ac1edf7e546a74b0ff26031fa95140b3cb..98a86a20ff64e5df4396730e0080a76c2a14bbce 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-rc5", default-features = false } -sp-runtime-interface = { version = "2.0.0-rc5", default-features = false } -sp-runtime = { version = "2.0.0-rc5", default-features = false } -sp-std = { version = "2.0.0-rc5", default-features = false } -sp-io = { version = "2.0.0-rc5", default-features = false } -frame-support = { version = "2.0.0-rc5", default-features = false } -frame-system = { version = "2.0.0-rc5", default-features = false } -frame-benchmarking = { version = "2.0.0-rc5", 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 } [features] default = [ "std" ] diff --git a/benchmarking/src/lib.rs b/benchmarking/src/lib.rs index 09d9606c22225dcf2213fdf122b40ee8e3a5d31e..4f6d942b253816a79ecf4fce448b0eec14b0f3c5 100644 --- a/benchmarking/src/lib.rs +++ b/benchmarking/src/lib.rs @@ -3,20 +3,18 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[cfg(feature = "std")] mod tests; -#[cfg(feature = "std")] -pub use frame_benchmarking::Analysis; pub use frame_benchmarking::{ benchmarking, BenchmarkBatch, BenchmarkParameter, BenchmarkResults, Benchmarking, BenchmarkingSetup, - BenchmarkingSetupInstance, }; +#[cfg(feature = "std")] +pub use frame_benchmarking::{Analysis, BenchmarkSelector}; pub use frame_support; pub use paste; #[doc(hidden)] pub use sp_io::storage::root as storage_root; -pub use sp_runtime::traits::{Dispatchable, One, Zero}; +pub use sp_runtime::traits::Zero; /// Construct pallet benchmarks for weighing dispatchables. /// @@ -83,11 +81,6 @@ pub use sp_runtime::traits::{Dispatchable, One, Zero}; /// // The constructed runtime struct, and the pallet to benchmark. /// { MyRuntime, my_pallet } /// -/// // common parameter; just one for this example. -/// // will be `1`, `MAX_LENGTH` or any value inbetween -/// _ { -/// let l in 1 .. MAX_LENGTH => initialize_l(l); -/// } /// /// // first dispatchable: foo; this is a user dispatchable and operates on a `u8` vector of /// // size `l`, which we allow to be initialized as usual. @@ -182,11 +175,12 @@ macro_rules! runtime_benchmarks { $( $rest:tt )* ) => { $crate::benchmarks_iter!( - NO_INSTANCE + { } $runtime $pallet { $( { $common , $common_from , $common_to , $common_instancer } )* } ( ) + ( ) $( $rest )* ); } @@ -205,11 +199,12 @@ macro_rules! runtime_benchmarks_instance { $( $rest:tt )* ) => { $crate::benchmarks_iter!( - $instance + { I } $runtime $pallet { $( { $common , $common_from , $common_to , $common_instancer } )* } ( ) + ( ) $( $rest )* ); } @@ -218,75 +213,79 @@ macro_rules! runtime_benchmarks_instance { #[macro_export] #[doc(hidden)] macro_rules! benchmarks_iter { - // mutation arm: + // detect and extract extra tag: ( - $instance:ident + { $( $instance:ident )? } $runtime:ident $pallet:ident { $( $common:tt )* } - ( $( $names:ident )* ) - $name:ident { $( $code:tt )* }: _ ( $origin:expr $( , $arg:expr )* ) - verify $postcode:block + ( $( $names:tt )* ) + ( $( $names_extra:tt )* ) + #[extra] + $name:ident $( $rest:tt )* ) => { $crate::benchmarks_iter! { - $instance + { $( $instance)? } $runtime $pallet { $( $common )* } ( $( $names )* ) - $name { $( $code )* }: $name ( $origin $( , $arg )* ) - verify $postcode + ( $( $names_extra )* $name ) + $name $( $rest )* } }; - // no instance mutation arm: + // mutation arm: ( - NO_INSTANCE + { $( $instance:ident )? } $runtime:ident $pallet:ident { $( $common:tt )* } - ( $( $names:ident )* ) - $name:ident { $( $code:tt )* }: $dispatch:ident ( $origin:expr $( , $arg:expr )* ) + ( $( $names:tt )* ) // This contains $( $( { $instance } )? $name:ident )* + ( $( $names_extra:tt )* ) + $name:ident { $( $code:tt )* }: _ ( $origin:expr $( , $arg:expr )* ) verify $postcode:block $( $rest:tt )* ) => { $crate::benchmarks_iter! { - NO_INSTANCE + { $( $instance)? } $runtime $pallet { $( $common )* } ( $( $names )* ) - $name { $( $code )* }: { - < - $pallet::Call<$runtime> as $crate::frame_support::traits::UnfilteredDispatchable - >::dispatch_bypass_filter($pallet::Call::<$runtime>::$dispatch($($arg),*), $origin.into())?; - } + ( $( $names_extra )* ) + $name { $( $code )* }: $name ( $origin $( , $arg )* ) verify $postcode $( $rest )* } }; - // instance mutation arm: + // mutation arm: ( - $instance:ident + { $( $instance:ident )? } $runtime:ident $pallet:ident { $( $common:tt )* } - ( $( $names:ident )* ) + ( $( $names:tt )* ) + ( $( $names_extra:tt )* ) $name:ident { $( $code:tt )* }: $dispatch:ident ( $origin:expr $( , $arg:expr )* ) verify $postcode:block $( $rest:tt )* ) => { $crate::benchmarks_iter! { - $instance + { $( $instance)? } $runtime $pallet { $( $common )* } ( $( $names )* ) + ( $( $names_extra )* ) $name { $( $code )* }: { < - $pallet::Call<$runtime, $instance> as $crate::frame_support::traits::UnfilteredDispatchable - >::dispatch_bypass_filter($pallet::Call::<$runtime, $instance>::$dispatch($($arg),*), $origin.into())?; + $pallet::Call<$runtime $(, $instance)? > as $crate::frame_support::traits::UnfilteredDispatchable + > + ::dispatch_bypass_filter( + $pallet::Call::<$runtime $(, $instance)? >::$dispatch($($arg),*), $origin.into() + )?; } verify $postcode $( $rest )* @@ -294,20 +293,21 @@ macro_rules! benchmarks_iter { }; // iteration arm: ( - $instance:ident + { $( $instance:ident )? } $runtime:ident $pallet:ident { $( $common:tt )* } - ( $( $names:ident )* ) + ( $( $names:tt )* ) + ( $( $names_extra:tt )* ) $name:ident { $( $code:tt )* }: $eval:block verify $postcode:block $( $rest:tt )* ) => { $crate::benchmark_backend! { - $instance + { $( $instance)? } + $name $runtime $pallet - $name { $( $common )* } { } { $eval } @@ -316,38 +316,64 @@ macro_rules! benchmarks_iter { } #[cfg(test)] - $crate::impl_benchmark_test!($instance $runtime $pallet $name); + $crate::impl_benchmark_test!( + $runtime + $pallet + { $( $instance)? } + $name + ); $crate::benchmarks_iter!( - $instance + { $( $instance)? } $runtime $pallet { $( $common )* } - ( $( $names )* $name ) + ( $( $names )* { $( $instance )? } $name ) + ( $( $names_extra )* ) $( $rest )* ); }; // iteration-exit arm - ( $instance:ident $runtime:ident $pallet:ident { $( $common:tt )* } ( $( $names:ident )* ) ) => { - $crate::selected_benchmark!( $instance $runtime $pallet $( $names ),* ); - $crate::impl_benchmark!( $instance $runtime $pallet $( $names ),* ); + ( + { $( $instance:ident )? } + $runtime:ident + $pallet:ident + { $( $common:tt )* } + ( $( $names:tt )* ) + ( $( $names_extra:tt )* ) + ) => { + $crate::selected_benchmark!( + $runtime + $pallet + { $( $instance)? } + $( $names )* + ); + $crate::impl_benchmark!( + $runtime + $pallet + { $( $instance)? } + ( $( $names )* ) + ( $( $names_extra ),* ) + ); }; // add verify block to _() format ( - $instance:ident + { $( $instance:ident )? } $runtime:ident $pallet:ident { $( $common:tt )* } - ( $( $names:ident )* ) + ( $( $names:tt )* ) + ( $( $names_extra:tt )* ) $name:ident { $( $code:tt )* }: _ ( $origin:expr $( , $arg:expr )* ) $( $rest:tt )* ) => { $crate::benchmarks_iter! { - $instance + { $( $instance)? } $runtime $pallet { $( $common )* } ( $( $names )* ) + ( $( $names_extra )* ) $name { $( $code )* }: _ ( $origin $( , $arg )* ) verify { } $( $rest )* @@ -355,20 +381,22 @@ macro_rules! benchmarks_iter { }; // add verify block to name() format ( - $instance:ident + { $( $instance:ident )? } $runtime:ident $pallet:ident { $( $common:tt )* } - ( $( $names:ident )* ) + ( $( $names:tt )* ) + ( $( $names_extra:tt )* ) $name:ident { $( $code:tt )* }: $dispatch:ident ( $origin:expr $( , $arg:expr )* ) $( $rest:tt )* ) => { $crate::benchmarks_iter! { - $instance + { $( $instance)? } $runtime $pallet { $( $common )* } ( $( $names )* ) + ( $( $names_extra )* ) $name { $( $code )* }: $dispatch ( $origin $( , $arg )* ) verify { } $( $rest )* @@ -376,20 +404,22 @@ macro_rules! benchmarks_iter { }; // add verify block to {} format ( - $instance:ident + { $( $instance:ident )? } $runtime:ident $pallet:ident { $( $common:tt )* } - ( $( $names:ident )* ) + ( $( $names:tt )* ) + ( $( $names_extra:tt )* ) $name:ident { $( $code:tt )* }: $eval:block $( $rest:tt )* ) => { $crate::benchmarks_iter!( - $instance + { $( $instance)? } $runtime $pallet { $( $common )* } ( $( $names )* ) + ( $( $names_extra )* ) $name { $( $code )* }: $eval verify { } $( $rest )* @@ -401,7 +431,7 @@ macro_rules! benchmarks_iter { #[doc(hidden)] macro_rules! benchmark_backend { // parsing arms - ($instance:ident $runtime:ident $pallet:ident $name:ident { + ( { $( $instance:ident )? } $name:ident $runtime:ident $pallet:ident { $( $common:tt )* } { $( PRE { $( $pre_parsed:tt )* } )* @@ -410,13 +440,13 @@ macro_rules! benchmark_backend { $( $rest:tt )* } $postcode:block) => { $crate::benchmark_backend! { - $instance $runtime $pallet $name { $( $common )* } { + { $( $instance)? } $name $runtime $pallet { $( $common )* } { $( PRE { $( $pre_parsed )* } )* PRE { $pre_id , $pre_ty , $pre_ex } } { $eval } { $( $rest )* } $postcode } }; - ($instance:ident $runtime:ident $pallet:ident $name:ident { + ( { $( $instance:ident )? } $name:ident $runtime:ident $pallet:ident { $( $common:tt )* } { $( $parsed:tt )* @@ -425,14 +455,14 @@ macro_rules! benchmark_backend { $( $rest:tt )* } $postcode:block) => { $crate::benchmark_backend! { - $instance $runtime $pallet $name { $( $common )* } { + { $( $instance)? } $name $runtime $pallet { $( $common )* } { $( $parsed )* PARAM { $param , $param_from , $param_to , $param_instancer } } { $eval } { $( $rest )* } $postcode } }; // mutation arm to look after defaulting to a common param - ($instance:ident $runtime:ident $pallet:ident $name:ident { + ( { $( $instance:ident )? } $name:ident $runtime:ident $pallet:ident { $( { $common:ident , $common_from:tt , $common_to:expr , $common_instancer:expr } )* } { $( $parsed:tt )* @@ -441,7 +471,7 @@ macro_rules! benchmark_backend { $( $rest:tt )* } $postcode:block) => { $crate::benchmark_backend! { - $instance $runtime $pallet $name { + { $( $instance)? } $name $runtime $pallet { $( { $common , $common_from , $common_to , $common_instancer } )* } { $( $parsed )* @@ -455,7 +485,7 @@ macro_rules! benchmark_backend { } }; // mutation arm to look after defaulting only the range to common param - ($instance:ident $runtime:ident $pallet:ident $name:ident { + ( { $( $instance:ident )? } $name:ident $runtime:ident $pallet:ident { $( { $common:ident , $common_from:tt , $common_to:expr , $common_instancer:expr } )* } { $( $parsed:tt )* @@ -464,7 +494,7 @@ macro_rules! benchmark_backend { $( $rest:tt )* } $postcode:block) => { $crate::benchmark_backend! { - $instance $runtime $pallet $name { + { $( $instance)? } $name $runtime $pallet { $( { $common , $common_from , $common_to , $common_instancer } )* } { $( $parsed )* @@ -478,7 +508,7 @@ macro_rules! benchmark_backend { } }; // mutation arm to look after a single tt for param_from. - ($instance:ident $runtime:ident $pallet:ident $name:ident { + ( { $( $instance:ident )? } $name:ident $runtime:ident $pallet:ident { $( $common:tt )* } { $( $parsed:tt )* @@ -487,14 +517,15 @@ macro_rules! benchmark_backend { $( $rest:tt )* } $postcode:block) => { $crate::benchmark_backend! { - $instance $runtime $pallet $name { $( $common )* } { $( $parsed )* } { $eval } { + { $( $instance)? } + $name $runtime $pallet { $( $common )* } { $( $parsed )* } { $eval } { let $param in ( $param_from ) .. $param_to => $param_instancer; $( $rest )* } $postcode } }; // mutation arm to look after the default tail of `=> ()` - ($instance:ident $runtime:ident $pallet:ident $name:ident { + ( { $( $instance:ident )? } $name:ident $runtime:ident $pallet:ident { $( $common:tt )* } { $( $parsed:tt )* @@ -503,14 +534,15 @@ macro_rules! benchmark_backend { $( $rest:tt )* } $postcode:block) => { $crate::benchmark_backend! { - $instance $runtime $pallet $name { $( $common )* } { $( $parsed )* } { $eval } { + { $( $instance)? } + $name $runtime $pallet { $( $common )* } { $( $parsed )* } { $eval } { let $param in $param_from .. $param_to => (); $( $rest )* } $postcode } }; // mutation arm to look after `let _ =` - ($instance:ident $runtime:ident $pallet:ident $name:ident { + ( { $( $instance:ident )? } $name:ident $runtime:ident $pallet:ident { $( $common:tt )* } { $( $parsed:tt )* @@ -519,14 +551,15 @@ macro_rules! benchmark_backend { $( $rest:tt )* } $postcode:block) => { $crate::benchmark_backend! { - $instance $runtime $pallet $name { $( $common )* } { $( $parsed )* } { $eval } { + { $( $instance)? } + $name $runtime $pallet { $( $common )* } { $( $parsed )* } { $eval } { let $pre_id : _ = $pre_ex; $( $rest )* } $postcode } }; - // no instance actioning arm - (NO_INSTANCE $runtime:ident $pallet:ident $name:ident { + // actioning arm + ( { $( $instance:ident )? } $name:ident $runtime:ident $pallet:ident { $( { $common:ident , $common_from:tt , $common_to:expr , $common_instancer:expr } )* } { $( PRE { $pre_id:tt , $pre_ty:ty , $pre_ex:expr } )* @@ -535,7 +568,7 @@ macro_rules! benchmark_backend { #[allow(non_camel_case_types)] struct $name; #[allow(unused_variables)] - impl $crate::BenchmarkingSetup<$runtime> for $name { + impl<$( <$instance>, I: Instance)? > $crate::BenchmarkingSetup<$runtime $(, $instance)?> for $name { fn components(&self) -> Vec<($crate::BenchmarkParameter, u32, u32)> { vec! [ $( @@ -587,68 +620,6 @@ macro_rules! benchmark_backend { } } }; - // instance actioning arm - ($instance:ident $runtime:ident $pallet:ident $name:ident { - $( { $common:ident , $common_from:tt , $common_to:expr , $common_instancer:expr } )* - } { - $( PRE { $pre_id:tt , $pre_ty:ty , $pre_ex:expr } )* - $( PARAM { $param:ident , $param_from:expr , $param_to:expr , $param_instancer:expr } )* - } { $eval:block } { $( $post:tt )* } $postcode:block) => { - #[allow(non_camel_case_types)] - struct $name; - #[allow(unused_variables)] - impl $crate::BenchmarkingSetupInstance<$runtime, $instance> for $name { - fn components(&self) -> Vec<($crate::BenchmarkParameter, u32, u32)> { - vec! [ - $( - ($crate::BenchmarkParameter::$param, $param_from, $param_to) - ),* - ] - } - - fn instance(&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; 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(()) })) - } - } - } } // Creates a `SelectedBenchmark` enum implementing `BenchmarkingSetup`. @@ -663,13 +634,15 @@ macro_rules! benchmark_backend { // struct SetBalance; // impl BenchmarkingSetup for SetBalance { ... } // -// selected_benchmark!(Transfer, SetBalance); +// selected_benchmark!({} Transfer {} SetBalance); // ``` #[macro_export] #[doc(hidden)] macro_rules! selected_benchmark { ( - NO_INSTANCE $runtime:ident $pallet:ident $( $bench:ident ),* + $runtime:ident $pallet:ident + { $( $instance:ident )? } + $( { $( $bench_inst:ident )? } $bench:ident )* ) => { // The list of available benchmarks for this pallet. #[allow(non_camel_case_types)] @@ -678,10 +651,14 @@ macro_rules! selected_benchmark { } // Allow us to select a benchmark from the list of available benchmarks. - impl $crate::BenchmarkingSetup<$runtime> for SelectedBenchmark { + impl<$( <$instance>, I: Instance)? > $crate::BenchmarkingSetup<$runtime $(, $instance)?> for SelectedBenchmark { fn components(&self) -> Vec<($crate::BenchmarkParameter, u32, u32)> { match self { - $( Self::$bench => <$bench as $crate::BenchmarkingSetup<$runtime>>::components(&$bench), )* + $( + Self::$bench => < + $bench as $crate::BenchmarkingSetup<$runtime $(, $bench_inst)? > + >::components(&$bench), + )* } } @@ -689,7 +666,11 @@ macro_rules! selected_benchmark { -> Result<Box<dyn FnOnce() -> Result<(), &'static str>>, &'static str> { match self { - $( Self::$bench => <$bench as $crate::BenchmarkingSetup<$runtime>>::instance(&$bench, components), )* + $( + Self::$bench => < + $bench as $crate::BenchmarkingSetup<$runtime $(, $bench_inst)? > + >::instance(&$bench, components), + )* } } @@ -697,200 +678,38 @@ macro_rules! selected_benchmark { -> Result<Box<dyn FnOnce() -> Result<(), &'static str>>, &'static str> { match self { - $( Self::$bench => <$bench as $crate::BenchmarkingSetup<$runtime>>::verify(&$bench, components), )* + $( + Self::$bench => < + $bench as $crate::BenchmarkingSetup<$runtime $(, $bench_inst)? > + >::verify(&$bench, components), + )* } } } }; - ( - $instance:ident $runtime:ident $pallet:ident $( $bench:ident ),* - ) => { - // The list of available benchmarks for this pallet. - #[allow(non_camel_case_types)] - enum SelectedBenchmark { - $( $bench, )* - } - - // Allow us to select a benchmark from the list of available benchmarks. - impl $crate::BenchmarkingSetupInstance<$runtime, $instance> for SelectedBenchmark { - fn components(&self) -> Vec<($crate::BenchmarkParameter, u32, u32)> { - match self { - $( Self::$bench => <$bench as $crate::BenchmarkingSetupInstance<$runtime, $instance>>::components(&$bench), )* - } - } - - fn instance(&self, components: &[($crate::BenchmarkParameter, u32)]) - -> Result<Box<dyn FnOnce() -> Result<(), &'static str>>, &'static str> - { - match self { - $( Self::$bench => <$bench as $crate::BenchmarkingSetupInstance<$runtime, $instance>>::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::BenchmarkingSetupInstance<$runtime, $instance>>::verify(&$bench, components), )* - } - } - } - } } #[macro_export] #[doc(hidden)] macro_rules! impl_benchmark { ( - NO_INSTANCE $runtime:ident $pallet:ident $( $name:ident ),* + $runtime:ident $pallet:ident + { $( $instance:ident )? } + ( $( { $( $name_inst:ident )? } $name:ident )* ) + ( $( $name_extra:ident ),* ) ) => { #[cfg(feature="runtime-benchmarks")] pub struct Benchmark; #[cfg(feature="runtime-benchmarks")] impl $crate::Benchmarking<$crate::BenchmarkResults> for Benchmark { - fn benchmarks() -> Vec<&'static [u8]> { - vec![ $( stringify!($name).as_ref() ),* ] - } - - fn run_benchmark( - extrinsic: &[u8], - lowest_range_values: &[u32], - highest_range_values: &[u32], - steps: &[u32], - repeat: u32, - whitelist: &[Vec<u8>] - ) -> Result<Vec<$crate::BenchmarkResults>, &'static str> { - // Map the input to the selected benchmark. - let extrinsic = sp_std::str::from_utf8(extrinsic) - .map_err(|_| "`extrinsic` is not a valid utf8 string!")?; - let selected_benchmark = match extrinsic { - $( stringify!($name) => SelectedBenchmark::$name, )* - _ => return Err("Could not find extrinsic."), - }; - - $crate::benchmarking::set_whitelist(whitelist.to_vec()); - - // Warm up the DB - $crate::benchmarking::commit_db(); - $crate::benchmarking::wipe_db(); - - let components = <SelectedBenchmark as $crate::BenchmarkingSetup<$runtime>>::components(&selected_benchmark); - let mut results: Vec<$crate::BenchmarkResults> = Vec::new(); - - // Default number of steps for a component. - let mut prev_steps = 10; - - // Select the component we will be benchmarking. Each component will be benchmarked. - for (idx, (name, low, high)) in components.iter().enumerate() { - // Get the number of steps for this component. - let steps = steps.get(idx).cloned().unwrap_or(prev_steps); - prev_steps = steps; - - // Skip this loop if steps is zero - if steps == 0 { continue } - - let lowest = lowest_range_values.get(idx).cloned().unwrap_or(*low); - let highest = highest_range_values.get(idx).cloned().unwrap_or(*high); - - let diff = highest - lowest; - - // Create up to `STEPS` steps for that component between high and low. - let step_size = (diff / steps).max(1); - let num_of_steps = diff / step_size + 1; - - for s in 0..num_of_steps { - // This is the value we will be testing for component `name` - let component_value = lowest + step_size * s; - - // Select the max value for all the other components. - let c: Vec<($crate::BenchmarkParameter, u32)> = components.iter() - .enumerate() - .map(|(idx, (n, _, h))| - if n == name { - (*n, component_value) - } else { - (*n, *highest_range_values.get(idx).unwrap_or(h)) - } - ) - .collect(); - - // Run the benchmark `repeat` times. - for _ in 0..repeat { - // Set up the externalities environment for the setup we want to - // benchmark. - let closure_to_benchmark = < - SelectedBenchmark as $crate::BenchmarkingSetup<$runtime> - >::instance(&selected_benchmark, &c)?; - - // 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()); - } - - // Commit the externalities to the database, flushing the DB cache. - // This will enable worst case scenario for reading from the database. - $crate::benchmarking::commit_db(); - - $crate::benchmarking::reset_read_write_count(); - - // Time the extrinsic logic. - frame_support::debug::trace!( - target: "benchmark", - "Start Benchmark: {:?} {:?}", name, component_value - ); - - let start_extrinsic = $crate::benchmarking::current_time(); - closure_to_benchmark()?; - let finish_extrinsic = $crate::benchmarking::current_time(); - let elapsed_extrinsic = finish_extrinsic - start_extrinsic; - - $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, - }); - - // Wipe the DB back to the genesis state. - $crate::benchmarking::wipe_db(); - } - } + fn benchmarks(extra: bool) -> Vec<&'static [u8]> { + let mut all = vec![ $( stringify!($name).as_ref() ),* ]; + if !extra { + let extra = [ $( stringify!($name_extra).as_ref() ),* ]; + all.retain(|x| !extra.contains(x)); } - return Ok(results); - } - } - }; - ( - $instance:ident $runtime:ident $pallet:ident $( $name:ident ),* - ) => { - #[cfg(feature="runtime-benchmarks")] - pub struct Benchmark; - - #[cfg(feature="runtime-benchmarks")] - impl $crate::Benchmarking<$crate::BenchmarkResults> for Benchmark { - fn benchmarks() -> Vec<&'static [u8]> { - vec![ $( stringify!($name).as_ref() ),* ] + all } fn run_benchmark( @@ -909,6 +728,7 @@ macro_rules! impl_benchmark { _ => return Err("Could not find extrinsic."), }; + // Add whitelist to DB $crate::benchmarking::set_whitelist(whitelist.to_vec()); // Warm up the DB @@ -916,112 +736,128 @@ macro_rules! impl_benchmark { $crate::benchmarking::wipe_db(); let components = < - SelectedBenchmark as $crate::BenchmarkingSetupInstance<$runtime, $instance> + 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; - // Select the component we will be benchmarking. Each component will be benchmarked. - for (idx, (name, low, high)) in components.iter().enumerate() { - // Get the number of steps for this component. - let steps = steps.get(idx).cloned().unwrap_or(prev_steps); - prev_steps = steps; - - // Skip this loop if steps is zero - if steps == 0 { continue } - - let lowest = lowest_range_values.get(idx).cloned().unwrap_or(*low); - let highest = highest_range_values.get(idx).cloned().unwrap_or(*high); - - let diff = highest - lowest; - - // Create up to `STEPS` steps for that component between high and low. - let step_size = (diff / steps).max(1); - let num_of_steps = diff / step_size + 1; - - for s in 0..num_of_steps { - // This is the value we will be testing for component `name` - let component_value = lowest + step_size * s; - - // Select the max value for all the other components. - let c: Vec<($crate::BenchmarkParameter, u32)> = components.iter() - .enumerate() - .map(|(idx, (n, _, h))| - if n == name { - (*n, component_value) - } else { - (*n, *highest_range_values.get(idx).unwrap_or(h)) - } - ) - .collect(); - - // Run the benchmark `repeat` times. - for _ in 0..repeat { - // Set up the externalities environment for the setup we want to benchmark. - let closure_to_benchmark = < - SelectedBenchmark as $crate::BenchmarkingSetupInstance<$runtime, $instance> - >::instance(&selected_benchmark, &c)?; - - // 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($crate::One::one()); - } - - // Commit the externalities to the database, flushing the DB cache. - // This will enable worst case scenario for reading from the database. - $crate::benchmarking::commit_db(); - - // 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: {:?} {:?}", name, component_value - ); - let start_extrinsic = $crate::benchmarking::current_time(); - closure_to_benchmark()?; - let finish_extrinsic = $crate::benchmarking::current_time(); - let elapsed_extrinsic = finish_extrinsic - start_extrinsic; + let repeat_benchmark = | + repeat: u32, + c: Vec<($crate::BenchmarkParameter, u32)>, + results: &mut Vec<$crate::BenchmarkResults>, + | -> Result<(), &'static str> { + // Run the benchmark `repeat` times. + for _ in 0..repeat { + // Set up the externalities environment for the setup we want to + // benchmark. + let closure_to_benchmark = < + SelectedBenchmark as $crate::BenchmarkingSetup<$runtime $(, $instance)?> + >::instance(&selected_benchmark, &c)?; - $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 - ); + // Set the block number to at least 1 so events are deposited. + if $crate::Zero::is_zero(&frame_system::Module::<T>::block_number()) { + frame_system::Module::<T>::set_block_number(1u8.into()); + } - // 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; + // Commit the externalities to the database, flushing the DB cache. + // This will enable worst case scenario for reading from the database. + $crate::benchmarking::commit_db(); + + // 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, + }); + + // Wipe the DB back to the genesis state. + $crate::benchmarking::wipe_db(); + } - 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, - }); + Ok(()) + }; - // Wipe the DB back to the genesis state. - $crate::benchmarking::wipe_db(); + if components.is_empty() { + repeat_benchmark(repeat, Default::default(), &mut results)?; + } else { + // Select the component we will be benchmarking. Each component will be benchmarked. + for (idx, (name, low, high)) in components.iter().enumerate() { + // Get the number of steps for this component. + let steps = steps.get(idx).cloned().unwrap_or(prev_steps); + prev_steps = steps; + + // Skip this loop if steps is zero + if steps == 0 { continue } + + let lowest = lowest_range_values.get(idx).cloned().unwrap_or(*low); + let highest = highest_range_values.get(idx).cloned().unwrap_or(*high); + + let diff = highest - lowest; + + // Create up to `STEPS` steps for that component between high and low. + let step_size = (diff / steps).max(1); + let num_of_steps = diff / step_size + 1; + + for s in 0..num_of_steps { + // This is the value we will be testing for component `name` + let component_value = lowest + step_size * s; + + // Select the max value for all the other components. + let c: Vec<($crate::BenchmarkParameter, u32)> = components.iter() + .enumerate() + .map(|(idx, (n, _, h))| + if n == name { + (*n, component_value) + } else { + (*n, *highest_range_values.get(idx).unwrap_or(h)) + } + ) + .collect(); + + repeat_benchmark(repeat, c, &mut results)?; } } } return Ok(results); } } - } + }; } // This creates a unit test for one benchmark of the main benchmark macro. @@ -1031,9 +867,8 @@ macro_rules! impl_benchmark { #[doc(hidden)] macro_rules! impl_benchmark_test { ( - NO_INSTANCE - $runtime:ident - $pallet:ident + $runtime:ident $pallet:ident + { $( $instance:ident )? } $name:ident ) => { $crate::paste::item! { @@ -1041,93 +876,51 @@ macro_rules! impl_benchmark_test { { let selected_benchmark = SelectedBenchmark::$name; let components = < - SelectedBenchmark as $crate::BenchmarkingSetup<$runtime> + SelectedBenchmark as $crate::BenchmarkingSetup<$runtime, _> >::components(&selected_benchmark); - // assert!( - // components.len() != 0, - // "You need to add components to your benchmark!", - // ); - for (_, (name, low, high)) in components.iter().enumerate() { - // Test only the low and high value, assuming values in the middle won't break - for component_value in vec![low, high] { - // Select the max value for all the other components. - let c: Vec<($crate::BenchmarkParameter, u32)> = components.iter() - .enumerate() - .map(|(_, (n, _, h))| - if n == name { - (*n, *component_value) - } else { - (*n, *h) - } - ) - .collect(); - - // Set up the verification state - let closure_to_verify = < - SelectedBenchmark as $crate::BenchmarkingSetup<$runtime> - >::verify(&selected_benchmark, &c)?; - - // 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($crate::One::one()); - } - - // Run verification - closure_to_verify()?; - - // Reset the state - $crate::benchmarking::wipe_db(); + let execute_benchmark = | + c: Vec<($crate::BenchmarkParameter, u32)> + | -> Result<(), &'static str> { + // Set up the verification state + let closure_to_verify = < + SelectedBenchmark as $crate::BenchmarkingSetup<$runtime, _> + >::verify(&selected_benchmark, &c)?; + + // 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()); } - } - Ok(()) - } - } - }; - ( - $instance:ident - $runtime:ident - $pallet:ident - $name:ident - ) => { - $crate::paste::item! { - fn [<test_benchmark_ $name>] () -> Result<(), &'static str> - { - let selected_benchmark = SelectedBenchmark::$name; - let components = < - SelectedBenchmark as $crate::BenchmarkingSetupInstance<$runtime, $instance> - >::components(&selected_benchmark); - for (_, (name, low, high)) in components.iter().enumerate() { - // Test only the low and high value, assuming values in the middle won't break - for component_value in vec![low, high] { - // Select the max value for all the other components. - let c: Vec<($crate::BenchmarkParameter, u32)> = components.iter() - .enumerate() - .map(|(_, (n, _, h))| - if n == name { - (*n, *component_value) - } else { - (*n, *h) - } - ) - .collect(); + // Run verification + closure_to_verify()?; - // Set up the verification state - let closure_to_verify = < - SelectedBenchmark as $crate::BenchmarkingSetupInstance<$runtime, $instance> - >::verify(&selected_benchmark, &c)?; - - // 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($crate::One::one()); - } + // Reset the state + $crate::benchmarking::wipe_db(); - // Run verification - closure_to_verify()?; + Ok(()) + }; - // Reset the state - $crate::benchmarking::wipe_db(); + if components.is_empty() { + execute_benchmark(Default::default())?; + } else { + for (_, (name, low, high)) in components.iter().enumerate() { + // Test only the low and high value, assuming values in the middle won't break + for component_value in vec![low, high] { + // Select the max value for all the other components. + let c: Vec<($crate::BenchmarkParameter, u32)> = components.iter() + .enumerate() + .map(|(_, (n, _, h))| + if n == name { + (*n, *component_value) + } else { + (*n, *h) + } + ) + .collect(); + + execute_benchmark(c)?; + } } } Ok(()) @@ -1141,33 +934,47 @@ 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); +/// let params = (&pallet, &benchmark, &lowest_range_values, &highest_range_values, &steps, repeat, &whitelist); /// ``` /// -/// Then define a mutable local variable to hold your `BenchmarkBatch` object: +/// The `whitelist` is a `Vec<Vec<u8>>` of storage keys that you would like to +/// skip for DB tracking. For example: +/// +/// ```ignore +/// let whitelist: Vec<Vec<u8>> = vec![ +/// // Block Number +/// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec(), +/// // Total Issuance +/// hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec(), +/// // Execution Phase +/// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec(), +/// // Event Count +/// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec(), +/// ]; /// +/// Then define a mutable local variable to hold your `BenchmarkBatch` object: /// ```ignore /// let mut batches = Vec::<BenchmarkBatch>::new(); /// ```` -/// -/// Then add the pallets you want to benchmark to this object, including the -/// string you want to use target a particular pallet: -/// +/// +/// Then add the pallets you want to benchmark to this object, using their crate name and generated +/// module struct: /// ```ignore -/// add_benchmark!(params, batches, b"balances", Balances); -/// add_benchmark!(params, batches, b"identity", Identity); -/// add_benchmark!(params, batches, b"session", SessionBench::<Runtime>); +/// add_benchmark!(params, batches, pallet_balances, Balances); +/// add_benchmark!(params, batches, pallet_session, SessionBench::<Runtime>); +/// add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>); /// ... /// ``` -/// +/// /// At the end of `dispatch_benchmark`, you should return this batches object. #[macro_export] macro_rules! add_benchmark { - ( $params:ident, $batches:ident, $name:literal, $( $location:tt )* ) => ( - let (pallet, benchmark, lowest_range_values, highest_range_values, steps, repeat, whitelist) = $params; - if &pallet[..] == &$name[..] || &pallet[..] == &b"*"[..] { + ( $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; + if &pallet[..] == &name_string[..] || &pallet[..] == &b"*"[..] { if &pallet[..] == &b"*"[..] || &benchmark[..] == &b"*"[..] { - for benchmark in $( $location )*::Benchmark::benchmarks().into_iter() { + for benchmark in $( $location )*::Benchmark::benchmarks(extra).into_iter() { $batches.push($crate::BenchmarkBatch { results: $( $location )*::Benchmark::run_benchmark( benchmark, @@ -1177,7 +984,7 @@ macro_rules! add_benchmark { repeat, whitelist, )?, - pallet: $name.to_vec(), + pallet: name_string.to_vec(), benchmark: benchmark.to_vec(), }); } @@ -1191,7 +998,7 @@ macro_rules! add_benchmark { repeat, whitelist, )?, - pallet: $name.to_vec(), + pallet: name_string.to_vec(), benchmark: benchmark.clone(), }); } diff --git a/currencies/Cargo.toml b/currencies/Cargo.toml index 040cf08dd3c9ffdfd2517ede2f3f912a09cf06ab..43c95db98b8925b2b1ec22fbfe93d4c1e703c18e 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-rc5", default-features = false } -sp-io = { version = "2.0.0-rc5", default-features = false } -sp-std = { version = "2.0.0-rc5", 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-rc5", default-features = false } -frame-system = { version = "2.0.0-rc5", default-features = false } +frame-support = { version = "2.0.0-rc6", default-features = false } +frame-system = { version = "2.0.0-rc6", default-features = false } orml-traits = { path = "../traits", version = "0.1.3-dev", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc5", default-features = false } -pallet-balances = "2.0.0-rc5" +sp-core = { version = "2.0.0-rc6", default-features = false } +pallet-balances = "2.0.0-rc6" 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/gradually-update/Cargo.toml b/gradually-update/Cargo.toml index 01378490f101f222462d43710d0319d3337d7423..ed904c86db3197a4503f05cedc742e2c406da4a1 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-rc5", default-features = false } -frame-system = { version = "2.0.0-rc5", default-features = false } -sp-io = { version = "2.0.0-rc5", default-features = false } -sp-std = { version = "2.0.0-rc5", default-features = false } -sp-core = { version = "2.0.0-rc5", default-features = false } -sp-runtime = { version = "2.0.0-rc5", 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 } [features] default = ["std"] diff --git a/oracle/Cargo.toml b/oracle/Cargo.toml index 8bc40a19237f3717b07c20e61ee80538a4371c09..c1328d54165116a53efed359139eb93ae4a60da4 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-rc5", default-features = false } -sp-io = { version = "2.0.0-rc5", default-features = false } -sp-runtime = { version = "2.0.0-rc5", default-features = false } -sp-std = { version = "2.0.0-rc5", 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 } -frame-support = { version = "2.0.0-rc5", default-features = false } -frame-system = { version = "2.0.0-rc5", default-features = false } +frame-support = { version = "2.0.0-rc6", default-features = false } +frame-system = { version = "2.0.0-rc6", default-features = false } orml-traits = { path = "../traits", version = "0.1.3-dev", default-features = false } orml-utilities = { path = "../utilities", version = "0.1.3-dev", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc5", default-features = false } +sp-core = { version = "2.0.0-rc6", 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 5a4c644215b5e22628aaccd2f4a1183bef488c41..b745f2b4640131fcaecec2f6e2b000dea53b5329 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-rc5" } -sp-api = { version = "2.0.0-rc5" } -sp-blockchain = { version = "2.0.0-rc5" } +sp-runtime = { version = "2.0.0-rc6" } +sp-api = { version = "2.0.0-rc6" } +sp-blockchain = { version = "2.0.0-rc6" } 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 6fb8e44a3c8a7cbfdb2ae570684259f2ee8ac39e..b81c91c5f57999b6f7d297031c73ad2e85f9f6ed 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-rc5" } -sp-std = { default-features = false, version = "2.0.0-rc5" } +sp-api = { default-features = false, version = "2.0.0-rc6" } +sp-std = { default-features = false, version = "2.0.0-rc6" } [features] default = ["std"] diff --git a/tokens/Cargo.toml b/tokens/Cargo.toml index 98e107724360b7cb368619e7808992f888b0e3cd..34a7e13c49acddef5c95ffc543ec45dd1bbe93be 100644 --- a/tokens/Cargo.toml +++ b/tokens/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-rc5", default-features = false } -sp-io = { version = "2.0.0-rc5", default-features = false } -sp-std = { version = "2.0.0-rc5", 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-rc5", default-features = false } -frame-system = { version = "2.0.0-rc5", default-features = false } +frame-support = { version = "2.0.0-rc6", default-features = false } +frame-system = { version = "2.0.0-rc6", default-features = false } orml-traits = { path = "../traits", version = "0.1.3-dev", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc5", default-features = false } +sp-core = { version = "2.0.0-rc6", default-features = false } clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179 diff --git a/traits/Cargo.toml b/traits/Cargo.toml index b20c75bfe482803d5c2e796a11755180b2669916..0f7b2c5207ee9eee53d54392ee439021a81d3296 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-rc5", default-features = false } -sp-io = { version = "2.0.0-rc5", default-features = false } -sp-std = { version = "2.0.0-rc5", 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 } num-traits = { version = "0.2.11", default-features = false } impl-trait-for-tuples = "0.1.3" -frame-support = { version = "2.0.0-rc5", default-features = false } +frame-support = { version = "2.0.0-rc6", 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 50103412203f115ff0dd759a081aff937bca17e4..acd04b3fdde55e8351456c87c50a74857b28c569 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-rc5", default-features = false } -sp-runtime = { version = "2.0.0-rc5", default-features = false } -sp-std = { version = "2.0.0-rc5", 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 } [dev-dependencies] serde_json = "1.0.53" -frame-system = { version = "2.0.0-rc5" } -sp-io = { version = "2.0.0-rc5" } +frame-system = { version = "2.0.0-rc6" } +sp-io = { version = "2.0.0-rc6" } 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 10210be2473b413f96f1bed6208ebcc8990168dc..9c73227a7bae700d6c7813b7f4b63e9ae8663d17 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-rc5", default-features = false } -sp-io = { version = "2.0.0-rc5", default-features = false } -sp-std = { version = "2.0.0-rc5", 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-rc5", default-features = false } -frame-system = { version = "2.0.0-rc5", default-features = false } +frame-support = { version = "2.0.0-rc6", default-features = false } +frame-system = { version = "2.0.0-rc6", default-features = false } [dev-dependencies] -sp-core = { version = "2.0.0-rc5", default-features = false } -pallet-balances = "2.0.0-rc5" +sp-core = { version = "2.0.0-rc6", default-features = false } +pallet-balances = "2.0.0-rc6" clear_on_drop = { version = "0.2.4", features = ["no_cc"] } # https://github.com/paritytech/substrate/issues/4179