diff --git a/substrate/frame/support/Cargo.toml b/substrate/frame/support/Cargo.toml index 7b1179122b..173e3da279 100644 --- a/substrate/frame/support/Cargo.toml +++ b/substrate/frame/support/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] serde = { version = "1.0.101", optional = true, features = ["derive"] } -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.1.0", default-features = false, features = ["derive"] } frame-metadata = { version = "13.0.0", default-features = false, path = "../metadata" } sp-std = { version = "3.0.0", default-features = false, path = "../../primitives/std" } sp-io = { version = "3.0.0", default-features = false, path = "../../primitives/io" } diff --git a/substrate/frame/support/procedural/src/pallet/expand/call.rs b/substrate/frame/support/procedural/src/pallet/expand/call.rs index 301d3fc5d9..bd7676c49a 100644 --- a/substrate/frame/support/procedural/src/pallet/expand/call.rs +++ b/substrate/frame/support/procedural/src/pallet/expand/call.rs @@ -89,6 +89,8 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream { #frame_support::codec::Encode, #frame_support::codec::Decode, )] + #[codec(encode_bound())] + #[codec(decode_bound())] #[allow(non_camel_case_types)] pub enum #call_ident<#type_decl_bounded_gen> #where_clause { #[doc(hidden)] diff --git a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.stderr b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.stderr index 86968221cf..e3e94f1fc3 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.stderr @@ -1,24 +1,28 @@ -error[E0277]: the trait bound `pallet::Call: Decode` is not satisfied - --> $DIR/call_argument_invalid_bound_2.rs:17:12 - | -17 | #[pallet::call] - | ^^^^ the trait `Decode` is not implemented for `pallet::Call` - | - ::: $WORKSPACE/frame/support/src/dispatch.rs - | - | type Call: UnfilteredDispatchable + Codec + Clone + PartialEq + Eq; - | ----- required by this bound in `frame_support::Callable::Call` +error[E0277]: the trait bound `::Bar: WrapperTypeDecode` is not satisfied + --> $DIR/call_argument_invalid_bound_2.rs:20:37 + | +20 | fn foo(origin: OriginFor, bar: T::Bar) -> DispatchResultWithPostInfo { + | ^ the trait `WrapperTypeDecode` is not implemented for `::Bar` + | + ::: /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/parity-scale-codec-2.1.0/src/codec.rs:277:18 + | +277 | fn decode(input: &mut I) -> Result; + | ----- required by this bound in `pallet::_::_parity_scale_codec::Decode::decode` + | + = note: required because of the requirements on the impl of `Decode` for `::Bar` -error[E0277]: the trait bound `pallet::Call: pallet::_::_parity_scale_codec::Encode` is not satisfied - --> $DIR/call_argument_invalid_bound_2.rs:17:12 - | -17 | #[pallet::call] - | ^^^^ the trait `pallet::_::_parity_scale_codec::Encode` is not implemented for `pallet::Call` - | - ::: $WORKSPACE/frame/support/src/dispatch.rs - | - | type Call: UnfilteredDispatchable + Codec + Clone + PartialEq + Eq; - | ----- required by this bound in `frame_support::Callable::Call` +error[E0277]: the trait bound `::Bar: WrapperTypeEncode` is not satisfied + --> $DIR/call_argument_invalid_bound_2.rs:20:37 + | +20 | fn foo(origin: OriginFor, bar: T::Bar) -> DispatchResultWithPostInfo { + | ^ the trait `WrapperTypeEncode` is not implemented for `::Bar` + | + ::: /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/parity-scale-codec-2.1.0/src/codec.rs:216:21 + | +216 | fn encode_to(&self, dest: &mut T) { + | ------ required by this bound in `encode_to` + | + = note: required because of the requirements on the impl of `pallet::_::_parity_scale_codec::Encode` for `::Bar` error[E0369]: binary operation `==` cannot be applied to type `&::Bar` --> $DIR/call_argument_invalid_bound_2.rs:20:37