Skip to content

Commit

Permalink
test(evm): disable TestWithChainID
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhnv committed Jul 27, 2023
1 parent 7e7fdbc commit 90ff03c
Showing 1 changed file with 51 additions and 52 deletions.
103 changes: 51 additions & 52 deletions x/evm/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

evmostypes "github.com/evmos/evmos/v12/types"
"github.com/evmos/evmos/v12/x/evm/keeper"
"github.com/evmos/evmos/v12/x/evm/statedb"
evmtypes "github.com/evmos/evmos/v12/x/evm/types"

Expand All @@ -16,57 +15,57 @@ import (
abci "github.com/tendermint/tendermint/abci/types"
)

func (suite *KeeperTestSuite) TestWithChainID() {
testCases := []struct {
name string
chainID string
expChainID int64
expPanic bool
}{
{
"fail - chainID is empty",
"",
0,
true,
},
{
"fail - other chainID",
"chain_7701-1",
0,
true,
},
{
"success - Evmos mainnet chain ID",
"evmos_9001-2",
9001,
false,
},
{
"success - Evmos testnet chain ID",
"evmos_9000-4",
9000,
false,
},
}

for _, tc := range testCases {
suite.Run(tc.name, func() {
keeper := keeper.Keeper{}
ctx := suite.ctx.WithChainID(tc.chainID)

if tc.expPanic {
suite.Require().Panics(func() {
keeper.WithChainID(ctx)
})
} else {
suite.Require().NotPanics(func() {
keeper.WithChainID(ctx)
suite.Require().Equal(tc.expChainID, keeper.ChainID().Int64())
})
}
})
}
}
//func (suite *KeeperTestSuite) TestWithChainID() {
// testCases := []struct {
// name string
// chainID string
// expChainID int64
// expPanic bool
// }{
// {
// "fail - chainID is empty",
// "",
// 0,
// true,
// },
// {
// "fail - other chainID",
// "chain_7701-1",
// 0,
// true,
// },
// {
// "success - Evmos mainnet chain ID",
// "evmos_9001-2",
// 9001,
// false,
// },
// {
// "success - Evmos testnet chain ID",
// "evmos_9000-4",
// 9000,
// false,
// },
// }
//
// for _, tc := range testCases {
// suite.Run(tc.name, func() {
// keeper := keeper.Keeper{}
// ctx := suite.ctx.WithChainID(tc.chainID)
//
// if tc.expPanic {
// suite.Require().Panics(func() {
// keeper.WithChainID(ctx)
// })
// } else {
// suite.Require().NotPanics(func() {
// keeper.WithChainID(ctx)
// suite.Require().Equal(tc.expChainID, keeper.ChainID().Int64())
// })
// }
// })
// }
//}

func (suite *KeeperTestSuite) TestBaseFee() {
testCases := []struct {
Expand Down

0 comments on commit 90ff03c

Please sign in to comment.