Skip to content

Commit c4bcd97

Browse files
committed
fix pool supply
1 parent 3746bd2 commit c4bcd97

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

x/lending/keeper/msg_server_pool.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ func (m msgServer) AddLiquidity(goCtx context.Context, msg *types.MsgAddLiquidit
8282
}
8383

8484
pool.TotalShares = pool.TotalShares.Add(outAmount)
85-
pool.Supply.Add(*msg.Amount)
85+
86+
newSupply := pool.Supply.Add(*msg.Amount)
87+
pool.Supply = &newSupply
8688

8789
received_shares := sdk.NewCoin(pool.Id, outAmount)
8890

@@ -134,7 +136,8 @@ func (m msgServer) RemoveLiquidity(goCtx context.Context, msg *types.MsgRemoveLi
134136
pool.TotalShares = pool.TotalShares.Sub(msg.Shares.Amount)
135137

136138
withdraw := sdk.NewCoin(pool.Supply.Denom, outAmount)
137-
pool.Supply.Sub(withdraw)
139+
newSupply := pool.Supply.Sub(withdraw)
140+
pool.Supply = &newSupply
138141

139142
m.SetPool(ctx, pool)
140143

0 commit comments

Comments
 (0)