From 3ea8635530bc4d5c7c33a13ba9cd7ffab803e6b5 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 7 Nov 2024 10:02:21 -0800 Subject: [PATCH] Revert "test: rm readPublished helper" This reverts commit 7c9e69539792947d92f5185c7074a720354075ca. --- .../proposals/z:acceptance/core-eval.test.js | 13 ++++++++----- .../proposals/z:acceptance/localchain.test.js | 9 ++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/a3p-integration/proposals/z:acceptance/core-eval.test.js b/a3p-integration/proposals/z:acceptance/core-eval.test.js index df07a50fcd92..26ffef39d507 100644 --- a/a3p-integration/proposals/z:acceptance/core-eval.test.js +++ b/a3p-integration/proposals/z:acceptance/core-eval.test.js @@ -8,8 +8,6 @@ import { retryUntilCondition } from '@agoric/client-utils'; import { walletUtils } from './test-lib/index.js'; -const { readLatest } = walletUtils.vstorage; - const SUBMISSION_DIR = 'core-eval-test-submission'; /** @@ -24,11 +22,16 @@ const replaceTemplateValuesInFile = async (fileName, replacements) => { await writeFile(`${fileName}.js`, script); }; +/** @param {string} path } */ +const readPublished = async path => { + return walletUtils.vstorage.readLatest(`published.${path}`); +}; + test(`core eval works`, async t => { - const nodePath = 'published.foo.bar'; + const nodePath = 'foo.bar'; const nodeValue = 'baz'; - await t.throwsAsync(readLatest(nodePath), { + await t.throwsAsync(readPublished(nodePath), { message: /not found/, }); @@ -40,7 +43,7 @@ test(`core eval works`, async t => { await evalBundles(SUBMISSION_DIR); const actualValue = await retryUntilCondition( - async () => readLatest(nodePath), + async () => readPublished(nodePath), value => value === nodeValue, 'core eval not processed yet', { setTimeout, retryIntervalMs: 5000, maxRetries: 15 }, diff --git a/a3p-integration/proposals/z:acceptance/localchain.test.js b/a3p-integration/proposals/z:acceptance/localchain.test.js index 9f9a5443b5d4..5ad1fa6f9f5b 100644 --- a/a3p-integration/proposals/z:acceptance/localchain.test.js +++ b/a3p-integration/proposals/z:acceptance/localchain.test.js @@ -7,18 +7,21 @@ import { walletUtils } from './test-lib/index.js'; const SUBMISSION_DIR = 'localchaintest-submission'; -const { readLatest } = walletUtils.vstorage; +/** @param {string} path } */ +const readPublished = async path => { + return walletUtils.vstorage.readLatest(`published.${path}`); +}; // The testing assertions are in the submission that runs in the core-eval. // The test here runs that and confirms the eval made it through all the assertions. test(`localchain passes tests`, async t => { await evalBundles(SUBMISSION_DIR); - const nodePath = 'published.test.localchain'; + const nodePath = 'test.localchain'; const nodeValue = JSON.stringify({ success: true }); const actualValue = await retryUntilCondition( - () => readLatest(nodePath), + async () => readPublished(nodePath), value => value === nodeValue, 'core eval not processed yet', { setTimeout, retryIntervalMs: 5000, maxRetries: 15 },