This commit is contained in:
Andre Medeiros 2018-09-21 15:45:02 -04:00
parent 12c495502d
commit 53ecd841da
4 changed files with 17 additions and 4 deletions

View File

@ -28,6 +28,7 @@ class ConsoleListener {
}
contractsList.forEach(contract => {
if (!contract.deployedAddress) return;
if (!contract.abiDefinition) return;
let address = contract.deployedAddress.toLowerCase();
if (!this.addressToContract[address]) {

View File

@ -206,6 +206,7 @@ class ContractsManager {
}
callback();
},
/*
function removeContractsWithNoCode(callback) {
let className, contract;
let dictionary = Object.keys(self.contracts);
@ -224,6 +225,7 @@ class ContractsManager {
self.logger.trace(self.contracts);
callback();
},
*/
// TODO: needs refactoring, has gotten too complex
/*eslint complexity: ["error", 16]*/
/*eslint max-depth: ["error", 16]*/
@ -232,6 +234,9 @@ class ContractsManager {
for (className in self.contracts) {
contract = self.contracts[className];
if(contract.code === undefined)
continue;
// look in code for dependencies
let libMatches = (contract.code.match(/:(.*?)(?=_)/g) || []);
for (let match of libMatches) {
@ -294,6 +299,7 @@ class ContractsManager {
callback();
}
], function (err) {
console.dir(self.contractsConfig);
if (err) {
self.compileError = true;
self.events.emit("status", __("Compile/Build error"));

View File

@ -85,6 +85,7 @@ class ENS {
const self = this;
// Code inspired by https://github.com/monkybrain/ipfs-to-ens
const {name, storageHash} = options;
console.dir(options);
if (!utils.isValidEthDomain(name)) {
return cb('Invalid domain name ' + name);
@ -93,8 +94,12 @@ class ENS {
let hashedName = namehash.hash(name);
let contentHash;
try {
console.dir('storageHash');
console.dir(storageHash);
contentHash = utils.hashTo32ByteHexString(storageHash);
} catch (e) {
console.dir('ens error with ipfs');
console.dir(e);
return cb('Invalid IPFS hash');
}

View File

@ -2,6 +2,8 @@ require('colors');
let async = require('async');
let shelljs = require('shelljs');
const path = require('path');
class IPFS {
constructor(options) {
@ -35,11 +37,10 @@ class IPFS {
});
},
function getHashFromOutput(result, callback) {
let rows = result.split("\n");
let dir_row = rows[rows.length - 2];
let dir_hash = dir_row.split(" ")[1];
let regexPattern = `added ([a-zA-Z1-9]{46}) ${path.basename(self.buildDir)}\n`;
let dirHash = result.match(RegExp(regexPattern, 'm'))[1];
callback(null, dir_hash);
callback(null, dirHash);
},
function printUrls(dir_hash, callback) {
console.log(("=== " + __("DApp available at") + " http://localhost:8080/ipfs/" + dir_hash + "/").green);