-
Notifications
You must be signed in to change notification settings - Fork 689
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
Ensure correct variant count in Runtime[Hold/Freeze]Reason
#1900
Conversation
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
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 we have many of these lines up to migrate to DefaultConfig, it might be best to wait for that. Thoughts?
I think we would wait forever... i did some replacements and it seems to compile. Will push in a minute.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@@ -132,9 +138,10 @@ impl Config for Test { | |||
type ReserveIdentifier = TestId; | |||
type WeightInfo = (); | |||
type RuntimeHoldReason = TestId; | |||
type RuntimeFreezeReason = RuntimeFreezeReason; |
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.
Shouldn't this be TestId
?
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.
probably me or oliver did too much copy pasta :D I will double check
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.
actually probably not, it should be the default one.
…k into kiz-variant-count
…k into kiz-variant-count
…ech#1900) closes paritytech#1882 ## Breaking Changes This PR introduces a new item to `pallet_balances::Config`: ```diff trait Config { ++ type RuntimeFreezeReasons; } ``` This value is only used to check it against `type MaxFreeze`. A similar check has been added for `MaxHolds` against `RuntimeHoldReasons`, which is already given to `pallet_balances`. In all contexts, you should pass the real `RuntimeFreezeReasons` generated by `construct_runtime` to `type RuntimeFreezeReasons`. Passing `()` would also work, but it would imply that the runtime uses no freezes at all. --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
IIUC, there is no migration required for teams which introduce - type RuntimeHoldReason = ();
+ type RuntimeHoldReason = RuntimeHoldReason; I would really appreciate a comment on this and apologize for the minor comment creep. |
Yes that is the correct thing to do. |
Really appreciate the quick response. Does your statement include the "no migration required" part as well? Let me elaborate: Say some pallet has used the Same for the freezes. |
iirc, |
@wischli I just wanted to say that this change shouldn't require migration. However, it could depend on the version of Also, we have |
This is basically just |
Signed-off-by: Xavier Lau <xavier@inv.cafe>
* Setup deps * Remove Koi from account migration test * paritytech/polkadot-sdk#1495 * Bump * paritytech/polkadot-sdk#1524 * !! paritytech/polkadot-sdk#1363 * paritytech/polkadot-sdk#1492 * paritytech/polkadot-sdk#1911 * paritytech/polkadot-sdk#1900 Signed-off-by: Xavier Lau <xavier@inv.cafe> * paritytech/polkadot-sdk#1661 * paritytech/polkadot-sdk#2144 * paritytech/polkadot-sdk#2048 * paritytech/polkadot-sdk#1672 * paritytech/polkadot-sdk#2303 * paritytech/polkadot-sdk#1256 * Remove identity and vesting * Fixes * paritytech/polkadot-sdk#2657 * paritytech/polkadot-sdk#1313 * paritytech/polkadot-sdk#2331 * paritytech/polkadot-sdk#2409 part.1 * paritytech/polkadot-sdk#2767 * paritytech/polkadot-sdk#2521 Signed-off-by: Xavier Lau <xavier@inv.cafe> * paritytech/polkadot-sdk#1222 * paritytech/polkadot-sdk#1234 part.1 * Satisfy compiler * XCM V4 part.1 * paritytech/polkadot-sdk#1246 * Remove pallet-democracy part.1 * paritytech/polkadot-sdk#2142 * paritytech/polkadot-sdk#2428 * paritytech/polkadot-sdk#3228 * XCM V4 part.2 * Bump * Build all runtimes * Build node * Remove pallet-democracy Signed-off-by: Xavier Lau <xavier@inv.cafe> * Format * Fix pallet tests * Fix precompile tests * Format * Fixes * Async, remove council, common pallet config * Fix `ethtx-forward` test case (#1519) * Fix ethtx-forward tests * Format * Fix following the review * Fixes * Fixes * Use default impl * Benchmark helper * Bench part.1 * Bench part.2 * Bench part.3 * Fix all tests * Typo * Feat * Fix EVM tracing build * Reuse upstream `proof_size_base_cost()` (#1521) * Format issue * Fixes * Fix CI --------- Signed-off-by: Xavier Lau <xavier@inv.cafe> Co-authored-by: Bear Wang <boundless.forest@outlook.com>
closes #1882
Breaking Changes
This PR introduces a new item to
pallet_balances::Config
:trait Config { ++ type RuntimeFreezeReasons; }
This value is only used to check it against
type MaxFreeze
. A similar check has been added forMaxHolds
againstRuntimeHoldReasons
, which is already given topallet_balances
.In all contexts, you should pass the real
RuntimeFreezeReasons
generated byconstruct_runtime
totype RuntimeFreezeReasons
. Passing()
would also work, but it would imply that the runtime uses no freezes at all.