diff --git a/command/rootchain/deploy/deploy.go b/command/rootchain/deploy/deploy.go index e9ff8dfcc0..a552caa2c5 100644 --- a/command/rootchain/deploy/deploy.go +++ b/command/rootchain/deploy/deploy.go @@ -560,15 +560,13 @@ func deployContracts(outputter command.OutputFormatter, client *jsonrpc.Client, return fmt.Errorf("deployment of %s contract failed", contract.name) } - resultsLock.Lock() - defer resultsLock.Unlock() - + deployResults := make([]*deployContractResult, 0, 2) implementationAddress := types.Address(receipt.ContractAddress) - results[contract.name] = newDeployContractsResult(contract.name, + deployResults = append(deployResults, newDeployContractsResult(contract.name, implementationAddress, receipt.TransactionHash, - receipt.GasUsed) + receipt.GasUsed)) if contract.hasProxy { proxyContractName := getProxyNameForImpl(contract.name) @@ -583,10 +581,17 @@ func deployContracts(outputter command.OutputFormatter, client *jsonrpc.Client, return fmt.Errorf("deployment of %s contract failed", proxyContractName) } - results[proxyContractName] = newDeployContractsResult(proxyContractName, + deployResults = append(deployResults, newDeployContractsResult(proxyContractName, types.Address(receipt.ContractAddress), receipt.TransactionHash, - receipt.GasUsed) + receipt.GasUsed)) + } + + resultsLock.Lock() + defer resultsLock.Unlock() + + for _, deployResult := range deployResults { + results[deployResult.Name] = deployResult } return nil