Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Oct 3, 2024
1 parent 58e94ce commit 5c304ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions native/blockchain/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"strings"
"sync"

provtypes "github.com/cometbft/cometbft/light/provider"
prov "github.com/cometbft/cometbft/light/provider/http"
types "github.com/cometbft/cometbft/rpc/jsonrpc/types"
tmtypes "github.com/cometbft/cometbft/types"
sdk "github.com/cosmos/cosmos-sdk/types"
prov "github.com/cometbft/cometbft/light/provider/http"
provtypes "github.com/cometbft/cometbft/light/provider"
"github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/cosmos/cosmos-sdk/x/bank"

Expand Down Expand Up @@ -160,10 +160,10 @@ func (b *chainRPC) Block(ctx context.Context, height int64) (blk *tmtypes.Block,
defer b.mu.Unlock()
blkResult, err := b.conn.websocketRPC.Block(ctx, &height)
if err != nil {
// usually a node does not have all the blocks,
// usually a node does not have all the blocks,
// in this case we could parse the last block that node has available and start from there.
// "error in json rpc client, with http response metadata:
// (Status: 200 OK, Protocol HTTP/1.1).
// "error in json rpc client, with http response metadata:
// (Status: 200 OK, Protocol HTTP/1.1).
// RPC error -32603 - Internal error: height 1 is not available, lowest height is 7942001"
errString := err.Error()
searchStrInErr := fmt.Sprintf("Internal error: height %d is not available, lowest height is ", height)
Expand Down Expand Up @@ -199,8 +199,9 @@ func (b *chainRPC) CheckTx(ctx context.Context, tx tmtypes.Tx) (err error) {

return nil
}

// create light provider
func (b *chainRPC) LightProvider() (provtypes.Provider) {
func (b *chainRPC) LightProvider() provtypes.Provider {

lightprovider, err := prov.New(b.ChainID(), b.conn.AddrRPC)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions native/blockchian.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package native
import (
"context"

provtypes "github.com/cometbft/cometbft/light/provider"
tmtypes "github.com/cometbft/cometbft/types"
sdktypes "github.com/cosmos/cosmos-sdk/types"
provtypes "github.com/cometbft/cometbft/light/provider"
)

// Blockchain is the expected blockchain interface the indexer needs to store data in the database.
Expand All @@ -18,5 +18,5 @@ type Blockchain interface {
SubscribeNewBlock(ctx context.Context) (<-chan *tmtypes.Block, error)
Block(ctx context.Context, height int64) (blk *tmtypes.Block, minimumBlkHeight int, err error)
CheckTx(ctx context.Context, tx tmtypes.Tx) (err error)
LightProvider() (provtypes.Provider)
}
LightProvider() provtypes.Provider
}
2 changes: 1 addition & 1 deletion native/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package native
import (
"context"
"encoding/hex"

tmtypes "github.com/cometbft/cometbft/types"
)

Expand Down

0 comments on commit 5c304ec

Please sign in to comment.