Skip to content

Commit d1248ac

Browse files
committed
chore: remove Pool prefix from pool's receiver getter
1 parent 0b2f4ae commit d1248ac

File tree

7 files changed

+77
-85
lines changed

7 files changed

+77
-85
lines changed

Diff for: pool/getter.gno

+29-29
Original file line numberDiff line numberDiff line change
@@ -11,119 +11,119 @@ func PoolGetPoolList() []string {
1111
}
1212

1313
func PoolGetToken0Path(poolPath string) string {
14-
return mustGetPool(poolPath).PoolGetToken0Path()
14+
return mustGetPool(poolPath).GetToken0Path()
1515
}
1616

1717
func PoolGetToken1Path(poolPath string) string {
18-
return mustGetPool(poolPath).PoolGetToken1Path()
18+
return mustGetPool(poolPath).GetToken1Path()
1919
}
2020

2121
func PoolGetFee(poolPath string) uint32 {
22-
return mustGetPool(poolPath).PoolGetFee()
22+
return mustGetPool(poolPath).GetFee()
2323
}
2424

2525
func PoolGetBalanceToken0(poolPath string) string {
26-
return mustGetPool(poolPath).PoolGetBalanceToken0().ToString()
26+
return mustGetPool(poolPath).GetBalanceToken0().ToString()
2727
}
2828

2929
func PoolGetBalanceToken1(poolPath string) string {
30-
return mustGetPool(poolPath).PoolGetBalanceToken1().ToString()
30+
return mustGetPool(poolPath).GetBalanceToken1().ToString()
3131
}
3232

3333
func PoolGetTickSpacing(poolPath string) int32 {
34-
return mustGetPool(poolPath).PoolGetTickSpacing()
34+
return mustGetPool(poolPath).GetTickSpacing()
3535
}
3636

3737
func PoolGetMaxLiquidityPerTick(poolPath string) string {
38-
return mustGetPool(poolPath).PoolGetMaxLiquidityPerTick().ToString()
38+
return mustGetPool(poolPath).GetMaxLiquidityPerTick().ToString()
3939
}
4040

4141
func PoolGetSlot0SqrtPriceX96(poolPath string) string {
42-
return mustGetPool(poolPath).PoolGetSlot0SqrtPriceX96().ToString()
42+
return mustGetPool(poolPath).GetSlot0SqrtPriceX96().ToString()
4343
}
4444

4545
func PoolGetSlot0Tick(poolPath string) int32 {
46-
return mustGetPool(poolPath).PoolGetSlot0Tick()
46+
return mustGetPool(poolPath).GetSlot0Tick()
4747
}
4848

4949
func PoolGetSlot0FeeProtocol(poolPath string) uint8 {
50-
return mustGetPool(poolPath).PoolGetSlot0FeeProtocol()
50+
return mustGetPool(poolPath).GetSlot0FeeProtocol()
5151
}
5252

5353
func PoolGetSlot0Unlocked(poolPath string) bool {
54-
return mustGetPool(poolPath).PoolGetSlot0Unlocked()
54+
return mustGetPool(poolPath).GetSlot0Unlocked()
5555
}
5656

5757
func PoolGetFeeGrowthGlobal0X128(poolPath string) string {
58-
return mustGetPool(poolPath).PoolGetFeeGrowthGlobal0X128().ToString()
58+
return mustGetPool(poolPath).GetFeeGrowthGlobal0X128().ToString()
5959
}
6060

6161
func PoolGetFeeGrowthGlobal1X128(poolPath string) string {
62-
return mustGetPool(poolPath).PoolGetFeeGrowthGlobal1X128().ToString()
62+
return mustGetPool(poolPath).GetFeeGrowthGlobal1X128().ToString()
6363
}
6464

6565
func PoolGetProtocolFeesToken0(poolPath string) string {
66-
return mustGetPool(poolPath).PoolGetProtocolFeesToken0().ToString()
66+
return mustGetPool(poolPath).GetProtocolFeesToken0().ToString()
6767
}
6868

