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

Add pallet referenda migration for referendumInfo #2134

Merged
merged 5 commits into from
Feb 27, 2023

Conversation

nbaztec
Copy link
Contributor

@nbaztec nbaztec commented Feb 27, 2023

What does it do?

adds pallet referenda migration to v1. The migration was introduced in paritytech/substrate#12788 and was missing in the release notes and the correct labels. The ReferendumInfo type is migrated to the newer version to allow refunding deposits.

⚠️ Breaking Change ⚠️
The following invariants of ReferendumInfo - Approved, Rejected, Cancelled, TimedOut now have their second parameter optional, Option<Deposit<AccountId, Balance>>, which was previously Deposit<AccountId, Balance>.

  • New event SubmissionDepositRefunded
SubmissionDepositRefunded {
	/// Index of the referendum.
	index: ReferendumIndex,
	/// The account who placed the deposit.
	who: T::AccountId,
	/// The amount placed by the account.
	amount: BalanceOf<T, I>,
},
  • New error
/// The referendum status is invalid for this operation.
BadStatus
  • New Extrinsic to refund submission deposit
refund_submission_deposit((index)

@nbaztec nbaztec added B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. breaking Needs to be mentioned in breaking changes labels Feb 27, 2023
@crystalin crystalin requested review from librelois and girazoki and removed request for librelois February 27, 2023 09:11
librelois and others added 2 commits February 27, 2023 12:13
Co-authored-by: girazoki <gorka.irazoki@gmail.com>
@librelois librelois merged commit 14b0132 into master Feb 27, 2023
@librelois librelois deleted the nish-referenda-migration branch February 27, 2023 11:52
librelois added a commit that referenced this pull request Feb 27, 2023
* add pallet referenda migration

* add migration to moonbase and moonriver only

* fix wrong file

* fix benchmarks compilation

* Update runtime/moonbeam/src/lib.rs

Co-authored-by: girazoki <gorka.irazoki@gmail.com>

---------

Co-authored-by: librelois <c@elo.tf>
Co-authored-by: girazoki <gorka.irazoki@gmail.com>
@crystalin crystalin changed the title [MOON-2215] add pallet referenda migration Add pallet referenda migration for referendumInfo Feb 27, 2023
@nbaztec nbaztec added the D1-runtime-migration PR introduces code that might require downstream chains to run a runtime upgrade. label Apr 12, 2023
@notlesh notlesh added D1-audited👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited and removed D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Apr 26, 2023
imstar15 pushed a commit to AvaProtocol/moonbeam that referenced this pull request May 16, 2023
* add pallet referenda migration

* add migration to moonbase and moonriver only

* fix wrong file

* fix benchmarks compilation

* Update runtime/moonbeam/src/lib.rs

Co-authored-by: girazoki <gorka.irazoki@gmail.com>

---------

Co-authored-by: librelois <c@elo.tf>
Co-authored-by: girazoki <gorka.irazoki@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes breaking Needs to be mentioned in breaking changes D1-audited👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited D1-runtime-migration PR introduces code that might require downstream chains to run a runtime upgrade.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants