-
Notifications
You must be signed in to change notification settings - Fork 695
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
Multi-Asset and Cross-Chain Bounties #6189
base: master
Are you sure you want to change the base?
Conversation
|
||
/// An index of a bounty. Just a `u32`. | ||
pub type BountyIndex = u32; | ||
|
||
type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source; | ||
|
||
type BountyType<T, I> = Bounty< |
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.
BountyOf
to follow our general naming
/// The kind of asset this bounty is rewarded in. | ||
asset_kind: AssetKind, | ||
/// The (total) amount of the `asset_kind` that should be paid if the bounty is rewarded. | ||
value: AssetBalance, |
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 would keep this just Balance
, since there wont be other balance types. Below for deposit and bond we will have consideration ticket type.
Or if we decide to have a separate PR for migrating to considerations. I would have them as BountyBalance
and DepositBalance
.
Otherwise might be confusing, because AssetBalance
can be native, and NativeBalance
can be non-native
@@ -242,6 +324,9 @@ pub mod pallet { | |||
#[pallet::constant] | |||
type DataDepositPerByte: Get<BalanceOf<Self, I>>; | |||
|
|||
#[cfg(feature = "runtime-benchmarks")] | |||
type BenchmarkDefaultAssetKind: Get<Self::AssetKind>; |
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.
introduce one BenchmarkHelper
instead with some specific trait. otherwise we might have too many benchmark specific types. check treasury pallet for reference
ensure!( | ||
bounty.value <= max_amount, | ||
native_amount <= max_amount, |
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.
this will needs to be wrapped into the context. check the treasury spend call for reference
part of #5500
Introduces the
asset_kind
parameter for a bounty and moves the payments processing from theCurrency
(only local transfers) trait toPay
(simpler alternative allowing cross-chain setups) trait.