Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
osmosis
Commits
7b5abef0
Unverified
Commit
7b5abef0
authored
2 years ago
by
khanh-notional
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
minor changes in gamm apptesting func (#2958)
* minor changes in gamm apptesting func * remove RunCustomSwap
parent
83c9d22c
main
adam/cl
adam/main-e2e-fixes
bez/3059-tick-bitmap-impl
concentrated-liquidity
concentrated-liquidity-main
dev/expand_inverse_bug
e2e-concentrated
faddat/ibc331
faddat/ledger-cosmos-go
mattverse-cl-4-fix-zero-for-one
mattverse/cl-4-slippage
mattverse/cl-store
mattverse/join-calculation
mattverse/sp
mattverse/unify-prices
nicolas/concentrated-liquidity-fees
nicolas/ibc-rate-limit-integration-and-tests
nicolas/rate-limiting-upgrade-handler
roman/cl-spec
roman/e2e-debug
roman/pool-id-refactor
roman/pool-id-refactor-pt1
sis/valSet-setValMsg
stargate_white_list
superfluid-update-test-err
try_using_app_hash
use-beginblocker-for-apptesting
valSet-ReDel-v2
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/apptesting/gamm.go
+19
-7
app/apptesting/gamm.go
with
19 additions
and
7 deletions
+19
-7
app/apptesting/gamm.go
+
19
-
7
View file @
7b5abef0
...
...
@@ -3,6 +3,7 @@ package apptesting
import
(
sdk
"github.com/cosmos/cosmos-sdk/types"
gammkeeper
"github.com/osmosis-labs/osmosis/v12/x/gamm/keeper"
"github.com/osmosis-labs/osmosis/v12/x/gamm/pool-models/balancer"
gammtypes
"github.com/osmosis-labs/osmosis/v12/x/gamm/types"
)
...
...
@@ -117,20 +118,30 @@ func (s *KeeperTestHelper) RunBasicSwap(poolId uint64) {
s
.
FundAcc
(
s
.
TestAccs
[
0
],
swapIn
)
msg
:=
gammtypes
.
MsgSwapExactAmountIn
{
Sender
:
string
(
s
.
TestAccs
[
0
]),
Sender
:
s
.
TestAccs
[
0
]
.
String
(
),
Routes
:
[]
gammtypes
.
SwapAmountInRoute
{{
PoolId
:
poolId
,
TokenOutDenom
:
denoms
[
1
]}},
TokenIn
:
swapIn
[
0
],
TokenOutMinAmount
:
sdk
.
ZeroInt
(),
}
// TODO: switch to message
_
,
err
=
s
.
App
.
GAMMKeeper
.
SwapExactAmountIn
(
s
.
Ctx
,
s
.
TestAccs
[
0
],
poolId
,
msg
.
TokenIn
,
denoms
[
1
],
msg
.
TokenOutMinAmount
)
gammMsgServer
:=
gammkeeper
.
NewMsgServerImpl
(
s
.
App
.
GAMMKeeper
)
_
,
err
=
gammMsgServer
.
SwapExactAmountIn
(
sdk
.
WrapSDKContext
(
s
.
Ctx
),
&
msg
)
s
.
Require
()
.
NoError
(
err
)
}
func
(
s
*
KeeperTestHelper
)
RunBasicExit
(
poolId
uint64
)
{
shareInAmount
:=
sdk
.
NewInt
(
100
)
tokenOutMins
:=
sdk
.
NewCoins
()
_
,
err
:=
s
.
App
.
GAMMKeeper
.
ExitPool
(
s
.
Ctx
,
s
.
TestAccs
[
0
],
poolId
,
shareInAmount
,
tokenOutMins
)
msg
:=
gammtypes
.
MsgExitPool
{
Sender
:
s
.
TestAccs
[
0
]
.
String
(),
PoolId
:
poolId
,
ShareInAmount
:
shareInAmount
,
TokenOutMins
:
tokenOutMins
,
}
gammMsgServer
:=
gammkeeper
.
NewMsgServerImpl
(
s
.
App
.
GAMMKeeper
)
_
,
err
:=
gammMsgServer
.
ExitPool
(
sdk
.
WrapSDKContext
(
s
.
Ctx
),
&
msg
)
s
.
Require
()
.
NoError
(
err
)
}
...
...
@@ -148,12 +159,13 @@ func (s *KeeperTestHelper) RunBasicJoin(poolId uint64) {
totalPoolShare
:=
pool
.
GetTotalShares
()
msg
:=
gammtypes
.
MsgJoinPool
{
Sender
:
string
(
s
.
TestAccs
[
0
]),
Sender
:
s
.
TestAccs
[
0
]
.
String
(
),
PoolId
:
poolId
,
ShareOutAmount
:
totalPoolShare
.
Quo
(
sdk
.
NewInt
(
100000
)),
TokenInMaxs
:
tokenIn
,
}
// TODO: switch to message
_
,
_
,
err
=
s
.
App
.
GAMMKeeper
.
JoinPoolNoSwap
(
s
.
Ctx
,
s
.
TestAccs
[
0
],
poolId
,
msg
.
ShareOutAmount
,
msg
.
TokenInMaxs
)
gammMsgServer
:=
gammkeeper
.
NewMsgServerImpl
(
s
.
App
.
GAMMKeeper
)
_
,
err
=
gammMsgServer
.
JoinPool
(
sdk
.
WrapSDKContext
(
s
.
Ctx
),
&
msg
)
s
.
Require
()
.
NoError
(
err
)
}
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
Menu
Explore
Projects
Groups
Snippets