Skip to content

Commit

Permalink
Don't use arrow functions: improve compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
eordano committed Nov 20, 2017
1 parent 9e845cd commit b38b847
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;
if (abiItem.inputs[index].type.indexOf("uint") !== -1) {
parsedParam = new Web3().toBigNumber(param).toString();
Expand Down Expand Up @@ -99,7 +99,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 @@ -110,7 +110,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 b38b847

Please sign in to comment.