This repository was archived by the owner on Nov 6, 2020. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does this actually make sense? Before this refactor we were matching
None
twice: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 like it does not.
None
matches toSome(&self.code_cache)
in all cases@gavofyork please take a look, might be a bug in the original code.
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.
the original code (https://github.com/ethcore/parity/blob/master/ethcore/src/account.rs) was:
there are no options here which are superfluous.
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.
The code from master already contains this change (was included with #889 - otherwise there was compilation error on nightly).
This is what it looked like before:
https://github.com/ethcore/parity/blob/61420d3c9c64d87ab2c83d972c7d2d812b1d9b72/ethcore/src/account.rs#L141
The logic wasn't different, but there was superfluous
| None
in first branch.My question is rather if when this method should return
None
- currently it's only the case whencode_hash == SHA3_EMPTY && !code_cache.is_empty() OR code_hash != SHA3_EMPTY && code_cache.is_empty()
- this is correct?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.
Correct (technically, the first is actually a logic error and should properly be either asserted against or an error). The second (i.e. there is definitely some non-empty code, but it isn't presently cached) properly returns
None
.