Skip to content

Commit e96335e

Browse files
committed
Test account creation
1 parent 280a733 commit e96335e

1 file changed

Lines changed: 82 additions & 5 deletions

File tree

tests/test_transactions.py

Lines changed: 82 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ def doit(self, printWire=False):
4646
# Test against Bitshares backened
4747
live = bitshares.rpc.get_transaction_hex(tx.json())
4848

49-
# Compare expected result with test unit
50-
self.assertEqual(self.cm[:-130], txWire[:-130])
49+
# Compare expected result with online backend
50+
self.assertEqual(live[:-130], self.cm[:-130])
5151

5252
# Compare expected result with online result
5353
self.assertEqual(live[:-130], txWire[:-130])
5454

55-
# Compare expected result with online backend
56-
self.assertEqual(live[:-130], self.cm[:-130])
55+
# Compare expected result with test unit
56+
self.assertEqual(self.cm[:-130], txWire[:-130])
5757

5858
def test_call_update(self):
5959
self.op = operations.Call_order_update(
@@ -241,9 +241,86 @@ def test_override_transfer(self):
241241
)
242242
self.doit()
243243

244+
def test_create_account(self):
245+
self.maxDiff = None
246+
self.op = operations.Account_create(
247+
**{
248+
"fee": {"amount": 1467634, "asset_id": "1.3.0"},
249+
"registrar": "1.2.33",
250+
"referrer": "1.2.27",
251+
"referrer_percent": 3,
252+
"name": "foobar-f124",
253+
"owner": {
254+
"weight_threshold": 1,
255+
"account_auths": [],
256+
"key_auths": [
257+
[
258+
prefix
259+
+ "6pbVDAjRFiw6fkiKYCrkz7PFeL7XNAfefrsREwg8MKpJ9VYV9x",
260+
1,
261+
],
262+
[
263+
prefix
264+
+ "6zLNtyFVToBsBZDsgMhgjpwysYVbsQD6YhP3kRkQhANUB4w7Qp",
265+
1,
266+
],
267+
],
268+
"address_auths": [],
269+
},
270+
"active": {
271+
"weight_threshold": 1,
272+
"account_auths": [],
273+
"key_auths": [
274+
[
275+
prefix
276+
+ "6pbVDAjRFiw6fkiKYCrkz7PFeL7XNAfefrsREwg8MKpJ9VYV9x",
277+
1,
278+
],
279+
[
280+
prefix
281+
+ "6zLNtyFVToBsBZDsgMhgjpwysYVbsQD6YhP3kRkQhANUB4w7Qp",
282+
1,
283+
],
284+
[
285+
prefix
286+
+ "8CemMDjdUWSV5wKotEimhK6c4dY7p2PdzC2qM1HpAP8aLtZfE7",
287+
1,
288+
],
289+
],
290+
"address_auths": [],
291+
},
292+
"options": {
293+
"memo_key": prefix
294+
+ "5TPTziKkLexhVKsQKtSpo4bAv5RnB8oXcG4sMHEwCcTf3r7dqE",
295+
"voting_account": "1.2.5",
296+
"num_witness": 0,
297+
"num_committee": 0,
298+
"votes": [],
299+
"extensions": [],
300+
},
301+
"extensions": {},
302+
"prefix": prefix,
303+
}
304+
)
305+
self.cm = (
306+
"f68585abf4dce7c804570105f26416000000000000211b03000b666f"
307+
"6f6261722d6631323401000000000202fe8cc11cc8251de6977636b5"
308+
"5c1ab8a9d12b0b26154ac78e56e7c4257d8bcf6901000314aa202c91"
309+
"58990b3ec51a1aa49b2ab5d300c97b391df3beb34bb74f3c62699e01"
310+
"000001000000000303b453f46013fdbccb90b09ba169c388c34d8445"
311+
"4a3b9fbec68d5a7819a734fca0010002fe8cc11cc8251de6977636b5"
312+
"5c1ab8a9d12b0b26154ac78e56e7c4257d8bcf6901000314aa202c91"
313+
"58990b3ec51a1aa49b2ab5d300c97b391df3beb34bb74f3c62699e01"
314+
"0000024ab336b4b14ba6d881675d1c782912783c43dbbe31693aa710"
315+
"ac1896bd7c3d61050000000000000000011f024373610743cab92abc"
316+
"197cc69aa04c45e20a8c1c495629ca5765d8e458a18f0920bfaf9d0a"
317+
"909c01819cf887a66d06903af71fb07f0aac34600c733590984e"
318+
)
319+
self.doit(1)
320+
244321
"""
245322
# TODO FIX THIS UNIT TEST
246-
def test_create_account(self):
323+
def test_create_account2(self):
247324
self.op = operations.Account_create(**{
248325
"fee": {"amount": 1467634,
249326
"asset_id": "1.3.0"

0 commit comments

Comments
 (0)