diff --git a/package.json b/package.json index 5dfeeb9..3b44cc6 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "publish-image": "chmod +x ./scripts/publish.sh && ./scripts/publish.sh" }, "dependencies": { - "@angleprotocol/sdk": "2.3.3", + "@angleprotocol/sdk": "2.9.1", "@google-cloud/secret-manager": "^4.2.2", "@octokit/rest": "19.0.13", "@types/chai": "^4.3.6", diff --git a/src/bot/runner.ts b/src/bot/runner.ts index 1ff45c6..700760e 100644 --- a/src/bot/runner.ts +++ b/src/bot/runner.ts @@ -43,19 +43,20 @@ export const checkDisputeWindow: Step = async (context, report) => { const { startTime } = report; const { disputer, disputeToken, endOfDisputePeriod } = report?.params; - if (!!disputer && disputer !== NULL_ADDRESS) return Result.Exit({ reason: 'Already disputed', report }); - else if (disputeToken === NULL_ADDRESS) return Result.Exit({ reason: 'No dispute token set', report }); - else if (endOfDisputePeriod <= startTime) { - // Check delay since last dispute period and eventually send an alert - if (endOfDisputePeriod + ALERTING_DELAY[context.chainId] * HOUR <= startTime) { - await context.logger.error( - context, - `Last update was ${((startTime - endOfDisputePeriod) / HOUR)?.toFixed(2)} hours ago`, - BotError.AlertDelay - ); - } - return Result.Exit({ reason: 'Not in dispute period', report }); - } + // if (!!disputer && disputer !== NULL_ADDRESS) return Result.Exit({ reason: 'Already disputed', report }); + // else + // if (disputeToken === NULL_ADDRESS) return Result.Exit({ reason: 'No dispute token set', report }); + // else if (endOfDisputePeriod <= startTime) { + // // Check delay since last dispute period and eventually send an alert + // if (endOfDisputePeriod + ALERTING_DELAY[context.chainId] * HOUR <= startTime) { + // await context.logger.error( + // context, + // `Last update was ${((startTime - endOfDisputePeriod) / HOUR)?.toFixed(2)} hours ago`, + // BotError.AlertDelay + // ); + // } + // return Result.Exit({ reason: 'Not in dispute period', report }); + // } return Result.Success(report); } catch (err) { return Result.Error({ code: BotError.OnChainFetch, reason: `Unable to check dispute status: ${err}`, report }); diff --git a/src/providers/on-chain/OnChainProvider.ts b/src/providers/on-chain/OnChainProvider.ts index 888ebcd..95a90b7 100644 --- a/src/providers/on-chain/OnChainProvider.ts +++ b/src/providers/on-chain/OnChainProvider.ts @@ -1,5 +1,4 @@ import { AMM } from '@angleprotocol/sdk'; -import { ExtensiveDistributionParametersStructOutput } from '@angleprotocol/sdk/dist/generated/DistributionCreator'; import { BigNumber, ContractReceipt, Overrides, Wallet } from 'ethers'; import { HolderClaims, HolderDetail } from '../../types/holders'; @@ -27,8 +26,8 @@ export default abstract class OnChainProvider extends ExponentialBackoffProvider protected abstract onChainParams: () => Promise; protected abstract timestampAt: (blockNumber: number) => Promise; - protected abstract activeDistributions: () => Promise; - protected abstract activeDistributionsBetween: (start: number, end: number) => Promise; + protected abstract activeDistributions: () => Promise; + protected abstract activeDistributionsBetween: (start: number, end: number) => Promise; protected abstract poolName: (pool: string, amm: AMM) => Promise; protected abstract claimed: (holderDetails: HolderDetail[]) => Promise; protected abstract approve: ( @@ -70,11 +69,11 @@ export default abstract class OnChainProvider extends ExponentialBackoffProvider return this.retryWithExponentialBackoff(this.approval, this.fetchParams, address, token); } - async fetchActiveDistributions(): Promise { + async fetchActiveDistributions(): Promise { return this.retryWithExponentialBackoff(this.activeDistributions, this.fetchParams); } - async fetchActiveDistributionsBetween(start: number, end: number): Promise { + async fetchActiveDistributionsBetween(start: number, end: number): Promise { return this.retryWithExponentialBackoff(this.activeDistributionsBetween, this.fetchParams, start, end); } diff --git a/yarn.lock b/yarn.lock index e4d155c..75f6986 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@angleprotocol/sdk@2.3.3": - version "2.3.3" - resolved "https://npm.pkg.github.com/download/@angleprotocol/sdk/2.3.3/d7704f15188fadd674d9b8d03753efb7b35a68aa#d7704f15188fadd674d9b8d03753efb7b35a68aa" - integrity sha512-6gqgad5OxCNl8gsTHUFtOXYM9yVD3zrFwUQGyZp4vQQKe7T0PXe6sAbRw69gCFiL0N0mf52oleZynf0YYRKQ/g== +"@angleprotocol/sdk@2.9.1": + version "2.9.1" + resolved "https://npm.pkg.github.com/download/@angleprotocol/sdk/2.9.1/ccb06980f8c62bc03c4010d985a95a2ae88f1308#ccb06980f8c62bc03c4010d985a95a2ae88f1308" + integrity sha512-lql4cr+0ai2LufIHdUgQlnzjNbRDsmE112GD6MsFsHY427GE9Qb0C72yp0tuoxEncqGgoTjux/iwjlRc87Hk4w== dependencies: "@apollo/client" "^3.7.17" "@typechain/ethers-v5" "^10.0.0"