-
Notifications
You must be signed in to change notification settings - Fork 33
add test to swap bought asset from maker #71
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
add test to swap bought asset from maker #71
Conversation
|
Swap quantities ( Therefore, when swapping from 5 asset 1 to 5 asset 2:
The expected off-chain balances after the last swap in the test then are:
With these balances the test passes. That being said, I've observed the test still failing sometimes due to balances not updating after the last swap (asset 1 remaining 590/10), will look into that. PS: a dedicated |
|
Thanks for the clear explanations, the expected amounts after the last swap is wrong and I'll modify it, but the fact that the the balances aren't updated remains the same. The test tries to replicate the exact situation I faced multiple times in my testing where the maker marks the swap as failed, taker marks it as pending and the amounts will not change. Let me know if I could provide more details. |
From some local test runs I did, with the correct balances the test passes most of the time.
From this I get that you expect the test to fail because of the maker failing the swap, is my understanding correct? |
To be exact, from my understanding, the maker marks the swap as failed because it fails to pay to taker, so the swap it self is marked as failed, but on the taker side it is stuck in pending status and also the balances doesn't change on both end. |
e95b0fb to
1d6bcd1
Compare
Both maker and taker mark the swap as succeeded, but the balance fails to update to the expected values because the second part of the swap sometimes happens on the wrong channel. The underlying cause of the bug has been identified and fixed. We're going to merge this test and will then improve on it to add more checks. Before we merge it, though, we'd like for the name of the test to be changed into |
|
Of-course, thanks for resolving this. |
96bd94b to
3bf7f89
Compare
3bf7f89 to
cfeb4ba
Compare
|
Merged, thanks! |
The test added shows an unexpected behavior of the nodes after the 2nd node swapped (bought) 2 assets with the 1st node and then tried to swapped these assets with the 1st node again.