Skip to content

Commit

Permalink
chore(a3p-integration): Improve n:upgrade-next log output
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 committed Nov 16, 2024
1 parent 0372937 commit ebec543
Show file tree
Hide file tree
Showing 6 changed files with 3,458 additions and 202 deletions.
9 changes: 8 additions & 1 deletion a3p-integration/proposals/n:upgrade-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"type": "module",
"license": "Apache-2.0",
"dependencies": {
"@agoric/client-utils": "dev",
"@agoric/synthetic-chain": "^0.3.0",
"@endo/init": "^1.1.6",
"@endo/marshal": "^1.6.1",
Expand All @@ -26,10 +27,16 @@
]
},
"scripts": {
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops"
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops",
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error 'lint:*'",
"lint:types": "tsc",
"lint:eslint": "eslint ."
},
"packageManager": "yarn@4.5.1",
"devDependencies": {
"eslint": "^8.57.0",
"npm-run-all": "^4.1.5",
"typescript": "^5.6.3"
}
}
22 changes: 10 additions & 12 deletions a3p-integration/proposals/n:upgrade-next/synthetic-chain-excerpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,20 @@ const waitForBootstrap = async () => {
}
};

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;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
pushPrices,
getPriceQuote,
} from '@agoric/synthetic-chain';
import { retryUntilCondition } from './sync-tools.js';
import { retryUntilCondition } from '@agoric/client-utils';

export const scale6 = x => BigInt(x * 1_000_000);

Expand Down Expand Up @@ -57,6 +57,6 @@ export const getPriceFeedRoundId = async brand => {
prefix: '',
});

console.log('latestRound: ', latestRound);
console.log(latestRoundPath, latestRound);
return Number(latestRound.roundId);
};
72 changes: 0 additions & 72 deletions a3p-integration/proposals/n:upgrade-next/test-lib/sync-tools.js

This file was deleted.

Loading

0 comments on commit ebec543

Please sign in to comment.