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

orderwatch: Add missing test coverage #416

Merged
merged 26 commits into from Sep 17, 2019
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5a1001f
Add integration tests for OrderWatcher and fix issue where we weren't…
fabioberger Sep 14, 2019
ff0e236
Add CHANGELOG entry for bug fix
fabioberger Sep 14, 2019
8381083
Fix linter errors
fabioberger Sep 14, 2019
5a027e2
Fix misnamed variable
fabioberger Sep 14, 2019
8a5b5d7
Fix test name
fabioberger Sep 14, 2019
d70f0c5
Omit OrderWatcher tests from WASM build
fabioberger Sep 15, 2019
6f1b67f
Run tests sequentially since we now have multiple test suites making …
fabioberger Sep 15, 2019
99df2d5
Use the same ethClient across tests to make debugging Ganache easier …
fabioberger Sep 15, 2019
1bdd3b1
Remove unnecessary snapshotting
fabioberger Sep 15, 2019
f69eb51
Remove duplicate test
fabioberger Sep 15, 2019
ed93a5f
Add bug fix to unreleased 4.1.0 changelog entry
fabioberger Sep 17, 2019
c8a6d42
Fix rebase issues
fabioberger Sep 17, 2019
b71fa9e
Use init instead of TestSetup pattern so that all tests can be run in…
fabioberger Sep 17, 2019
8a66f72
Standardize on importing the Ethereum rpc package as `ethrpc`
fabioberger Sep 17, 2019
e4583f3
set content length to a variable to improve readability
fabioberger Sep 17, 2019
ec040ed
Add timeout when listening for OrderEvent to provide developers with …
fabioberger Sep 17, 2019
8db0e7b
Use assert instead of require in places where the tests could continu…
fabioberger Sep 17, 2019
6ed7d4d
Move contract wrapper declarations into the init function so we don't…
fabioberger Sep 17, 2019
b1530de
Pass in a context with a timeout to calls to WaitMined so that they a…
fabioberger Sep 17, 2019
d18bff8
Split tests so that only those that tests that can be run in parallel do
fabioberger Sep 17, 2019
58d74c4
Pass context into goroutines and cancel them when tests exit
fabioberger Sep 17, 2019
6de0fd8
Call cancelFn after WaitMined completes to cancel the context before …
fabioberger Sep 17, 2019
a4e57cd
Add missing serial flag on additional tests
fabioberger Sep 17, 2019
64dd326
Add waitForOrderEvents helper method
fabioberger Sep 17, 2019
7b9ab60
Use require for orders length assertion
fabioberger Sep 17, 2019
e1673d4
Add waitTxnSuccessfullyMined convenience method
fabioberger Sep 17, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Fix misnamed variable

  • Loading branch information
fabioberger committed Sep 14, 2019
commit 5a027e2da8305dfeba0ca572d8fc783489385e1c
@@ -256,8 +256,8 @@ func TestOrderWatcherUnfundedThenFundedAgain(t *testing.T) {
orderEvent = orderEvents[0]
require.Equal(t, zeroex.EKOrderAdded, orderEvent.Kind)

newOrders := []*meshdb.Order{}
err = meshDB.Orders.FindAll(&orders)
var newOrders []*meshdb.Order
err = meshDB.Orders.FindAll(&newOrders)
require.NoError(t, err)
require.Len(t, newOrders, 1)
require.Equal(t, orderEvent.OrderHash, newOrders[0].Hash)
@@ -299,8 +299,8 @@ func TestOrderWatcherNoChange(t *testing.T) {
require.NoError(t, err)
require.Equal(t, receipt.Status, uint64(1))

newOrders := []*meshdb.Order{}
err = meshDB.Orders.FindAll(&orders)
var newOrders []*meshdb.Order
err = meshDB.Orders.FindAll(&newOrders)
require.NoError(t, err)
require.Len(t, newOrders, 1)
require.NotEqual(t, dbOrder.LastUpdated, newOrders[0].Hash)
@@ -367,8 +367,8 @@ func TestOrderWatcherWETHWithdrawAndDeposit(t *testing.T) {
orderEvent = orderEvents[0]
require.Equal(t, zeroex.EKOrderAdded, orderEvent.Kind)

newOrders := []*meshdb.Order{}
err = meshDB.Orders.FindAll(&orders)
var newOrders []*meshdb.Order
err = meshDB.Orders.FindAll(&newOrders)
require.NoError(t, err)
require.Len(t, newOrders, 1)
require.Equal(t, orderEvent.OrderHash, newOrders[0].Hash)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.