From a426b02a17cc33d044ef83b94802849ff3a7ab6a Mon Sep 17 00:00:00 2001 From: Travis Jacobs Date: Tue, 19 Sep 2017 11:11:06 +0200 Subject: [PATCH 1/3] Fix #2 - pass through tx id to next function (in case of unlocked node) - maybe there is a more sophisticated way to check whether the input is a tx id than its length --- src/api/contract/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api/contract/index.js b/src/api/contract/index.js index 7c38f4b..29f02d1 100644 --- a/src/api/contract/index.js +++ b/src/api/contract/index.js @@ -117,9 +117,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', requestId }); + return this._pollCheckRequest(requestId); + } else { return result; } }) .then((txhash) => { statecb(null, { state: 'getTransactionReceipt', txhash }); From 0e8014a892eff4844e083993ce1f1f63ad4cf04e Mon Sep 17 00:00:00 2001 From: Travis Jacobs Date: Tue, 19 Sep 2017 11:18:50 +0200 Subject: [PATCH 2/3] Fix small issue in docs --- src/api/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/README.md b/src/api/README.md index 1f8238b..c0e1156 100644 --- a/src/api/README.md +++ b/src/api/README.md @@ -83,7 +83,7 @@ attach contract ```javascript const abi = [{ name: 'callMe', inputs: [{ type: 'bool', ...}, { type: 'string', ...}]}, ...abi...]; -const contract = new ethapi.newContract(abi); +const contract = ethapi.newContract(abi); ``` deploy From 1055c282aa34b520f61c22bb80c76cae754ed169 Mon Sep 17 00:00:00 2001 From: Travis Jacobs Date: Tue, 19 Sep 2017 15:28:09 +0200 Subject: [PATCH 3/3] Fix error in checkRequest skip --- src/api/contract/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/contract/index.js b/src/api/contract/index.js index 29f02d1..2fa45f9 100644 --- a/src/api/contract/index.js +++ b/src/api/contract/index.js @@ -119,8 +119,8 @@ export default class Contract { .postTransaction(encodedOptions) .then((result) => { if(result.length !== 66) { - statecb(null, { state: 'checkRequest', requestId }); - return this._pollCheckRequest(requestId); + statecb(null, { state: 'checkRequest', result }); + return this._pollCheckRequest(result); } else { return result; } }) .then((txhash) => {