Commit 8916fb5b authored by yann300's avatar yann300

Fx linking when 2 or more libraries

parent 7d859f55
...@@ -229,7 +229,7 @@ module.exports = { ...@@ -229,7 +229,7 @@ module.exports = {
atAddress: function () {}, atAddress: function () {},
linkBytecodeStandard: function (contract, contracts, callback, callbackStep, callbackDeployLibrary) { linkBytecodeStandard: function (contract, contracts, callback, callbackStep, callbackDeployLibrary) {
var contractBytecode = '' var contractBytecode = contract.evm.bytecode.object
asyncJS.eachOfSeries(contract.evm.bytecode.linkReferences, (libs, file, cbFile) => { asyncJS.eachOfSeries(contract.evm.bytecode.linkReferences, (libs, file, cbFile) => {
asyncJS.eachOfSeries(contract.evm.bytecode.linkReferences[file], (libRef, libName, cbLibDeployed) => { asyncJS.eachOfSeries(contract.evm.bytecode.linkReferences[file], (libRef, libName, cbLibDeployed) => {
var library = contracts[file][libName] var library = contracts[file][libName]
...@@ -242,7 +242,7 @@ module.exports = { ...@@ -242,7 +242,7 @@ module.exports = {
if (hexAddress.slice(0, 2) === '0x') { if (hexAddress.slice(0, 2) === '0x') {
hexAddress = hexAddress.slice(2) hexAddress = hexAddress.slice(2)
} }
contractBytecode = this.linkLibraryStandard(libName, hexAddress, contract) contractBytecode = this.linkLibraryStandard(libName, hexAddress, contractBytecode, contract)
cbLibDeployed() cbLibDeployed()
}, callbackStep, callbackDeployLibrary) }, callbackStep, callbackDeployLibrary)
} else { } else {
...@@ -338,8 +338,8 @@ module.exports = { ...@@ -338,8 +338,8 @@ module.exports = {
return bytecode return bytecode
}, },
linkLibraryStandard: function (libraryName, address, contract) { linkLibraryStandard: function (libraryName, address, bytecode, contract) {
return this.linkLibraryStandardFromlinkReferences(libraryName, address, contract.evm.bytecode.object, contract.evm.bytecode.linkReferences) return this.linkLibraryStandardFromlinkReferences(libraryName, address, bytecode, contract.evm.bytecode.linkReferences)
}, },
setLibraryAddress: function (address, bytecodeToLink, positions) { setLibraryAddress: function (address, bytecodeToLink, positions) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment