-
Notifications
You must be signed in to change notification settings - Fork 495
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
refactor all sync and callback code uses to promises #30
Comments
definitely! :) |
I had this open in #39, but will just put it here instead because it is related: It doesn't work for me. I'm running Ubuntu 14.10, embark 0.7.0, geth 0.9.39 lib/deploy.js
Sometimes I get "CONNECTION ERROR" (and sometimes it just quietly returned back to my shell without doing anything), I think web3 just trying over and over again to do JSON-RPC to geth. I tried to convert this into a way to use the callbacks on the .new() call to a contract that tell you the address, but then everything else broke. (Such as when it goes to write the ABI, it wasn't waiting for the transaction to finish being deployed, it was depending on this loop to repeat.) I'm not sure what the best way to fix all of this is, unfortunately I'm not a JS expert. :-( My mess of an attempt to try to make a callback for embark-framework: linagee@277a345#diff-eff50028862616c28af389bc1a879f9bR36 It actually did work, it's just I only moved the waiting one step down the line. It wrote the abi JS file without any contract contents because it didn't wait for it or something...? Good luck converting it to promises/async stuff. (Maybe "mac people" are having more luck than "Ubuntu people"? grumble grumble "mac people"... strokes beard) edit:
|
It seems like right now, in order to expose a totally synchronous API to the contract users in JS, there's a lot of sync JS under the hood too. I would take the premise of this issue to the next level, and say all external contract APIs should be async, likely returning Promises, and all internal calls to |
this issue refered to embark 1, embark 2 changed greatly and does everything with async calls and promises. |
I think everything in lib/ should use promises. Objections?
The text was updated successfully, but these errors were encountered: