Skip to content

Commit

Permalink
Merge pull request #8 from eordano/patch-1
Browse files Browse the repository at this point in the history
Don't use arrow functions: improve compatibility
  • Loading branch information
denisgranha committed Feb 22, 2018
2 parents 4ae2e6f + b38b847 commit 3bf01d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function _addABI(abiArray) {
if (Array.isArray(abiArray)) {

// Iterate new abi to generate method id's
abiArray.map((abi) => {
abiArray.map(function (abi) {
if(abi.name){
const signature = new Web3().sha3(abi.name + "(" + abi.inputs.map(function(input) {return input.type;}).join(",") + ")");
if(abi.type == "event"){
Expand All @@ -37,7 +37,7 @@ function _removeABI(abiArray) {
if (Array.isArray(abiArray)) {

// Iterate new abi to generate method id's
abiArray.map((abi) => {
abiArray.map(function (abi) {
if(abi.name){
const signature = new Web3().sha3(abi.name + "(" + abi.inputs.map(function(input) {return input.type;}).join(",") + ")");
if(abi.type == "event"){
Expand Down Expand Up @@ -66,11 +66,11 @@ function _decodeMethod(data) {
const methodID = data.slice(2, 10);
const abiItem = state.methodIDs[methodID];
if (abiItem) {
const params = abiItem.inputs.map((item) => item.type);
const params = abiItem.inputs.map(function (item) { return item.type; });
let decoded = SolidityCoder.decodeParams(params, data.slice(10));
return {
name: abiItem.name,
params: decoded.map((param, index) => {
params: decoded.map(function (param, index) {
let parsedParam = param;
const isUint = abiItem.inputs[index].type.indexOf("uint") == 0;
const isInt = abiItem.inputs[index].type.indexOf("int") == 0;
Expand Down Expand Up @@ -108,7 +108,7 @@ function padZeros (address) {
};

function _decodeLogs(logs) {
return logs.map((logItem) => {
return logs.map(function(logItem) {
const methodID = logItem.topics[0].slice(2);
const method = state.methodIDs[methodID];
if (method) {
Expand All @@ -119,7 +119,7 @@ function _decodeLogs(logs) {

let dataTypes = [];
method.inputs.map(
(input) => {
function (input) {
if (!input.indexed) {
dataTypes.push(input.type);
}
Expand Down

0 comments on commit 3bf01d3

Please sign in to comment.