Commit f140a9db authored by Dev Ojha's avatar Dev Ojha
Browse files

Make tests ctx aware

parent bb40562a
Showing with 6 additions and 3 deletions
+6 -3
......@@ -380,7 +380,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{
},
}
func TestCalcJoinPoolShares(t *testing.T) {
func (suite *KeeperTestSuite) TestCalcJoinPoolShares() {
// We append shared calcSingleAssetJoinTestCases with multi-asset and edge
// test cases.
//
......@@ -506,12 +506,12 @@ func TestCalcJoinPoolShares(t *testing.T) {
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
suite.T().Run(tc.name, func(t *testing.T) {
pool := createTestPool(t, tc.swapFee, sdk.ZeroDec(), tc.poolAssets...)
// system under test
sut := func() {
shares, liquidity, err := pool.CalcJoinPoolShares(sdk.Context{}, tc.tokensIn, tc.swapFee)
shares, liquidity, err := pool.CalcJoinPoolShares(suite.Ctx, tc.tokensIn, tc.swapFee)
if tc.expErr != nil {
require.Error(t, err)
require.ErrorAs(t, tc.expErr, &err)
......
......@@ -6,6 +6,7 @@ import (
"github.com/stretchr/testify/suite"
"github.com/osmosis-labs/osmosis/v9/app/apptesting"
v10 "github.com/osmosis-labs/osmosis/v9/app/upgrades/v10"
"github.com/osmosis-labs/osmosis/v9/x/gamm/types"
)
......@@ -22,4 +23,6 @@ func TestKeeperTestSuite(t *testing.T) {
func (suite *KeeperTestSuite) SetupTest() {
suite.Setup()
suite.queryClient = types.NewQueryClient(suite.QueryHelper)
// be post-bug
suite.Ctx = suite.Ctx.WithBlockHeight(v10.ForkHeight)
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment