diff --git a/packages/cli/src/base.ts b/packages/cli/src/base.ts index 7d199e4ef..0871a637a 100644 --- a/packages/cli/src/base.ts +++ b/packages/cli/src/base.ts @@ -122,10 +122,14 @@ export abstract class BaseCommand extends Command { } async getKit() { - if (!this._kit) { - this._kit = newKitFromWeb3(await this.getWeb3()) + // return now if kit already has been built instead of doing all that parsing and awaiting + // because this.getKit is called when closing down the command by not returning early this.parse would be called and weird logs occure + if (this._kit) { + return this._kit } + this._kit = newKitFromWeb3(await this.getWeb3()) + const res = await this.parse() if (res.flags && res.flags.privateKey && !res.flags.useLedger && !res.flags.useAKV) { this._kit.connection.addAccount(res.flags.privateKey) diff --git a/packages/cli/src/commands/governance/propose.test.ts b/packages/cli/src/commands/governance/propose.test.ts index a346e9069..5dd66382a 100644 --- a/packages/cli/src/commands/governance/propose.test.ts +++ b/packages/cli/src/commands/governance/propose.test.ts @@ -395,7 +395,7 @@ testWithGanache('governance:propose cmd', (web3: Web3) => { ).rejects.toThrowErrorMatchingInlineSnapshot( `"Couldn't build call for transaction: {"contract":"0x552b9AA0eEe500c60f09456e49FBc1096322714C","function":"approve(address,uint256)","args":["0xFa3df877F98ac5ecd87456a7AcCaa948462412f0","10000000000000000000000000"],"value":"0"}"` ) - }, 8000) + }, 20000) test('succeeds when proposal contains transactions for contracts verified on celoScan', async () => { const transactionsToBeSaved = JSON.stringify(transactionsForContractsVerifiedOnCeloScan) @@ -410,5 +410,5 @@ testWithGanache('governance:propose cmd', (web3: Web3) => { '--descriptionURL', 'https://example.com', ]) - }, 8000) + }, 20000) })