-
Notifications
You must be signed in to change notification settings - Fork 374
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
introduce new field in struct and update genesis file used explicitly in DEV #1248
Conversation
pallets/dapp-staking-v3/src/lib.rs
Outdated
@@ -478,6 +479,7 @@ pub mod pallet { | |||
pub tier_thresholds: Vec<TierThreshold>, | |||
pub slots_per_tier: Vec<u16>, | |||
pub _config: PhantomData<T>, | |||
pub disable_safeguard: bool, |
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.
If the default value of Safeguard
changes, does this approach still work?
E.g. Safeguard
is set to false
by default, and user sets disable_safeguard
to false
. What's the result?
Perhaps it's better to set the storage value directly.
Nitpick comment - PhantomData
should be at the bottom of the fields declaration.
This is a storage value. Why don't you use chopsticks or sudo to override storage. What is the use case of 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.
LGTM, just a comment about tests.
@@ -2962,3 +2962,135 @@ fn safeguard_on_by_default() { | |||
assert!(Safeguard::<Test>::get()); | |||
}); | |||
} | |||
|
|||
#[test] |
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.
It's ok to test all scenarios if you wish, of course, but the setup code bloats 99% of the added test code. Maybe optimize that, and reuse storage
for creating multiple test externalities.
@ermalkaleci it's related to this issue: #1188 |
@yuriechan please make sure to test |
I ran the command locally, and it seems that all test cases are passing. |
Pull Request Summary
Check list
To Reviewers
Fixes #1188