@@ -3,7 +3,6 @@ package v1
33import (
44 "chain"
55 "chain/banker"
6- "strconv"
76 "testing"
87
98 "gno.land/r/gnoland/wugnot"
@@ -614,28 +613,25 @@ func TestBurnTokens(t *testing.T) {
614613 uassert.Equal(t, bar.BalanceOf(addr01), int64(0)) // 100_000_000 -> 0
615614}
616615
617- func mockSwapCallback(token0Path string, token1Path string, amount0Delta string , amount1Delta string ) error {
616+ func mockSwapCallback(token0Path string, token1Path string, amount0Delta int64 , amount1Delta int64 ) error {
618617 func(cur realm) {
619618 testing.SetRealm(adminRealm)
620619
621- amount0Int64, _ := strconv.ParseInt(amount0Delta, 10, 64)
622- amount1Int64, _ := strconv.ParseInt(amount1Delta, 10, 64)
623-
624- if amount0Int64 > 0 {
620+ if amount0Delta > 0 {
625621 if token0Path == wugnotPath {
626- testing.SetOriginSend(chain.Coins{{ugnotDenom, amount0Int64 }})
622+ testing.SetOriginSend(chain.Coins{{ugnotDenom, amount0Delta }})
627623 wugnot.Deposit(cross)
628624 }
629625
630- common.SafeGRC20Transfer(cross, token0Path, poolAddr, amount0Int64 )
626+ common.SafeGRC20Transfer(cross, token0Path, poolAddr, amount0Delta )
631627 }
632- if amount1Int64 > 0 {
628+ if amount1Delta > 0 {
633629 if token1Path == wugnotPath {
634- testing.SetOriginSend(chain.Coins{{ugnotDenom, amount1Int64 }})
630+ testing.SetOriginSend(chain.Coins{{ugnotDenom, amount1Delta }})
635631 wugnot.Deposit(cross)
636632 }
637633
638- common.SafeGRC20Transfer(cross, token1Path, poolAddr, amount1Int64 )
634+ common.SafeGRC20Transfer(cross, token1Path, poolAddr, amount1Delta )
639635 }
640636 }(cross)
641637
@@ -781,7 +777,7 @@ func mockInstanceCollectProtocol(token0Path string, token1Path string, fee uint3
781777 }(cross)
782778}
783779
784- func mockInstanceSwap(token0Path string, token1Path string, fee uint32, recipient address, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string, payer address, swapCallback func(cur realm, amount0Delta string , amount1Delta string ) error) (string, string) {
780+ func mockInstanceSwap(token0Path string, token1Path string, fee uint32, recipient address, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string, payer address, swapCallback func(cur realm, amount0Delta int64 , amount1Delta int64 ) error) (string, string) {
785781 return func(cur realm) (string, string) {
786782 const currentPoolPath = "gno.land/r/gnoswap/pool"
787783 testing.SetRealm(testing.NewCodeRealm(currentPoolPath))
0 commit comments