-
Notifications
You must be signed in to change notification settings - Fork 202
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: use viem when creating burner wallet #576
Conversation
const cachedPrivateKey = localStorage.getItem(cacheKey); | ||
const subject = cachedPrivateKey | ||
const subject = isHex(cachedPrivateKey) |
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.
are we okay with this being a destructive action? it used to just add a burner wallet if no value was set for the given cache key, but now it checks if it's hex and will recreate one if not
which means if someone has a different value stored at this key, we will end up overriding it with a new burner wallet private key
alternatively, we could just throw/bail if we detect a non-hex value at this cache key
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.
I think throwing if it's an invalid value would be better bc it would tell users who are trying to override the burner wallet (but put an invalid value) why it fails
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 👍 (just one comment about throwing)
see #582