-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(mainnet): Add treasury pallet and handle fees #428
Conversation
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #428 +/- ##
==========================================
- Coverage 71.02% 70.86% -0.17%
==========================================
Files 73 74 +1
Lines 13748 14170 +422
Branches 13748 14170 +422
==========================================
+ Hits 9764 10041 +277
- Misses 3717 3861 +144
- Partials 267 268 +1
|
Could we please add a unit test to ensure the fee split is accurately distributed. Will send DM. |
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.
Looking good, thanks for doing! There are a few config items that will need to change please.
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.
Just a few potential suggestions to improve the test style.
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.
LGTM!
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.
Looks great!
It looks like there are a couple of imports that could be removed as they are not being used.
A few config items for pallet_treasury aren't being check on the tests. I think we could add them. Maybe I'm too paranoid ?
Also I'd like to rise the point that right now we are not funneling any fee % for block production. Which might be desired for now or handled later one.
* add treasury pallet to runtime * add treasury pallet * add features * clean * fmt * remove-comment * add a sanity test, clean * fmt * fix * comment out and strip back * update to patch version * back to normality, builds good * fmt * add integration tests back * taplo * dont burn anything * finally tests * fmt * moar tests :) * fmt * use onunbalanced * daans comments * fmt * docs * peters comments * franks comments * fmt * style: fmt * chore(mainnet): remove unused imports * test(mainnet): more tresaury config tests --------- Co-authored-by: Felix G <[email protected]> Co-authored-by: f-gate <[email protected]> Co-authored-by: Peter White <[email protected]>
* add treasury pallet to runtime * add treasury pallet * add features * clean * fmt * remove-comment * add a sanity test, clean * fmt * fix * comment out and strip back * update to patch version * back to normality, builds good * fmt * add integration tests back * taplo * dont burn anything * finally tests * fmt * moar tests :) * fmt * use onunbalanced * daans comments * fmt * docs * peters comments * franks comments * fmt * style: fmt * chore(mainnet): remove unused imports * test(mainnet): more tresaury config tests --------- Co-authored-by: Felix G <[email protected]> Co-authored-by: f-gate <[email protected]> Co-authored-by: Peter White <[email protected]>
* chore: rebase * chore: rebase nonfungibles pallet to pallet-nfts * chore: update nonfungibles tests * refactor: do_approve and do_cancel_approval * chore: naming * chore: resolve review comments * chore: resolve review comments & update weights * chore: add tests for nonfungibles api in runtime devnet * fix: integration test & return post dispatch weight for transfer() on error * refactor: reorder `Read` impl in nonfungibles * chore: remove unnecessary clone() * chore: remove description for pallet configure * refactor: approve() tests * chore: resolve review comments * feat: add AttributeSet event * chore: comments and add test for Collection read * chore: revert changes made to pallet nfts * chore: fix comment * chore: resolve review comments * chore: update function order * chore: add release conventions document and refactor CI to run node release separately (#433) * refactor: reuse `WeightInfo` in nonfungibles pallet test (#450) * chore: update collection details field to public (#449) * chore: rebase and remove local collection details type * chore: remove impls.rs and update burn() * chore: remove double-charged weights * chore: reorder test and update comments * fix: test * chore: sync spec * chore: revert changes made to mint witness * chore: update approve() and tests * chore: resolve review comments * chore: add more comment to dispatchables * chore: revert changes * refactor: approve weight * chore: update approve() weight * chore: update approve weight * refactor: weight approve (#460) * feat(mainnet): add XCM APIs, config tests, refactor mod (#447) * test(mainnet): more configuration tests * refactor(mainnet): runtime APIs to apis module * feat(mainnet): add XCM runtime APIs * feat(mainnet): add pallet revive (#452) * feat(mainnet): add pallet-revive * test(mainnet): revive configuration tests refactor(mainnet): import revive config for tests and use consistent pallet syntax fix(mainnet): UncheckedExtrinsic test needs to use revive unchecked extrinsics * feat(mainnet): add EthExtraImpl for UncheckedExtrinsic * feat(mainnet): add `EventRecord` type * docs(mainnet): add config comments for revive * test(mainnet): check percent value in revive config test * docs(mainnet): update comments on EthExtraImpl * chore(mainnet): remove unnecessary revive path prefix * feat(mainnet): Add treasury pallet and handle fees (#428) * add treasury pallet to runtime * add treasury pallet * add features * clean * fmt * remove-comment * add a sanity test, clean * fmt * fix * comment out and strip back * update to patch version * back to normality, builds good * fmt * add integration tests back * taplo * dont burn anything * finally tests * fmt * moar tests :) * fmt * use onunbalanced * daans comments * fmt * docs * peters comments * franks comments * fmt * style: fmt * chore(mainnet): remove unused imports * test(mainnet): more tresaury config tests --------- Co-authored-by: Felix G <[email protected]> Co-authored-by: f-gate <[email protected]> Co-authored-by: Peter White <[email protected]> * chore: revert pallet-nfts changes * chore: update weights * chore: update index of the dispatchables * chore: remove Collection read As discussed in #432 (comment), the Collection read might not be needed and there are better ways to implement it in the future if there is a demand for it. * chore: add TODO comment for approve weight --------- Co-authored-by: Daan van der Plas <[email protected]> Co-authored-by: Peter White <[email protected]> Co-authored-by: gatsey <[email protected]> Co-authored-by: Felix G <[email protected]> Co-authored-by: f-gate <[email protected]>
* chore: rebase * chore: rebase nonfungibles pallet to pallet-nfts * chore: update nonfungibles tests * refactor: do_approve and do_cancel_approval * chore: naming * chore: resolve review comments * chore: resolve review comments & update weights * chore: add tests for nonfungibles api in runtime devnet * fix: integration test & return post dispatch weight for transfer() on error * refactor: reorder `Read` impl in nonfungibles * chore: remove unnecessary clone() * chore: remove description for pallet configure * refactor: approve() tests * chore: resolve review comments * feat: add AttributeSet event * chore: comments and add test for Collection read * chore: revert changes made to pallet nfts * chore: fix comment * chore: resolve review comments * chore: update function order * chore: add release conventions document and refactor CI to run node release separately (#433) * refactor: reuse `WeightInfo` in nonfungibles pallet test (#450) * chore: update collection details field to public (#449) * chore: rebase and remove local collection details type * chore: remove impls.rs and update burn() * chore: remove double-charged weights * chore: reorder test and update comments * fix: test * chore: sync spec * chore: revert changes made to mint witness * chore: update approve() and tests * chore: resolve review comments * chore: add more comment to dispatchables * chore: revert changes * refactor: approve weight * chore: update approve() weight * chore: update approve weight * refactor: weight approve (#460) * feat(mainnet): add XCM APIs, config tests, refactor mod (#447) * test(mainnet): more configuration tests * refactor(mainnet): runtime APIs to apis module * feat(mainnet): add XCM runtime APIs * feat(mainnet): add pallet revive (#452) * feat(mainnet): add pallet-revive * test(mainnet): revive configuration tests refactor(mainnet): import revive config for tests and use consistent pallet syntax fix(mainnet): UncheckedExtrinsic test needs to use revive unchecked extrinsics * feat(mainnet): add EthExtraImpl for UncheckedExtrinsic * feat(mainnet): add `EventRecord` type * docs(mainnet): add config comments for revive * test(mainnet): check percent value in revive config test * docs(mainnet): update comments on EthExtraImpl * chore(mainnet): remove unnecessary revive path prefix * feat(mainnet): Add treasury pallet and handle fees (#428) * add treasury pallet to runtime * add treasury pallet * add features * clean * fmt * remove-comment * add a sanity test, clean * fmt * fix * comment out and strip back * update to patch version * back to normality, builds good * fmt * add integration tests back * taplo * dont burn anything * finally tests * fmt * moar tests :) * fmt * use onunbalanced * daans comments * fmt * docs * peters comments * franks comments * fmt * style: fmt * chore(mainnet): remove unused imports * test(mainnet): more tresaury config tests --------- Co-authored-by: Felix G <[email protected]> Co-authored-by: f-gate <[email protected]> Co-authored-by: Peter White <[email protected]> * chore: revert pallet-nfts changes * chore: update weights * feat: pop-api nonfungibles feature * fix: integration tests * chore: remove integration tests * chore: remove integration tests * chore: remove integration tests * chore: update comments and add README * chore: update index of the dispatchables * chore: update index of the dispatchables * chore: update index of reads & dispatchables * chore: add comments for api methods * chore: update index of the dispatchables * chore: update types * chore: update traits & types, map psp34 error * chore: remove Collection read As discussed in #432 (comment), the Collection read might not be needed and there are better ways to implement it in the future if there is a demand for it. * chore: add TODO comment for approve weight * chore: update pallet dispatchable index * chore: remove redundant type in macro * feat: pop-api nonfungibles feature * chore: rebase * chore: rebase * chore: remove changes made for integration-tests * fix: comments * chore: remove unused derive * refactor: remove `Decode` derive * chore: remove macro * chore: revert macro * chore: revert macro TypeInfo * feat: add Psp34Mintable and Psp34Burnable * chore: add macro comment * chore: fix trait error type * chore: add tests for nonfungibles api types * refactor: dependencies order * chore: remove unused types * fix: comment Co-authored-by: Daan van der Plas <[email protected]> * chore: revert CollectionConfigOf --------- Co-authored-by: Daan van der Plas <[email protected]> Co-authored-by: Peter White <[email protected]> Co-authored-by: gatsey <[email protected]>
* chore: rebase * chore: rebase nonfungibles pallet to pallet-nfts * chore: update nonfungibles tests * refactor: do_approve and do_cancel_approval * chore: naming * chore: resolve review comments * chore: resolve review comments & update weights * chore: add tests for nonfungibles api in runtime devnet * fix: integration test & return post dispatch weight for transfer() on error * refactor: reorder `Read` impl in nonfungibles * chore: remove unnecessary clone() * chore: remove description for pallet configure * refactor: approve() tests * chore: resolve review comments * feat: add AttributeSet event * chore: comments and add test for Collection read * chore: revert changes made to pallet nfts * chore: fix comment * chore: resolve review comments * chore: update function order * chore: add release conventions document and refactor CI to run node release separately (#433) * refactor: reuse `WeightInfo` in nonfungibles pallet test (#450) * chore: update collection details field to public (#449) * chore: rebase and remove local collection details type * chore: remove impls.rs and update burn() * chore: remove double-charged weights * chore: reorder test and update comments * fix: test * chore: sync spec * chore: revert changes made to mint witness * chore: update approve() and tests * chore: resolve review comments * chore: add more comment to dispatchables * chore: revert changes * refactor: approve weight * chore: update approve() weight * chore: update approve weight * refactor: weight approve (#460) * feat(mainnet): add XCM APIs, config tests, refactor mod (#447) * test(mainnet): more configuration tests * refactor(mainnet): runtime APIs to apis module * feat(mainnet): add XCM runtime APIs * feat(mainnet): add pallet revive (#452) * feat(mainnet): add pallet-revive * test(mainnet): revive configuration tests refactor(mainnet): import revive config for tests and use consistent pallet syntax fix(mainnet): UncheckedExtrinsic test needs to use revive unchecked extrinsics * feat(mainnet): add EthExtraImpl for UncheckedExtrinsic * feat(mainnet): add `EventRecord` type * docs(mainnet): add config comments for revive * test(mainnet): check percent value in revive config test * docs(mainnet): update comments on EthExtraImpl * chore(mainnet): remove unnecessary revive path prefix * feat(mainnet): Add treasury pallet and handle fees (#428) * add treasury pallet to runtime * add treasury pallet * add features * clean * fmt * remove-comment * add a sanity test, clean * fmt * fix * comment out and strip back * update to patch version * back to normality, builds good * fmt * add integration tests back * taplo * dont burn anything * finally tests * fmt * moar tests :) * fmt * use onunbalanced * daans comments * fmt * docs * peters comments * franks comments * fmt * style: fmt * chore(mainnet): remove unused imports * test(mainnet): more tresaury config tests --------- Co-authored-by: Felix G <[email protected]> Co-authored-by: f-gate <[email protected]> Co-authored-by: Peter White <[email protected]> * chore: revert pallet-nfts changes * chore: update weights * feat: pop-api nonfungibles feature * fix: integration tests * chore: remove integration tests * chore: remove integration tests * chore: remove integration tests * chore: update comments and add README * chore: update index of the dispatchables * chore: update index of the dispatchables * chore: update index of reads & dispatchables * chore: add comments for api methods * chore: update index of the dispatchables * chore: update types * chore: update traits & types, map psp34 error * chore: remove Collection read As discussed in #432 (comment), the Collection read might not be needed and there are better ways to implement it in the future if there is a demand for it. * chore: add TODO comment for approve weight * chore: update pallet dispatchable index * chore: remove redundant type in macro * feat: pop-api nonfungibles feature * chore: rebase * chore: rebase * chore: remove changes made for integration-tests * fix: comments * chore: remove unused derive * refactor: remove `Decode` derive * chore: remove macro * chore: rebase * refactor: do_approve and do_cancel_approval * chore: naming * chore: resolve review comments & update weights * chore: add tests for nonfungibles api in runtime devnet * chore: remove description for pallet configure * refactor: approve() tests * chore: comments and add test for Collection read * chore: revert changes made to pallet nfts * chore: resolve review comments * chore: update function order * chore: rebase and remove local collection details type * chore: remove impls.rs and update burn() * chore: remove double-charged weights * fix: test * chore: sync spec * chore: revert changes made to mint witness * chore: resolve review comments * chore: add more comment to dispatchables * chore: revert changes * refactor: approve weight * chore: update approve() weight * refactor: weight approve (#460) * chore: revert pallet-nfts changes * feat: pop-api nonfungibles feature * fix: integration tests * chore: remove integration tests * chore: remove integration tests * chore: update comments and add README * Revert "chore: update comments and add README" This reverts commit b86e68b. * Revert "chore: remove integration tests" This reverts commit 5e6b685. * Revert "chore: remove integration tests" This reverts commit baeb5ea. * chore: fix test * chore: remove collection read test * chore: disable devnet feature for nonfungibles * chore: revert changes * chore: revert macro * chore: revert devnet runtime changes * chore: revert macro TypeInfo * feat: add Psp34Mintable and Psp34Burnable * chore: add macro comment * chore: fix trait error type * chore: add tests for nonfungibles api types * refactor: dependencies order * chore: remove unused types * fix: comment Co-authored-by: Daan van der Plas <[email protected]> * chore: revert macro TypeInfo * feat: add Psp34Mintable and Psp34Burnable * chore: add macro comment * chore: fix trait error type * chore: add tests for nonfungibles api types * refactor: dependencies order * chore: remove unused types * fix: comment Co-authored-by: Daan van der Plas <[email protected]> * feat: pop-api nonfungibles feature * chore: revert changes * chore: rebase * chore: revert CollectionConfigOf * chore: revert changes made to pop-api * chore: revert CollectionConfigOf * feat: pop-api nonfungibles feature * chore: revert changes * chore: revert changes * chore: rebase * refactor: storage type aliases * refactor: test order * refactor: integration test method params order * fix: test * chore: remove unused dependencies * chore: remove features * chore: resolve review comments --------- Co-authored-by: Daan van der Plas <[email protected]> Co-authored-by: Peter White <[email protected]> Co-authored-by: gatsey <[email protected]> Co-authored-by: Felix G <[email protected]> Co-authored-by: f-gate <[email protected]>
Have added the treasury pallet with reasonable parameters and have taken inspiration from polkadot and rococo for these. The only one really of concern is
MaxSpend
i have left it as u32::MAX.The
DealWithFees
simply takes both the fees and tips and splits equally between the newly createdTreasuryAccount
andMaintenenceAccount
.In the future i will split the tasks down into 2 PRs as Peter and i discussed yesterday.
[sc-2260]
[sc-2199]