-
Notifications
You must be signed in to change notification settings - Fork 170
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
Parse SafeTx numeric parameters to int #288
Conversation
Uxio0
commented
Jul 5, 2022
- Guard SafeTx from other numeric formats like float, Decimal or even str
Why this is necessary? |
That's a good question. EIP712 library is very picky, and does not accept different types than expected. I spent today a lot of time debugging an issue because a |
- Guard SafeTx from other numeric formats like float, Decimal or even str
Pull Request Test Coverage Report for Build 2617366441
💛 - Coveralls |
self.gas_token = gas_token or NULL_ADDRESS | ||
self.refund_receiver = refund_receiver or NULL_ADDRESS | ||
self.signatures = signatures or b"" | ||
self._safe_nonce = safe_nonce | ||
self._safe_nonce = safe_nonce and int(safe_nonce) |
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.
Could be in this case int(safe_nonce)
directly instead safe_nonce and int(safe_nonce)
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.
No, because it can be None
, and you don't want to try int(None)
😉