Skip to content

Commit

Permalink
Change the tests back to transferring only 2 tokens to exceed. Discov…
Browse files Browse the repository at this point in the history
…ered that the mint module was minting more tokens and causing the supply to change. Osmosis did not have this problem because of their custom mint module.
  • Loading branch information
Matthew Witkowski committed Oct 3, 2023
1 parent 10d4255 commit f33d4fa
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions x/ibcratelimit/ibc_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (suite *MiddlewareTestSuite) SetupTest() {
// txfeetypes.ConsensusMinFee = osmomath.ZeroDec()
ibctesting.DefaultTestingAppInit = SetupSimApp
suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2)

suite.chainA = &osmosisibctesting.TestChain{
TestChain: suite.coordinator.GetChain(ibctesting.GetChainID(1)),
}
Expand All @@ -97,6 +98,13 @@ func (suite *MiddlewareTestSuite) SetupTest() {
//err = suite.chainB.MoveEpochsToTheFuture()
//suite.Require().NoError(err)
suite.coordinator.Setup(suite.path)

params := suite.chainA.GetProvenanceApp().MintKeeper.GetParams(suite.chainA.GetContext())
params.InflationMax = sdk.NewDec(0)
params.InflationRateChange = sdk.NewDec(1)
params.InflationMin = sdk.NewDec(0)
suite.chainA.GetProvenanceApp().MintKeeper.SetParams(suite.chainA.GetContext(), params)
suite.chainB.GetProvenanceApp().MintKeeper.SetParams(suite.chainB.GetContext(), params)
}

// TODO: This needs to get removed. Waiting on https://github.com/cosmos/ibc-go/issues/3123
Expand Down Expand Up @@ -369,7 +377,7 @@ func (suite *MiddlewareTestSuite) fullSendTest(native bool) map[string]string {
suite.Require().Equal(used, sendAmount.MulRaw(2))

// Sending above the quota should fail. We use 2 instead of 1 here to avoid rounding issues
_, err = suite.AssertSend(false, suite.MessageFromAToB(denom, osmomath.NewInt(500_000_000_000)))
_, err = suite.AssertSend(false, suite.MessageFromAToB(denom, osmomath.NewInt(2)))
suite.Require().Error(err)
return attrs
}
Expand Down Expand Up @@ -455,7 +463,7 @@ func (suite *MiddlewareTestSuite) fullRecvTest(native bool) {
suite.Require().NoError(err)

// Sending above the quota should fail. We send 2 instead of 1 to account for rounding errors
_, err = suite.AssertReceive(false, suite.MessageFromBToA(sendDenom, osmomath.NewInt(500_000_000_000)))
_, err = suite.AssertReceive(false, suite.MessageFromBToA(sendDenom, osmomath.NewInt(2)))
suite.Require().NoError(err)
}

Expand Down

0 comments on commit f33d4fa

Please sign in to comment.