Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
fix: resolve undefined error
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Sep 17, 2022
1 parent c1eb0cf commit 6c6f4d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type CommonOptions = {
networkId: ChainId;
blockNumber?: string;
forkNetworkId: string;
forkId?: string;
//
enterProposalId: boolean;
proposalId?: number;
Expand Down Expand Up @@ -296,6 +297,7 @@ function getName(options: Options) {
if (initialAnswers.forkType === "existing") {
// seed parameters on existing fork
const params = await getForkParameters({ forkId: initialAnswers.forkId });
console.log(params);
initialAnswers.blockNumber = params.blockNumber;
initialAnswers.forkNetworkId = params.forkNetworkId;
initialAnswers.networkId = params.networkId;
Expand All @@ -310,7 +312,7 @@ function getName(options: Options) {
});
}
const argv = (await yargs(hideBinArgv)
let argv = (await yargs(hideBinArgv)
.usage("Usage: npx $0")
.options(getOptions(questions))
.parseAsync()) as unknown as Options;
Expand Down Expand Up @@ -375,6 +377,13 @@ function getName(options: Options) {
}
}
if (argv.forkId && !argv.networkId) {
const params = await getForkParameters({
forkId: argv.forkId,
});
argv = { ...argv, ...params };
}
console.log(`To use this fork on the aave interface you need to do the following things.

1. Open the browser console on app.aave.com (or a local instance) and enter
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bgd-labs/aave-tenderly-cli",
"version": "0.0.4",
"version": "0.0.5",
"description": "",
"main": "main.ts",
"private": false,
Expand All @@ -10,7 +10,7 @@
"scripts": {
"start": "npm run build && node dist/index.js",
"build": "ncc build ./main.ts -o dist --minify",
"publish:local": "npm run build && npm pack && npm i -g bgd-labs-aave-tenderly-cli-0.0.4.tgz && rm bgd-labs-aave-tenderly-cli-0.0.4.tgz"
"publish:local": "npm run build && npm pack && npm i -g bgd-labs-aave-tenderly-cli-0.0.5.tgz && rm bgd-labs-aave-tenderly-cli-0.0.5.tgz"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 6c6f4d9

Please sign in to comment.