Skip to content

Commit

Permalink
chore: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hacheigriega committed Nov 1, 2024
1 parent 834ccf5 commit a2971b5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ func NewApp(
)

app.PubKeyKeeper = *pubkeykeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[pubkeytypes.StoreKey]),
app.StakingKeeper,
authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
Expand Down
8 changes: 2 additions & 6 deletions app/utils/seda_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ var sedaKeyGenerators = map[SEDAKeyIndex]privKeyGenerator{
var sedaKeyValidators = map[SEDAKeyIndex]pubKeyValidator{
SEDAKeyIndexSecp256k1: func(pubKey []byte) bool {
x, _ := elliptic.Unmarshal(ethcrypto.S256(), pubKey)

Check failure on line 51 in app/utils/seda_keys.go

View workflow job for this annotation

GitHub Actions / golangci

SA1019: elliptic.Unmarshal has been deprecated since Go 1.21: for ECDH, use the crypto/ecdh package. This function accepts an encoding equivalent to that of the NewPublicKey methods in crypto/ecdh. (staticcheck)
if x == nil {
return false
}
return true
return x != nil
},
}

Expand Down Expand Up @@ -223,8 +220,7 @@ func LoadSEDASigner(loadPath string) (SEDASigner, error) {
return &sedaKeys{keys: keys}, nil
}

// Sign hashes the given input using Keccak-256 and signs the resulting
// hash with the key at the given index.
// Sign signs a 32-byte digest with the key at the given index.
func (s *sedaKeys) Sign(input []byte, index SEDAKeyIndex) ([]byte, error) {
var signature []byte
var err error
Expand Down
3 changes: 1 addition & 2 deletions x/pubkey/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"cosmossdk.io/core/address"
storetypes "cosmossdk.io/core/store"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

Expand All @@ -23,7 +22,7 @@ type Keeper struct {
pubKeys collections.Map[collections.Pair[[]byte, uint32], []byte]
}

func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, sk types.StakingKeeper, validatorAddressCodec address.Codec) *Keeper {
func NewKeeper(storeService storetypes.KVStoreService, sk types.StakingKeeper, validatorAddressCodec address.Codec) *Keeper {
if validatorAddressCodec == nil {
panic("validator address codec is nil")
}
Expand Down
1 change: 1 addition & 0 deletions x/pubkey/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
gomock "go.uber.org/mock/gomock"

"github.com/cometbft/cometbft/crypto/secp256k1"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
Expand Down
4 changes: 1 addition & 3 deletions x/pubkey/types/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)

var (
_ sdk.Msg = &MsgAddKey{}
)
var _ sdk.Msg = &MsgAddKey{}

func (m *MsgAddKey) Validate() error {
if m.ValidatorAddr == "" {
Expand Down

0 comments on commit a2971b5

Please sign in to comment.