Guest User

Untitled

a guest
Jan 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. const web3 = new Web3(providerAddress);
  2. const myContract = new web3.eth.Contract(abi, contractAddress);
  3.  
  4. let validate = myContract.methods.validateAuthentication(accountAddress,'data',1).call();
  5.  
  6. validate.then(res=>{
  7. console.log('res',res) //returns false, successfully
  8. })
  9.  
  10. let event1 = myContract.methods.getMoreTokens().send({from:accountAddress});
  11.  
  12. event1.then(res=>{
  13. //does not reach here
  14. })
  15.  
  16. Unhandled rejection Error: Returned error: The method eth_sendTransaction does not exist/is not available
  17. at Object.ErrorResponse (/node_modules/web3-core-helpers/src/errors.js:29:16)
  18. at Object.<anonymous> (/node_modules/web3-core-requestmanager/src/index.js:137:36)
  19. at /node_modules/web3-providers-ws/src/index.js:76:44
  20. at Array.forEach (<anonymous>)
  21. at W3CWebSocket.WebsocketProvider.connection.onmessage (/node_modules/web3-providers-ws/src/index.js:53:36)
  22. at W3CWebSocket._dispatchEvent [as dispatchEvent] (/node_modules/yaeti/lib/EventTarget.js:107:17)
  23. at W3CWebSocket.onMessage (/node_modules/websocket/lib/W3CWebSocket.js:234:14)
  24. at WebSocketConnection.<anonymous> (/node_modules/websocket/lib/W3CWebSocket.js:205:19)
  25. at emitOne (events.js:116:13)
  26. at WebSocketConnection.emit (events.js:211:7)
  27. at WebSocketConnection.processFrame (/node_modules/websocket/lib/WebSocketConnection.js:547:26)
  28. at /node_modules/websocket/lib/WebSocketConnection.js:321:40
  29. at _combinedTickCallback (internal/process/next_tick.js:131:7)
  30. at process._tickCallback (internal/process/next_tick.js:180:9)
Add Comment
Please, Sign In to add comment