-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Migrate Slot Depositors in Crowdloan Migration #5173
Migrate Slot Depositors in Crowdloan Migration #5173
Conversation
let account_info = frame_system::Account::<T>::take(old_fund_account); | ||
frame_system::Account::<T>::insert(new_fund_account, account_info); | ||
let account_info = frame_system::Account::<T>::take(&old_fund_account); | ||
frame_system::Account::<T>::insert(&new_fund_account, account_info); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure I understand, if this migration runs twice things break; we would overwrite new_fund_account
here with some empty info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but not sure if there is a way around this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can and should guard the migration by something, either StorageVersion
, custom storage, or at the minimum spec_verion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good - only potential issue I see is #5173 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor issues, but LGTM.
Just makre sure to correct the other migration in Polkadot, if there is going to be a 9181 replacing 9180.
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
bot merge |
This PR fixes an issue with the existing Crowdloan migration (#4772), where the deposits tracking in the Slots pallet was not migrated to the new accounts.