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

refactor: reuse WeightInfo in nonfungibles pallet test #450

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

chungquantin
Copy link
Collaborator

Minor refactor to avoid code duplication in nonfungible pallet test

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.28%. Comparing base (8b2438b) to head (fe5f6dd).

@@           Coverage Diff           @@
##             main     #450   +/-   ##
=======================================
  Coverage   71.28%   71.28%           
=======================================
  Files          72       72           
  Lines       13626    13626           
  Branches    13626    13626           
=======================================
  Hits         9713     9713           
  Misses       3646     3646           
  Partials      267      267           
Files with missing lines Coverage Δ
pallets/api/src/fungibles/tests.rs 99.69% <100.00%> (ø)

@chungquantin chungquantin merged commit 4f09cf6 into main Jan 24, 2025
15 checks passed
@chungquantin chungquantin deleted the chungquantin/refactor-nonfungibles_types branch January 24, 2025 09:20
chungquantin added a commit that referenced this pull request Feb 4, 2025
* 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]>
chungquantin added a commit that referenced this pull request Feb 11, 2025
* 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]>
chungquantin added a commit that referenced this pull request Feb 25, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants