Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trinitys7 committed Oct 28, 2024
1 parent 4bfba55 commit 77836aa
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 18 deletions.
8 changes: 4 additions & 4 deletions app/ante/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (suite *AnteTestSuite) SetupTest() {

suite.ctx = suite.app.BaseApp.NewContextLegacy(isCheckTx, tmproto.Header{
Height: 1,
ChainID: realionetworktypes.MainnetChainID,
ChainID: realionetworktypes.MainnetChainID + "-1",
Time: time.Now().UTC(),
ProposerAddress: consAddress.Bytes(),

Expand Down Expand Up @@ -292,7 +292,7 @@ func createTx(priv *osecp256k1.PrivKey, msgs ...sdk.Msg) (sdk.Tx, error) {
}

signerData := authsigning.SignerData{
ChainID: realionetworktypes.MainnetChainID,
ChainID: realionetworktypes.MainnetChainID + "-1",
AccountNumber: 0,
Sequence: 0,
}
Expand Down Expand Up @@ -335,8 +335,8 @@ func createEIP712CosmosTx(

fee := legacytx.NewStdFee(gas, amount) //nolint:staticcheck // ignore staticcheck for deprecated NewStdFee

data := legacytx.StdSignBytes(realionetworktypes.MainnetChainID, 0, 0, 0, fee, msgs, "")
pc, err := types.ParseChainID(realionetworktypes.MainnetChainID)
data := legacytx.StdSignBytes(realionetworktypes.MainnetChainID+"-1", 0, 0, 0, fee, msgs, "")
pc, err := types.ParseChainID(realionetworktypes.MainnetChainID + "-1")
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func Setup(
}

db := dbm.NewMemDB()
opt := baseapp.SetChainID(types.MainnetChainID)
opt := baseapp.SetChainID(types.MainnetChainID + "-1")
app := New(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, encCdc, simtestutil.EmptyAppOptions{}, opt)
if !isCheckTx {
// init chain must be called to stop deliverState from being nil
Expand All @@ -127,7 +127,7 @@ func Setup(
// Initialize the chain
if _, err = app.InitChain(
&abci.RequestInitChain{
ChainId: types.MainnetChainID,
ChainId: types.MainnetChainID + "-1",
Validators: []abci.ValidatorUpdate{},
ConsensusParams: DefaultConsensusParams,
AppStateBytes: stateBytes,
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ require (
github.com/cosmos/rosetta v0.50.10
github.com/ethereum/go-ethereum v1.11.5
github.com/evmos/os v0.0.0-20241002122822-02a9121016ee
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.4
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
Expand Down Expand Up @@ -124,6 +123,7 @@ require (
github.com/go-stack/stack v1.8.1 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/golang/glog v1.2.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
Expand Down Expand Up @@ -246,11 +246,11 @@ require (
replace (
// need this replace to pick up the store changes (Copy func) in our cosmos-sdk fork
cosmossdk.io/store => github.com/evmos/cosmos-sdk/store v0.0.0-20240718141609-414cbd051fbe
// use Realio sdk v0.46.11-realio-4
// github.com/cosmos/cosmos-sdk => github.com/realiotech/cosmos-sdk v0.46.11-realio-4

// use Evmos geth fork
github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc4
// use Realio sdk v0.46.11-realio-4
// github.com/cosmos/cosmos-sdk => github.com/realiotech/cosmos-sdk v0.46.11-realio-4
github.com/evmos/os/example_chain => github.com/evmos/os/example_chain v0.0.0-20241002122822-02a9121016ee

// github.com/realio-tech/multi-staking-module => ../multi-staking
// github.com/evmos/os => ../evmos-os
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ github.com/evmos/go-ethereum v1.10.26-evmos-rc4 h1:vwDVMScuB2KSu8ze5oWUuxm6v3bMU
github.com/evmos/go-ethereum v1.10.26-evmos-rc4/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/evmos/os v0.0.0-20241002122822-02a9121016ee h1:lPqHHT7ezQbrF7NLK2tCCjD8NQ31TeNXW7l4nNFWslI=
github.com/evmos/os v0.0.0-20241002122822-02a9121016ee/go.mod h1:uQQyppk8z2C7Ypk/zj8/wnJSrf74rY8cXLzsD8F1tEE=
github.com/evmos/os/example_chain v0.0.0-20240924163020-b2a4187dad50 h1:zWJYHc0WXE5YnuzYJnUzjMwuloxSz5ALCoNSzcuhKsA=
github.com/evmos/os/example_chain v0.0.0-20240924163020-b2a4187dad50/go.mod h1:+SPMqw9wtbWO3jG02uLbLtVVjMHBldmXTN51kxbWqJ8=
github.com/evmos/os/example_chain v0.0.0-20241002122822-02a9121016ee h1:BZpePPAM2zYn8P9EkU14K0p4TTgwEQJLaQG4FjNh99Q=
github.com/evmos/os/example_chain v0.0.0-20241002122822-02a9121016ee/go.mod h1:+SPMqw9wtbWO3jG02uLbLtVVjMHBldmXTN51kxbWqJ8=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
Expand Down
2 changes: 1 addition & 1 deletion x/asset/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (suite *GenesisTestSuite) SetupTest() {
suite.app = app.Setup(false, feemarkettypes.DefaultGenesisState(), 1)
suite.ctx = suite.app.BaseApp.NewContextLegacy(false, tmproto.Header{
Height: 1,
ChainID: realiotypes.MainnetChainID,
ChainID: realiotypes.MainnetChainID + "-1",
Time: time.Now().UTC(),
ProposerAddress: consAddress.Bytes(),

Expand Down
9 changes: 6 additions & 3 deletions x/bridge/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ func (suite *KeeperTestSuite) TestGRPCQuery() {
ratelimits, err := suite.queryClient.RateLimits(suite.ctx, &types.QueryRateLimitsRequest{})
suite.Require().NoError(err)

expectedRateLimits := []types.RateLimit{}
err = suite.app.BridgeKeeper.RegisteredCoins.Walk(suite.ctx, nil, func(_ string, ratelimit types.RateLimit) (stop bool, err error) {
expectedRateLimits = append(expectedRateLimits, ratelimit)
expectedRateLimits := []types.DenomAndRateLimit{}
err = suite.app.BridgeKeeper.RegisteredCoins.Walk(suite.ctx, nil, func(denom string, ratelimit types.RateLimit) (stop bool, err error) {
expectedRateLimits = append(expectedRateLimits, types.DenomAndRateLimit{
Denom: denom,
RateLimit: ratelimit,
})
return false, nil
})
suite.Require().NoError(err)
Expand Down
2 changes: 1 addition & 1 deletion x/bridge/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (suite *KeeperTestSuite) DoSetupTest(t *testing.T) {
// Set Context
suite.ctx = suite.app.BaseApp.NewContextLegacy(checkTx, tmproto.Header{
Height: 1,
ChainID: realiotypes.MainnetChainID,
ChainID: realiotypes.MainnetChainID + "-1",
Time: time.Now().UTC(),
ProposerAddress: consAddress.Bytes(),

Expand Down
2 changes: 1 addition & 1 deletion x/mint/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (suite *KeeperTestSuite) DoSetupTest(t *testing.T) {
// Set Context
suite.ctx = suite.app.BaseApp.NewContextLegacy(checkTx, tmproto.Header{
Height: 1,
ChainID: realiotypes.MainnetChainID,
ChainID: realiotypes.MainnetChainID + "-1",
Time: time.Now().UTC(),
ProposerAddress: consAddress.Bytes(),

Expand Down

0 comments on commit 77836aa

Please sign in to comment.