Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle removal of AccountId32::default() #120

Closed
clangenb opened this issue Jan 23, 2022 · 0 comments · Fixed by #133
Closed

How to handle removal of AccountId32::default() #120

clangenb opened this issue Jan 23, 2022 · 0 comments · Fixed by #133
Assignees

Comments

@clangenb
Copy link
Member

clangenb commented Jan 23, 2022

Recently, substrate removed the Default traitbound for AccountId32. This has implications for our storage fields, namely we can't use T::AccountId as a value field because the Default traitbound is needed (wrapping the field with an Option<T::AcountId> results in the same error, which I can't understand why yet).

The decl_storage macro does allow setting a default value for types that don't implement a Default, but as we are being generic and there is no const constructor in the trait bound for frame_system::Config::Account we can't set that field to a value without getting an error like: expected parameter 'AccountId' found AccountId32.

The only reasonable solution I see to this is to migrate to the new frame v2 pallet syntax. The Default traitbound limitation does simply not exist if the storage value query is set to OptionQuery.

Migration Guide

EDIT: Storage migration might be needed. Seems not to be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant