-
Notifications
You must be signed in to change notification settings - Fork 112
Conversation
…actor swap tests cheques
…tire TestCheques function
…p-improve-balance-tests # Conflicts: # swap/swap_test.go
…e-tests # Conflicts: # swap/protocol.go # swap/swap.go # swap/swap_test.go
// create a test swap account | ||
swap, clean := newTestSwap(t, ownerKey, nil) | ||
defer clean() | ||
// test previous results are still correct |
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.
What is the added value of these extra tests?
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 value isn't huge (in fact, it's an arguably somewhat paranoic practice) but since we progressively deal with different peers, it's conceivable that after working with a new one, results from the previous peer could be affected (and therefore, be erroneous).
one could apply this logic for many more cases, though
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.
Functionally not much changed, but a good cleanup. Thanks for doing this!
In both TestBalance and TestBalances, you add extra test cases in the end, seemingly testing something which you already tested before. I am curious why you would do this.
Looks good to me!
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.
LGTM
The purpose of this PR is to improve the test functions for the peer balances RPCs, in terms of code clarity, tidiness and test cases coverage.
Test
+name of the function they are testing
heuristic.