From 2e26e0bbe877f18f44ec0775b0c0cef31b076e37 Mon Sep 17 00:00:00 2001 From: 0xTopaz <60733299+onlyhyde@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:49:11 +0900 Subject: [PATCH] fix: run test code error (#441) --- pool/errors.gno | 2 +- pool/type.gno | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pool/errors.gno b/pool/errors.gno index 2031f4ad9..11c4efa57 100644 --- a/pool/errors.gno +++ b/pool/errors.gno @@ -32,7 +32,7 @@ var ( errInvalidTickAndTickSpacing = errors.New("[GNOSWAP-POOL-022] invalid tick and tick spacing requested") errInvalidAddress = errors.New("[GNOSWAP-POOL-023] invalid address") errInvalidTickRange = errors.New("[GNOSWAP-POOL-024] tickLower is greater than tickUpper") - errUnderflow = errors.New("[GNOSWAP-POOL-025] underflow") // TODO: make as common error code + errUnderflow = errors.New("[GNOSWAP-POOL-025] underflow") // TODO: make as common error code ) // addDetailToError adds detail to an error message diff --git a/pool/type.gno b/pool/type.gno index 2c2fd3d47..0135c34ef 100644 --- a/pool/type.gno +++ b/pool/type.gno @@ -268,8 +268,8 @@ func (t *TickInfo) init() { } type ( - Ticks map[int32]TickInfo // tick => TickInfo - TickBitmaps map[int16]*u256.Uint // tick(wordPos) => bitmap(tickWord ^ mask) + Ticks map[int32]TickInfo // tick => TickInfo + TickBitmaps map[int16]*u256.Uint // tick(wordPos) => bitmap(tickWord ^ mask) Positions map[string]PositionInfo // positionKey => PositionInfo ) @@ -327,71 +327,71 @@ func newPool(poolInfo *createPoolParams) *Pool { } } -func (p *Pool) PoolGetToken0Path() string { +func (p *Pool) GetToken0Path() string { return p.token0Path } -func (p *Pool) PoolGetToken1Path() string { +func (p *Pool) GetToken1Path() string { return p.token1Path } -func (p *Pool) PoolGetFee() uint32 { +func (p *Pool) GetFee() uint32 { return p.fee } -func (p *Pool) PoolGetBalanceToken0() *u256.Uint { +func (p *Pool) GetBalanceToken0() *u256.Uint { return p.balances.token0 } -func (p *Pool) PoolGetBalanceToken1() *u256.Uint { +func (p *Pool) GetBalanceToken1() *u256.Uint { return p.balances.token1 } -func (p *Pool) PoolGetTickSpacing() int32 { +func (p *Pool) GetTickSpacing() int32 { return p.tickSpacing } -func (p *Pool) PoolGetMaxLiquidityPerTick() *u256.Uint { +func (p *Pool) GetMaxLiquidityPerTick() *u256.Uint { return p.maxLiquidityPerTick } -func (p *Pool) PoolGetSlot0() Slot0 { +func (p *Pool) GetSlot0() Slot0 { return p.slot0 } -func (p *Pool) PoolGetSlot0SqrtPriceX96() *u256.Uint { +func (p *Pool) GetSlot0SqrtPriceX96() *u256.Uint { return p.slot0.sqrtPriceX96 } -func (p *Pool) PoolGetSlot0Tick() int32 { +func (p *Pool) GetSlot0Tick() int32 { return p.slot0.tick } -func (p *Pool) PoolGetSlot0FeeProtocol() uint8 { +func (p *Pool) GetSlot0FeeProtocol() uint8 { return p.slot0.feeProtocol } -func (p *Pool) PoolGetSlot0Unlocked() bool { +func (p *Pool) GetSlot0Unlocked() bool { return p.slot0.unlocked } -func (p *Pool) PoolGetFeeGrowthGlobal0X128() *u256.Uint { +func (p *Pool) GetFeeGrowthGlobal0X128() *u256.Uint { return p.feeGrowthGlobal0X128 } -func (p *Pool) PoolGetFeeGrowthGlobal1X128() *u256.Uint { +func (p *Pool) GetFeeGrowthGlobal1X128() *u256.Uint { return p.feeGrowthGlobal1X128 } -func (p *Pool) PoolGetProtocolFeesToken0() *u256.Uint { +func (p *Pool) GetProtocolFeesToken0() *u256.Uint { return p.protocolFees.token0 } -func (p *Pool) PoolGetProtocolFeesToken1() *u256.Uint { +func (p *Pool) GetProtocolFeesToken1() *u256.Uint { return p.protocolFees.token1 } -func (p *Pool) PoolGetLiquidity() *u256.Uint { +func (p *Pool) GetLiquidity() *u256.Uint { return p.liquidity }