Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Looking for some support on - Remove without_storage_info on pallets & migration to BoundedVec ... #11615

Closed
2 tasks done
rajesh-nodle opened this issue Jun 7, 2022 · 3 comments
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.

Comments

@rajesh-nodle
Copy link

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

Issue closely related to ...

Trying to migrate instances of Vec to BoundedVec & removal of without_storage_info annotations for nodle pallets.

Hit With some MaxEncodedLen & Clone trait bound errors.

Shared some demo pallet to simplify & reproduce the issue.

https://github.com/rajesh-nodle/tst-demo

Here in this context, integrated BoundedVec as part of struct Validator

https://github.com/rajesh-nodle/tst-demo/blob/d36d477ab1872798c25972acf23c09ecf1fea12a/pallets/tst-demo/src/types.rs#L118

Issue-1 :: Removal of without_storage_info is causing error "the trait MaxEncodedLen is not implemented"

Issue-2 :: Looks like Clone is not derived for const type ConstU32, unable to use it as part of the struct struct Validator

https://github.com/rajesh-nodle/tst-demo/blob/d36d477ab1872798c25972acf23c09ecf1fea12a/pallets/tst-demo/src/mock.rs#L205

Can I have some suggestions on rightway in migrating it?

Steps to reproduce

@github-actions github-actions bot added the J2-unconfirmed Issue might be valid, but it’s not yet known. label Jun 7, 2022
@shawntabrizi
Copy link
Member

I think you need to just add the derive macro to the UnlockChunk type. Here is an example from a random struct in Substrate:

/// Store named reserved balance.
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, MaxEncodedLen, TypeInfo)]
pub struct ReserveData<ReserveIdentifier, Balance> {
	/// The identifier for the named reserve.
	pub id: ReserveIdentifier,
	/// The amount of the named reserve.
	pub amount: Balance,
}

@ggwpez
Copy link
Member

ggwpez commented Jun 7, 2022

About Get<> not implementing Clone you can look here: #11589 (comment)
Had the same problem two days ago 😆 PS: You can probably apply that to MaxEncodedLen as well.

Such questions are good to post on our SO https://substrate.stackexchange.com/

@rajesh-nodle
Copy link
Author

@ggwpez Thanks for suggestion 11589 - Discussion pointer, It unblocks my issue :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.
Projects
None yet
Development

No branches or pull requests

3 participants