-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Contract function send does not return the provider error. #2553
Comments
The correct initialization is |
The connection parameters in the provider was bad. The Ethereum client was on different port, that I gave in the configuration. It turned out when I wanted to unlock my account, and I've got the exception 'Connection is not open on send()', but I didn't get this on contract transaction sending. |
Could you add a GitHub repository with your code and development environment? Otherwise, it will be hard to help you. Thanks! |
I meant the parameter was bad at the web3 initialization with the port number, but I fixed already. I just let information it hasn't exception handling at contract transaction sending, but no problem for me now. |
Sorry I've got you wrong. The send and the call method are handled internally the same way. The error should have been thrown there too but I will check that closer asap. |
More exactly when I change my configuration from HTTP connection (with connection uri: http:127.0.0.1:8545) provider to Websocket provider (with connection uri: ws:127.0.0.1:8545) in Web3 client the contract methods don't have exceptions. Of course that I mentioned I have simple http connection for the geth but in the code I used websocket provider with websocket provider with ws:127.0.0.1:8545 connection instead of http:127.0.0.1:8545. |
Description
Cannot call contract's methods. I use ERC20 Token transactions in my code and at the contract's send() method the application freezes, but no errors. I would like to ask how should I initialize the contract or the web3 in order to make calls by constractInstance.methods.transfer(address, amount).send();
I saw at the new version, the web3 constructor's Web3ModuleOptions parameter's interface changed, so I picked out from the initialization. Is there an example (that I searched for but unfortunately I didn't find) how should implement the sign() method?
Expected behavior
await this.contractInstance.methods.transfer(addressTo, 10).send({from: addressMain, , gas: 100000, gasPrice: "2000000000"});
should return true (or something)Actual behavior
At the above instruction the application freezes.
Steps to reproduce the behavior
So here is my code, the first console.log of sendToken() method has input, but after the send has no answer.
The web3 initialization:
Versions
The text was updated successfully, but these errors were encountered: