-
Notifications
You must be signed in to change notification settings - Fork 143
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
adding condition for allowing rcv to be none if close to is set #317
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.
Looks fine to me
nit: not sure if ZERO_ADDRESS
should live in transaction.py
or constants.py
. I don't have a strong opinion so I'll just leave it as a thought.
Good point, moved it. |
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.
This seems like a good idea but it does open up a new edge case: what if amount is > 0? In that case the amount gets sent to the receiver (which is the zero address now), and the account balance minus that amount gets sent to the close to address.
Perhaps the condition should be close_remainder_to is not None and not amt
?
To clarify, is this change meant to fix decoding transactions properly from a block, or to let users instantiate transactions in a more useful way? |
Good point, I guess your suggestion of checking amt >0 should also be implemented.
In this case the bug report I got was when decoding a transaction included in a block where apparently no |
Thanks for addressing the concerns I raised offline. This looks good, but it would be amazing if you could also add a test to |
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.
Looks great, thanks
closes #316
This should still raise a useful error in the case that close to is also zero since that is likely user error.