Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception when decoding receipt logs of some transaction #27

Open
kelvinkuo opened this issue Aug 28, 2018 · 2 comments
Open

exception when decoding receipt logs of some transaction #27

kelvinkuo opened this issue Aug 28, 2018 · 2 comments

Comments

@kelvinkuo
Copy link

kelvinkuo commented Aug 28, 2018

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
@kolya182
Copy link
Contributor

And this is the fix #11

@kolya182
Copy link
Contributor

@denisgranha I think this this can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants