Make lint changes
This commit is contained in:
parent
0e263a23be
commit
c412168e1c
@ -241,13 +241,13 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
|
|||||||
pgConfig.MaxIdle = ctx.GlobalInt(utils.StateDiffDBMaxIdleConns.Name)
|
pgConfig.MaxIdle = ctx.GlobalInt(utils.StateDiffDBMaxIdleConns.Name)
|
||||||
}
|
}
|
||||||
if ctx.GlobalIsSet(utils.StateDiffDBMaxConnLifetime.Name) {
|
if ctx.GlobalIsSet(utils.StateDiffDBMaxConnLifetime.Name) {
|
||||||
pgConfig.MaxConnLifetime = ctx.GlobalDuration(utils.StateDiffDBMaxConnLifetime.Name) * time.Second
|
pgConfig.MaxConnLifetime = time.Duration(ctx.GlobalDuration(utils.StateDiffDBMaxConnLifetime.Name).Seconds())
|
||||||
}
|
}
|
||||||
if ctx.GlobalIsSet(utils.StateDiffDBMaxConnIdleTime.Name) {
|
if ctx.GlobalIsSet(utils.StateDiffDBMaxConnIdleTime.Name) {
|
||||||
pgConfig.MaxConnIdleTime = ctx.GlobalDuration(utils.StateDiffDBMaxConnIdleTime.Name) * time.Second
|
pgConfig.MaxConnIdleTime = time.Duration(ctx.GlobalDuration(utils.StateDiffDBMaxConnIdleTime.Name).Seconds())
|
||||||
}
|
}
|
||||||
if ctx.GlobalIsSet(utils.StateDiffDBConnTimeout.Name) {
|
if ctx.GlobalIsSet(utils.StateDiffDBConnTimeout.Name) {
|
||||||
pgConfig.ConnTimeout = ctx.GlobalDuration(utils.StateDiffDBConnTimeout.Name) * time.Second
|
pgConfig.ConnTimeout = time.Duration(ctx.GlobalDuration(utils.StateDiffDBConnTimeout.Name).Seconds())
|
||||||
}
|
}
|
||||||
indexerConfig = pgConfig
|
indexerConfig = pgConfig
|
||||||
case shared.DUMP:
|
case shared.DUMP:
|
||||||
|
@ -18,8 +18,6 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type gapValues struct {
|
type gapValues struct {
|
||||||
lastProcessedBlock int64
|
|
||||||
currentBlock int64
|
|
||||||
knownErrorBlocksStart int64
|
knownErrorBlocksStart int64
|
||||||
knownErrorBlocksEnd int64
|
knownErrorBlocksEnd int64
|
||||||
expectedDif int64
|
expectedDif int64
|
||||||
|
@ -112,8 +112,8 @@ func testErrorInChainEventLoop(t *testing.T) {
|
|||||||
|
|
||||||
payloads := make([]statediff.Payload, 0, 2)
|
payloads := make([]statediff.Payload, 0, 2)
|
||||||
wg := new(sync.WaitGroup)
|
wg := new(sync.WaitGroup)
|
||||||
go func() {
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
|
go func() {
|
||||||
for i := 0; i < 2; i++ {
|
for i := 0; i < 2; i++ {
|
||||||
select {
|
select {
|
||||||
case payload := <-payloadChan:
|
case payload := <-payloadChan:
|
||||||
|
@ -34,7 +34,6 @@ type BlockChain struct {
|
|||||||
HashesLookedUp []common.Hash
|
HashesLookedUp []common.Hash
|
||||||
blocksToReturnByHash map[common.Hash]*types.Block
|
blocksToReturnByHash map[common.Hash]*types.Block
|
||||||
blocksToReturnByNumber map[uint64]*types.Block
|
blocksToReturnByNumber map[uint64]*types.Block
|
||||||
callCount int
|
|
||||||
ChainEvents []core.ChainEvent
|
ChainEvents []core.ChainEvent
|
||||||
Receipts map[common.Hash]types.Receipts
|
Receipts map[common.Hash]types.Receipts
|
||||||
TDByHash map[common.Hash]*big.Int
|
TDByHash map[common.Hash]*big.Int
|
||||||
|
@ -154,8 +154,8 @@ func testSubscriptionAPI(t *testing.T) {
|
|||||||
payloadChan := make(chan statediff.Payload)
|
payloadChan := make(chan statediff.Payload)
|
||||||
quitChan := make(chan bool)
|
quitChan := make(chan bool)
|
||||||
wg := new(sync.WaitGroup)
|
wg := new(sync.WaitGroup)
|
||||||
go func() {
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
sort.Slice(expectedStateDiffBytes, func(i, j int) bool { return expectedStateDiffBytes[i] < expectedStateDiffBytes[j] })
|
sort.Slice(expectedStateDiffBytes, func(i, j int) bool { return expectedStateDiffBytes[i] < expectedStateDiffBytes[j] })
|
||||||
select {
|
select {
|
||||||
@ -177,7 +177,7 @@ func testSubscriptionAPI(t *testing.T) {
|
|||||||
t.Errorf("channel quit before delivering payload")
|
t.Errorf("channel quit before delivering payload")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
time.Sleep(1)
|
time.Sleep(1 * time.Second)
|
||||||
mockService.Subscribe(id, payloadChan, quitChan, parameters)
|
mockService.Subscribe(id, payloadChan, quitChan, parameters)
|
||||||
blockChan <- block1
|
blockChan <- block1
|
||||||
parentBlockChain <- block0
|
parentBlockChain <- block0
|
||||||
|
Loading…
Reference in New Issue
Block a user