Fix lint warnings

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Łukasz Magiera 2020-10-10 14:06:03 +02:00 committed by Jakub Sztandera
parent 2c92157233
commit 8ae66d6c6a
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
2 changed files with 10 additions and 16 deletions

View File

@ -5,16 +5,18 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/query"
ledgerfil "github.com/whyrusleeping/ledger-filecoin-go"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/query"
ledgerfil "github.com/whyrusleeping/ledger-filecoin-go"
)
type LedgerWallet struct {
@ -42,7 +44,7 @@ func (lw LedgerWallet) WalletSign(ctx context.Context, signer address.Address, t
if err != nil {
return nil, err
}
defer fl.Close()
defer fl.Close() // nolint:errcheck
if meta.Type != api.MTChainMsg {
return nil, fmt.Errorf("ledger can only sign chain messages")
}
@ -82,7 +84,7 @@ func (lw LedgerWallet) getKeyInfo(addr address.Address) (*LedgerKeyInfo, error)
var out LedgerKeyInfo
if err := json.Unmarshal(kib, &out); err != nil {
return nil, err
return nil, xerrors.Errorf("unmarshalling ledger key info: %w", err)
}
return &out, nil

View File

@ -33,8 +33,8 @@ var ledgerListAddressesCmd = &cli.Command{
Name: "list",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "print-balances",
Usage: "print balances",
Name: "print-balances",
Usage: "print balances",
Aliases: []string{"b"},
},
},
@ -137,19 +137,11 @@ func printHDPath(pth []uint32) string {
return strings.TrimRight(s, "/")
}
func numlist(p []uint32) string {
var out []string
for _, v := range p {
out = append(out, fmt.Sprint(v))
}
return strings.Join(out, ",")
}
var ledgerKeyInfoCmd = &cli.Command{
Name: "key-info",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "verbose",
Name: "verbose",
Aliases: []string{"v"},
},
},