Check chain data when performing settle#2468
Conversation
dd90a30 to
0a80d37
Compare
|
|
||
| if our_balance_proof: | ||
| our_balance_hash = channel_details.participants_data.our_details.balance_hash | ||
| if our_balance_proof and our_balance_hash != bytes(32): |
There was a problem hiding this comment.
Can you use the raiden.constants.EMPTY_HASH constant here.
|
|
||
| if partner_balance_proof: | ||
| partner_balance_hash = channel_details.participants_data.partner_details.balance_hash | ||
| if partner_balance_proof and partner_balance_hash != bytes(32): |
| app0, | ||
| app1, | ||
| token_network_identifier, | ||
| 1, |
There was a problem hiding this comment.
would be nice to add keywords for all parameters
There was a problem hiding this comment.
yeah it would, but there're no kwargs for this call :)
There was a problem hiding this comment.
Hu? Why can't you write amount=1?
There was a problem hiding this comment.
plz add kwargs as @palango suggested. We want to make it a habit. Helps readability and avoid errors.
Edit: what he means is:
direct_transfer(
initiator_app=app0,
target_app=app1,
...
)
There was a problem hiding this comment.
Also please do the same to all the function calls in this test
0a80d37 to
be185ab
Compare
palango
left a comment
There was a problem hiding this comment.
Last comment is about readability, lets get this merged afterwards.
| args=args, | ||
| ) | ||
|
|
||
| def decode_transaction_input(self, transaction_hash): |
| app0, | ||
| app1, | ||
| token_network_identifier, | ||
| 1, |
There was a problem hiding this comment.
plz add kwargs as @palango suggested. We want to make it a habit. Helps readability and avoid errors.
Edit: what he means is:
direct_transfer(
initiator_app=app0,
target_app=app1,
...
)
| app0, | ||
| app1, | ||
| token_network_identifier, | ||
| 1, |
There was a problem hiding this comment.
Also please do the same to all the function calls in this test
| ) | ||
| channel_identifier = get_channelstate(app0, app1, token_network_identifier).identifier | ||
|
|
||
| # make a transfer |
There was a problem hiding this comment.
Add a bit more commentary here to explain what's happening:
-# make a transfer
+# make a transfer from app0 to app1 so that app1 is supposed to have a non empty balance hash| app1.stop() | ||
| token_network_contract = TokenNetwork(app1.raiden.chain.client, token_network_identifier) | ||
|
|
||
| # app1 closes the channel |
There was a problem hiding this comment.
Add more info on the comment.
- # app1 closes the channel
+ # app1 closes the channel with an empty hash instead of the expected hash of the transferred amount from app0| ) | ||
| channel_identifier = get_channelstate(app0, app1, token_network_identifier).identifier | ||
|
|
||
| # make a transfer |
There was a problem hiding this comment.
Same comments as in the above test apply.
- Add kwargs in the function calls
- Expand comments a bit so that the future readers easily understand what's happening
47452d6 to
11d3131
Compare
- checks on-chain state of the channel balance_proof state in order to use ensure consistent settle call even if partner used empty hash to `close` the channel or if he didn't call `updateTransfer` - fixes raiden-network#2410 - fix webargs' `handle_request_parsing_error` [ci integration]
11d3131 to
2423540
Compare
|
The stress test fails. But locally when I check out your branch it passes. |
|
merging since all pass except a flaky test. |
use ensure consistent settle call even if partner used empty hash to
closethe channel or if he didn't callupdateTransfer[ci integration]