Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: some lint problems and import issue #121

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cmd/client_gnfd.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/bnb-chain/greenfield-go-sdk/client"
"github.com/bnb-chain/greenfield-go-sdk/types"
sdktypes "github.com/bnb-chain/greenfield-go-sdk/types"
"github.com/urfave/cli/v2"
)

Expand Down Expand Up @@ -47,7 +46,7 @@ func NewClient(ctx *cli.Context, opts ClientOptions) (client.IClient, error) {
return nil, err
}

account, err = sdktypes.NewAccountFromPrivateKey("gnfd-account", privateKey)
account, err = types.NewAccountFromPrivateKey("gnfd-account", privateKey)
if err != nil {
fmt.Println("new account err", err.Error())
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions cmd/cmd_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func listKeyStore(keystoreDir, defaultAccount string) error {
keyPath := filepath.Join(keystoreDir, file.Name())
keyFileContent, err = os.ReadFile(keyPath)
if err != nil {
return fmt.Errorf("failed to read the keyfile at '%s': %v \n", keyPath, err)
return fmt.Errorf("failed to read the keyfile at '%s': %v", keyPath, err)
}

k := new(encryptedKey)
Expand Down Expand Up @@ -545,7 +545,7 @@ func parseKeystore(ctx *cli.Context) (string, string, error) {

privateKey, err := DecryptKey(keyjson, password)
if err != nil {
return "", "", fmt.Errorf("failed to decrypting key: %v \n", err)
return "", "", fmt.Errorf("failed to decrypting key: %v", err)
}

return privateKey, keyFile, nil
Expand Down
8 changes: 4 additions & 4 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ func loadKey(file string) (string, sdk.AccAddress, error) {
}

if len(priBytes) != 32 {
return "", nil, fmt.Errorf("Len of Keybytes is not equal to 32 ")
return "", nil, fmt.Errorf("len of Keybytes is not equal to 32 ")
}
var keyBytesArray [32]byte
copy(keyBytesArray[:], priBytes[:32])
Expand Down Expand Up @@ -583,7 +583,7 @@ func loadKeyStoreFile(ctx *cli.Context) ([]byte, string, error) {
// fetch private key from keystore
content, err := os.ReadFile(keyfilePath)
if err != nil {
return nil, "", fmt.Errorf("failed to read the keyfile at '%s': %v \n", keyfilePath, err)
return nil, "", fmt.Errorf("failed to read the keyfile at '%s': %v", keyfilePath, err)
}

return content, keyfilePath, nil
Expand Down Expand Up @@ -759,7 +759,7 @@ func checkIfDownloadFileExist(filePath, objectName string) (string, error) {
filePath = filePath + "/" + objectName
return filePath, nil
}
return filePath, fmt.Errorf("download file:%s already exist\n", filePath)
return filePath, fmt.Errorf("download file:%s already exist", filePath)
}
return filePath, nil
}
Expand Down Expand Up @@ -810,7 +810,7 @@ func createAndWriteFile(fileName string, content []byte) error {
func readFile(fileName string) ([]byte, error) {
content, err := os.ReadFile(fileName)
if err != nil {
return nil, fmt.Errorf("failed to read the keyfile at '%s': %v \n", fileName, err)
return nil, fmt.Errorf("failed to read the keyfile at '%s': %v", fileName, err)
}

return content, nil
Expand Down
Loading