Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
MalteHerrmann committed Aug 21, 2024
1 parent fc5bda0 commit 0f29fa7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 34 deletions.
39 changes: 18 additions & 21 deletions tests/integration/ledger/evmosd_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,30 @@ import (
"time"

"cosmossdk.io/simapp/params"
"github.com/cometbft/cometbft/crypto/tmhash"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmversion "github.com/cometbft/cometbft/proto/tendermint/version"
rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock"
"github.com/cometbft/cometbft/version"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
cosmosledger "github.com/cosmos/cosmos-sdk/crypto/ledger"
"github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/server"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/common"
clientkeys "github.com/evmos/os/client/keys"
"github.com/evmos/os/crypto/hd"
evmoskeyring "github.com/evmos/os/crypto/keyring"
example_app "github.com/evmos/os/example_chain"
"github.com/evmos/os/tests/integration/ledger/mocks"
"github.com/evmos/os/testutil"
utiltx "github.com/evmos/os/testutil/tx"
"github.com/spf13/cobra"

"github.com/cometbft/cometbft/crypto/tmhash"
"github.com/cometbft/cometbft/version"
"github.com/evmos/evmos/v19/app"
"github.com/evmos/evmos/v19/crypto/hd"
"github.com/evmos/evmos/v19/tests/integration/ledger/mocks"
utiltx "github.com/evmos/evmos/v19/testutil/tx"
"github.com/evmos/evmos/v19/utils"
"github.com/stretchr/testify/suite"

tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmversion "github.com/cometbft/cometbft/proto/tendermint/version"
rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock"
cosmosledger "github.com/cosmos/cosmos-sdk/crypto/ledger"
sdk "github.com/cosmos/cosmos-sdk/types"
clientkeys "github.com/evmos/evmos/v19/client/keys"
evmoskeyring "github.com/evmos/evmos/v19/crypto/keyring"
feemarkettypes "github.com/evmos/evmos/v19/x/feemarket/types"

//nolint:revive // dot imports are fine for Ginkgo
. "github.com/onsi/ginkgo/v2"
//nolint:revive // dot imports are fine for Ginkgo
Expand All @@ -47,7 +44,7 @@ var s *LedgerTestSuite
type LedgerTestSuite struct {
suite.Suite

app *app.Evmos
app *example_app.ExampleChain
ctx sdk.Context

ledger *mocks.SECP256K1
Expand Down Expand Up @@ -87,8 +84,8 @@ func (suite *LedgerTestSuite) SetupEvmosApp() {
consAddress := sdk.ConsAddress(utiltx.GenerateAddress().Bytes())

// init app
chainID := utils.MainnetChainID + "-1"
suite.app = app.Setup(false, feemarkettypes.DefaultGenesisState(), chainID)
chainID := testutil.ExampleChainID
suite.app = example_app.Setup(suite.T(), false, chainID)
suite.ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{
Height: 1,
ChainID: chainID,
Expand Down Expand Up @@ -136,7 +133,7 @@ func (suite *LedgerTestSuite) NewKeyringAndCtxs(krHome string, input io.Reader,
WithUseLedger(true).
WithKeyring(kr).
WithClient(mocks.MockTendermintRPC{Client: rpcclientmock.Client{}}).
WithChainID(utils.TestnetChainID + "-13")
WithChainID(testutil.ExampleChainIDPrefix + "-13")

srvCtx := server.NewDefaultContext()
ctx := context.Background()
Expand Down
23 changes: 10 additions & 13 deletions tests/integration/ledger/ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/keyring"

"github.com/evmos/evmos/v19/app"
"github.com/evmos/evmos/v19/crypto/hd"
"github.com/evmos/evmos/v19/encoding"
"github.com/evmos/evmos/v19/tests/integration/ledger/mocks"
"github.com/evmos/evmos/v19/testutil"
utiltx "github.com/evmos/evmos/v19/testutil/tx"

"github.com/spf13/cobra"

sdktestutil "github.com/cosmos/cosmos-sdk/testutil"
sdktestutilcli "github.com/cosmos/cosmos-sdk/testutil/cli"
sdk "github.com/cosmos/cosmos-sdk/types"
bankcli "github.com/cosmos/cosmos-sdk/x/bank/client/cli"
"github.com/evmos/os/crypto/hd"
"github.com/evmos/os/encoding"
example_app "github.com/evmos/os/example_chain"
chainutil "github.com/evmos/os/example_chain/testutil"
"github.com/evmos/os/tests/integration/ledger/mocks"
utiltx "github.com/evmos/os/testutil/tx"
"github.com/spf13/cobra"

//nolint:revive // dot imports are fine for Ginkgo
. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -59,7 +56,7 @@ var _ = Describe("Ledger CLI and keyring functionality: ", func() {
Describe("Adding a key from ledger using the CLI", func() {
BeforeEach(func() {
krHome = s.T().TempDir()
encCfg = encoding.MakeConfig(app.ModuleBasics)
encCfg = encoding.MakeConfig(example_app.ModuleBasics)

cmd = s.evmosAddKeyCmd()

Expand Down Expand Up @@ -104,7 +101,7 @@ var _ = Describe("Ledger CLI and keyring functionality: ", func() {
Describe("Singing a transactions", func() {
BeforeEach(func() {
krHome = s.T().TempDir()
encCfg = encoding.MakeConfig(app.ModuleBasics)
encCfg = encoding.MakeConfig(example_app.ModuleBasics)

var err error

Expand Down Expand Up @@ -171,7 +168,7 @@ var _ = Describe("Ledger CLI and keyring functionality: ", func() {
BeforeEach(func() {
s.ledger = mocks.NewSECP256K1(s.T())

err := testutil.FundAccount(
err := chainutil.FundAccount(
s.ctx,
s.app.BankKeeper,
s.accAddr,
Expand Down

0 comments on commit 0f29fa7

Please sign in to comment.