Skip to content

Commit

Permalink
some debug: contract addr set and exists in tests, but not exist on r…
Browse files Browse the repository at this point in the history
…untime"
  • Loading branch information
quasisamurai committed Sep 5, 2024
1 parent 12353cc commit 1969117
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(tokenfactorytypes.StoreKey).WithKeyTable(tokenfactorytypes.ParamKeyTable())
paramsKeeper.Subspace(interchainqueriesmoduletypes.StoreKey).WithKeyTable(interchainqueriesmoduletypes.ParamKeyTable())
paramsKeeper.Subspace(interchaintxstypes.StoreKey).WithKeyTable(interchaintxstypes.ParamKeyTable())
paramsKeeper.Subspace(ibcratelimittypes.ModuleName).WithKeyTable(ibcratelimittypes.ParamKeyTable())
paramsKeeper.Subspace(ibcratelimittypes.ModuleName)

return paramsKeeper
}
Expand Down
14 changes: 4 additions & 10 deletions x/ibc-rate-limit/ibc_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ func (suite *MiddlewareTestSuite) FullSendAToB(msg sdk.Msg) (*abci.ExecTxResult,
if err != nil {
return nil, "", err
}
fmt.Println(sendResult.Log)
fmt.Println(sendResult.Info)
fmt.Println(sendResult.Code)
fmt.Println(sendResult.Events)
fmt.Println(sendResult.GasUsed)

packet, err := ibctesting.ParsePacketFromEvents(sendResult.GetEvents())
if err != nil {
Expand Down Expand Up @@ -650,13 +645,12 @@ func (suite *MiddlewareTestSuite) InstantiateRLContract(quotas string) sdk.AccAd
transferModule := app.AccountKeeper.GetModuleAddress(transfertypes.ModuleName)
fmt.Println(quotas)
//govModule := app.AccountKeeper.GetModuleAddress(govtypes.ModuleName)

initMsgBz := []byte(fmt.Sprintf(`{
"gov_module": "%s",
"ibc_module":"%s",
"paths": [%s]
}`,
suite.ChainA.SenderAccount.GetAddress(), transferModule, quotas))
testutil.TestOwnerAddress, transferModule, quotas))

contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper)
codeID := uint64(1)
Expand All @@ -675,9 +669,9 @@ func (suite *MiddlewareTestSuite) RegisterRateLimitingContract(addr []byte) {
paramSpace, ok := app.ParamsKeeper.GetSubspace(types.ModuleName)
require.True(suite.ChainA.TB, ok)
paramSpace.SetParamSet(suite.ChainA.GetContext(), &params)
//p := app.GetContractAddress(suite.ChainA.GetContext())
//fmt.Println("print contract addr from params module")
//fmt.Println(p)
p := app.RateLimitingICS4Wrapper.GetContractAddress(suite.ChainA.GetContext())
fmt.Println("print contract addr from params module")
fmt.Println(p)
}

// AssertEventEmitted asserts that ctx's event manager has emitted the given number of events
Expand Down
2 changes: 2 additions & 0 deletions x/ibc-rate-limit/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ibc_rate_limit

import (
"encoding/json"
"fmt"
"strings"

"github.com/neutron-org/neutron/v4/x/ibc-hooks/utils"
Expand Down Expand Up @@ -138,6 +139,7 @@ func (im *IBCModule) OnRecvPacket(
contract := im.ics4Middleware.GetContractAddress(ctx)
if contract == "" {
// The contract has not been configured. Continue as usual
fmt.Println("The contract has not been configured. Continue as usual")
return im.app.OnRecvPacket(ctx, packet, relayer)
}

Expand Down

0 comments on commit 1969117

Please sign in to comment.