-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate
pallet_bounties
into runtime with configuration and depen…
…dencies (#908) * added config bounties * added pallet bounties * set timing * Bounties can spend treasury * only root can spend directly * fix version and metadata * Replace EnsureWithSuccess + EnsureRoot with EnsureRootWithSuccess * Add block delay for bounty claim * CouncilMajority is SpendOrigin in pallet treasury * Solving EnsureWithSuccess compile issue * Fix metadata golden * Add bounties to benchmark * use substrate weights in pallet bounties because of ED bug --------- Co-authored-by: Tomás Senovilla Polo <tspscgs@gmail.com> Co-authored-by: luispdm <17044119+luispdm@users.noreply.github.com>
- Loading branch information
1 parent
35a4be1
commit 3c729b5
Showing
9 changed files
with
2,834 additions
and
1,708 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use crate::{ | ||
currency::{MILLIUNIT, UNIT}, | ||
Balance, BlockNumber, Runtime, RuntimeEvent, Treasury, | ||
}; | ||
use frame_support::parameter_types; | ||
use parachains_common::{DAYS, MINUTES}; | ||
use polkadot_runtime_common::prod_or_fast; | ||
use sp_runtime::Permill; | ||
|
||
parameter_types! { | ||
pub const BountyDepositBase: Balance = UNIT; | ||
pub const BountyDepositPayoutDelay: BlockNumber = prod_or_fast!(7 * DAYS, 5 * MINUTES); | ||
pub const BountyUpdatePeriod: BlockNumber = prod_or_fast!(7 * DAYS, 5 * MINUTES); | ||
pub const MaximumReasonLength: u32 = 16384; | ||
pub const CuratorDepositMultiplier: Permill = Permill::from_percent(50); | ||
pub const CuratorDepositMin: Balance = 10 * UNIT; | ||
pub const CuratorDepositMax: Balance = 200 * UNIT; | ||
pub const BountyValueMinimum: Balance = 10 * UNIT; | ||
pub const DataDepositPerByte: Balance = 10 * MILLIUNIT; | ||
} | ||
|
||
impl pallet_bounties::Config for Runtime { | ||
type RuntimeEvent = RuntimeEvent; | ||
type BountyDepositBase = BountyDepositBase; | ||
type BountyDepositPayoutDelay = BountyDepositPayoutDelay; | ||
type BountyUpdatePeriod = BountyUpdatePeriod; | ||
type CuratorDepositMultiplier = CuratorDepositMultiplier; | ||
type CuratorDepositMin = CuratorDepositMin; | ||
type CuratorDepositMax = CuratorDepositMax; | ||
type BountyValueMinimum = BountyValueMinimum; | ||
type ChildBountyManager = (); | ||
type DataDepositPerByte = DataDepositPerByte; | ||
type MaximumReasonLength = MaximumReasonLength; | ||
type OnSlash = Treasury; | ||
// TODO the benchmarks fail as they try to fund the treasury by calling: | ||
// "Currency::minimum_balance().saturating_mul(1_000_000_000u32.into())" | ||
// Currency::minimum_balance() returns the ED, which is 0 in our runtime | ||
type WeightInfo = pallet_bounties::weights::SubstrateWeight<Runtime>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.