Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ExitSwapExternAmountOut #1244

Merged
merged 28 commits into from
Apr 18, 2022
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3a505af
refactor: ExitSwapExternAmountOut
p0mvn Apr 13, 2022
118bd85
better name for interface extension
p0mvn Apr 13, 2022
cedc684
implement types.PoolExitSwapExternAmountOutExtension
p0mvn Apr 13, 2022
b9af906
update changelog
p0mvn Apr 13, 2022
3cee732
interface assertion for PoolI in balancer pool
p0mvn Apr 14, 2022
0426eec
err check on extendedPool.ExitSwapExternAmountOut
p0mvn Apr 14, 2022
5f3e4b9
ZeroDec()
p0mvn Apr 14, 2022
a8fd3eb
comma in calcPoolInGivenSingleOut call
p0mvn Apr 14, 2022
c7f3728
redundnet type in calcPoolInGivenSingleOut
p0mvn Apr 14, 2022
a3c2e58
comment for feeRatio
p0mvn Apr 14, 2022
10d2e1f
fix comment for calcPoolInGivenSingleOut and the converse
p0mvn Apr 14, 2022
b566003
whitespace in ExitSwapExternAmountOut
p0mvn Apr 14, 2022
955831d
fix changelog entry
p0mvn Apr 14, 2022
f2c428a
godoc for PoolExitSwapExternAmountOutExtension
p0mvn Apr 14, 2022
ebb8b96
fmt
p0mvn Apr 14, 2022
135fc28
gofumpt
p0mvn Apr 14, 2022
0239280
deduct shares on exit, make exit pool logic shared, improve names
p0mvn Apr 15, 2022
e8966c2
rename to ExitSwapExactAmountOutExtension
p0mvn Apr 15, 2022
57d57ed
comment out TestNewExitSwapShareAmountInCmd
p0mvn Apr 15, 2022
a4ecefb
fix ExitSwapExactAmountOut by truncating int on return from calcPoolS…
p0mvn Apr 15, 2022
0ea012a
Merge branch 'main' into roman/1130
p0mvn Apr 15, 2022
84c257b
revert x/gamm/cli_test.go to original state with TestNewExitSwapExter…
p0mvn Apr 15, 2022
191f9be
uncomment ExitSwapExactAmountOut in TestActiveBalancerPool
p0mvn Apr 15, 2022
8a46f30
change variable name to exitingCoins
p0mvn Apr 15, 2022
37c95cc
fmt
p0mvn Apr 15, 2022
795d50c
Update x/gamm/keeper/pool_service.go
alexanderbez Apr 16, 2022
798c33d
Update x/gamm/pool-models/balancer/amm.go
alexanderbez Apr 16, 2022
685f439
Update x/gamm/keeper/pool_service.go
alexanderbez Apr 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
comma in calcPoolInGivenSingleOut call
p0mvn committed Apr 14, 2022
commit a8fd3eb38c9b77a51fb207499fcc0d8c626eb62d
3 changes: 2 additions & 1 deletion x/gamm/pool-models/balancer/amm.go
Original file line number Diff line number Diff line change
@@ -416,7 +416,8 @@ func (p *Pool) ExitSwapExternAmountOut(
p.GetTotalShares().ToDec(),
tokenOut.Amount.ToDec(),
p.GetSwapFee(ctx),
p.GetExitFee(ctx))
p.GetExitFee(ctx),
)

if poolAmountInBeforeFee.LTE(sdk.ZeroDec()) {
return sdk.Int{}, sdkerrors.Wrapf(types.ErrInvalidMathApprox, "token amount is zero or negative")