Skip to content

Commit

Permalink
Linitng
Browse files Browse the repository at this point in the history
  • Loading branch information
pbukva committed Oct 31, 2024
1 parent 7f27af0 commit 3d661a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions client/keys/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"bufio"
"encoding/hex"
"fmt"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"os"
"strings"

"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"

"github.com/spf13/cobra"

"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -113,7 +114,6 @@ At the moment, only the secp256k1 curve/algo is supported.`,
info, err := clientCtx.Keyring.ImportUnarmoredPrivKey(args[0], privKeyRaw, algo)
if err != nil {
return fmt.Errorf("importing unarmored private key: %w", err)

}

if err := printCreateUnarmored(cmd, info, clientCtx.OutputFormat); err != nil {
Expand All @@ -124,7 +124,7 @@ At the moment, only the secp256k1 curve/algo is supported.`,
},
}

cmd.Flags().String(flagUnarmoredKeyAlgo, string(hd.Secp256k1Type), fmt.Sprintf("defines cryptographic scheme algorithm of the private key (\"%s\", \"%s\"). At the moent *ONLY* the \"%s\" is supported. Defaults to \"%s\".", hd.Secp256k1Type, hd.Ed25519Type, hd.Secp256k1Type, hd.Secp256k1Type))
cmd.Flags().String(flagUnarmoredKeyAlgo, string(hd.Secp256k1Type), fmt.Sprintf("defines cryptographic scheme algorithm of the private key (\"%s\", \"%s\"). At the moment *ONLY* the \"%s\" is supported. Defaults to \"%s\".", hd.Secp256k1Type, hd.Ed25519Type, hd.Secp256k1Type, hd.Secp256k1Type))

return cmd
}
Expand Down
5 changes: 3 additions & 2 deletions crypto/keyring/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"bufio"
"encoding/hex"
"fmt"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
"io"
"os"
"path/filepath"
"sort"
"strings"

"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"

"github.com/99designs/keyring"
bip39 "github.com/cosmos/go-bip39"
"github.com/pkg/errors"
Expand Down Expand Up @@ -327,7 +328,7 @@ func (ks keystore) ImportUnarmoredPrivKey(uid string, unarmoredPrivKeyRaw []byte
return nil, fmt.Errorf("only the \"%s\" algo is supported at the moment", hd.Secp256k1Type)
}

//privKey, err := legacy.PrivKeyFromBytes(privKeyRaw)
// privKey, err := legacy.PrivKeyFromBytes(privKeyRaw)
//if err != nil {

Check failure on line 332 in crypto/keyring/keyring.go

View workflow job for this annotation

GitHub Actions / golangci-lint

commentFormatting: put a space between `//` and comment text (gocritic)
// return errors.Wrap(err, "failed to create private key from provided hex value")
//}
Expand Down

0 comments on commit 3d661a4

Please sign in to comment.