Checks against chain_id == 0 in TokenNetworkRegistry#4887
Closed
pirapira wants to merge 2 commits into
Closed
Conversation
added 2 commits
September 14, 2019 17:51
This getter will be useful for precondition checks.
When TokenNetworkRegistry's createERC20TokenNetwork() tries to deploy a TokenNetwork contract, the constructor of TokenNetwork fails if chain_id stored in TokenNetworkRegistry is zero. This commit adds checks against this case in the proxy of TokenNetworkRegistry.
Codecov Report
@@ Coverage Diff @@
## develop #4887 +/- ##
===========================================
- Coverage 80.83% 80.71% -0.13%
===========================================
Files 119 119
Lines 14454 14461 +7
Branches 2231 2233 +2
===========================================
- Hits 11684 11672 -12
- Misses 2116 2128 +12
- Partials 654 661 +7
Continue to review full report at Codecov.
|
rakanalh
suggested changes
Sep 16, 2019
Contributor
rakanalh
left a comment
There was a problem hiding this comment.
Wrote why those changes are not required somewhere else
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes: #4886
Description
Please, describe what this PR does in detail:
A proxy should try to avoid sending a transaction that's going to fail. Before this PR, TokenNetworkRegistry didn't check a condition: namely,
chain_idstate variable must hold a non-zero value. Otherwise,createERC20TokenNetwork()calls will fail.This PR adds a precondition check and a post-failure check against this case.
PR review check list
Quality check list that cannot be automatically verified.