Skip to content

Update relevant code to Treasury pallet in the pallet_bounty#1

Closed
chungquantin wants to merge 1 commit intochungquantin/remove_treasury_deprecated_callsfrom
chungquantin/update_treasury_in_bounties_pallet
Closed

Update relevant code to Treasury pallet in the pallet_bounty#1
chungquantin wants to merge 1 commit intochungquantin/remove_treasury_deprecated_callsfrom
chungquantin/update_treasury_in_bounties_pallet

Conversation

@chungquantin
Copy link
Copy Markdown
Collaborator

Description

Remove deprecated Treasury relevant code in the Bounties pallet code

  • Remove T::OnSlash::on_unbalanced(imbalance)
  • Remove parameter types related to the Treasury pallet
type OnSlash = ();
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ConstU64<1>;
type ProposalBondMaximum = ();

Test Outcome

running 40 tests
test tests::__construct_runtime_integrity_test::runtime_integrity_tests ... ok
test benchmarking::bench_approve_bounty ... ok
test benchmarking::bench_propose_curator ... ok
test benchmarking::bench_award_bounty ... ok
test benchmarking::bench_accept_curator ... ok
test benchmarking::bench_unassign_curator ... ok
test benchmarking::bench_extend_bounty_expiry ... ok
test tests::accepted_spend_proposal_enacted_on_spend_period ... ok
test tests::accepted_spend_proposal_ignored_outside_spend_period ... ok
test benchmarking::bench_claim_bounty ... ok
test tests::approve_bounty_instance1_insufficient_spend_limit_errors ... ok
test tests::accept_curator_handles_different_deposit_calculations ... ok
test tests::approve_bounty_insufficient_spend_limit_errors ... ok
test tests::approve_bounty_works_second_instance ... ok
test tests::approve_bounty_works ... ok
test benchmarking::bench_propose_bounty ... ok
test tests::close_bounty_works ... ok
test tests::award_and_cancel ... ok
test tests::genesis_config_works ... ok
test tests::genesis_funding_works ... ok
test tests::claim_handles_high_fee ... ok
test tests::assign_curator_works ... ok
test tests::award_and_claim_bounty_works ... ok
test tests::expire_and_unassign ... ok
test tests::minting_works ... ok
test tests::inexistent_account_works ... ok
test tests::test_genesis_config_builds ... ok
test tests::pot_underflow_should_not_diminish ... ok
test tests::propose_bounty_works ... ok
test tests::test_migration_v4 ... ok
test tests::cancel_and_refund ... ok
test tests::propose_bounty_validation_works ... ok
test tests::treasury_account_doesnt_get_deleted ... ok
test tests::extend_expiry ... ok
test tests::unassign_curator_self ... ok
test tests::unused_pot_should_diminish ... ok
test tests::propose_curator_insufficient_spend_limit_errors ... ok
test tests::propose_curator_instance1_insufficient_spend_limit_errors ... ok
test tests::unassign_curator_works ... ok
test benchmarking::bench_spend_funds ... ok

test result: ok. 40 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.18s

   Doc-tests pallet_bounties

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

ensure!(!T::Currency::free_balance(&beneficiary_account).is_zero(), "Beneficiary didn't get paid");
}

close_bounty_proposed {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This benchmark case relies on the parameter type ApproveOrigin which is deprecated in the pallet_treasury. Hence, I simply remove the benchmark case. I wonder if we need a workaround to cover this case or not.

let slash_curator = |curator: &T::AccountId,
curator_deposit: &mut BalanceOf<T, I>| {
let imbalance = T::Currency::slash_reserved(curator, *curator_deposit).0;
T::OnSlash::on_unbalanced(imbalance);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pallet_bounty still rely on the old low-level implementation Propose > Approve so I wonder if removing this on_unbalanced when slash_reserved affects the existing use of the pallet.

@chungquantin chungquantin self-assigned this Mar 27, 2024
@chungquantin chungquantin changed the title Update relevant code to Treasury pallet Update relevant code to Treasury pallet in the pallet_bounty Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant