@colony/colony-js-contract-loader
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -15,8 +15,23 @@ Object.defineProperty(exports, "__esModule", { | ||
var networkIds = Object.keys(networks); | ||
// Pick the last network (assumed to be the most recent) | ||
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, | ||
network = _ref2.network; | ||
var _ref2 = networks[parseInt(networkIds[networkIds.length - 1], 10)] || {}, | ||
address = _ref2.address; | ||
var address = void 0; | ||
// Some clients (like Ganache) create IDs as integers; normalise them | ||
var networkKeys = Object.keys(networks).map(function (id) { | ||
return '' + id; | ||
}); | ||
if (network && networkKeys.length) { | ||
if (!networks[network]) throw new Error('Network ID ' + network + ' not found in contract'); | ||
address = networks[network].address; | ||
} else { | ||
var _ref3 = networks[networkKeys[networkKeys.length - 1]] || {}; | ||
// Pick the last network (assumed to be the most recent) | ||
address = _ref3.address; | ||
} | ||
return { | ||
@@ -23,0 +38,0 @@ abi: abi, |
{ | ||
"name": "@colony/colony-js-contract-loader", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Contract loader interfaces", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26237
218