diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index f34bc4686d..f68ae16202 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -4121,13 +4121,13 @@ dependencies = [ "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "byte-slice-cast 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec-derive 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec-derive 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parity-scale-codec-derive" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -8381,7 +8381,7 @@ dependencies = [ "checksum parity-multihash 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "df3a17dc27848fd99e4f87eb0f8c9baba6ede0a6d555400c850ca45254ef4ce3" "checksum parity-multihash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c70cad855872dd51ce6679e823efb6434061a2c1782a1686438aabf506392cdd" "checksum parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f9f9d99dae413590a5f37e43cd99b94d4e62a244160562899126913ea7108673" -"checksum parity-scale-codec-derive 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "492ac3aa93d6caa5d20e4e3e0b75d08e2dcd9dd8a50d19529548b6fe11b3f295" +"checksum parity-scale-codec-derive 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "34e513ff3e406f3ede6796dcdc83d0b32ffb86668cea1ccf7363118abeb00476" "checksum parity-send-wrapper 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" "checksum parity-util-mem 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "570093f39f786beea92dcc09e45d8aae7841516ac19a50431953ac82a0e8f85c" "checksum parity-wasm 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16ad52817c4d343339b3bc2e26861bd21478eda0b7509acf83505727000512ac" diff --git a/substrate/client/authority-discovery/src/lib.rs b/substrate/client/authority-discovery/src/lib.rs index 6ab2d899a5..d8cb074395 100644 --- a/substrate/client/authority-discovery/src/lib.rs +++ b/substrate/client/authority-discovery/src/lib.rs @@ -693,7 +693,7 @@ mod tests { &self, _: &BlockId, _: ExecutionContext, - _: Option<(Block)>, + _: Option, _: Vec, ) -> std::result::Result, sp_blockchain::Error> { unimplemented!("Not required for testing!") diff --git a/substrate/client/finality-grandpa/src/tests.rs b/substrate/client/finality-grandpa/src/tests.rs index 7b52aad6e3..6b4d8bb681 100644 --- a/substrate/client/finality-grandpa/src/tests.rs +++ b/substrate/client/finality-grandpa/src/tests.rs @@ -225,7 +225,7 @@ impl Core for RuntimeApi { &self, _: &BlockId, _: ExecutionContext, - _: Option<(Block)>, + _: Option, _: Vec, ) -> Result> { unimplemented!("Not required for testing!") diff --git a/substrate/client/src/light/backend.rs b/substrate/client/src/light/backend.rs index f946d91b3c..e6ec2ae2cf 100644 --- a/substrate/client/src/light/backend.rs +++ b/substrate/client/src/light/backend.rs @@ -62,7 +62,7 @@ pub struct ImportOperation { finalized_blocks: Vec>, set_head: Option>, storage_update: Option>, - _phantom: ::std::marker::PhantomData<(S)>, + _phantom: ::std::marker::PhantomData, } /// Either in-memory genesis state, or locally-unavailable state. diff --git a/substrate/frame/support/src/dispatch.rs b/substrate/frame/support/src/dispatch.rs index 6683aaea31..f6f42a28ca 100644 --- a/substrate/frame/support/src/dispatch.rs +++ b/substrate/frame/support/src/dispatch.rs @@ -1186,7 +1186,7 @@ macro_rules! decl_module { { #[doc(hidden)] #[codec(skip)] - __PhantomItem($crate::sp_std::marker::PhantomData<($trait_instance $(, $instance)?)>, $crate::dispatch::Never), + __PhantomItem($crate::sp_std::marker::PhantomData<($trait_instance, $($instance)?)>, $crate::dispatch::Never), $( $generated_variants )* } }; @@ -1224,7 +1224,7 @@ macro_rules! decl_module { pub struct $mod_type< $trait_instance: $trait_name $(, $instance: $instantiable $( = $module_default_instance)?)? - >($crate::sp_std::marker::PhantomData<($trait_instance $(, $instance)?)>) where + >($crate::sp_std::marker::PhantomData<($trait_instance, $( $instance)?)>) where $( $other_where_bounds )*; $crate::decl_module! { @@ -1671,7 +1671,7 @@ macro_rules! __impl_module_constants_metadata { , $const_instance: $const_instantiable )? >($crate::dispatch::marker::PhantomData< - ($const_trait_instance $(, $const_instance)?) + ($const_trait_instance, $( $const_instance)?) >); impl<$const_trait_instance: 'static + $const_trait_name $( , $const_instance: $const_instantiable)? diff --git a/substrate/frame/support/src/error.rs b/substrate/frame/support/src/error.rs index 0120b6da60..5461dfaeb7 100644 --- a/substrate/frame/support/src/error.rs +++ b/substrate/frame/support/src/error.rs @@ -86,7 +86,7 @@ macro_rules! decl_error { pub enum $error<$generic: $trait $(, $inst_generic: $instance)?> { #[doc(hidden)] __Ignore( - $crate::sp_std::marker::PhantomData<($generic $(, $inst_generic)?)>, + $crate::sp_std::marker::PhantomData<($generic, $( $inst_generic)?)>, $crate::dispatch::Never, ), $( diff --git a/substrate/frame/support/test/tests/decl_storage.rs b/substrate/frame/support/test/tests/decl_storage.rs index e12799f479..86d351ad6e 100644 --- a/substrate/frame/support/test/tests/decl_storage.rs +++ b/substrate/frame/support/test/tests/decl_storage.rs @@ -79,7 +79,7 @@ mod tests { COMPLEXTYPE1: ::std::vec::Vec<::Origin>; COMPLEXTYPE2: (Vec)>>, u32); - COMPLEXTYPE3: ([u32;25]); + COMPLEXTYPE3: [u32;25]; } add_extra_genesis { build(|_| {}); @@ -430,7 +430,7 @@ mod tests { StorageEntryMetadata { name: DecodeDifferent::Encode("COMPLEXTYPE3"), modifier: StorageEntryModifier::Default, - ty: StorageEntryType::Plain(DecodeDifferent::Encode("([u32; 25])")), + ty: StorageEntryType::Plain(DecodeDifferent::Encode("[u32; 25]")), default: DecodeDifferent::Encode( DefaultByteGetter(&__GetByteStructCOMPLEXTYPE3(PhantomData::)) ), diff --git a/substrate/primitives/runtime-interface/test/src/lib.rs b/substrate/primitives/runtime-interface/test/src/lib.rs index a791442fc4..fb3d10b023 100644 --- a/substrate/primitives/runtime-interface/test/src/lib.rs +++ b/substrate/primitives/runtime-interface/test/src/lib.rs @@ -15,6 +15,7 @@ // along with Substrate. If not, see . //! Integration tests for runtime interface primitives +#![cfg(test)] use sp_runtime_interface::*; use sp_runtime_interface_test_wasm::{WASM_BINARY, test_api::HostFunctions}; @@ -23,85 +24,85 @@ use sp_wasm_interface::HostFunctions as HostFunctionsT; type TestExternalities = sp_state_machine::TestExternalities; fn call_wasm_method(method: &str) -> TestExternalities { - let mut ext = TestExternalities::default(); - let mut ext_ext = ext.ext(); + let mut ext = TestExternalities::default(); + let mut ext_ext = ext.ext(); - sc_executor::call_in_wasm::< - _, - ( - HF, - sp_io::SubstrateHostFunctions, - sc_executor::deprecated_host_interface::SubstrateExternals - ) - >( - method, - &[], - sc_executor::WasmExecutionMethod::Interpreted, - &mut ext_ext, - &WASM_BINARY[..], - 8, - ).expect(&format!("Executes `{}`", method)); + sc_executor::call_in_wasm::< + _, + ( + HF, + sp_io::SubstrateHostFunctions, + sc_executor::deprecated_host_interface::SubstrateExternals + ) + >( + method, + &[], + sc_executor::WasmExecutionMethod::Interpreted, + &mut ext_ext, + &WASM_BINARY[..], + 8, + ).expect(&format!("Executes `{}`", method)); - ext + ext } #[test] fn test_return_data() { - call_wasm_method::("test_return_data"); + call_wasm_method::("test_return_data"); } #[test] fn test_return_option_data() { - call_wasm_method::("test_return_option_data"); + call_wasm_method::("test_return_option_data"); } #[test] fn test_set_storage() { - let mut ext = call_wasm_method::("test_set_storage"); + let mut ext = call_wasm_method::("test_set_storage"); - let expected = "world"; - assert_eq!(expected.as_bytes(), &ext.ext().storage("hello".as_bytes()).unwrap()[..]); + let expected = "world"; + assert_eq!(expected.as_bytes(), &ext.ext().storage("hello".as_bytes()).unwrap()[..]); } #[test] fn test_return_value_into_mutable_reference() { - call_wasm_method::("test_return_value_into_mutable_reference"); + call_wasm_method::("test_return_value_into_mutable_reference"); } #[test] fn test_get_and_return_array() { - call_wasm_method::("test_get_and_return_array"); + call_wasm_method::("test_get_and_return_array"); } #[test] fn test_array_as_mutable_reference() { - call_wasm_method::("test_array_as_mutable_reference"); + call_wasm_method::("test_array_as_mutable_reference"); } #[test] fn test_return_input_public_key() { - call_wasm_method::("test_return_input_public_key"); + call_wasm_method::("test_return_input_public_key"); } #[test] #[should_panic( - expected = "Other(\"Instantiation: Export ext_test_api_return_input_version_1 not found\")" + expected = "Other(\"Instantiation: Export ext_test_api_return_input_version_1 not found\")" )] fn host_function_not_found() { - call_wasm_method::<()>("test_return_data"); + call_wasm_method::<()>("test_return_data"); } #[test] #[should_panic( - expected = - "FunctionExecution(\"ext_test_api_invalid_utf8_data_version_1\", \ - \"Invalid utf8 data provided\")" + expected = + "FunctionExecution(\"ext_test_api_invalid_utf8_data_version_1\", \ + \"Invalid utf8 data provided\")" )] fn test_invalid_utf8_data_should_return_an_error() { - call_wasm_method::("test_invalid_utf8_data_should_return_an_error"); + call_wasm_method::("test_invalid_utf8_data_should_return_an_error"); } #[test] fn test_overwrite_native_function_implementation() { - call_wasm_method::("test_overwrite_native_function_implementation"); + call_wasm_method::("test_overwrite_native_function_implementation"); } diff --git a/substrate/primitives/runtime/Cargo.toml b/substrate/primitives/runtime/Cargo.toml index 2b3829529d..2574fef4b9 100644 --- a/substrate/primitives/runtime/Cargo.toml +++ b/substrate/primitives/runtime/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] serde = { version = "1.0.101", optional = true, features = ["derive"] } -codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] } sp-core = { version = "2.0.0", default-features = false, path = "../core" } sp-application-crypto = { version = "2.0.0", default-features = false, path = "../application-crypto" } sp-arithmetic = { version = "2.0.0", default-features = false, path = "../arithmetic" }