From abcc358b7cd9d179c897b0ec9cefd247f9dc818f Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 6 Aug 2021 11:15:16 +0530 Subject: [PATCH 1/2] disable smartweave logger workaround --- src/index.ts | 9 +++++---- src/lib/get_tp_tokens.ts | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 8817b4e..8265cff 100644 --- a/src/index.ts +++ b/src/index.ts @@ -39,10 +39,10 @@ import Transaction from "arweave/node/lib/transaction"; import { GQLEdgeInterface } from "ar-gql/dist/faces"; // eslint-disable-next-line -console.log = (...x: any[]) => { - if (new Error().stack?.includes("smartweave")) return; - console.info(...x); -}; +// console.log = (...x: any[]) => { +// if (new Error().stack?.includes("smartweave")) return; +// console.info(...x); +// }; interface VertoLibOptions { useCache?: boolean; @@ -306,6 +306,7 @@ export default class Verto { return getTPTokens( this.arweave, post, + this.useCache, this.exchangeContract, this.exchangeWallet ); diff --git a/src/lib/get_tp_tokens.ts b/src/lib/get_tp_tokens.ts index a44dd88..564d143 100644 --- a/src/lib/get_tp_tokens.ts +++ b/src/lib/get_tp_tokens.ts @@ -13,6 +13,7 @@ const unique = (arr: VertoToken[]): VertoToken[] => { export const getTPTokens = async ( client: Arweave, post: string, + useCache: boolean, exchangeContract: string, exchangeWallet: string ): Promise => { @@ -20,7 +21,7 @@ export const getTPTokens = async ( const tokens: VertoToken[] = [ ...(await popularTokens(client, exchangeWallet)), - ...(await getTokens(client, exchangeContract)), + ...(await getTokens(client, useCache, exchangeContract)), ]; // @ts-ignore config.blockedTokens.map((token: string) => { From adc0eefec122841936f177b4786ba9c1e0dff4d9 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 10 Aug 2021 14:07:34 +0530 Subject: [PATCH 2/2] use cache in e2e tests --- tests/e2e.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e.test.ts b/tests/e2e.test.ts index 7a99606..fe55cf0 100644 --- a/tests/e2e.test.ts +++ b/tests/e2e.test.ts @@ -12,7 +12,7 @@ let vertoInstance: Verto; describe("E2E Tests", function () { before(() => { - vertoInstance = new Verto(); + vertoInstance = new Verto(undefined, undefined, { useCache: true }); }); it("Assert Verto instance", (done) => {