Apply go fmt updates to statediff pkg

This commit is contained in:
Elizabeth Engelman 2019-01-28 12:48:34 -06:00
parent b6dc2d509e
commit 16ee9a519a
2 changed files with 14 additions and 14 deletions

View File

@ -58,20 +58,20 @@ func (sds *StateDiffService) Loop(chainEventCh chan core.ChainEvent) {
quitCh := make(chan struct{}) quitCh := make(chan struct{})
go func() { go func() {
HandleLoop: HandleLoop:
for { for {
select { select {
//Notify chain event channel of events //Notify chain event channel of events
case chainEvent := <-chainEventCh: case chainEvent := <-chainEventCh:
log.Debug("Event received from chainEventCh", "event", chainEvent) log.Debug("Event received from chainEventCh", "event", chainEvent)
blocksCh <- chainEvent.Block blocksCh <- chainEvent.Block
//if node stopped //if node stopped
case err := <-errCh: case err := <-errCh:
log.Debug("Error from chain event subscription, breaking loop.", "error", err) log.Debug("Error from chain event subscription, breaking loop.", "error", err)
break HandleLoop break HandleLoop
}
} }
close(quitCh) }
close(quitCh)
}() }()
//loop through chain events until no more //loop through chain events until no more

View File

@ -1,11 +1,11 @@
package mocks package mocks
import ( import (
"errors"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
"errors"
) )
type BlockChain struct { type BlockChain struct {