Garbage collection

This commit is contained in:
viktor 2017-11-17 16:54:18 +03:00
parent c0de787e0f
commit 2c105fde1f
3 changed files with 4 additions and 30 deletions

17
assets/javascripts/application.js Normal file → Executable file
View File

@ -13,18 +13,6 @@ function SHA3Encrypt(web3, str) {
return strEncode;
}
function estimateGas(web3, acc, contractAddr, data, cb) {
web3.eth.estimateGas({
from: acc,
data: data,
to: contractAddr
}, function(err, estimatedGas) {
console.log(err);
console.log(estimatedGas);
cb(estimatedGas);
});
}
function call(web3, acc, contractAddr, data, cb) {
let props;
if (acc) props = { from: acc, data: data, to: contractAddr };
@ -328,7 +316,7 @@ function getValidators(web3, func, contractAddress, disabled, cb) {
var validatorsArray = [];
var item = "";
for (var i = 0; i < validatorsResp.length; i++) {
item+=validatorsResp[i];
item += validatorsResp[i];
if ((i + 1) % 64 == 0) {
item = item.substr(item.length - 40, 40);
validatorsArray.push(item);
@ -339,8 +327,7 @@ function getValidators(web3, func, contractAddress, disabled, cb) {
validatorsArray.shift(); //number of elements
if (validatorsArray.length == 0) {
cb(validatorsArray);
return;
return cb(validatorsArray);
}
var validatorsArrayOut = [];

View File

@ -3,18 +3,6 @@ function SHA3Encrypt(web3, str) {
return strEncode;
}
function estimateGas(web3, acc, contractAddr, data, cb) {
web3.eth.estimateGas({
from: acc,
data: data,
to: contractAddr
}, function(err, estimatedGas) {
console.log(err);
console.log(estimatedGas);
cb(estimatedGas);
});
}
function call(web3, acc, contractAddr, data, cb) {
let props;
if (acc) props = { from: acc, data: data, to: contractAddr };

View File

@ -9,7 +9,7 @@ function getValidators(web3, func, contractAddress, disabled, cb) {
var validatorsArray = [];
var item = "";
for (var i = 0; i < validatorsResp.length; i++) {
item+=validatorsResp[i];
item += validatorsResp[i];
if ((i + 1) % 64 == 0) {
item = item.substr(item.length - 40, 40);
validatorsArray.push(item);
@ -20,8 +20,7 @@ function getValidators(web3, func, contractAddress, disabled, cb) {
validatorsArray.shift(); //number of elements
if (validatorsArray.length == 0) {
cb(validatorsArray);
return;
return cb(validatorsArray);
}
var validatorsArrayOut = [];