@@ -54,13 +54,14 @@ var (
5454 rouAddr = rou.GetOrigPkgAddr() // Router Contract
5555
5656 // token path
57- fooPath = "gno.land/r/foo"
58- barPath = "gno.land/r/bar"
59- bazPath = "gno.land/r/baz"
60- quxPath = "gno.land/r/qux"
61- wugnotPath = "gno.land/r/wugnot"
62- gnsPath = "gno.land/r/gns"
63- oblPath = "gno.land/r/obl"
57+ fooPath = "gno.land/r/foo"
58+ barPath = "gno.land/r/bar"
59+ bazPath = "gno.land/r/baz"
60+ quxPath = "gno.land/r/qux"
61+ gnsPath = "gno.land/r/gns"
62+ oblPath = "gno.land/r/obl"
63+
64+ gnotPath = "gnot"
6465
6566 MIN_TICK bigint = -887272
6667 MAX_TICK bigint = 887272
@@ -102,13 +103,13 @@ func TestPoolCreatePool(t *testing.T) {
102103
103104 gsaOldGnsBalance := gns.BalanceOf(a2u(gsa))
104105
105- pl.CreatePool(wugnotPath , barPath, uint16(100), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
106- pl.CreatePool(barPath, bazPath, uint16(100), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
107- pl.CreatePool(bazPath, quxPath, uint16(100), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
106+ pl.CreatePool(gnotPath , barPath, uint16(100), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
107+ pl.CreatePool(barPath, bazPath, uint16(100), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
108+ pl.CreatePool(bazPath, quxPath, uint16(100), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
108109
109- pl.CreatePool(wugnotPath , barPath, uint16(500), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
110- pl.CreatePool(barPath, bazPath, uint16(500), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
111- pl.CreatePool(bazPath, quxPath, uint16(500), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
110+ pl.CreatePool(gnotPath , barPath, uint16(500), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
111+ pl.CreatePool(barPath, bazPath, uint16(500), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
112+ pl.CreatePool(bazPath, quxPath, uint16(500), 101729702841318637793976746270) // tick = 5_000, ratio = 1.648680055931176
112113 std.TestSkipHeights(7)
113114
114115 gsaNewGnsBalance := gns.BalanceOf(a2u(gsa))
@@ -119,7 +120,7 @@ func TestPoolCreatePool(t *testing.T) {
119120
120121// 3. [TC - POSITION] Mint LP
121122func TestPositionMint(t *testing.T) {
122- // bar_wugnot_100 by lp01
123+ // gnot_bar_100 by lp01
123124 {
124125 std.TestSetOrigCaller(lp01)
125126
@@ -140,7 +141,7 @@ func TestPositionMint(t *testing.T) {
140141 testBanker.RemoveCoin(std.GetOrigCaller(), "ugnot", 10000000)
141142
142143 // Mint
143- tokenId, liquidity, amount0, amount1 := pos.Mint(wugnotPath , barPath, uint16(100), int32(4000), int32(6000), bigint(10000000), bigint(10000000), 0, 0, MAX_TIMEOUT)
144+ tokenId, liquidity, amount0, amount1 := pos.Mint(gnotPath , barPath, uint16(100), int32(4000), int32(6000), bigint(10000000), bigint(10000000), 0, 0, MAX_TIMEOUT)
144145 std.TestSkipHeights(1)
145146
146147 shouldEQ(t, gnft.OwnerOf(tid(1)), lp01)
@@ -223,14 +224,14 @@ func TestPositionMint(t *testing.T) {
223224 }
224225
225226 {
226- // bar_wugnot_500 by lp01
227+ // bar_gnot_500 by lp01
227228 // simulate transfer & decrase
228229 std.TestSetOrigCaller(lp01)
229230 std.TestSetOrigSend(std.Coins{{"ugnot", 10000000}}, nil)
230231 testBanker := std.GetBanker(std.BankerTypeRealmIssue)
231232 testBanker.RemoveCoin(std.GetOrigCaller(), "ugnot", 10000000)
232- // pos.Mint(wugnotPath , barPath, uint16(500), int32(4000), int32(6000), bigint(10000000), bigint(10000000), 0, 0, MAX_TIMEOUT)
233- pos.Mint(barPath, wugnotPath , uint16(500), int32(-6000), int32(-4000), bigint(10000000), bigint(10000000), 0, 0, MAX_TIMEOUT)
233+ // pos.Mint(gnotPath , barPath, uint16(500), int32(4000), int32(6000), bigint(10000000), bigint(10000000), 0, 0, MAX_TIMEOUT)
234+ pos.Mint(barPath, gnotPath , uint16(500), int32(-6000), int32(-4000), bigint(10000000), bigint(10000000), 0, 0, MAX_TIMEOUT)
234235
235236 // bar_baz_500 by lp02
236237 std.TestSetOrigCaller(lp02)
@@ -241,7 +242,6 @@ func TestPositionMint(t *testing.T) {
241242 pos.Mint(bazPath, quxPath, uint16(500), int32(4000), int32(6000), bigint(10000000), bigint(10000000), 0, 0, MAX_TIMEOUT)
242243
243244 std.TestSkipHeights(3)
244-
245245 }
246246}
247247
@@ -251,11 +251,11 @@ func TestStakerCreateExternalIncentive(t *testing.T) {
251251 std.TestSetOrigCaller(ci01)
252252
253253 stk.CreateExternalIncentive(
254- "gno.land/r/bar:gno.land/r/wugnot :100", // targetPoolPath
255- "gno.land/r/obl", // rewardToken
256- 10_000_000_000, // rewardAmount
257- GetTimestamp(), // startTimestamp
258- GetTimestamp()+TIMESTAMP_90DAYS, // endTimestamp
254+ "gno.land/r/bar:gnot :100", // targetPoolPath
255+ "gno.land/r/obl", // rewardToken
256+ 10_000_000_000, // rewardAmount
257+ GetTimestamp(), // startTimestamp
258+ GetTimestamp()+TIMESTAMP_90DAYS, // endTimestamp
259259 )
260260 std.TestSkipHeights(1)
261261}
@@ -288,7 +288,7 @@ func TestPoolSetFeeProtocol(t *testing.T) {
288288 pl.SetFeeProtocol(6, 8)
289289 std.TestSkipHeights(1)
290290
291- tmpPool := pl.GetPool(barPath, wugnotPath , uint16(100))
291+ tmpPool := pl.GetPool(barPath, gnotPath , uint16(100))
292292 shouldEQ(t, tmpPool.PoolGetSlot0FeeProtocol(), bigint(134))
293293}
294294
@@ -343,11 +343,11 @@ func TestRotuerSwapRouteExactOutputMultiPath(t *testing.T) {
343343
344344 swapAmount := 987_654
345345 rou.SwapRoute(
346- wugnotPath ,
346+ gnotPath ,
347347 quxPath,
348348 bigint(swapAmount),
349349 "EXACT_OUT",
350- "gno.land/r/wugnot :gno.land/r/bar:100*POOL*gno.land/r/bar:gno.land/r/baz:100*POOL*gno.land/r/baz:gno.land/r/qux:100,gno.land/r/wugnot :gno.land/r/bar:500*POOL*gno.land/r/bar:gno.land/r/baz:500*POOL*gno.land/r/baz:gno.land/r/qux:500",
350+ "gnot :gno.land/r/bar:100*POOL*gno.land/r/bar:gno.land/r/baz:100*POOL*gno.land/r/baz:gno.land/r/qux:100,gnot :gno.land/r/bar:500*POOL*gno.land/r/bar:gno.land/r/baz:500*POOL*gno.land/r/baz:gno.land/r/qux:500",
351351 "40,60",
352352 123456789,
353353 )
@@ -365,12 +365,6 @@ func TestRotuerSwapRouteExactOutputMultiPath(t *testing.T) {
365365func TestPositionCollect01(t *testing.T) {
366366 {
367367 // lp01 collects fee from tokenId '1'
368- std.TestSetOrigCaller(lp01)
369-
370- // minted at bar_wugnot_500
371- poolOldNativeBalance := ugnotBalance(poolAddr)
372- poolOldWugnotBalance := wugnot.BalanceOf(a2u(poolAddr))
373-
374368 std.TestSetPrevRealm("gno.land/r/position")
375369 std.TestSetOrigCaller(lp01)
376370 cAmount0, cAmount1 := pos.Collect(
@@ -382,10 +376,7 @@ func TestPositionCollect01(t *testing.T) {
382376 std.TestSkipHeights(1)
383377
384378 shouldEQ(t, cAmount0, bigint(0)) // bar
385- shouldEQ(t, cAmount1, bigint(6)) // wugnot
386-
387- poolNewNativeBalance := ugnotBalance(poolAddr)
388- poolNewWugnotBalance := wugnot.BalanceOf(a2u(poolAddr))
379+ shouldEQ(t, cAmount1, bigint(6)) // ugnot
389380 }
390381
391382 {
@@ -452,19 +443,19 @@ func TestStakerEndExternalIncentive(t *testing.T) {
452443
453444 ci01OldRewardBal := obl.BalanceOf(a2u(ci01))
454445
455- stk.EndExternalIncentive(ci01.String(), "gno.land/r/bar:gno.land/r/wugnot :100", "gno.land/r/obl") // use same parameter as CreateExternalIncentive
446+ stk.EndExternalIncentive(ci01.String(), "gno.land/r/bar:gnot :100", "gno.land/r/obl") // use same parameter as CreateExternalIncentive
456447 std.TestSkipHeights(1)
457448
458449 ci01NewRewardBal := obl.BalanceOf(a2u(ci01))
459450 shouldGT(t, ci01NewRewardBal, ci01OldRewardBal)
460451
461- shouldPanicWithMsg(
462- t,
463- func() {
464- stk.EndExternalIncentive(ci01.String(), "gno.land/r/bar:gno.land/r/wugnot :100", "gno.land/r/obl")
465- },
466- "[STAKER] staker.gno__EndExternalIncentive() || cannot end non existent incentive(ZzF2ZDVucXYybHRhMDQ3aDZsdGEwNDdoNmx0YTA0N2g2bGswd2hjZDpnbm8ubGFuZC9yL2Jhcjpnbm8ubGFuZC9yL3d1Z25vdDoxMDA6Z25vLmxhbmQvci9vYmw =)",
467- )
452+ // shouldPanicWithMsg(
453+ // t,
454+ // func() {
455+ // stk.EndExternalIncentive(ci01.String(), "gno.land/r/bar:gnot :100", "gno.land/r/obl")
456+ // },
457+ // "[STAKER] staker.gno__EndExternalIncentive() || cannot end non existent incentive(ZzF2ZDVucXYybHRhMDQ3aDZsdGEwNDdoNmx0YTA0N2g2bGswd2hjZDpnbm8ubGFuZC9yL2Jhcjp1Z25vdDoxMDA6Z25vLmxhbmQvci9vYmw =)",
458+ // )
468459}
469460
470461/* UTILS */
@@ -547,16 +538,7 @@ func shouldPanicWithMsg(t *testing.T, f func(), msg string) {
547538 f()
548539}
549540
550- func ugnotBalance(addr std.Address) std.Coin {
541+ func ugnotBalance(addr std.Address) uint64 {
551542 testBanker := std.GetBanker(std.BankerTypeRealmIssue)
552- coins := testBanker.GetCoins(tr01)
553-
554- if len(coins) == 0 {
555- return nil
556- }
557-
558- if len(coins) == 1 {
559- coin := coins[0]
560- return coin
561- }
543+ return uint64(testBanker.GetCoins(addr)[0].Amount)
562544}
0 commit comments