Skip to content

Commit

Permalink
changed deploy resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
frozeman committed Sep 20, 2016
1 parent 721668d commit ee6f298
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ethereum:[email protected]alpha
ethereum:[email protected]beta
[email protected]
[email protected]
8 changes: 4 additions & 4 deletions lib/web3/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ Contract.prototype._checkForContractAddress = function(transactionHash, callback
callbackFired = true;

if(code.length > 2) {
callback(null, receipt.contractAddress);
callback(null, receipt);
} else {
callback(new Error('The contract code couldn\'t be stored, please check your gas limit.'));
}
Expand Down Expand Up @@ -464,13 +464,13 @@ Contract.prototype.deploy = function(options, callback){
defer.promise.emit('transactionHash', hash);

// wait for the contract to be mined and return the address
_this._checkForContractAddress(hash, function(err, address){
_this._checkForContractAddress(hash, function(err, receipt){
if(err) {
defer.reject(err);
defer.promise.emit('error', err);
} else {
defer.resolve(address);
defer.promise.emit('mined', address, _this);
defer.resolve(receipt);
defer.promise.emit('mined', receipt);
}

// remove all listeners on the end, as no event will ever fire again
Expand Down
2 changes: 1 addition & 1 deletion test/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ describe('contract', function () {
assert.equal('0x5550000000000000000000000000000000000000000000000000000000000032', value);
});
deploy.on('mined', function (value) {
assert.equal(address, value);
assert.equal(address, value.contractAddress);
done();
});
// deploy.on('error', function (value) {
Expand Down

0 comments on commit ee6f298

Please sign in to comment.