Skip to content

Commit

Permalink
Update child bounties and tip pallet
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Apr 17, 2024
1 parent f42fd02 commit ea5ba72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
7 changes: 2 additions & 5 deletions substrate/frame/child-bounties/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,8 @@ parameter_types! {
impl pallet_treasury::Config for Test {
type PalletId = TreasuryPalletId;
type Currency = pallet_balances::Pallet<Test>;
type ApproveOrigin = frame_system::EnsureRoot<u128>;
type RejectOrigin = frame_system::EnsureRoot<u128>;
type RuntimeEvent = RuntimeEvent;
type OnSlash = ();
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ConstU64<1>;
type ProposalBondMaximum = ();
type SpendPeriod = ConstU64<2>;
type Burn = Burn;
type BurnDestination = ();
Expand All @@ -126,6 +121,8 @@ parameter_types! {

}
impl pallet_bounties::Config for Test {
type ApproveOrigin = frame_system::EnsureRoot<u128>;
type OnSlash = ();
type RuntimeEvent = RuntimeEvent;
type BountyDepositBase = ConstU64<80>;
type BountyDepositPayoutDelay = ConstU64<3>;
Expand Down
3 changes: 3 additions & 0 deletions substrate/frame/tips/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ pub mod pallet {

/// Weight information for extrinsics in this pallet.
type WeightInfo: WeightInfo;

/// Handler for the unbalanced decrease when slashing for a bounty.
type OnSlash: OnUnbalanced<pallet_treasury::NegativeImbalanceOf<Self, I>>;
}

/// TipsMap that are not yet completed. Keyed by the hash of `(reason, who)` from the value.
Expand Down
12 changes: 2 additions & 10 deletions substrate/frame/tips/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,8 @@ parameter_types! {
impl pallet_treasury::Config for Test {
type PalletId = TreasuryPalletId;
type Currency = pallet_balances::Pallet<Test>;
type ApproveOrigin = frame_system::EnsureRoot<u128>;
type RejectOrigin = frame_system::EnsureRoot<u128>;
type RuntimeEvent = RuntimeEvent;
type OnSlash = ();
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ConstU64<1>;
type ProposalBondMaximum = ();
type SpendPeriod = ConstU64<2>;
type Burn = Burn;
type BurnDestination = (); // Just gets burned.
Expand All @@ -143,13 +138,8 @@ impl pallet_treasury::Config for Test {
impl pallet_treasury::Config<Instance1> for Test {
type PalletId = TreasuryPalletId2;
type Currency = pallet_balances::Pallet<Test>;
type ApproveOrigin = frame_system::EnsureRoot<u128>;
type RejectOrigin = frame_system::EnsureRoot<u128>;
type RuntimeEvent = RuntimeEvent;
type OnSlash = ();
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ConstU64<1>;
type ProposalBondMaximum = ();
type SpendPeriod = ConstU64<2>;
type Burn = Burn;
type BurnDestination = (); // Just gets burned.
Expand All @@ -172,6 +162,7 @@ parameter_types! {
pub static TipReportDepositBase: u64 = 1;
}
impl Config for Test {
type OnSlash = ();
type MaximumReasonLength = ConstU32<16384>;
type Tippers = TenToFourteen;
type TipCountdown = ConstU64<1>;
Expand All @@ -184,6 +175,7 @@ impl Config for Test {
}

impl Config<Instance1> for Test {
type OnSlash = ();
type MaximumReasonLength = ConstU32<16384>;
type Tippers = TenToFourteen;
type TipCountdown = ConstU64<1>;
Expand Down

0 comments on commit ea5ba72

Please sign in to comment.