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

Tx Encoding and decoding fix #33

Merged
merged 4 commits into from
Aug 13, 2019
Merged

Conversation

austinabell
Copy link
Contributor

@austinabell austinabell commented Aug 8, 2019

Followed status encoding functions from foundation who implicitly ommitted PostState which altered the logic of the functionality of the receipt encoding and decoding, which was not caught by the existing tests or tests pulled from foundation.

Issue was if a Receipt in storage contained the PostState and Status, the Status would not be translated over into the returned value in favour of the PostState (which was removed and irrelevant at the current block).

I made these changes to remain compatible with all previous versions and now stores all fields without ommitting the PostState as was previously intended, but optimizations can be made later. I also added tests to ensure the compatibility and test these edge cases to make sure no changes affect the compatibility.

Please ensure the tx status appears on receipts migrating from a previous version, I cannot test that specifically.

Fixes #23

GregTheGreek
GregTheGreek previously approved these changes Aug 9, 2019
@eyfl eyfl requested review from r8d8 and tzdybal August 9, 2019 09:18
r8d8
r8d8 previously requested changes Aug 9, 2019
core/types/receipt.go Outdated Show resolved Hide resolved
Copy link
Contributor

@tzdybal tzdybal left a comment

Choose a reason for hiding this comment

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

LGTM

@soc1c soc1c merged commit fd99d76 into development Aug 13, 2019
@soc1c soc1c deleted the austin/oldreceiptdecoding branch August 13, 2019 07:11
soc1c pushed a commit that referenced this pull request Aug 13, 2019
* Added test for decoding old encoding function

* Fixed decoding issue and improved tests to handle all cases including previous client

* Add compatibility with previous version

* Rename receipt storage variable
@soc1c soc1c mentioned this pull request Aug 13, 2019
4 tasks
soc1c added a commit that referenced this pull request Aug 13, 2019
* Replace repository reference for accounts/abi/bind (#29)

* docs: update badges (#34)

* docs: add gitter badge

* docs: add circle-ci badge

* Update README.md

* Update README.md

* Update README.md

* docs: update repository path

* Update README.md

* Tx Encoding and decoding fix (#33)

* Added test for decoding old encoding function

* Fixed decoding issue and improved tests to handle all cases including previous client

* Add compatibility with previous version

* Rename receipt storage variable

* Storage and edge case fixes (#28)

* Applied storage fixes and updates

* Minor execution refactor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants