Skip to content

Commit

Permalink
fix: validate scriptArgs endowment
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Oct 23, 2024
1 parent 0c5639b commit 6864614
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/builders/scripts/inter-protocol/updatePriceFeeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ const Usage = `agoric run updatePriceFeed.js ${keys(configurations).join(' | ')}
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
export default async (homeP, endowments) => {
const { scriptArgs } = endowments;
const config = configurations[scriptArgs?.[0]];
assert(scriptArgs, 'expected script args endowment');
const config = configurations[scriptArgs[0]];
if (!config) {
console.error(Usage);
process.exit(1);
Expand Down
1 change: 1 addition & 0 deletions packages/deploy-script-support/src/externalTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export {};
* now: () => number,
* pathResolve: (...path: string[]) => string,
* publishBundle: PublishBundleRef,
* scriptArgs?: string[],
* }} DeployScriptEndownments
*/

Expand Down

0 comments on commit 6864614

Please sign in to comment.