Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- just skip the checkRequest call if result of postTransaction is a tx ID
  • Loading branch information
Travis Jacobs committed Sep 20, 2017
1 parent 203a225 commit 46f5bd2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/src/api/contract/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ export default class Contract {

return this._api.parity
.postTransaction(encodedOptions)
.then((requestId) => {
statecb(null, { state: 'checkRequest', requestId });
return this._pollCheckRequest(requestId);
.then((result) => {
if (result.length !== 66) {
statecb(null, { state: 'checkRequest', result });
return this._pollCheckRequest(result);
} else { return result; }
})
.then((txhash) => {
statecb(null, { state: 'getTransactionReceipt', txhash });
Expand Down

0 comments on commit 46f5bd2

Please sign in to comment.