Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 345e4b1

Browse files
authored
Merge pull request #1915 from OpenBazaar/eth_wallet_service
(#1783) Make ETH transactions asynchronous
2 parents fe099fa + 9b39cf0 commit 345e4b1

File tree

5 files changed

+134
-301
lines changed

5 files changed

+134
-301
lines changed

qa/eth_cancel_direct_offline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def run_test(self):
111111
elif r.status_code != 200:
112112
resp = json.loads(r.text)
113113
raise TestFailure("EthCancelDirectOfflineTest - FAIL: Purchase POST failed. Reason: %s", resp["reason"])
114-
time.sleep(20)
114+
time.sleep(40)
115115

116116
# check bob detected payment
117117
api_url = bob["gateway_url"] + "ob/order/" + orderId

qa/eth_complete_direct_online.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def run_test(self):
111111
api_url = bob["gateway_url"] + "ob/orderspend"
112112
print("################################")
113113
print("before spend post : ", api_url)
114-
print(json.dumps(spend, indent=4))
114+
print(json.dumps(spend, indent=4))
115115
r = requests.post(api_url, data=json.dumps(spend, indent=4))
116116
if r.status_code == 404:
117117
raise TestFailure("EthCompleteDirectOnlineTest - FAIL: Spend post endpoint not found")
@@ -141,7 +141,7 @@ def run_test(self):
141141
raise TestFailure("EthCompleteDirectOnlineTest - FAIL: Alice failed to detect payment")
142142
if resp["funded"] == False:
143143
raise TestFailure("EthCompleteDirectOnlineTest - FAIL: Alice incorrectly saved as unfunded")
144-
144+
145145
# alice send order fulfillment
146146
with open('testdata/fulfillment.json') as fulfillment_file:
147147
fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict)

qa/eth_dispute_close_buyer.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ def run_test(self):
1616
bob = self.nodes[2]
1717
charlie = self.nodes[3]
1818

19-
# generate some coins and send them to bob
20-
generated_coins = 10
2119
time.sleep(4)
2220
api_url = bob["gateway_url"] + "wallet/address/" + self.cointype
2321
r = requests.get(api_url)
@@ -28,7 +26,6 @@ def run_test(self):
2826
raise TestFailure("EthDisputeCloseBuyerTest - FAIL: Address endpoint not found")
2927
else:
3028
raise TestFailure("EthDisputeCloseBuyerTest - FAIL: Unknown response")
31-
time.sleep(20)
3229

3330
# create a profile for charlie
3431
pro = {"name": "Charlie"}
@@ -141,7 +138,7 @@ def run_test(self):
141138
elif r.status_code != 200:
142139
resp = json.loads(r.text)
143140
raise TestFailure("EthDisputeCloseBuyerTest - FAIL: Spend POST failed. Reason: %s", resp["reason"])
144-
time.sleep(20)
141+
time.sleep(120)
145142

146143
# check bob detected payment
147144
api_url = bob["gateway_url"] + "ob/order/" + orderId
@@ -164,7 +161,7 @@ def run_test(self):
164161
raise TestFailure("EthDisputeCloseBuyerTest - FAIL: Alice failed to detect payment")
165162
if resp["funded"] == False:
166163
raise TestFailure("EthDisputeCloseBuyerTest - FAIL: Alice incorrectly saved as unfunded")
167-
164+
168165
# Bob open dispute
169166
dispute = {
170167
"orderId": orderId,
@@ -220,7 +217,7 @@ def run_test(self):
220217
elif r.status_code != 200:
221218
resp = json.loads(r.text)
222219
raise TestFailure("EthDisputeCloseBuyerTest - FAIL: CloseDispute POST failed. Reason: %s", resp["reason"])
223-
time.sleep(4)
220+
time.sleep(40)
224221

225222
# Alice check dispute closed correctly
226223
api_url = alice["gateway_url"] + "ob/order/" + orderId
@@ -261,9 +258,7 @@ def run_test(self):
261258
elif r.status_code != 200:
262259
resp = json.loads(r.text)
263260
raise TestFailure("EthDisputeCloseBuyerTest - FAIL: ReleaseFunds POST failed. Reason: %s", resp["reason"])
264-
time.sleep(20)
265-
266-
time.sleep(5)
261+
time.sleep(120)
267262

268263
# Check bob received payout
269264
api_url = bob["gateway_url"] + "wallet/balance/T" + self.cointype

vendor/github.com/OpenBazaar/go-ethwallet/wallet/client.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)