-
Notifications
You must be signed in to change notification settings - Fork 49
Remove without_storage_info for the grants pallet V3 #642
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
Conversation
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
…de/chain into shamb0/v2_bounded_grants
…de/chain into shamb0/v2_bounded_grants
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
Co-authored-by: Fredrik Simonsson <simson@thesimson.net>
…de/chain into shamb0/v2_bounded_grants
… into shamb0/v2_bounded_grants
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
…de/chain into shamb0/v2_bounded_grants
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
|
Changes in |
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
Codecov Report
@@ Coverage Diff @@
## master #642 +/- ##
==========================================
+ Coverage 89.60% 89.74% +0.13%
==========================================
Files 33 33
Lines 6087 6238 +151
==========================================
+ Hits 5454 5598 +144
- Misses 633 640 +7
Continue to review full report at Codecov.
|
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
Signed-off-by: R.Rajeshkumar <rajesh@nodle.com>
| log::info!( | ||
| "post_upgrade[{:#?}]=> VestingSchedules map count :: [{:#?}]", | ||
| line!(), | ||
| mapping_count, | ||
| ); |
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.
We could have a better test for post upgrade to actually return Err for some unexpected cases, however it could be an improvement and I will not hold this PR for that. Especially that we have a good test pre-upgrade.
| let releases = Releases::default(); | ||
| assert_eq!(releases, Releases::V0); | ||
| assert_ne!(releases, Releases::V1); |
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.
I think this test didn't need to be called inside ExtBuilder...execute_with, but not an issue.
aliXsed
left a 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.
LGTM. Thank you @rajesh-nodle for taking all the suggestions patiently.
| }) | ||
| .collect::<Vec<_>>() | ||
| .try_into() | ||
| .expect("Genesis Init Failed Vesting Schedules Overflow"); |
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.
todo check if this is done only in try-runtime and never will make it to the runtime
| }) | ||
| Self::vesting_schedules(who).iter().fold(Zero::zero(), |acc, s| { | ||
| acc.checked_add(&s.locked_amount(now)).expect( | ||
| "locked amount is a balance and can't be higher than the total balance stored inside the same integer type; qed", |
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.
todo check if this code is only present in tryruntime sand never will make it into runtime.
| if let Ok(new_vesting) = BoundedVec::<VestingScheduleOf<T>, T::MaxSchedule>::try_from(old_vesting) { | ||
| <VestingSchedules<T>>::insert(account, new_vesting); | ||
| } else { | ||
| log::error!( |
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.
no panic - good.
| line!(), | ||
| err | ||
| ) | ||
| }); |
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.
Unwrap or else panic will still panic just with an error message.
Part of #173
HighLights
VestingSchedulesis moved to bounded vector.VestingSchedulesis Configured viaMaxSchedule.MaxScheduleOverflow.TODO
Ready for Intake Review