Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinssgh committed Nov 15, 2023
1 parent 9699e65 commit 2709f1e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/zetaclientd/hsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package main

import (
"fmt"
"github.com/zeta-chain/zetacore/zetaclient/hsm"

"github.com/pkg/errors"
"github.com/spf13/cobra"
keystone "github.com/zeta-chain/keystone/keys"
"github.com/zeta-chain/zetacore/cmd"
"github.com/zeta-chain/zetacore/common/cosmos"
"github.com/zeta-chain/zetacore/zetaclient/hsm"
)

var HsmCmd = &cobra.Command{
Expand Down
3 changes: 2 additions & 1 deletion zetaclient/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package zetaclient

import (
"fmt"
"github.com/zeta-chain/zetacore/zetaclient/hsm"
"regexp"
"strconv"
"strings"

"github.com/zeta-chain/zetacore/zetaclient/hsm"

"github.com/cosmos/cosmos-sdk/client"
clienttx "github.com/cosmos/cosmos-sdk/client/tx"
sdktypes "github.com/cosmos/cosmos-sdk/types"
Expand Down
6 changes: 3 additions & 3 deletions zetaclient/hsm/hsm_signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const hsmPath = "HSM_PATH"
const hsmPIN = "HSM_PIN"
const hsmLabel = "HSM_LABEL"

// HsmSign Generates signature of msg using the key indexed by the label through the HSM defined in the config
func HsmSign(config *crypto11.Config, msg []byte, label string) (signature []byte, err error) {
// Sign Generates signature of msg using the key indexed by the label through the HSM defined in the config
func Sign(config *crypto11.Config, msg []byte, label string) (signature []byte, err error) {
keyring, err := keystone.NewPkcs11(config)
if err != nil {
return
Expand Down Expand Up @@ -131,7 +131,7 @@ func SignWithHSM(
}

// Sign those bytes
sigBytes, err := HsmSign(hsmCfg, bytesToSign, name)
sigBytes, err := Sign(hsmCfg, bytesToSign, name)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion zetaclient/hsm/hsm_signer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestSignSecp256k1(t *testing.T) {
//Create sample message
msg := []byte("Signing this plaintext tells me what exactly?")

signature, err := HsmSign(config, msg, string(label))
signature, err := Sign(config, msg, string(label))
require.NoError(t, err)
require.NotNil(t, signature)
require.Equal(t, key.KeyType(), keystone.KEYGEN_SECP256K1)
Expand Down

0 comments on commit 2709f1e

Please sign in to comment.