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

Abstract CustomMetadata & CurrencyId to avoid usage in tests #1770

Open
lemunozm opened this issue Mar 13, 2024 · 0 comments
Open

Abstract CustomMetadata & CurrencyId to avoid usage in tests #1770

lemunozm opened this issue Mar 13, 2024 · 0 comments
Labels
I4-tests Test needs fixing or improving. I6-refactoring Code needs refactoring. I11-cleaning No mandatory issue that leave the repo more readable/organized P2-nice-to-have Issue is worth doing. Q5-hard Can be done by an experienced coder with a good knowledge of the codebase.

Comments

@lemunozm
Copy link
Contributor

lemunozm commented Mar 13, 2024

Description

Currently, we use our runtime type CustomMetadata in most of our tests. This forces us to have a runtime dependency in pallets, making it harder to do refactorizations and test simplifications. Also, it forces us to use our specific CurrencyId in tests. Populating the tests even with more runtime types when we shouldn't.

We should abstract CustomMetadata and CurrencyId (with their subtypes) with some traits to avoid their usage in pallet tests. This helps go towards runtime-free dependencies architecture (see #1380)

@lemunozm lemunozm added I4-tests Test needs fixing or improving. Q5-hard Can be done by an experienced coder with a good knowledge of the codebase. P2-nice-to-have Issue is worth doing. I6-refactoring Code needs refactoring. I11-cleaning No mandatory issue that leave the repo more readable/organized labels Mar 13, 2024
@lemunozm lemunozm changed the title Abstract CurrencyId to avoid use in tests Abstract CustomMetadata & CurrencyId to avoid usage in tests Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I4-tests Test needs fixing or improving. I6-refactoring Code needs refactoring. I11-cleaning No mandatory issue that leave the repo more readable/organized P2-nice-to-have Issue is worth doing. Q5-hard Can be done by an experienced coder with a good knowledge of the codebase.
Projects
None yet
Development

No branches or pull requests

1 participant