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

Commit

Permalink
Fixes for 2.8 (#1473)
Browse files Browse the repository at this point in the history
* Change call to action from oz create to oz deploy (#1470)

* Ensure verify warning for regular contracts is printed (#1471)

* Force network question if session network is undefined (#1468)

* Add spinner during deployment (just because)
  • Loading branch information
frangio authored and spalladino committed Feb 19, 2020
1 parent 6600961 commit dc298d0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
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) {
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

0 comments on commit dc298d0

Please sign in to comment.