Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Fixed linter errors, migrated deprecated packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle committed Sep 11, 2023
1 parent 7a4b821 commit 93652eb
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 29 deletions.
11 changes: 0 additions & 11 deletions x/igp/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package keeper_test

import (
"encoding/hex"
"fmt"
"math/big"
"math/rand"
Expand Down Expand Up @@ -667,16 +666,6 @@ func (suite *KeeperTestSuite) SetupIsm() {
}
}

func (suite *KeeperTestSuite) getTestMessageMetadata(index int) (message []byte, metadata []byte) {
var err error
message, err = hex.DecodeString(messages[index])
suite.Require().NoError(err)

metadata, err = hex.DecodeString(metadatas[index])
suite.Require().NoError(err)
return
}

func (suite *KeeperTestSuite) VerifyMessage(message []byte, metadata []byte) (bool, error) {
// Verify Merkle Proof & Validator signature (for LegacyMultiSig). TODO: Ask Steve why this isn't the case for other MultiSigs.
return ismMap[common.Origin(message)].Verify(metadata, message)
Expand Down
9 changes: 0 additions & 9 deletions x/igp/keeper/test_data_test.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions x/ism/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState {
panic(err)
}
ismAny, err := types.PackAbstractIsm(ism)
if err != nil {
panic(err)
}
genesisState.DefaultIsm = append(genesisState.DefaultIsm, types.Ism{
Origin: uint32(origin),
AbstractIsm: ismAny,
Expand Down
2 changes: 1 addition & 1 deletion x/ism/types/errors.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package types

import sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
import sdkerrors "cosmossdk.io/errors"

var (
ErrInvalid = sdkerrors.Register(ModuleName, 1, "invalid")
Expand Down
1 change: 0 additions & 1 deletion x/ism/types/message_id_multisig/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type MultisigIsmMetadata struct {
Index uint32
OriginMailbox []byte
Proof []byte
signatures [][]byte
}

func TestMetadataSuccess(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion x/mailbox/bindings/message_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package bindings
import (
"encoding/json"

sdkerrors "cosmossdk.io/errors"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

bindingstypes "github.com/strangelove-ventures/hyperlane-cosmos/x/mailbox/bindings/types"
mailboxkeeper "github.com/strangelove-ventures/hyperlane-cosmos/x/mailbox/keeper"
Expand Down
5 changes: 4 additions & 1 deletion x/mailbox/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ func (k *Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState) error {
}
var index uint32
for index = 0; index < gs.Tree.Count; index++ {
k.Tree.Insert(tempTree[index])
err := k.Tree.Insert(tempTree[index])
if err != nil {
panic("unreachable")
}
}
for _, msgDelivered := range gs.DeliveredMessages {
k.Delivered[msgDelivered.Id] = true
Expand Down
4 changes: 0 additions & 4 deletions x/mailbox/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@ import (
"github.com/strangelove-ventures/hyperlane-cosmos/x/mailbox/types"

"github.com/stretchr/testify/suite"

ismkeeper "github.com/strangelove-ventures/hyperlane-cosmos/x/ism/keeper"
)

type KeeperTestSuite struct {
suite.Suite

ctx sdk.Context
ismctx sdk.Context
keeper keeper.Keeper
ismkeeper ismkeeper.Keeper
queryClient types.QueryClient
msgServer types.MsgServer

Expand Down
2 changes: 1 addition & 1 deletion x/mailbox/types/errors.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package types

import sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
import sdkerrors "cosmossdk.io/errors"

var (
ErrInvalid = sdkerrors.Register(ModuleName, 1, "invalid")
Expand Down

0 comments on commit 93652eb

Please sign in to comment.