6969
func PoolGetProtocolFeesToken1(poolPath string) string {
70-
return mustGetPool(poolPath).PoolGetProtocolFeesToken1().ToString()
70+
return mustGetPool(poolPath).GetProtocolFeesToken1().ToString()
7171
}
7272

7373
func PoolGetLiquidity(poolPath string) string {
74-
return mustGetPool(poolPath).PoolGetLiquidity().ToString()
74+
return mustGetPool(poolPath).GetLiquidity().ToString()
7575
}
7676

7777
// position
7878
func PoolGetPositionLiquidity(poolPath, key string) string {
79-
return mustGetPool(poolPath).PoolGetPositionLiquidity(key).ToString()
79+
return mustGetPool(poolPath).GetPositionLiquidity(key).ToString()
8080
}
8181

8282
func PoolGetPositionFeeGrowthInside0LastX128(poolPath, key string) string {
83-
return mustGetPool(poolPath).PoolGetPositionFeeGrowthInside0LastX128(key).ToString()
83+
return mustGetPool(poolPath).GetPositionFeeGrowthInside0LastX128(key).ToString()
8484
}
8585

8686
func PoolGetPositionFeeGrowthInside1LastX128(poolPath, key string) string {
87-
return mustGetPool(poolPath).PoolGetPositionFeeGrowthInside1LastX128(key).ToString()
87+
return mustGetPool(poolPath).GetPositionFeeGrowthInside1LastX128(key).ToString()
8888
}
8989

9090
func PoolGetPositionTokensOwed0(poolPath, key string) string {
91-
return mustGetPool(poolPath).PoolGetPositionTokensOwed0(key).ToString()
91+
return mustGetPool(poolPath).GetPositionTokensOwed0(key).ToString()
9292
}
9393

9494
func PoolGetPositionTokensOwed1(poolPath, key string) string {
95-
return mustGetPool(poolPath).PoolGetPositionTokensOwed1(key).ToString()
95+
return mustGetPool(poolPath).GetPositionTokensOwed1(key).ToString()
9696
}
9797

9898
// tick
9999
func PoolGetTickLiquidityGross(poolPath string, tick int32) string {
100-
return mustGetPool(poolPath).PoolGetTickLiquidityGross(tick).ToString()
100+
return mustGetPool(poolPath).GetTickLiquidityGross(tick).ToString()
101101
}
102102

103103
func PoolGetTickLiquidityNet(poolPath string, tick int32) string {
104-
return mustGetPool(poolPath).PoolGetTickLiquidityNet(tick).ToString()
104+
return mustGetPool(poolPath).GetTickLiquidityNet(tick).ToString()
105105
}
106106

107107
func PoolGetTickFeeGrowthOutside0X128(poolPath string, tick int32) string {
108-
return mustGetPool(poolPath).PoolGetTickFeeGrowthOutside0X128(tick).ToString()
108+
return mustGetPool(poolPath).GetTickFeeGrowthOutside0X128(tick).ToString()
109109
}
110110

111111
func PoolGetTickFeeGrowthOutside1X128(poolPath string, tick int32) string {
112-
return mustGetPool(poolPath).PoolGetTickFeeGrowthOutside1X128(tick).ToString()
112+
return mustGetPool(poolPath).GetTickFeeGrowthOutside1X128(tick).ToString()
113113
}
114114

115115
func PoolGetTickCumulativeOutside(poolPath string, tick int32) int64 {
116-
return mustGetPool(poolPath).PoolGetTickCumulativeOutside(tick)
116+
return mustGetPool(poolPath).GetTickCumulativeOutside(tick)
117117
}
118118

119119
func PoolGetTickSecondsPerLiquidityOutsideX128(poolPath string, tick int32) string {
120-
return mustGetPool(poolPath).PoolGetTickSecondsPerLiquidityOutsideX128(tick).ToString()
120+
return mustGetPool(poolPath).GetTickSecondsPerLiquidityOutsideX128(tick).ToString()
121121
}
122122

123123
func PoolGetTickSecondsOutside(poolPath string, tick int32) uint32 {
124-
return mustGetPool(poolPath).PoolGetTickSecondsOutside(tick)
124+
return mustGetPool(poolPath).GetTickSecondsOutside(tick)
125125
}
126126

