Remove async from TickUtil.getTickArrayPDAs (#77)

This commit is contained in:
meep 2023-01-11 09:39:58 +08:00 committed by GitHub
parent 277e4ff7c8
commit 1fc24cedff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -81,9 +81,9 @@ export function collectRewardsQuote(param: CollectRewardsQuoteParam): CollectRew
rewardGrowthsBelowX64 =
tickCurrentIndex < tickLowerIndex
? MathUtil.subUnderflowU128(
adjustedRewardGrowthGlobalX64,
tickLowerRewardGrowthsOutsideX64
)
adjustedRewardGrowthGlobalX64,
tickLowerRewardGrowthsOutsideX64
)
: tickLowerRewardGrowthsOutsideX64;
}
@ -93,9 +93,9 @@ export function collectRewardsQuote(param: CollectRewardsQuoteParam): CollectRew
tickCurrentIndex < tickUpperIndex
? tickUpperRewardGrowthsOutsideX64
: MathUtil.subUnderflowU128(
adjustedRewardGrowthGlobalX64,
tickUpperRewardGrowthsOutsideX64
);
adjustedRewardGrowthGlobalX64,
tickUpperRewardGrowthsOutsideX64
);
}
const rewardGrowthInsideX64 = MathUtil.subUnderflowU128(

View File

@ -1,3 +1,4 @@
import { PDA } from "@orca-so/common-sdk";
import { PublicKey } from "@solana/web3.js";
import invariant from "tiny-invariant";
import { AccountFetcher } from "../../network/public";
@ -198,14 +199,14 @@ export class TickArrayUtil {
* @param whirlpoolAddress - Address for the Whirlpool for these tick-arrays
* @returns TickArray PDAs for the sequence`
*/
public static async getTickArrayPDAs(
public static getTickArrayPDAs(
tick: number,
tickSpacing: number,
numOfTickArrays: number,
programId: PublicKey,
whirlpoolAddress: PublicKey,
aToB: boolean
) {
): PDA[] {
let arrayIndexList = [...Array(numOfTickArrays).keys()];
if (aToB) {
arrayIndexList = arrayIndexList.map((value) => -value);