Skip to content

Commit bfe0ad7

Browse files
mergify[bot]colin-axner
authored andcommitted
fix: partial revert of cosmos#1942 (cosmos#2148) (cosmos#2474)
## Description See cosmos/interchain-accounts-demo#129 Adding mock module account in chain setup was assuming that the `NewTestChain` func was using a SimApp() which custom apps do not. Proper way to fund mock module at chain startup for us would be via modifying the default genesis (though we would need to modify the existing SetupChainWithGenesis to not assume the default auth/bank genesis is empty. I decided to take the easier route of just fixing the one test case using the mock module balance closes: #XXXX --- Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why. - [ ] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#testing) - [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) - [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [ ] Re-reviewed `Files changed` in the Github PR explorer - [ ] Review `Codecov Report` in the comment section below once CI passes (cherry picked from commit 2d3e55d) Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
1 parent 2b75c83 commit bfe0ad7

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ Ref: https://keepachangelog.com/en/1.0.0/
9292

9393
### Improvements
9494

95-
* (testing) [\#1942](https://github.com/cosmos/ibc-go/pull/1942) Add a balance for the mock module account upon testing package initialization.
9695
* (app/20-transfer) [\#1680](https://github.com/cosmos/ibc-go/pull/1680) Adds migration to correct any malformed trace path information of tokens with denoms that contains slashes. The transfer module consensus version has been bumped to 2.
9796
* (app/20-transfer) [\#1730](https://github.com/cosmos/ibc-go/pull/1730) parse the ics20 denomination provided via a packet using the channel identifier format specified by ibc-go.
9897
* (cleanup) [\#1335](https://github.com/cosmos/ibc-go/pull/1335/) `gofumpt -w -l .` to standardize the code layout more strictly than `go fmt ./...`

modules/apps/29-fee/keeper/msg_server_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ func (suite *KeeperTestSuite) TestPayPacketFee() {
200200
{
201201
"refund account is module account",
202202
func() {
203+
suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibcmock.ModuleName, fee.Total())
203204
msg.Signer = suite.chainA.GetSimApp().AccountKeeper.GetModuleAddress(ibcmock.ModuleName).String()
204205
expPacketFee := types.NewPacketFee(fee, msg.Signer, nil)
205206
expFeesInEscrow = []types.PacketFee{expPacketFee}

testing/chain.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ func NewTestChainWithValSet(t *testing.T, coord *Coordinator, chainID string, va
121121
senderAccs = append(senderAccs, senderAcc)
122122
}
123123

124-
// add mock module account balance
125-
genBals = append(genBals, banktypes.Balance{
126-
Address: authtypes.NewModuleAddress(mock.ModuleName).String(),
127-
Coins: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1000000000))},
128-
})
129-
130124
app := SetupWithGenesisValSet(t, valSet, genAccs, chainID, sdk.DefaultPowerReduction, genBals...)
131125

132126
// create current header and call begin block
@@ -156,10 +150,6 @@ func NewTestChainWithValSet(t *testing.T, coord *Coordinator, chainID string, va
156150
SenderAccounts: senderAccs,
157151
}
158152

159-
// creates mock module account
160-
mockModuleAcc := chain.GetSimApp().AccountKeeper.GetModuleAccount(chain.GetContext(), mock.ModuleName)
161-
require.NotNil(t, mockModuleAcc)
162-
163153
coord.CommitBlock(chain)
164154

165155
return chain

0 commit comments

Comments
 (0)