-
Notifications
You must be signed in to change notification settings - Fork 45
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
Separate _verify_single_precompiled_checksum() #1304
Conversation
595efcb
to
73aaa34
Compare
2fa885b
to
5d1d154
Compare
Codecov Report
@@ Coverage Diff @@
## master #1304 +/- ##
==========================================
+ Coverage 81.77% 81.94% +0.17%
==========================================
Files 21 21
Lines 1465 1468 +3
Branches 193 193
==========================================
+ Hits 1198 1203 +5
+ Misses 228 226 -2
Partials 39 39
Continue to review full report at Codecov.
|
b71bd66
to
2796726
Compare
2796726
to
84a6477
Compare
|
||
def test_verify_single_precompiled_cyhecksum_on_nonexistent_contract_name() -> None: | ||
with pytest.raises(ContractSourceManagerVerificationError, match="No checksum for"): | ||
verify_single_precompiled_checksum_on_nonexistetnt_contract_name() |
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.
verify_single_precompiled_checksum_on_nonexistetnt_contract_name() | |
verify_single_precompiled_checksum_on_nonexistent_contract_name() |
) | ||
|
||
|
||
def verify_single_precompiled_checksum_on_nonexistetnt_contract_name() -> None: |
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.
It appears, this functions exists only for testing behavior. So it seems a little odd to have it inside contract_source_manager.py
-- can't you move it to, e.g. https://github.com/raiden-network/raiden-contracts/blob/master/raiden_contracts/tests/utils/contracts.py ?
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.
I'm trying to avoid using _xyz
from other modules. @hackaugusto what do you suggest?
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.
you get my approval, but please change the typos and reconsider the placement of the nonexistent
test function!
16ba9e4
to
d9646fe
Compare
This commit separates a function that checks one entry of contracts.json. This eases the implementation of raiden-network#1257.
d9646fe
to
e8f5dda
Compare
e8f5dda
to
01fe451
Compare
This commit separates a function that checks one entry of
contracts.json. This eases the implementation of #1257.
What this PR does
This is a pure refactoring that separates away a subroutine.
Before this PR, ContractSourceManager didn't have a function that checks a single entry of
contracrts.json
. There was onlyverify_precompiled_checksums()
that checks all entries ofcontracts.json
. This PR separates_verify_single_precompiled_checksum()
that checks a single entry ofcontracts.json
.Why I'm making this PR
After this PR, I want to expose a feature to check a single
contracts.json
entry. That will be useful for checking whether or not SecretRegistry's sources have changed.What's tricky about this PR (if any)
I had to take a moment to name the arguments of the new function.
Any reviewer can check these:
python_variable
And before "merge" all checkboxes have to be checked. If you find redundant points, remove them.