When building my parachain, I run into the error:
error[E0277]: the trait bound `parity_scale_codec::Compact<sp_runtime::Perbill>: parity_scale_codec::MaxEncodedLen` is not satisfied
--> /Users/ganesholi/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/frame/staking/src/lib.rs:412:18
|
412 | pub commission: Perbill,
| ^^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `parity_scale_codec::Compact<sp_runtime::Perbill>`
|
= help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
parity_scale_codec::Compact<u8>
parity_scale_codec::Compact<u16>
parity_scale_codec::Compact<u32>
parity_scale_codec::Compact<u64>
parity_scale_codec::Compact<u128>
error[E0277]: the trait bound `parity_scale_codec::Compact<Balance>: parity_scale_codec::MaxEncodedLen` is not satisfied
--> /Users/ganesholi/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/frame/staking/src/lib.rs:424:9
|
424 | value: Balance,
| ^^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `parity_scale_codec::Compact<Balance>`
|
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
|
420 | #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen, parity_scale_codec::Compact<Balance>: parity_scale_codec::MaxEncodedLen)]
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `parity_scale_codec::Compact<<T as pallet::pallet::Config>::CurrencyBalance>: parity_scale_codec::MaxEncodedLen` is not satisfied
--> /Users/ganesholi/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/frame/staking/src/lib.rs:448:13
|
448 | pub total: BalanceOf<T>,
| ^^^^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `parity_scale_codec::Compact<<T as pallet::pallet::Config>::CurrencyBalance>`
|
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
|
439 | MaxEncodedLen, parity_scale_codec::Compact<<T as pallet::pallet::Config>::CurrencyBalance>: parity_scale_codec::MaxEncodedLen,
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `parity_scale_codec::Compact<<T as pallet::pallet::Config>::CurrencyBalance>: parity_scale_codec::MaxEncodedLen` is not satisfied
--> /Users/ganesholi/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/frame/staking/src/lib.rs:452:14
|
452 | pub active: BalanceOf<T>,
| ^^^^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `parity_scale_codec::Compact<<T as pallet::pallet::Config>::CurrencyBalance>`
|
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
|
439 | MaxEncodedLen, parity_scale_codec::Compact<<T as pallet::pallet::Config>::CurrencyBalance>: parity_scale_codec::MaxEncodedLen,
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
For more information about this error, try `rustc --explain E0277`.
error: could not compile `pallet-staking` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
ganesholi@Ganeshs-MacBook-Air xcav-parachain %
How do I resolve this issue? This is github code repo.
parity-scale-codec
are you using? There was a recent bug,3.6.5
should work.3.0.0
I am using