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

fix(pallet-allocations): fix try-runtime and the migration code #643

Merged
merged 2 commits into from Jul 21, 2022

Conversation

aliXsed
Copy link
Contributor

@aliXsed aliXsed commented Jul 21, 2022

Remove the attempt to remove CoinsConsumed which was already removed in a previous deployment of release 2.0.21. Fix the try-runtime test which could have indicated this error to us before merging the migration code.

Remove the attempt to remove CoinsConsumed which was already removed in a previous deployment of release 2.0.21. Fix the try-runtime test which could have indicated this error to us before merging the migration code.
@codecov
Copy link

codecov bot commented Jul 21, 2022

Codecov Report

Merging #643 (e1b95ac) into master (16bf7fe) will increase coverage by 0.18%.
The diff coverage is 0.00%.

❗ Current head e1b95ac differs from pull request most recent head b54fc4c. Consider uploading reports for the commit b54fc4c to get more accurate results

@@            Coverage Diff             @@
##           master     #643      +/-   ##
==========================================
+ Coverage   88.47%   88.66%   +0.18%     
==========================================
  Files          35       35              
  Lines        6292     6279      -13     
==========================================
  Hits         5567     5567              
+ Misses        725      712      -13     
Impacted Files Coverage Δ
pallets/allocations/src/lib.rs 74.54% <0.00%> (ø)
pallets/allocations/src/migrations.rs 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 16bf7fe...b54fc4c. Read the comment docs.

…r own way of tests through the try-runtime feature
V0_0_0Legacy, // To handle Legacy version
V2_0_21,
V0, // Legacy version
V1, // Adds storage info
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not right way to enumerate by Pallet version ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The think is it's hard to aim at a release version inside the code. For example, here 2.0.21 is already released but this code implies the change should have been part of that.


#[cfg(feature = "try-runtime")]
use crate::BalanceOf;
pub fn on_runtime_upgrade<T: Config>() -> Weight {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we take this as suggested migration immplementation pattern and apply to other PR's ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest it

Copy link
Contributor

@rajesh-nodle rajesh-nodle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Added some clarification questions on implementation.

@aliXsed aliXsed merged commit c8e0183 into master Jul 21, 2022
@aliXsed aliXsed deleted the aliX/fix-try-runtime branch July 21, 2022 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants