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

chore: fix contract type #59

Merged
merged 1 commit into from
Feb 7, 2024
Merged

chore: fix contract type #59

merged 1 commit into from
Feb 7, 2024

Conversation

legobeat
Copy link
Contributor

@legobeat legobeat commented Feb 2, 2024

  • fix: entries function is actually a Promise
  • remove type duplication

- fix: entries function is actually a Promise
- remove type duplication
@@ -1,14 +1,18 @@
declare module '@metamask/ethjs-types' {
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that usually type augmentations aren't a good idea because they will only be present locally and will not be included in the type declaration files, so they could cause type errors in another project that uses this package. This seems to be okay for right now because registry is private, so DeployedRegistryContract gets erased from the built type declaration files, but something to keep in mind in case this does cause problems later.

Copy link
Contributor Author

@legobeat legobeat Feb 6, 2024

Choose a reason for hiding this comment

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

I don't see how it would cause type-errors? But in any case yes, this "synthetic module" is for internal use only. If reuse elsewhere becomes relevant I guess it also becomes relevant to consider exposing these (for example generated from jsdoc comments) from ethjs-contract and ethjs-query packages themselves.

@legobeat legobeat merged commit 26c28d6 into MetaMask:main Feb 7, 2024
6 checks passed
@legobeat legobeat deleted the type-fixes branch February 7, 2024 19:10
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.

2 participants