Skip to content
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

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

muharem
Copy link
Contributor

@muharem muharem commented Oct 23, 2024

part of #5500

Introduces the asset_kind parameter for a bounty and moves the payments processing from the Currency (only local transfers) trait to Pay (simpler alternative allowing cross-chain setups) trait.

@davidk-pt davidk-pt added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Nov 14, 2024

/// 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<
Copy link
Contributor Author

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,
Copy link
Contributor Author

@muharem muharem Nov 14, 2024

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>;
Copy link
Contributor Author

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,
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants