1

I send a transaction i.e

web3.eth.sendTransaction({
            to: toAddress,
            from: fromAddress,
            value: web3.toWei(amount, 'ether'),
            data : inputData,
        });

But when I am trying to get transaction data from local RPC(Ganache) i.e

web3.eth.getTransaction(tsHash,function(error,data){
            if (error) {

            }else {
               console.log(data); 
            }
        });

Return all fields perfectly except "input".i.e

{"hash":"0x6xxxxxcb877","nonce":3,"blockHash":"0x0bxxxxxxx5798","blockNumber":4,"transactionIndex":0,"from":"0x4xxxxxxxx0abb","to":"0x5xxxxxxxxe649","value":"20000000000000000","gas":2000002,"gasPrice":"1000000000","input":"0x0"}
  • Are you sure inputDaTa is not empty? Is it formatted as hexadecimal? – Ismael Apr 21 '18 at 22:20
  • Hi @ Ismael, thanks for time. Yes i passed a string to "data" field of "sendTransaction()" method of web3.js. – Davinder Singh Apr 23 '18 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.