Comments (4)
Hi @mhhf. Try this for me:
a = web3.eth.accounts[0]
c = Coin.at( Coin.deployed_address );
c.mint( a, 42 ).then( function() {
return c.queryBalance(a);
}).then( function( v ){
console.log( v ); // should get called
});
If you return a promise within a promise's handler, it will continue executing that promise chain. So in this case, v
will be the return value from c.queryBalance(a);
(v
should be a transaction hash since it looks like queryBalance
is a transaction). Make sense?
from truffle-artifactor.
Edited the comment above; lots of typos.
from truffle-artifactor.
Works like a charm!
I should have read about promises, d'oh!
from truffle-artifactor.
Cheers! Let me know if you have anymore questions!
from truffle-artifactor.
Related Issues (20)
- `npm install` installs 2.0.6 without latest commits HOT 1
- Not working with node v6.0 HOT 1
- How do you send ether? HOT 1
- How do you get the balance of an account? HOT 1
- ReferenceError: attempts is not defined HOT 3
- Contract .call() with "defaultBlock" param specified not working HOT 2
- Feature: named enum values HOT 2
- Strict operator comparison and CamelCase output inside of any `.sol.js`
- Exception while deploying on testnet HOT 1
- "Invalid JSON RPC response: undefined" with the new web3 HOT 2
- Make .address a property such that if it's null it'll error. HOT 1
- Let built pudding contracts inherit from, not redefine, basic methods HOT 1
- better interface for sending money to a contract HOT 3
- Interface with storage layers HOT 2
- Truffle hangs and then throws exception when running truffle test HOT 1
- README outdated? HOT 7
- Refactor tests for reduced coupling with `truffle-contract`
- Broken dependencies HOT 1
- ERROR in ./node_modules/graceful-fs/graceful-fs.js
- Cannot artifacts.require npm module name with '/' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from truffle-artifactor.