Skip to content

Commit ce2e292

Browse files
authored
chore: remove Pool prefix from pool's receiver getter (#423)
1 parent 47811ab commit ce2e292

File tree

7 files changed

+73
-73
lines changed

7 files changed

+73
-73
lines changed

pool/getter.gno

Lines changed: 29 additions & 29 deletions
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
}

pool/pool.gno

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -985,71 +985,71 @@ func checkAmountRange(amount *u256.Uint) (uint64, error) {
985985
}
986986

987987
// receiver getters
988-
func (p *Pool) PoolGetToken0Path() string {
988+
func (p *Pool) GetToken0Path() string {
989989
return p.token0Path
990990
}
991991

992-
func (p *Pool) PoolGetToken1Path() string {
992+
func (p *Pool) GetToken1Path() string {
993993
return p.token1Path
994994
}
995995

996-
func (p *Pool) PoolGetFee() uint32 {
996+
func (p *Pool) GetFee() uint32 {
997997
return p.fee
998998
}
999999

1000-
func (p *Pool) PoolGetBalanceToken0() *u256.Uint {
1000+
func (p *Pool) GetBalanceToken0() *u256.Uint {
10011001
return p.balances.token0
10021002
}
10031003

1004-
func (p *Pool) PoolGetBalanceToken1() *u256.Uint {
1004+
func (p *Pool) GetBalanceToken1() *u256.Uint {
10051005
return p.balances.token1
10061006
}
10071007

1008-
func (p *Pool) PoolGetTickSpacing() int32 {
1008+
func (p *Pool) GetTickSpacing() int32 {
10091009
return p.tickSpacing
10101010
}
10111011

1012-
func (p *Pool) PoolGetMaxLiquidityPerTick() *u256.Uint {
1012+
func (p *Pool) GetMaxLiquidityPerTick() *u256.Uint {
10131013
return p.maxLiquidityPerTick
10141014
}
10151015

1016-
func (p *Pool) PoolGetSlot0() Slot0 {
1016+
func (p *Pool) GetSlot0() Slot0 {
10171017
return p.slot0
10181018
}
10191019

1020-
func (p *Pool) PoolGetSlot0SqrtPriceX96() *u256.Uint {
1020+
func (p *Pool) GetSlot0SqrtPriceX96() *u256.Uint {
10211021
return p.slot0.sqrtPriceX96
10221022
}
10231023

1024-
func (p *Pool) PoolGetSlot0Tick() int32 {
1024+
func (p *Pool) GetSlot0Tick() int32 {
10251025
return p.slot0.tick
10261026
}
10271027

1028-
func (p *Pool) PoolGetSlot0FeeProtocol() uint8 {
1028+
func (p *Pool) GetSlot0FeeProtocol() uint8 {
10291029
return p.slot0.feeProtocol
10301030
}
10311031

1032-
func (p *Pool) PoolGetSlot0Unlocked() bool {
1032+
func (p *Pool) GetSlot0Unlocked() bool {
10331033
return p.slot0.unlocked
10341034
}
10351035

1036-
func (p *Pool) PoolGetFeeGrowthGlobal0X128() *u256.Uint {
1036+
func (p *Pool) GetFeeGrowthGlobal0X128() *u256.Uint {
10371037
return p.feeGrowthGlobal0X128
10381038
}
10391039

1040-
func (p *Pool) PoolGetFeeGrowthGlobal1X128() *u256.Uint {
1040+
func (p *Pool) GetFeeGrowthGlobal1X128() *u256.Uint {
10411041
return p.feeGrowthGlobal1X128
10421042
}
10431043

1044-
func (p *Pool) PoolGetProtocolFeesToken0() *u256.Uint {
1044+
func (p *Pool) GetProtocolFeesToken0() *u256.Uint {
10451045
return p.protocolFees.token0
10461046
}
10471047

1048-
func (p *Pool) PoolGetProtocolFeesToken1() *u256.Uint {
1048+
func (p *Pool) GetProtocolFeesToken1() *u256.Uint {
10491049
return p.protocolFees.token1
10501050
}
10511051

1052-
func (p *Pool) PoolGetLiquidity() *u256.Uint {
1052+
func (p *Pool) GetLiquidity() *u256.Uint {
10531053
return p.liquidity
10541054
}
10551055

pool/position.gno

Lines changed: 5 additions & 5 deletions
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

pool/tick.gno

Lines changed: 8 additions & 8 deletions
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

position/_RPC_api.gno

Lines changed: 8 additions & 8 deletions
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

position/liquidity_management.gno

Lines changed: 1 addition & 1 deletion
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)