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

Comment out cooperativeSettle & setTotalWithdraw temporarily #270

Conversation

loredanacirstea
Copy link
Contributor

@loredanacirstea loredanacirstea commented Sep 17, 2018

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:

Changed in this PR, that should be changed back when re-enabling cooperative settle & withdraw

Contracts

Test contracts

Tests

@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor Author

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')
Copy link
Contributor

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)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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
Copy link
Contributor

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.

loredanacirstea added a commit to loredanacirstea/raiden-contracts that referenced this pull request Sep 18, 2018
loredanacirstea added a commit to loredanacirstea/raiden-contracts that referenced this pull request Sep 19, 2018
@loredanacirstea loredanacirstea force-pushed the remove-cooperativesettle-withdraw branch from 6af34c4 to d5c398c Compare September 19, 2018 10:02
loredanacirstea added a commit to loredanacirstea/raiden-contracts that referenced this pull request Sep 19, 2018
@LefterisJP LefterisJP merged commit 2b4d503 into raiden-network:master Sep 20, 2018
LefterisJP pushed a commit that referenced this pull request Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove unimplemented client functionality
2 participants