-
Notifications
You must be signed in to change notification settings - Fork 699
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/replace enums with companion pattern approach #1083
Merged
ivpavici
merged 26 commits into
starknet-io:next-version
from
lukasaric:chore/replace-enums-with-companion-pattern-approach
May 31, 2024
Merged
Chore/replace enums with companion pattern approach #1083
ivpavici
merged 26 commits into
starknet-io:next-version
from
lukasaric:chore/replace-enums-with-companion-pattern-approach
May 31, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…actor # Conflicts: # src/wallet/getst/localStorageStore.ts
…n-approach # Conflicts: # src/types/api/rpcspec_0_7/nonspec.ts # src/wallet/account.ts # src/wallet/connect.ts
lukasaric
commented
Apr 25, 2024
* test: fix transaction retry interval fallback for devnet tests * test: remove test.only
# [6.9.0](starknet-io/starknet.js@v6.8.0...v6.9.0) (2024-05-21) ### Bug Fixes * cannot infer ts2742 types from starknet-types@0.7 ([starknet-io#1098](starknet-io#1098)) ([f1c3b8e](starknet-io@f1c3b8e)) * remove [warning] from typedoc for external usage ([starknet-io#1095](starknet-io#1095)) ([195186f](starknet-io@195186f)), closes [starknet-io#1121](starknet-io#1121) [starknet-io#1126](starknet-io#1126) ### Features * add type coverage ([starknet-io#1120](starknet-io#1120)) ([eceda5d](starknet-io@eceda5d)) * provider.getL1MessageHash ([starknet-io#1123](starknet-io#1123)) ([1489cf2](starknet-io@1489cf2)) ### Reverts * Revert "chore: add examples to JsDoc for transaction.ts file (starknet-io#1105)" (starknet-io#1108) ([59eb01e](starknet-io@59eb01e)), closes [starknet-io#1105](starknet-io#1105) [starknet-io#1108](starknet-io#1108)
tabaktoni
approved these changes
May 30, 2024
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
ivpavici
approved these changes
May 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solves #1077
Motivation and Resolution
To increase the type safety, this PR introduces the
enum
replacement with thecompanion pattern
approach.To have a better understanding, here's a good thread on why it would be good to avoid enums in TS
Don't use Enums in Typescript, they are very dangerous
RPC version (if applicable)
Usage related changes
n.a
Development related changes
Here's the example of before vs after usage:
BEFORE
AFTER
Checklist: