-
Notifications
You must be signed in to change notification settings - Fork 21
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(templates): Make templates and providers generic #226
Conversation
… Template and TemplateType
…late and TemplateType
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #226 +/- ##
==========================================
- Coverage 70.07% 70.03% -0.04%
==========================================
Files 44 44
Lines 6596 6565 -31
Branches 6596 6565 -31
==========================================
- Hits 4622 4598 -24
+ Misses 1236 1230 -6
+ Partials 738 737 -1
|
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.
Nicely done.
I'm not completely convinced by the name TemplateType
, but it seems the best approach to include both providers for parachains
and categories for contracts
.
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.
Great start, left a number of suggestions for improvement.
…d values" This reverts commit 97f8b2b.
Comments resolved! Seems much better now :) |
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.
LGTM!
With the introduction of contract generation, with specific types (ERC, Examples, etc), duplicate code was introduced for Template types (such as Provider and ContractTypes and parachain & contract templates).
This PR introduces two traits to simplify template handling:
Template
-> the types of a TemplateType.TemplateType
-> the type, category, or "parent" of aTemplate
For example:
ERC -> TemplateType
has many typesERC20, ERC721
Pop -> TemplateType
has many typesAssets, Contracts, EVM