-
Notifications
You must be signed in to change notification settings - Fork 2.6k
HoldReason: Improve usage #13869
HoldReason: Improve usage #13869
Conversation
`HoldReason` was switched recently to use the `composite_enum` attribute that will merge the enums from all pallets in the runtime to `RuntimeHoldReason`. `pallet-nis` was still requiring that the variant was passed as constant to call `hold`. The proper implementation is to use the `HoldReason` from inside the pallet directly when calling `hold`. This is done by adding a `RuntimeHoldReason` as type to the `Config` trait and requiring that `Currency` is using the same reason. Besides that the pr changes the name `HoldIdentifier` in `pallet_balances::Config` to `RuntimeHoldReason`.
Co-authored-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.
Not sure if Gav would approve the name change from HoldIdentifier
to RuntimeHoldReason
, but LGTM otherwise.
Naming here just follows |
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
Do we need to open a cumulus companion PR? |
Yes, I will do this shortly. Was the fractionalization already released on Westmint? |
the companion PR was merged yesterday |
bot merge |
* Companion: Substrate#13869 paritytech/substrate#13869 * update lockfile for {"substrate"} * ".git/.scripts/commands/fmt/fmt.sh" --------- Co-authored-by: parity-processbot <>
* Companion for: Substrate#13869 paritytech/substrate#13869 * Fix * Warning * update lockfile for {"polkadot", "substrate"} --------- Co-authored-by: parity-processbot <>
* Companion for: Substrate#13869 paritytech/substrate#13869 * Fix * Warning * update lockfile for {"polkadot", "substrate"} --------- Co-authored-by: parity-processbot <>
* Companion for: Substrate#13869 paritytech/substrate#13869 * Fix * Warning * update lockfile for {"polkadot", "substrate"} --------- Co-authored-by: parity-processbot <>
* HoldReason: Improve usage `HoldReason` was switched recently to use the `composite_enum` attribute that will merge the enums from all pallets in the runtime to `RuntimeHoldReason`. `pallet-nis` was still requiring that the variant was passed as constant to call `hold`. The proper implementation is to use the `HoldReason` from inside the pallet directly when calling `hold`. This is done by adding a `RuntimeHoldReason` as type to the `Config` trait and requiring that `Currency` is using the same reason. Besides that the pr changes the name `HoldIdentifier` in `pallet_balances::Config` to `RuntimeHoldReason`. * Update frame/nis/src/lib.rs Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Review comment * Fixes --------- Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Companion: Substrate#13869 paritytech/substrate#13869 * update lockfile for {"substrate"} * ".git/.scripts/commands/fmt/fmt.sh" --------- Co-authored-by: parity-processbot <>
* Companion for: Substrate#13869 paritytech/substrate#13869 * Fix * Warning * update lockfile for {"polkadot", "substrate"} --------- Co-authored-by: parity-processbot <>
* HoldReason: Improve usage `HoldReason` was switched recently to use the `composite_enum` attribute that will merge the enums from all pallets in the runtime to `RuntimeHoldReason`. `pallet-nis` was still requiring that the variant was passed as constant to call `hold`. The proper implementation is to use the `HoldReason` from inside the pallet directly when calling `hold`. This is done by adding a `RuntimeHoldReason` as type to the `Config` trait and requiring that `Currency` is using the same reason. Besides that the pr changes the name `HoldIdentifier` in `pallet_balances::Config` to `RuntimeHoldReason`. * Update frame/nis/src/lib.rs Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Review comment * Fixes --------- Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
HoldReason
was switched recently to use thecomposite_enum
attribute that will merge the enums from all pallets in the runtime toRuntimeHoldReason
.pallet-nis
was still requiring that the variant was passed as constant to callhold
. The proper implementation is to use theHoldReason
from inside the pallet directly when callinghold
. This is done by adding aRuntimeHoldReason
as type to theConfig
trait and requiring thatCurrency
is using the same reason. Besides that the pr changes the nameHoldIdentifier
inpallet_balances::Config
toRuntimeHoldReason
.Downstream code changes
For the
pallet_balances::Config
trait you need to changeHoldIdentifier
toRuntimeHoldReason
and pass theRuntimeHoldReason
that is being generated byconstruct_runtime!
.For the
pallet_nis::Config
trait you need to removeHoldReason
as this is not being handled internally of the pallet, but you need to addRuntimeHoldReason
which you also need to set toRuntimeHoldReason
that is being generated byconstruct_runtime!
.polkadot companion: paritytech/polkadot#7119
cumulus companion: paritytech/cumulus#2631