From 5a6a753de614691fa0a509f4fe4c887443597474 Mon Sep 17 00:00:00 2001 From: Asa Oines Date: Tue, 4 Apr 2023 23:53:36 -0400 Subject: [PATCH] Fix fork tests 2 (#2063) - Fix an issue where `pick` inserts a key into an object. - Skip fork testing ICAs/IQS due to the IGP mismatch error --- .github/workflows/node.yml | 2 +- typescript/infra/scripts/deploy.ts | 16 +++++++++------- typescript/sdk/src/utils/objects.ts | 5 ++++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index ddf354920..aa433ba67 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -115,7 +115,7 @@ jobs: strategy: matrix: environment: [testnet3, mainnet2] - module: [core, igp, ica, iqs] + module: [core, igp] steps: - uses: actions/checkout@v3 diff --git a/typescript/infra/scripts/deploy.ts b/typescript/infra/scripts/deploy.ts index b4cad48d9..ae5d9ea74 100644 --- a/typescript/infra/scripts/deploy.ts +++ b/typescript/infra/scripts/deploy.ts @@ -121,13 +121,15 @@ async function main() { read: environment !== 'test', write: true, }; - const agentConfig = ['core', 'igp'].includes(module) - ? { - addresses, - environment, - multiProvider, - } - : undefined; + // Don't write agent config in fork tests + const agentConfig = + ['core', 'igp'].includes(module) && !fork + ? { + addresses, + environment, + multiProvider, + } + : undefined; await deployWithArtifacts(deployer, cache, fork, agentConfig); } diff --git a/typescript/sdk/src/utils/objects.ts b/typescript/sdk/src/utils/objects.ts index d8bacd920..1c7b7b99f 100644 --- a/typescript/sdk/src/utils/objects.ts +++ b/typescript/sdk/src/utils/objects.ts @@ -40,8 +40,11 @@ export function promiseObjAll(obj: { // Get the subset of the object from key list export function pick(obj: Record, keys: K[]) { const ret: Partial> = {}; + const objKeys = Object.keys(obj); for (const key of keys) { - ret[key] = obj[key]; + if (objKeys.includes(key)) { + ret[key] = obj[key]; + } } return ret as Record; }