Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
r3v4s committed May 2, 2024
1 parent d1d3959 commit d7c47ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions gov/api.gno
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ func GetActiveProposals() []Proposal {
return nil
}

func GetProposalById(proposalID uint64) *Proposal {
return &proposalsMap[proposalID]
}

func SubmitProposalText(
title string,
summary string,
Expand Down
3 changes: 2 additions & 1 deletion pool/_RPC_dry.gno
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ func DrySwap(
amount1 = i256.Zero().Sub(amountSpecified, state.amountSpecifiedRemaining)
}

pool.slot0.unlocked = true

if zeroForOne {
if pool.balances.token1.Lt(amount1.Abs()) {
// NOT ENOUGH BALANCE for output token1
Expand All @@ -199,6 +201,5 @@ func DrySwap(
return "0", "0", false
}

pool.slot0.unlocked = true
return amount0.ToString(), amount1.ToString(), true
}
4 changes: 4 additions & 0 deletions pool/pool.gno
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ func (pool *Pool) transferAndVerify(
amount *i256.Int,
isToken0 bool,
) {
if amount.IsZero() {
return
}

// must be negative to send token from pool to user
// as point of view from pool, it is negative
if !amount.IsNeg() {
Expand Down

0 comments on commit d7c47ae

Please sign in to comment.