Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
osmosis
Commits
f140a9db
Commit
f140a9db
authored
2 years ago
by
Dev Ojha
Browse files
Options
Download
Email Patches
Plain Diff
Make tests ctx aware
parent
bb40562a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
x/gamm/pool-models/balancer/amm_joinpool_test.go
+3
-3
x/gamm/pool-models/balancer/amm_joinpool_test.go
x/gamm/pool-models/balancer/suite_test.go
+3
-0
x/gamm/pool-models/balancer/suite_test.go
with
6 additions
and
3 deletions
+6
-3
x/gamm/pool-models/balancer/amm_joinpool_test.go
+
3
-
3
View file @
f140a9db
...
...
@@ -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
(
s
dk
.
Context
{}
,
tc
.
tokensIn
,
tc
.
swapFee
)
shares
,
liquidity
,
err
:=
pool
.
CalcJoinPoolShares
(
s
uite
.
Ctx
,
tc
.
tokensIn
,
tc
.
swapFee
)
if
tc
.
expErr
!=
nil
{
require
.
Error
(
t
,
err
)
require
.
ErrorAs
(
t
,
tc
.
expErr
,
&
err
)
...
...
This diff is collapsed.
Click to expand it.
x/gamm/pool-models/balancer/suite_test.go
+
3
-
0
View file @
f140a9db
...
...
@@ -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
)
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment