ethereum-web3-plus
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -76,3 +76,3 @@ //######################################################################################### | ||
EventSynchronizer.prototype.historyFromBlock = function(fromBlock, callback) { | ||
if(this.events.length==0) if(callback) callback("No event registered!", null); | ||
if(this.events.length==0) { if(callback) callback("No event registered!", null); return;} | ||
this.historyToBlock = this.events[0].instance._eth.blockNumber; | ||
@@ -79,0 +79,0 @@ var toBlock = (+this.historyToBlock); |
{ | ||
"name": "ethereum-web3-plus", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Adds some simplifications to the web3 package such as compilation, instance creation, call sequencing, events readers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,3 +7,3 @@ | ||
//######################################################################################### | ||
var path=require('path'); | ||
var SolidityCompiler = function(web3) { | ||
@@ -84,3 +84,3 @@ this.web3 = web3; // instance of the connection to the geth node | ||
} | ||
const solidityFolder = process.env.PWD+"/.ethereum_contracts"; | ||
const solidityFolder = path.resolve(process.env.PWD,".ethereum_contracts"); | ||
// save the ABI and Code (unlinked) to a folder for reloading without compilation | ||
@@ -94,4 +94,4 @@ SolidityCompiler.prototype.persist = function() { | ||
// same format generation as what solc --bin --abi Contract.sol would generate. | ||
fs.writeFileSync(solidityFolder+"/"+contract+".abi", JSON.stringify(self.DictContract[contract].abi)); | ||
fs.writeFileSync(solidityFolder+"/"+contract+".bin", self.DictContract[contract].unlinkedCode.substr(2)); | ||
fs.writeFileSync(path.resolve(solidityFolder, contract+".abi"), JSON.stringify(self.DictContract[contract].abi)); | ||
fs.writeFileSync(path.resolve(solidityFolder, contract+".bin"), self.DictContract[contract].unlinkedCode.substr(2)); | ||
}); | ||
@@ -102,3 +102,3 @@ } | ||
if(! fs.existsSync(solidityFolder)) throw new Error("a folder "+solidityFolder+" is expected to locate the contract abi and binary" ); | ||
const abifile = solidityFolder+"/"+contract+".abi"; | ||
const abifile = path.resolve(solidityFolder,contract+".abi"); | ||
if(fs.existsSync(abifile)) { | ||
@@ -113,3 +113,3 @@ const abi = JSON.parse(fs.readFileSync(abifile)); | ||
//this.LibToken[contract]= ("__"+obj.substr(0,36)+"_".repeat(38)).substr(0,40); // 40 is the size of the target address | ||
const binfile=solidityFolder+"/"+contract+".bin"; | ||
const binfile= path.resolve(solidityFolder, contract+".bin"); | ||
if(fs.existsSync(binfile)) { | ||
@@ -116,0 +116,0 @@ const code="0x"+fs.readFileSync(binfile).toString(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45201
564