Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Fixes for 2.8 #1473

Merged
merged 4 commits into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/src/commands/deploy/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const options: Option[] = [
const networks = ConfigManager.getNetworkNamesFromConfig();
const { network: lastNetwork, expired } = Session.getNetwork();

if (expired) {
if (expired || lastNetwork === undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ported to verify as well

return {
prompt: 'Pick a network',
choices: networks,
Expand Down
13 changes: 7 additions & 6 deletions packages/cli/src/commands/verify/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ export async function action(params: Options & Args & { dontExitProcess: boolean

const controller = new NetworkController(params.network, params.txParams, params.networkFile);

if (!controller.isContractDeployed(params.contract)) {
throw new Error(
`Contract '${params.contract}' is not deployed to '${userNetworkName}'.\n\nVerification of regular instances is not yet supported.`,
);
try {
controller.checkLocalContractDeployed(params.contract, true);
} catch (e) {
if (!e.message.includes('has changed locally')) {
e.message += '\n\nVerification of regular instances is not yet supported.';
}
throw e;
}

controller.checkLocalContractDeployed(params.contract, true);

await controller.verifyAndPublishContract(
params.contract,
params.optimizer,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/models/local/LocalController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class LocalController {
__filename,
'initProjectFile',
'init-project-file',
`Project initialized. Write a new contract in the contracts folder and run 'openzeppelin create' to deploy it.`,
`Project initialized. Write a new contract in the contracts folder and run 'openzeppelin deploy' to deploy it.`,
);
}

Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/models/network/NetworkController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,9 @@ export default class NetworkController {
const contract = this.contractManager.getContractClass(packageName, contractAlias);
await this._setSolidityLibs(contract);

Loggy.spin(__filename, 'createInstance', 'create-instance', `Deploying an instance of ${contractAlias}`);
const instance = await Transactions.deployContract(contract, initArgs, this.txParams);
Loggy.succeed('create-instance', `Deployed instance of ${contractAlias}`);

if (packageName === this.projectFile.name) {
await this._updateTruffleDeployedInformation(contractAlias, instance);
Expand Down