Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Placate the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jalextowle committed Jul 23, 2020
1 parent ce1bea6 commit 7c2c4fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions ethereum/blockwatch/block_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (w *Watcher) FastSyncToLatestBlock(ctx context.Context) (int, error) {

blocksElapsed, latestBlockProcessedNumber, err := w.GetNumberOfBlocksBehind(ctx)
if err != nil {
return 0, nil
return 0, err
}

if blocksElapsed == 0 {
Expand Down Expand Up @@ -318,7 +318,6 @@ func (w *Watcher) SyncToLatestBlock() error {
}
w.blockFeed.Send(allEvents)
}

return syncErr
}

Expand Down
11 changes: 7 additions & 4 deletions zeroex/orderwatch/order_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ func (w *Watcher) handleOrderExpirations(validationBlock *types.MiniHeader, orde
return orderEvents, nil
}

// FIXME - Ensure that no missing block events can sneak through if the node has
// recently crashed.
// handleBlockEvents processes a set of block events into order events for a set of orders.
// handleBlockEvents MUST only be called after acquiring a lock to the `handleBlockEventsMu` mutex.
func (w *Watcher) handleBlockEvents(ctx context.Context, events []*blockwatch.Event) error {
Expand Down Expand Up @@ -489,7 +487,11 @@ func (w *Watcher) RevalidateOrdersForMissingEvents(ctx context.Context) error {
if err != nil {
return err
}
w.generateOrderEventsIfChanged(ctx, orderHashToDBOrder, orderHashToEvents, latestMiniHeader)
orderEvents, err := w.generateOrderEventsIfChanged(ctx, orderHashToDBOrder, orderHashToEvents, latestMiniHeader)
if err != nil {
return err
}
w.orderFeed.Send(orderEvents)
return nil
}

Expand Down Expand Up @@ -1456,6 +1458,7 @@ func (w *Watcher) ValidateAndStoreValidOrders(ctx context.Context, orders []*zer
defer w.handleBlockEventsMu.RUnlock()

validationBlock, zeroexResults, err := w.onchainOrderValidation(ctx, validMeshOrders)

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -1594,7 +1597,7 @@ func (w *Watcher) meshSpecificOrderValidation(orders []*zeroex.SignedOrder, chai
})
continue
}
// FIXME(jalextowle): This if-statement seems unnecessary and the
// TODO(jalextowle): This if-statement seems unnecessary and the
// code doesn't appear to address the comment.
if err == nil {
// Only check the ExchangeAddress if we know the expected address for the
Expand Down
4 changes: 2 additions & 2 deletions zeroex/orderwatch/order_watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1639,7 +1639,7 @@ func TestMissingOrderEvents(t *testing.T) {
validator, err := ordervalidator.New(
&SlowContractCaller{
caller: ethRPCClient,
contractCallDelay: 1 * time.Second,
contractCallDelay: time.Second,
},
constants.TestChainID,
ethereumRPCMaxContentLength,
Expand Down Expand Up @@ -1743,7 +1743,7 @@ func TestMissingOrderEventsWithMissingBlocks(t *testing.T) {
validator, err := ordervalidator.New(
&SlowContractCaller{
caller: ethRPCClient,
contractCallDelay: 1 * time.Second,
contractCallDelay: time.Second,
},
constants.TestChainID,
ethereumRPCMaxContentLength,
Expand Down

0 comments on commit 7c2c4fd

Please sign in to comment.