Skip to content

Commit 8975815

Browse files
faddatp0mvnczarcas7ic
authored andcommitted
chore: check all errors in tests (#5104)
* run golangci-lint and resolve ineffectual assignment to err * go work sync * waypoint in "check all errors in tests" * 50 error checks remaining * 42 errors remaining to check in tests * all tests pass and as many errors as possible have been checked * revert enabling golangci-lint to check tests, as it would always fail afterwards * update changelog * use thelper in golangci-lint without linting every test * Update tests/e2e/containers/containers.go Co-authored-by: Roman <roman@osmosis.team> * thelper for incentives bench test * Update x/concentrated-liquidity/position_test.go Co-authored-by: Adam Tucker <adam@osmosis.team> * Update CHANGELOG.md Co-authored-by: Roman <roman@osmosis.team> * return error in SetIncentiveRecord * revert change to .golanci.yml --------- Co-authored-by: Roman <roman@osmosis.team> Co-authored-by: Adam Tucker <adam@osmosis.team>
1 parent 513ed2a commit 8975815

File tree

74 files changed

+413
-214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+413
-214
lines changed

.golangci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ linters:
1818
- goconst
1919
- gofmt
2020
- goimports
21-
# - gofumpt
2221
- goheader
2322
- gomodguard
2423
- goprintffuncname
@@ -30,14 +29,14 @@ linters:
3029
- misspell
3130
- nakedret
3231
- nilnil
33-
- paralleltest
3432
- promlinter
3533
- staticcheck
3634
- stylecheck
3735
- tenv
3836
- thelper
39-
- testpackage
37+
- tparallel
4038
- typecheck
39+
- thelper
4140
- unconvert
4241
- unused
4342
- whitespace

app/upgrades/v12/upgrade_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (suite *UpgradeTestSuite) TestPoolMigration() {
5353
plan := upgradetypes.Plan{Name: "v12", Height: dummyUpgradeHeight}
5454
err := suite.App.UpgradeKeeper.ScheduleUpgrade(suite.Ctx, plan)
5555
suite.Require().NoError(err)
56-
plan, exists := suite.App.UpgradeKeeper.GetUpgradePlan(suite.Ctx)
56+
_, exists := suite.App.UpgradeKeeper.GetUpgradePlan(suite.Ctx)
5757
suite.Require().True(exists)
5858

5959
suite.Ctx = suite.Ctx.WithBlockHeight(dummyUpgradeHeight)

app/upgrades/v13/upgrade_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func dummyUpgrade(suite *UpgradeTestSuite) {
3535
plan := upgradetypes.Plan{Name: "v13", Height: dummyUpgradeHeight}
3636
err := suite.App.UpgradeKeeper.ScheduleUpgrade(suite.Ctx, plan)
3737
suite.Require().NoError(err)
38-
plan, exists := suite.App.UpgradeKeeper.GetUpgradePlan(suite.Ctx)
38+
_, exists := suite.App.UpgradeKeeper.GetUpgradePlan(suite.Ctx)
3939
suite.Require().True(exists)
4040

4141
suite.Ctx = suite.Ctx.WithBlockHeight(dummyUpgradeHeight)
@@ -73,7 +73,6 @@ func (suite *UpgradeTestSuite) TestUpgrade() {
7373
// Same comment as above: this was the case when the upgrade happened, but we don't have accounts anymore
7474
// hasAcc := suite.App.AccountKeeper.HasAccount(suite.Ctx, ibc_hooks.WasmHookModuleAccountAddr)
7575
// suite.Require().False(hasAcc)
76-
7776
},
7877
func() { dummyUpgrade(suite) },
7978
func() {

app/upgrades/v15/upgrade_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ func (suite *UpgradeTestSuite) TestMigrateBalancerToStablePools() {
128128

129129
// shares before migration
130130
balancerPool, err := gammKeeper.GetCFMMPool(suite.Ctx, poolID)
131+
suite.Require().NoError(err)
131132
balancerLiquidity, err := gammKeeper.GetTotalPoolLiquidity(suite.Ctx, balancerPool.GetId())
132133
suite.Require().NoError(err)
133134

@@ -240,13 +241,16 @@ func (suite *UpgradeTestSuite) TestSetRateLimits() {
240241

241242
state, err := suite.App.WasmKeeper.QuerySmart(suite.Ctx, addr, []byte(`{"get_quotas": {"channel_id": "any", "denom": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"}}`))
242243
suite.Require().Greaterf(len(state), 0, "state should not be empty")
244+
suite.Require().NoError(err)
243245

244246
state, err = suite.App.WasmKeeper.QuerySmart(suite.Ctx, addr, []byte(`{"get_quotas": {"channel_id": "any", "denom": "ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858"}}`))
245247
suite.Require().Greaterf(len(state), 0, "state should not be empty")
248+
suite.Require().NoError(err)
246249

247250
// This is the last one. If the others failed the upgrade would've panicked before adding this one
248251
state, err = suite.App.WasmKeeper.QuerySmart(suite.Ctx, addr, []byte(`{"get_quotas": {"channel_id": "any", "denom": "ibc/E6931F78057F7CC5DA0FD6CEF82FF39373A6E0452BF1FD76910B93292CF356C1"}}`))
249252
suite.Require().Greaterf(len(state), 0, "state should not be empty")
253+
suite.Require().NoError(err)
250254
}
251255

252256
func (suite *UpgradeTestSuite) validateCons(coinsA, coinsB sdk.Coins) {

app/upgrades/v16/concentrated_pool_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ func (suite *ConcentratedUpgradeTestSuite) TestCreateCanonicalConcentratedLiuqid
181181
suite.Require().NoError(err)
182182

183183
// Get balancer gauges.
184-
gaugeToRedirect, err := suite.App.PoolIncentivesKeeper.GetPoolGaugeId(suite.Ctx, balancerPool.GetId(), longestLockableDuration)
184+
gaugeToRedirect, _ := suite.App.PoolIncentivesKeeper.GetPoolGaugeId(suite.Ctx, balancerPool.GetId(), longestLockableDuration)
185185

186-
gaugeToNotRedeirect, err := suite.App.PoolIncentivesKeeper.GetPoolGaugeId(suite.Ctx, balancerId2, longestLockableDuration)
186+
gaugeToNotRedeirect, _ := suite.App.PoolIncentivesKeeper.GetPoolGaugeId(suite.Ctx, balancerId2, longestLockableDuration)
187187

188188
originalDistrInfo := poolincentivestypes.DistrInfo{
189189
TotalWeight: sdk.NewInt(100),

tests/e2e/e2e_setup_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package e2e
22

33
import (
4-
"fmt"
54
"os"
65
"strconv"
76
"testing"
@@ -40,7 +39,7 @@ type IntegrationTestSuite struct {
4039
func TestIntegrationTestSuite(t *testing.T) {
4140
isEnabled := os.Getenv(e2eEnabledEnv)
4241
if isEnabled != "True" {
43-
t.Skip(fmt.Sprintf("e2e test is disabled. To run, set %s to True", e2eEnabledEnv))
42+
t.Skipf("e2e test is disabled. To run, set %s to True", e2eEnabledEnv)
4443
}
4544
suite.Run(t, new(IntegrationTestSuite))
4645
}
@@ -64,22 +63,22 @@ func (s *IntegrationTestSuite) SetupSuite() {
6463
s.skipUpgrade, err = strconv.ParseBool(str)
6564
s.Require().NoError(err)
6665
if s.skipUpgrade {
67-
s.T().Log(fmt.Sprintf("%s was true, skipping upgrade tests", skipUpgradeEnv))
66+
s.T().Logf("%s was true, skipping upgrade tests", skipUpgradeEnv)
6867
}
6968
}
7069
upgradeSettings.IsEnabled = !s.skipUpgrade
7170

7271
if str := os.Getenv(forkHeightEnv); len(str) > 0 {
7372
upgradeSettings.ForkHeight, err = strconv.ParseInt(str, 0, 64)
7473
s.Require().NoError(err)
75-
s.T().Log(fmt.Sprintf("fork upgrade is enabled, %s was set to height %d", forkHeightEnv, upgradeSettings.ForkHeight))
74+
s.T().Logf("fork upgrade is enabled, %s was set to height %d", forkHeightEnv, upgradeSettings.ForkHeight)
7675
}
7776

7877
if str := os.Getenv(skipIBCEnv); len(str) > 0 {
7978
s.skipIBC, err = strconv.ParseBool(str)
8079
s.Require().NoError(err)
8180
if s.skipIBC {
82-
s.T().Log(fmt.Sprintf("%s was true, skipping IBC tests", skipIBCEnv))
81+
s.T().Logf("%s was true, skipping IBC tests", skipIBCEnv)
8382
}
8483
}
8584

@@ -102,7 +101,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
102101

103102
if str := os.Getenv(upgradeVersionEnv); len(str) > 0 {
104103
upgradeSettings.Version = str
105-
s.T().Log(fmt.Sprintf("upgrade version set to %s", upgradeSettings.Version))
104+
s.T().Logf("upgrade version set to %s", upgradeSettings.Version)
106105
}
107106

108107
s.configurer, err = configurer.New(s.T(), !s.skipIBC, isDebugLogEnabled, upgradeSettings)

tests/e2e/e2e_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ func (s *IntegrationTestSuite) TestConcentratedLiquidity() {
206206
}
207207

208208
// Change the parameter to enable permisionless pool creation.
209-
chainA.SubmitParamChangeProposal("concentratedliquidity", string(cltypes.KeyIsPermisionlessPoolCreationEnabled), []byte("true"))
209+
err = chainA.SubmitParamChangeProposal("concentratedliquidity", string(cltypes.KeyIsPermisionlessPoolCreationEnabled), []byte("true"))
210+
s.Require().NoError(err)
210211

211212
// Confirm that the parameter has been changed.
212213
isPermisionlessCreationEnabledStr = chainANode.QueryParams(cltypes.ModuleName, string(cltypes.KeyIsPermisionlessPoolCreationEnabled))
@@ -599,7 +600,7 @@ func (s *IntegrationTestSuite) TestConcentratedLiquidity() {
599600
addr1BalancesAfter.AmountOf("uion"),
600601
)
601602

602-
// Assert position that was active thoughout the whole swap:
603+
// Assert position that was active throughout the whole swap:
603604

604605
// Track balance of address3
605606
addr3BalancesBefore = s.addrBalance(chainANode, address3)
@@ -770,7 +771,7 @@ func (s *IntegrationTestSuite) TestStableSwapPostUpgrade() {
770771
}
771772

772773
// TestGeometricTwapMigration tests that the geometric twap record
773-
// migration runs succesfully. It does so by attempting to execute
774+
// migration runs successfully. It does so by attempting to execute
774775
// the swap on the pool created pre-upgrade. When a pool is created
775776
// pre-upgrade, twap records are initialized for a pool. By runnning
776777
// a swap post-upgrade, we confirm that the geometric twap was initialized
@@ -987,7 +988,6 @@ func (s *IntegrationTestSuite) TestIBCTokenTransferRateLimiting() {
987988
val := node.QueryParams(ibcratelimittypes.ModuleName, string(ibcratelimittypes.KeyContractAddress))
988989
return strings.Contains(val, param)
989990
}, time.Second*30, time.Millisecond*500)
990-
991991
}
992992
}
993993

@@ -1100,6 +1100,7 @@ func (s *IntegrationTestSuite) TestPacketForwarding() {
11001100

11011101
// sender wasm addr
11021102
senderBech32, err := ibchookskeeper.DeriveIntermediateSender("channel-0", validatorAddr, "osmo")
1103+
s.Require().NoError(err)
11031104
s.Require().Eventually(func() bool {
11041105
response, err := nodeA.QueryWasmSmartObject(contractAddr, fmt.Sprintf(`{"get_count": {"addr": "%s"}}`, senderBech32))
11051106
if err != nil {
@@ -1154,7 +1155,7 @@ func (s *IntegrationTestSuite) TestAddToExistingLock() {
11541155
// TestArithmeticTWAP tests TWAP by creating a pool, performing a swap.
11551156
// These two operations should create TWAP records.
11561157
// Then, we wait until the epoch for the records to be pruned.
1157-
// The records are guranteed to be pruned at the next epoch
1158+
// The records are guaranteed to be pruned at the next epoch
11581159
// because twap keep time = epoch time / 4 and we use a timer
11591160
// to wait for at least the twap keep time.
11601161
func (s *IntegrationTestSuite) TestArithmeticTWAP() {

tests/e2e/initialization/init_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func TestChainInit(t *testing.T) {
4747
}
4848
dataDir, err = os.MkdirTemp("", "osmosis-e2e-testnet-test")
4949
)
50+
require.NoError(t, err)
5051

5152
chain, err := initialization.InitChain(id, dataDir, nodeConfigs, time.Second*3, time.Second, forkHeight)
5253
require.NoError(t, err)
@@ -104,6 +105,7 @@ func TestSingleNodeInit(t *testing.T) {
104105
}
105106
dataDir, err = os.MkdirTemp("", "osmosis-e2e-testnet-test")
106107
)
108+
require.NoError(t, err)
107109

108110
// Setup
109111
existingChain, err := initialization.InitChain(id, dataDir, existingChainNodeConfigs, time.Second*3, time.Second, forkHeight)
@@ -116,6 +118,7 @@ func TestSingleNodeInit(t *testing.T) {
116118
}
117119

118120
func validateNode(t *testing.T, chainId string, dataDir string, expectedConfig *initialization.NodeConfig, actualNode *initialization.Node) {
121+
t.Helper()
119122
require.Equal(t, fmt.Sprintf("%s-node-%s", chainId, expectedConfig.Name), actualNode.Name)
120123
require.Equal(t, expectedConfig.IsValidator, actualNode.IsValidator)
121124

tests/ibc-hooks/ibc_middleware_test.go

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ func (suite *HooksTestSuite) receivePacketWithSequence(receiver, memo string, pr
319319

320320
// recv in chain a
321321
res, err := suite.pathAB.EndpointA.RecvPacketWithResult(packet)
322+
suite.Require().NoError(err)
322323

323324
// get the ack from the chain a's response
324325
ack, err := ibctesting.ParseAckFromEvents(res.GetEvents())
@@ -593,15 +594,17 @@ func (suite *HooksTestSuite) TestAcks() {
593594
callbackMemo := fmt.Sprintf(`{"ibc_callback":"%s"}`, addr)
594595
// Send IBC transfer with the memo with crosschain-swap instructions
595596
transferMsg := NewMsgTransfer(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1000)), suite.chainA.SenderAccount.GetAddress().String(), addr.String(), "channel-0", callbackMemo)
596-
suite.FullSend(transferMsg, AtoB)
597+
_, _, _, err := suite.FullSend(transferMsg, AtoB)
598+
suite.Require().NoError(err)
597599

598600
// The test contract will increment the counter for itself every time it receives an ack
599601
state := suite.chainA.QueryContract(
600602
&suite.Suite, addr,
601603
[]byte(fmt.Sprintf(`{"get_count": {"addr": "%s"}}`, addr)))
602604
suite.Require().Equal(`{"count":1}`, state)
603605

604-
suite.FullSend(transferMsg, AtoB)
606+
_, _, _, err = suite.FullSend(transferMsg, AtoB)
607+
suite.Require().NoError(err)
605608
state = suite.chainA.QueryContract(
606609
&suite.Suite, addr,
607610
[]byte(fmt.Sprintf(`{"get_count": {"addr": "%s"}}`, addr)))
@@ -792,17 +795,20 @@ func (suite *HooksTestSuite) SetupCrosschainRegistry(chainName Chain) (sdk.AccAd
792795

793796
// Send some token0 tokens from C to B
794797
transferMsg := NewMsgTransfer(sdk.NewCoin("token0", sdk.NewInt(2000)), suite.chainC.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), "channel-0", "")
795-
suite.FullSend(transferMsg, CtoB)
798+
_, _, _, err = suite.FullSend(transferMsg, CtoB)
799+
suite.Require().NoError(err)
796800

797801
// Send some token0 tokens from B to A
798802
transferMsg = NewMsgTransfer(sdk.NewCoin("token0", sdk.NewInt(2000)), suite.chainB.SenderAccount.GetAddress().String(), suite.chainA.SenderAccount.GetAddress().String(), "channel-0", "")
799-
suite.FullSend(transferMsg, BtoA)
803+
_, _, _, err = suite.FullSend(transferMsg, BtoA)
804+
suite.Require().NoError(err)
800805

801806
// Send some token0 tokens from C to B to A
802807
denomTrace0CB := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", suite.pathBC.EndpointA.ChannelID, "token0"))
803808
token0CB := denomTrace0CB.IBCDenom()
804809
transferMsg = NewMsgTransfer(sdk.NewCoin(token0CB, sdk.NewInt(2000)), suite.chainB.SenderAccount.GetAddress().String(), suite.chainA.SenderAccount.GetAddress().String(), "channel-0", "")
805-
suite.FullSend(transferMsg, BtoA)
810+
_, _, _, err = suite.FullSend(transferMsg, BtoA)
811+
suite.Require().NoError(err)
806812

807813
// Denom traces
808814
CBAPath := fmt.Sprintf("transfer/%s/transfer/%s", suite.pathAB.EndpointA.ChannelID, suite.pathBC.EndpointA.ChannelID)
@@ -1060,7 +1066,8 @@ func (suite *HooksTestSuite) TestCrosschainSwapsViaIBCTest() {
10601066
_, crosschainAddr := suite.SetupCrosschainSwaps(ChainA)
10611067
// Send some token0 tokens to B so that there are ibc tokens to send to A and crosschain-swap
10621068
transferMsg := NewMsgTransfer(sdk.NewCoin("token0", sdk.NewInt(2000)), suite.chainA.SenderAccount.GetAddress().String(), initializer.String(), "channel-0", "")
1063-
suite.FullSend(transferMsg, AtoB)
1069+
_, _, _, err := suite.FullSend(transferMsg, AtoB)
1070+
suite.Require().NoError(err)
10641071

10651072
// Calculate the names of the tokens when swapped via IBC
10661073
denomTrace0 := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", "channel-0", "token0"))
@@ -1110,7 +1117,8 @@ func (suite *HooksTestSuite) TestCrosschainSwapsViaIBCBadAck() {
11101117
_, crosschainAddr := suite.SetupCrosschainSwaps(ChainA)
11111118
// Send some token0 tokens to B so that there are ibc tokens to send to A and crosschain-swap
11121119
transferMsg := NewMsgTransfer(sdk.NewCoin("token0", sdk.NewInt(2000)), suite.chainA.SenderAccount.GetAddress().String(), initializer.String(), "channel-0", "")
1113-
suite.FullSend(transferMsg, AtoB)
1120+
_, _, _, err := suite.FullSend(transferMsg, AtoB)
1121+
suite.Require().NoError(err)
11141122

11151123
// Calculate the names of the tokens when swapped via IBC
11161124
denomTrace0 := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", "channel-0", "token0"))
@@ -1205,7 +1213,8 @@ func (suite *HooksTestSuite) TestCrosschainSwapsViaIBCBadSwap() {
12051213
_, crosschainAddr := suite.SetupCrosschainSwaps(ChainA)
12061214
// Send some token0 tokens to B so that there are ibc tokens to send to A and crosschain-swap
12071215
transferMsg := NewMsgTransfer(sdk.NewCoin("token0", sdk.NewInt(2000)), suite.chainA.SenderAccount.GetAddress().String(), initializer.String(), "channel-0", "")
1208-
suite.FullSend(transferMsg, AtoB)
1216+
_, _, _, err := suite.FullSend(transferMsg, AtoB)
1217+
suite.Require().NoError(err)
12091218

12101219
// Calculate the names of the tokens when swapped via IBC
12111220
denomTrace0 := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", "channel-0", "token0"))
@@ -1247,7 +1256,8 @@ func (suite *HooksTestSuite) TestBadCrosschainSwapsNextMemoMessages() {
12471256
_, crosschainAddr := suite.SetupCrosschainSwaps(ChainA)
12481257
// Send some token0 tokens to B so that there are ibc tokens to send to A and crosschain-swap
12491258
transferMsg := NewMsgTransfer(sdk.NewCoin("token0", sdk.NewInt(20000)), suite.chainA.SenderAccount.GetAddress().String(), initializer.String(), "channel-0", "")
1250-
suite.FullSend(transferMsg, AtoB)
1259+
_, _, _, err := suite.FullSend(transferMsg, AtoB)
1260+
suite.Require().NoError(err)
12511261

12521262
// Calculate the names of the tokens when swapped via IBC
12531263
denomTrace0 := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", "channel-0", "token0"))
@@ -1396,9 +1406,11 @@ func (suite *HooksTestSuite) TestCrosschainForwardWithMemo() {
13961406
swaprouterAddrB, crosschainAddrB := suite.SetupCrosschainSwaps(ChainB)
13971407
// Send some token0 and token1 tokens to B so that there are ibc token0 to send to A and crosschain-swap, and token1 to create the pool
13981408
transferMsg := NewMsgTransfer(sdk.NewCoin("token0", sdk.NewInt(500000)), suite.chainA.SenderAccount.GetAddress().String(), initializer.String(), "channel-0", "")
1399-
suite.FullSend(transferMsg, AtoB)
1409+
_, _, _, err := suite.FullSend(transferMsg, AtoB)
1410+
suite.Require().NoError(err)
14001411
transferMsg1 := NewMsgTransfer(sdk.NewCoin("token1", sdk.NewInt(500000)), suite.chainA.SenderAccount.GetAddress().String(), initializer.String(), "channel-0", "")
1401-
suite.FullSend(transferMsg1, AtoB)
1412+
_, _, _, err = suite.FullSend(transferMsg1, AtoB)
1413+
suite.Require().NoError(err)
14021414
denom := suite.GetIBCDenom(ChainA, ChainB, "token1")
14031415
poolId := suite.CreateIBCNativePoolOnChain(ChainB, denom)
14041416
suite.SetupIBCRouteOnChain(swaprouterAddrB, suite.chainB.SenderAccount.GetAddress(), poolId, ChainB, denom)
@@ -1472,7 +1484,8 @@ func (suite *HooksTestSuite) TestCrosschainSwapsViaIBCMultiHop() {
14721484
suite.pathAC.EndpointA.ChannelID,
14731485
"",
14741486
)
1475-
suite.FullSend(transferMsg, AtoC)
1487+
_, _, _, err := suite.FullSend(transferMsg, AtoC)
1488+
suite.Require().NoError(err)
14761489

14771490
token0AC := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", suite.pathAC.EndpointB.ChannelID, "token0")).IBCDenom()
14781491
transferMsg = NewMsgTransfer(
@@ -1482,7 +1495,8 @@ func (suite *HooksTestSuite) TestCrosschainSwapsViaIBCMultiHop() {
14821495
suite.pathBC.EndpointB.ChannelID,
14831496
"",
14841497
)
1485-
suite.FullSend(transferMsg, CtoB)
1498+
_, _, _, err = suite.FullSend(transferMsg, CtoB)
1499+
suite.Require().NoError(err)
14861500

14871501
// Calculate the names of the tokens when sent via IBC
14881502
ACBPath := fmt.Sprintf("transfer/%s/transfer/%s", suite.pathAC.EndpointB.ChannelID, suite.pathBC.EndpointA.ChannelID)
@@ -1564,7 +1578,6 @@ func (suite *HooksTestSuite) SimpleNativeTransfer(token string, amount sdk.Int,
15641578
prevPrefix = strings.TrimLeft(prevPrefix, "/")
15651579
denom = transfertypes.DenomTrace{Path: prevPrefix, BaseDenom: token}.IBCDenom()
15661580
prev = toChain
1567-
15681581
}
15691582
return denom
15701583
}
@@ -1795,7 +1808,8 @@ func (suite *HooksTestSuite) ExecuteOutpostSwap(initializer, receiverAddr sdk.Ac
17951808

17961809
// Send some token0 tokens to B so that there are ibc tokens to send to A and crosschain-swap
17971810
transferMsg := NewMsgTransfer(sdk.NewCoin("token0", sdk.NewInt(2000)), suite.chainA.SenderAccount.GetAddress().String(), initializer.String(), "channel-0", "")
1798-
suite.FullSend(transferMsg, AtoB)
1811+
_, _, _, err := suite.FullSend(transferMsg, AtoB)
1812+
suite.Require().NoError(err)
17991813

18001814
// Calculate the names of the tokens when swapped via IBC
18011815
denomTrace0 := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", "channel-0", "token0"))
@@ -1817,7 +1831,7 @@ func (suite *HooksTestSuite) ExecuteOutpostSwap(initializer, receiverAddr sdk.Ac
18171831
// Call the outpost
18181832
contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(osmosisAppB.WasmKeeper)
18191833
ctxB := suite.chainB.GetContext()
1820-
_, err := contractKeeper.Execute(ctxB, outpostAddr, initializer, []byte(swapMsg), sdk.NewCoins(sdk.NewCoin(token0IBC, sdk.NewInt(1000))))
1834+
_, err = contractKeeper.Execute(ctxB, outpostAddr, initializer, []byte(swapMsg), sdk.NewCoins(sdk.NewCoin(token0IBC, sdk.NewInt(1000))))
18211835
suite.Require().NoError(err)
18221836
suite.chainB.NextBlock()
18231837
err = suite.pathAB.EndpointA.UpdateClient()

tests/simulator/sim_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func TestFullAppSimulation(t *testing.T) {
4747
}
4848

4949
func fullAppSimulation(tb testing.TB, is_testing bool) {
50+
tb.Helper()
5051
// TODO: Get SDK simulator fixed to have min fees possible
5152
txfeetypes.ConsensusMinFee = sdk.ZeroDec()
5253
config, db, logger, cleanup, err := osmosim.SetupSimulation("goleveldb-app-sim", "Simulation")

0 commit comments

Comments
 (0)