From f68a11145fd4ffc1f14c0c9a423feacd28e38cc2 Mon Sep 17 00:00:00 2001 From: microwavedcola1 Date: Mon, 19 Dec 2022 09:42:05 +0100 Subject: [PATCH] Filter by account Signed-off-by: microwavedcola1 --- ts/client/src/debug-scripts/debug-user.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ts/client/src/debug-scripts/debug-user.ts b/ts/client/src/debug-scripts/debug-user.ts index dc739674e..b6b45df50 100644 --- a/ts/client/src/debug-scripts/debug-user.ts +++ b/ts/client/src/debug-scripts/debug-user.ts @@ -1,5 +1,5 @@ import { AnchorProvider, Wallet } from '@project-serum/anchor'; -import { Cluster, Connection, Keypair } from '@solana/web3.js'; +import { Cluster, Connection, Keypair, PublicKey } from '@solana/web3.js'; import fs from 'fs'; import { Group } from '../accounts/group'; import { HealthCache } from '../accounts/healthCache'; @@ -17,6 +17,7 @@ const PAYER_KEYPAIR = const USER_KEYPAIR = process.env.USER_KEYPAIR_OVERRIDE || process.env.MB_PAYER_KEYPAIR; const GROUP_NUM = Number(process.env.GROUP_NUM || 0); +const MANGO_ACCOUNT = process.env.MANGO_ACCOUNT; const CLUSTER: Cluster = (process.env.CLUSTER_OVERRIDE as Cluster) || 'mainnet-beta'; @@ -256,12 +257,8 @@ async function main(): Promise { for (const mangoAccount of mangoAccounts) { if ( - // eslint-disable-next-line no-constant-condition - true - // Enable below to debug specific mango accounts - // mangoAccount.publicKey.equals( - // new PublicKey('GGfkfpT4dY8hmNK6SKKSBFdn7ucQXSc4WtDCQpnQt4p2'), - // ) + !MANGO_ACCOUNT || + mangoAccount.publicKey.equals(new PublicKey(MANGO_ACCOUNT)) ) { console.log(); console.log(`MangoAccount ${mangoAccount.publicKey}`);