-
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
Comment out cooperativeSettle & setTotalWithdraw temporarily #270
Comment out cooperativeSettle & setTotalWithdraw temporarily #270
Conversation
f80e600
to
39929d7
Compare
@@ -330,7 +330,7 @@ contract TokenNetwork is Utils { | |||
require(token.transferFrom(msg.sender, address(this), added_deposit)); | |||
} | |||
|
|||
/// @notice Allows `participant` to withdraw tokens from the channel that he | |||
/* /// @notice Allows `participant` to withdraw tokens from the channel that he |
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.
nitpick: Why start he comment at the docstring (commenting out comments does not make sense) and not at the actual code like you did at the event above?
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 natspec comments as more than normal comments and part of the function that they actually define. This is why I also commented them out.
If you specifically want them to not be commented out, please let me know.
@@ -811,7 +811,7 @@ contract TokenNetwork is Utils { | |||
assert(locked_amount >= unlocked_amount); | |||
} | |||
|
|||
/// @notice Cooperatively settles the balances between the two channel | |||
/* /// @notice Cooperatively settles the balances between the two channel |
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.
same here
signature_participant, | ||
signature_partner | ||
).transact({'from': delegate}) | ||
# TODO uncomment this after setTotalWithdraw is uncommented in the TokenNetwork contract |
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.
In order to not forget it in the future I suggest making an issue in this repo about reintroducint coopsettle and total withdraw and link it in this and subsequent comments
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.
Yes, I will make an issue with a list of changes after merging.
@@ -520,6 +528,7 @@ def test_cooperative_settle_channel_wrong_balances( | |||
).transact({'from': C}) | |||
|
|||
|
|||
@pytest.mark.skip(reason='Delayed to another milestone') |
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.
super super nitpick for all of these skips: Delayed until
@@ -389,6 +390,14 @@ def test_settlement_with_unauthorized_token_transfer( | |||
vals_B, | |||
) | |||
|
|||
# Assign additional tokens to A | |||
assign_tokens(A, externally_transferred_amount) |
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.
Why are you changing the logic of the the test in this PR? I can't see how this is connected to removing coopsettle and withdraw.
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.
Because the test was completely wrong. A
did not have tokens to transfer and the transfer
function used does not revert, it just returns false
. So A
was not transferring anything to the token_network
and the last balance checks were constructed wrongly.
I am adding some more checks for the balances in the test, so things are clear.
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.
Added the additional checks in dab0a9a
@@ -25,7 +25,9 @@ def __init__( | |||
additional_hash=EMPTY_ADDITIONAL_HASH, | |||
): | |||
self.deposit = deposit | |||
self.withdrawn = withdrawn | |||
# FIXME after setTotalWithdraw is enabled again |
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.
if you make that issue I mentioned above you should point to it here too.
6af34c4
to
d5c398c
Compare
We are scoping out the cooperativeSettle for now, as it is not implemented in the Raiden client.
We are scoping out the setTotalWithdraw for now, as it is not implemented in the Raiden client.
dab0a9a
to
d47aa6b
Compare
fixes #265
Please do not merge this until I have the contract limits PR functional on top of this one.
Issue: TokenNetworkRegistry bytecode is too big for deployment if we try to implement #262 and #263
We might go with either:
cooperativeSettle
&setTotalWithdraw
)Changed in this PR, that should be changed back when re-enabling cooperative settle & withdraw
Contracts
raiden-contracts/raiden_contracts/contracts/TokenNetwork.sol
Lines 148 to 152 in d47aa6b
setTotalWithdraw
raiden-contracts/raiden_contracts/contracts/TokenNetwork.sol
Line 333 in d47aa6b
cooperativeSettle
raiden-contracts/raiden_contracts/contracts/TokenNetwork.sol
Line 814 in d47aa6b
recoverAddressFromCooperativeSettleSignature
raiden-contracts/raiden_contracts/contracts/TokenNetwork.sol
Line 1441 in d47aa6b
recoverAddressFromWithdrawMessage
raiden-contracts/raiden_contracts/contracts/TokenNetwork.sol
Line 1472 in d47aa6b
Test contracts
recoverAddressFromCooperativeSettleSignaturePublic
recoverAddressFromCooperativeSettleSignaturePublicrecoverAddressFromWithdrawMessagePublic
raiden-contracts/raiden_contracts/contracts/test/TokenNetworkInternalsTest.sol
Line 224 in d47aa6b
Tests
raiden-contracts/raiden_contracts/tests/fixtures/channel.py
Lines 118 to 126 in d47aa6b
raiden-contracts/raiden_contracts/tests/test_channel_settle.py
Lines 146 to 158 in d47aa6b
test_recover_address_from_withdraw_message
raiden-contracts/raiden_contracts/tests/unit/test_unit_signatures.py
Lines 6 to 7 in d47aa6b
test_recover_address_from_cooperative_settle_signature
raiden-contracts/raiden_contracts/tests/unit/test_unit_signatures.py
Lines 173 to 174 in d47aa6b
ChannelValues
(now withdraw is set to0
for all tests)raiden-contracts/raiden_contracts/tests/utils/utils.py
Lines 30 to 31 in d47aa6b