-
Notifications
You must be signed in to change notification settings - Fork 6
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!: refactor sign_message and update to 0.7.0 eth-ape #5
Conversation
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.
Tests are failing... because there are no tests 😅
How could we test this? Does Frame provide an automated mock we could integrate with?
APE-1351 "feat: refactor sign_message" (ApeWorX/ape-frame #5)
now supports strings, SignableMessage, and EIP712Message What I didUpdated sign_message and check_message to support the types they can handle How I did itsome type checking and lots of experimenting How to verify itI used this script
Checklist
ApeWorX/ape-frame #5 by z80dev on GitHub via LinearSync |
4d2bcd1
to
4676202
Compare
4676202
to
f19ff41
Compare
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.
mostly nit comments though you may want to be careful assuming all ValueErrors have arguments, that is likely to cause a random IndexError down the line.
I think this PR needs some rebasing or something, not sure if it's up to date with core |
f19ff41
to
113386a
Compare
113386a
to
5ead12b
Compare
elif isinstance(msg, EIP712Message): | ||
raw_signature = wrap_sign( | ||
lambda: self.web3.eth.sign_typed_data( | ||
self.address, msg._body_ # type: ignore[arg-type] |
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.
@z80dev may know more about the type discrepancy here, but I created this issue: ethereum/web3.py#3255
OK, I tidied it all up and updated everything, lemme know if that works |
note: this will fail type checking until we release the changes in ApeWorX/ape#1614 (review)
now supports strings, SignableMessage, and EIP712Message
What I did
Updated sign_message and check_message to support the types they can handle
Fixes: APE-1351
How I did it
some type checking and lots of experimenting
How to verify it
I used this script
Checklist