Skip to content

Commit

Permalink
more replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
usmanmani1122 committed Nov 29, 2024
1 parent 3b9dc63 commit 9f46fcb
Show file tree
Hide file tree
Showing 3 changed files with 253 additions and 120 deletions.
2 changes: 1 addition & 1 deletion runner/lib/helpers/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ export const makeTimeSource = ({
return { timeOrigin, getTime, now, shift };
};

/** @typedef {ReturnType<makeTimeSource>} TimeSource */
/** @typedef {ReturnType<typeof makeTimeSource>} TimeSource */
21 changes: 14 additions & 7 deletions runner/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,15 @@ const makeInterrupterKit = ({ console }) => {
const getSDKBinaries = async () => {
const srcHelpers = 'agoric/src/helpers.js';
const libHelpers = 'agoric/lib/helpers.js';

/**
* @type {import('./tasks/types.js').SDKBinaries}
*/
let binaryPaths;

try {
const cliHelpers = await import(srcHelpers).catch(() => import(libHelpers));
return cliHelpers.getSDKBinaries();
binaryPaths = cliHelpers.getSDKBinaries();
} catch (err) {
// Older SDKs were only at lib
const cliHelpersUrl = await importMetaResolve(libHelpers, import.meta.url);
Expand All @@ -181,19 +187,20 @@ const getSDKBinaries = async () => {
) {
agSolo = agSolo.replace(/\.cjs$/, '.js');
}
return {
binaryPaths = {
agSolo,
cosmosChain: new URL(
'../../cosmic-swingset/bin/ag-chain-cosmos',
cliHelpersUrl,
).pathname,
cosmosChain: '',
cosmosHelper: new URL(
// The older SDKs without getSDKBinaries hadn't renamed to agd yet
'../../../golang/cosmos/build/ag-cosmos-helper',
cliHelpersUrl,
).pathname,
};
}

binaryPaths = {...binaryPaths, cosmosChain: 'ag-chain-cosmos'};

return binaryPaths;
};

/**
Expand Down Expand Up @@ -984,7 +991,7 @@ const main = async (progName, rawArgs, powers) => {
// This will throw if there was any interrupt, and prevent further execution
async () => releaseInterrupt(),
));
logPerfEvent('setup-tasks-finish');
return logPerfEvent('setup-tasks-finish');
}

const stages =
Expand Down
Loading

0 comments on commit 9f46fcb

Please sign in to comment.