127127
func PoolGetTickInitialized(poolPath string, tick int32) bool {
128-
return mustGetPool(poolPath).PoolGetTickInitialized(tick)
128+
return mustGetPool(poolPath).GetTickInitialized(tick)
129129
}

Diff for: pool/pool.gno

+17-17
Original file line numberDiff line numberDiff line change
@@ -759,71 +759,71 @@ func checkAmountRange(amount *i256.Int) uint64 {
759759
}
760760

761761
// receiver getters
762-
func (p *Pool) PoolGetToken0Path() string {
762+
func (p *Pool) GetToken0Path() string {
763763
return p.token0Path
764764
}
765765

766-
func (p *Pool) PoolGetToken1Path() string {
766+
func (p *Pool) GetToken1Path() string {
767767
return p.token1Path
768768
}
769769

770-
func (p *Pool) PoolGetFee() uint32 {
770+
func (p *Pool) GetFee() uint32 {
771771
return p.fee
772772
}
773773

774-
func (p *Pool) PoolGetBalanceToken0() *u256.Uint {
774+
func (p *Pool) GetBalanceToken0() *u256.Uint {
775775
return p.balances.token0
776776
}
777777

778-
func (p *Pool) PoolGetBalanceToken1() *u256.Uint {
778+
func (p *Pool) GetBalanceToken1() *u256.Uint {
779779
return p.balances.token1
780780
}
781781

782-
func (p *Pool) PoolGetTickSpacing() int32 {
782+
func (p *Pool) GetTickSpacing() int32 {
783783
return p.tickSpacing
784784
}
785785

786-
func (p *Pool) PoolGetMaxLiquidityPerTick() *u256.Uint {
786+
func (p *Pool) GetMaxLiquidityPerTick() *u256.Uint {
787787
return p.maxLiquidityPerTick
788788
}
789789

790-
func (p *Pool) PoolGetSlot0() Slot0 {
790+
func (p *Pool) GetSlot0() Slot0 {
791791
return p.slot0
792792
}
793793

794-
func (p *Pool) PoolGetSlot0SqrtPriceX96() *u256.Uint {
794+
func (p *Pool) GetSlot0SqrtPriceX96() *u256.Uint {
795795
return p.slot0.sqrtPriceX96
796796
}
797797

798-
func (p *Pool) PoolGetSlot0Tick() int32 {
798+
func (p *Pool) GetSlot0Tick() int32 {
799799
return p.slot0.tick
800800
}
801801

802-
func (p *Pool) PoolGetSlot0FeeProtocol() uint8 {
802+
func (p *Pool) GetSlot0FeeProtocol() uint8 {
803803
return p.slot0.feeProtocol
804804
}
805805

806-
func (p *Pool) PoolGetSlot0Unlocked() bool {
806+
func (p *Pool) GetSlot0Unlocked() bool {
807807
return p.slot0.unlocked
808808
}
809809

810-
func (p *Pool) PoolGetFeeGrowthGlobal0X128() *u256.Uint {
810+
func (p *Pool) GetFeeGrowthGlobal0X128() *u256.Uint {
811811
return p.feeGrowthGlobal0X128
812812
}
813813

814-
func (p *Pool) PoolGetFeeGrowthGlobal1X128() *u256.Uint {
814+
func (p *Pool) GetFeeGrowthGlobal1X128() *u256.Uint {
815815
return p.feeGrowthGlobal1X128
816816
}
817817

818-
func (p *Pool) PoolGetProtocolFeesToken0() *u256.Uint {
818+
func (p *Pool) GetProtocolFeesToken0() *u256.Uint {
819819
return p.protocolFees.token0
820820
}
821821

822-
func (p *Pool) PoolGetProtocolFeesToken1() *u256.Uint {
822+
func (p *Pool) GetProtocolFeesToken1() *u256.Uint {
823823
return p.protocolFees.token1
824824
}
825825

826-
func (p *Pool) PoolGetLiquidity() *u256.Uint {
826+
func (p *Pool) GetLiquidity() *u256.Uint {
827827
return p.liquidity
828828
}
829829

Diff for: pool/position.gno

+5-5
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,23 @@ func positionUpdate(
107107

108108
// receiver getters
109109

110-
func (p *Pool) PoolGetPositionLiquidity(key string) *u256.Uint {
110+
func (p *Pool) GetPositionLiquidity(key string) *u256.Uint {
111111
return p.mustGetPosition(key).liquidity
112112
}
113113

114-
func (p *Pool) PoolGetPositionFeeGrowthInside0LastX128(key string) *u256.Uint {
114+
func (p *Pool) GetPositionFeeGrowthInside0LastX128(key string) *u256.Uint {
115115
return p.mustGetPosition(key).feeGrowthInside0LastX128
116116
}
117117

118-
func (p *Pool) PoolGetPositionFeeGrowthInside1LastX128(key string) *u256.Uint {
118+
func (p *Pool) GetPositionFeeGrowthInside1LastX128(key string) *u256.Uint {
119119
return p.mustGetPosition(key).feeGrowthInside1LastX128
120120
}
121121

122-
func (p *Pool) PoolGetPositionTokensOwed0(key string) *u256.Uint {
122+
func (p *Pool) GetPositionTokensOwed0(key string) *u256.Uint {
123123
return p.mustGetPosition(key).tokensOwed0
124124
}
125125

126-
func (p *Pool) PoolGetPositionTokensOwed1(key string) *u256.Uint {
126+
func (p *Pool) GetPositionTokensOwed1(key string) *u256.Uint {
127127
return p.mustGetPosition(key).tokensOwed1
128128
}
129129

Diff for: pool/tick.gno

+8-8
Original file line numberDiff line numberDiff line change
@@ -144,35 +144,35 @@ func getFeeGrowthAboveX128(
144144
}
145145

146146
// receiver getters
147-
func (p *Pool) PoolGetTickLiquidityGross(tick int32) *u256.Uint {
147+
func (p *Pool) GetTickLiquidityGross(tick int32) *u256.Uint {
148148
return p.mustGetTick(tick).liquidityGross
149149
}
150150

151-
func (p *Pool) PoolGetTickLiquidityNet(tick int32) *i256.Int {
151+
func (p *Pool) GetTickLiquidityNet(tick int32) *i256.Int {
152152
return p.mustGetTick(tick).liquidityNet
153153
}
154154

155-
func (p *Pool) PoolGetTickFeeGrowthOutside0X128(tick int32) *u256.Uint {
155+
func (p *Pool) GetTickFeeGrowthOutside0X128(tick int32) *u256.Uint {
156156
return p.mustGetTick(tick).feeGrowthOutside0X128
157157
}
158158

159-
func (p *Pool) PoolGetTickFeeGrowthOutside1X128(tick int32) *u256.Uint {
159+
func (p *Pool) GetTickFeeGrowthOutside1X128(tick int32) *u256.Uint {
160160
return p.mustGetTick(tick).feeGrowthOutside1X128
161161
}
162162

163-
func (p *Pool) PoolGetTickCumulativeOutside(tick int32) int64 {
163+
func (p *Pool) GetTickCumulativeOutside(tick int32) int64 {
164164
return p.mustGetTick(tick).tickCumulativeOutside
165165
}
166166

167-
func (p *Pool) PoolGetTickSecondsPerLiquidityOutsideX128(tick int32) *u256.Uint {
167+
func (p *Pool) GetTickSecondsPerLiquidityOutsideX128(tick int32) *u256.Uint {
168168
return p.mustGetTick(tick).secondsPerLiquidityOutsideX128
169169
}
170170

171-
func (p *Pool) PoolGetTickSecondsOutside(tick int32) uint32 {
171+
func (p *Pool) GetTickSecondsOutside(tick int32) uint32 {
172172
return p.mustGetTick(tick).secondsOutside
173173
}
174174

175-
func (p *Pool) PoolGetTickInitialized(tick int32) bool {
175+
func (p *Pool) GetTickInitialized(tick int32) bool {
176176
return p.mustGetTick(tick).initialized
177177
}
178178

Diff for: position/_RPC_api.gno

+8-8
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ func rpcMakePosition(lpTokenId uint64) RpcPosition {
390390
burned := isBurned(lpTokenId)
391391

392392
pool := pl.GetPoolFromPoolPath(position.poolKey)
393-
currentX96 := pool.PoolGetSlot0SqrtPriceX96()
393+
currentX96 := pool.GetSlot0SqrtPriceX96()
394394
lowerX96 := common.TickMathGetSqrtRatioAtTick(position.tickLower)
395395
upperX96 := common.TickMathGetSqrtRatioAtTick(position.tickUpper)
396396

@@ -439,24 +439,24 @@ func unclaimedFee(tokenId uint64) (*i256.Int, *i256.Int) {
439439
poolKey := positions[tokenId].poolKey
440440
pool := pl.GetPoolFromPoolPath(poolKey)
441441

442-
currentTick := pool.PoolGetSlot0Tick()
442+
currentTick := pool.GetSlot0Tick()
443443

444-
_feeGrowthGlobal0X128 := pool.PoolGetFeeGrowthGlobal0X128() // u256
444+
_feeGrowthGlobal0X128 := pool.GetFeeGrowthGlobal0X128() // u256
445445
feeGrowthGlobal0X128 := i256.FromUint256(_feeGrowthGlobal0X128) // i256
446446

447-
_feeGrowthGlobal1X128 := pool.PoolGetFeeGrowthGlobal1X128() // u256
447+
_feeGrowthGlobal1X128 := pool.GetFeeGrowthGlobal1X128() // u256
448448
feeGrowthGlobal1X128 := i256.FromUint256(_feeGrowthGlobal1X128) // i256
449449

450-
_tickUpperFeeGrowthOutside0X128 := pool.PoolGetTickFeeGrowthOutside0X128(tickUpper) // u256
450+
_tickUpperFeeGrowthOutside0X128 := pool.GetTickFeeGrowthOutside0X128(tickUpper) // u256
451451
tickUpperFeeGrowthOutside0X128 := i256.FromUint256(_tickUpperFeeGrowthOutside0X128) // i256
452452

453-
_tickUpperFeeGrowthOutside1X128 := pool.PoolGetTickFeeGrowthOutside1X128(tickUpper) // u256
453+
_tickUpperFeeGrowthOutside1X128 := pool.GetTickFeeGrowthOutside1X128(tickUpper) // u256
454454
tickUpperFeeGrowthOutside1X128 := i256.FromUint256(_tickUpperFeeGrowthOutside1X128) // i256
455455

456-
_tickLowerFeeGrowthOutside0X128 := pool.PoolGetTickFeeGrowthOutside0X128(tickLower) // u256
456+
_tickLowerFeeGrowthOutside0X128 := pool.GetTickFeeGrowthOutside0X128(tickLower) // u256
457457
tickLowerFeeGrowthOutside0X128 := i256.FromUint256(_tickLowerFeeGrowthOutside0X128) // i256
458458

459-
_tickLowerFeeGrowthOutside1X128 := pool.PoolGetTickFeeGrowthOutside1X128(tickLower) // u256
459+
_tickLowerFeeGrowthOutside1X128 := pool.GetTickFeeGrowthOutside1X128(tickLower) // u256
460460
tickLowerFeeGrowthOutside1X128 := i256.FromUint256(_tickLowerFeeGrowthOutside1X128) // i256
461461

462462
_feeGrowthInside0LastX128 := positions[tokenId].feeGrowthInside0LastX128 // u256

Diff for: position/liquidity_management.gno

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
func addLiquidity(params AddLiquidityParams) (*u256.Uint, *u256.Uint, *u256.Uint) {
1717
pool := pl.GetPoolFromPoolPath(params.poolKey)
1818

19-
sqrtPriceX96 := pool.PoolGetSlot0SqrtPriceX96()
19+
sqrtPriceX96 := pool.GetSlot0SqrtPriceX96()
2020
sqrtRatioAX96 := common.TickMathGetSqrtRatioAtTick(params.tickLower)
2121
sqrtRatioBX96 := common.TickMathGetSqrtRatioAtTick(params.tickUpper)
2222

0 commit comments

Comments
 (0)