Skip to content

Commit

Permalink
[Fix] non-development migrations (#494)
Browse files Browse the repository at this point in the history
In the last PR: #489
a bug was introduced as the for nonDevelopment networks, also the BatchExchange as a dependency would be tried to be pulled, although we have to get it from the usual build artifacts.
  • Loading branch information
josojo committed Jan 22, 2020
1 parent 5871670 commit 81fc612
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/migration/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@ function initializeContract(path, deployer, accounts) {

function getDependency(artifacts, network, deployer, account, path) {
let contract

if (isDevelopmentNetwork(network)) {
// If this migration script is used from the repository dex-contracts, the contract
// data is received via the artificats.require.
// If this migration script is used from an external project, the first try statement
// will fail and it will get the contracts from the function initializeContract.
try {
contract = artifacts.require(path.split("/").pop())
} catch (error) {
contract = initializeContract(path, deployer, account)
}
} else {
// If this migration script is used from the repository dex-contracts, the contract
// data is received via the artificats.require.
// If this migration script is used from an external project, the first try statement
// will fail and it will get the contracts from the function initializeContract.
try {
contract = artifacts.require(path.split("/").pop())
} catch (error) {
contract = initializeContract(path, deployer, account)
}
return contract
Expand Down

0 comments on commit 81fc612

Please sign in to comment.