Consensys/abi-decoder

exception when decoding receipt logs of some transaction

kelvinkuo opened this issue · 2 comments

transaction:0x7834632fb74e671317e87551c5969dcf117efaf00c1f16c4e5d66419715e3b37

when decoding the transaction above, got the exception, most other transactions is ok.

const abiDecoder = require('abi-decoder');
abiDecoder.addABI(config.get('ERC20-abi'));
let batch = web3.createBatch();                                                                                                                               
batch.add(web3.eth.getTransactionReceipt.request('0x7834632fb74e671317e87551c5969dcf117efaf00c1f16c4e5d66419715e3b37', receiveTransactionReceipt));                                                                                                                          
batch.execute();

function receiveTransactionReceipt(err, receipt) {
    const decodedLogs = abiDecoder.decodeLogs(receipt.logs);
    console.log(decodedLogs);
}

TypeError: Cannot read property 'slice' of undefined                                                                                                                                 
    at /data/ethereum/wallet_server/node_modules/abi-decoder/index.js:112:40
    at Array.map (<anonymous>)
    at Object._decodeLogs [as decodeLogs] (/data/ethereum/wallet_server/node_modules/abi-decoder/index.js:111:15)
    at Object.receiveTransactionReceipt [as callback] (/data/ethereum/wallet_server/ether_scan/ether-scan-test.js:218:36)
    at /data/ethereum/wallet_server/node_modules/web3/lib/web3/batch.js:59:33
    at Array.forEach (<anonymous>)
    at /data/ethereum/wallet_server/node_modules/web3/lib/web3/batch.js:52:12
    at /data/ethereum/wallet_server/node_modules/web3/lib/web3/requestmanager.js:116:9

And this is the fix #11

@denisgranha I think this this can be closed