10

This doesn't exist in truffle-contract. Here's a quick way to wrap web3 calls to make them use promises. const promisify = (inner) => new Promise((resolve, reject) => inner((err, res) => { if (err) { reject(err) } resolve(res); }) ); const getBalance = (account, at) => promisify(cb => web3.eth.getBalance(account, at,...


7

Unless something has changed in ether-pudding, it is primarily focused on wrapping/simplifying contract code while also adding javascript promises to deal with asynchronous calls. So I do not believe it has a simpler call to get the balance. Short answer: use the web3 call you mention.


4

I'm afraid you can't do it easily (but you can set up a more complex deploy management). However, you can just create a new instance in a test just by calling Contract.new(params).then(...) (Where 'Contract' is the name of a specific contract class name, like in Ballot.new() or MetaCoin.new() ). You could set up a contract instance in the before() ...


4

The contract's constructor only runs during the process of contract creation/deployment, so Contract.new(arg1ForConstructor, arg2...). Contract.deployed() is for a contract that has already been deployed: the constructor can't be invoked again.


2

Adding parenthesis as C1 = this.counterforindex(); should do the trick as explained on this StackOverflow question


2

See: https://ethereum.stackexchange.com/a/4035/383 Ether-pudding is focused on working with Contracts. web3 is the main library for interacting with Ethereum from javascript.


Only top voted, non community-wiki answers of a minimum length are eligible