From ea85b72551708387e9ce297c7c698472105b07ef Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Mon, 18 Nov 2024 12:09:47 -0500 Subject: [PATCH 1/2] chore(synthetic-chain): Improve JS waitForBlock output Duplicates d1ba3207b5511f8620d016b9d4440c3869127bc1 in the JS version of `waitForBlock` --- .../src/lib/commonUpgradeHelpers.ts | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/synthetic-chain/src/lib/commonUpgradeHelpers.ts b/packages/synthetic-chain/src/lib/commonUpgradeHelpers.ts index 740d309f..fcc6f5be 100644 --- a/packages/synthetic-chain/src/lib/commonUpgradeHelpers.ts +++ b/packages/synthetic-chain/src/lib/commonUpgradeHelpers.ts @@ -32,22 +32,20 @@ const waitForBootstrap = async (): Promise => { } }; -export const waitForBlock = async (times = 1) => { - console.log(times); - let time = 0; - while (time < times) { - const block1 = await waitForBootstrap(); +export const waitForBlock = async (n = 1) => { + console.log(`waitForBlock waiting for ${n} new block(s)...`); + const h0 = await waitForBootstrap(); + let lastHeight = h0; + for (let i = 0; i < n; i += 1) { while (true) { - const block2 = await waitForBootstrap(); - - if (block1 !== block2) { - console.log('block produced'); + await new Promise(r => setTimeout(r, 1000)); + const currentHeight = await waitForBootstrap(); + if (currentHeight !== lastHeight) { + console.log(`waitForBlock saw new height ${currentHeight}`); + lastHeight = currentHeight; break; } - - await new Promise(r => setTimeout(r, 1000)); } - time += 1; } }; From 40e20bc22da131fe08fc15ccfaf783adfed7662e Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Mon, 11 Nov 2024 10:25:20 -0500 Subject: [PATCH 2/2] chore(synthetic-chain): release 0.4.3 --- packages/synthetic-chain/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/synthetic-chain/package.json b/packages/synthetic-chain/package.json index d64c479f..3ccc6b6a 100644 --- a/packages/synthetic-chain/package.json +++ b/packages/synthetic-chain/package.json @@ -1,6 +1,6 @@ { "name": "@agoric/synthetic-chain", - "version": "0.4.2", + "version": "0.4.3", "description": "Utilities to build a chain and test proposals atop it", "bin": "dist/cli/cli.js", "main": "./dist/lib/index.js",