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

feat: replace assert with invariant in code to not require node environment #30

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

frontendphil
Copy link
Member

@frontendphil frontendphil commented Jan 9, 2025

While working on gnosisguild/zodiac-pilot#469 I noticed that ser-kit relies on some node-specific modules. In this case, assert. While I know that there are ways of getting node modules into a browser bundle, I think for this specific case, using @epic-web/invariant instead of assert is also a good way forward. It eliminates the node dependency and makes ser-kit work more easily across environments.

closes #20

assert(right != null)
invariant(
waypoint.account.type == AccountType.EOA,
`Expected account type to be "${AccountType.EOA}" but got "${waypoint.account.type}"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

🙏

Copy link
Collaborator

Choose a reason for hiding this comment

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

closes #20

@cristovaoth cristovaoth merged commit de85648 into main Jan 9, 2025
2 checks passed
@cristovaoth cristovaoth deleted the feat/remove-assert-dependency branch January 9, 2025 14:25
jfschwarz pushed a commit that referenced this pull request Jan 9, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.1.0](v1.0.7...v1.1.0)
(2025-01-09)


### Features

* new options for Safe transaction `nonce`: override and enqueue
([#28](#28))
([2ed336c](2ed336c)),
closes [#24](#24)
* normalize routes
([#27](#27))
([173c892](173c892)),
closes [#26](#26)
* replace assert with invariant in code to not require node environment
([#30](#30))
([de85648](de85648)),
closes [#20](#20)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Make error messages more helpful
3 participants