fix library deployment

pull/1/head
yann300 7 years ago
parent 08e13f1f72
commit d5f6b073a5
  1. 4
      src/app/execution/txFormat.js
  2. 2
      src/app/execution/txHelper.js

@ -81,7 +81,7 @@ module.exports = {
if (!libraryabi) { if (!libraryabi) {
return callback('Library ' + libraryName + ' not found.') return callback('Library ' + libraryName + ' not found.')
} }
this.deployLibrary(libraryabi, udapp, (err, address) => { this.deployLibrary(libraryName, libraryabi, udapp, (err, address) => {
if (err) { if (err) {
return callback(err) return callback(err)
} }
@ -108,7 +108,7 @@ module.exports = {
if (bytecode.indexOf('_') >= 0) { if (bytecode.indexOf('_') >= 0) {
this.linkBytecode(libraryName, (err, bytecode) => { this.linkBytecode(libraryName, (err, bytecode) => {
if (err) callback(err) if (err) callback(err)
else this.deployLibrary(libraryName, callback) else this.deployLibrary(libraryName, library, udapp, callback)
}) })
} else { } else {
udapp.runTx({ data: bytecode, useCall: false }, (err, txResult) => { udapp.runTx({ data: bytecode, useCall: false }, (err, txResult) => {

@ -91,7 +91,7 @@ module.exports = {
getContractByName: function (contractName, contracts) { getContractByName: function (contractName, contracts) {
for (var c in contracts) { for (var c in contracts) {
if (contracts[c].name === contractName) { if (c === contractName) {
return contracts[c] return contracts[c]
} }
} }

Loading…
Cancel
Save