Skip to content

Commit

Permalink
Merge pull request #197 from JoinColony/fix/wait-for-deployment-tx
Browse files Browse the repository at this point in the history
Wait for TX receipt in token deployment
  • Loading branch information
JamesLefrere committed Jun 19, 2018
2 parents ab6a1cf + 608d91f commit 262c340
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## v.NEXT

**Bug fixes**

* Actually wait for transaction receipt in Token contract deployment. This fixes issues with real-life environments like testnets or mainnet (`@colony/colony-js-client`)

## v1.5.0

Expand Down
4 changes: 4 additions & 0 deletions packages/colony-js-client/src/ColonyNetworkClient/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ export default class ColonyNetworkClient extends ContractClient {
[utf8ToHex(name), utf8ToHex(symbol), decimals],
);
const { hash } = await this.adapter.wallet.sendTransaction(transaction);
const receipt = await this.adapter.getTransactionReceipt(hash);
if (receipt != null) return receipt.contractAddress;

await this.adapter.waitForTransaction(hash);
const { contractAddress } = await this.adapter.getTransactionReceipt(hash);
return contractAddress;
}
Expand Down

0 comments on commit 262c340

Please sign in to comment.