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

Commit 591a123

Browse files
committed
addressed test failures
1 parent f098b1a commit 591a123

File tree

5 files changed

+76
-57
lines changed

5 files changed

+76
-57
lines changed

iota/transaction/creation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def __init__(self, address, value, tag=None, message=None, timestamp=None):
4747
hash_ = None,
4848
last_index = None,
4949
signature_message_fragment = None,
50-
attachment_timestamp = None,
51-
attachment_timestamp_lower_bound = None,
52-
attachment_timestamp_upper_bound = None,
50+
attachment_timestamp = 0,
51+
attachment_timestamp_lower_bound = 0,
52+
attachment_timestamp_upper_bound = 0,
5353

5454
# These values start out empty; they will be populated when the
5555
# node does PoW.

test/commands/extended/get_bundles_test.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from filters.test import BaseFilterTestCase
99

1010
from iota import Address, BadApiResponse, Bundle, BundleHash, Fragment, Hash, \
11-
Iota, Tag, Transaction, TransactionHash, TransactionTrytes
11+
Iota, Tag, Transaction, TransactionHash, TransactionTrytes, Nonce
1212
from iota.adapter import MockAdapter
1313
from iota.commands.extended.get_bundles import GetBundlesCommand
1414
from iota.filters import Trytes
@@ -141,21 +141,24 @@ def test_single_transaction(self):
141141
"""
142142
transaction =\
143143
Transaction(
144-
current_index = 0,
145-
last_index = 0,
146-
tag = Tag(b''),
147-
timestamp = 1484960990,
148-
value = 0,
144+
current_index = 0,
145+
last_index = 0,
146+
tag = Tag(b''),
147+
timestamp = 1484960990,
148+
value = 0,
149+
attachment_timestamp = 1484960990,
150+
attachment_timestamp_lower_bound = 12,
151+
attachment_timestamp_upper_bound = 0,
149152

150153
# These values are not relevant for 0-value transactions.
151-
nonce = Hash(b''),
154+
nonce = Nonce(b''),
152155
signature_message_fragment = Fragment(b''),
153156

154157
# This value is computed automatically, so it has to be real.
155158
hash_ =
156159
TransactionHash(
157-
b'UGQBSMKGNXXWDCS9XZCFTPUXFADCT9I9KCNQGUXK'
158-
b'NDJDUXLWODOVJQWJHCLWTODAELDXGL9SMQYQZFWHE',
160+
b'XPJIYZWPF9LBCYZPNBFARDRCSUGJGF9TWZT9K9PX'
161+
b'VYDFPZOZBGXUCKLTJEUCFBEKQQ9VCSQVQDMMJQAY9',
159162
),
160163

161164
address =
@@ -238,8 +241,8 @@ def test_multiple_transactions(self):
238241
b'999999999999999999999999999999999999999999999999999999999999999999'
239242
b'999999999999999999999999999999999999999999999999999999999999999999'
240243
b'999999999WUQXEGBVIECGIWO9IGSYKWWPYCIVUJJGSJPWGIAFJPYSF9NSQOHWAHS9P'
241-
b'9PWQHOBXNNQIF9IRHVQXKPZW999999999999999999999999999999999999999999'
242-
b'999999999999HNLFMVD99A99999999A99999999PDQWLVVDPUU9VIBODGMRIAZPGQX'
244+
b'9PWQHOBXNNQIF9IRHVQXKPZW999999999999999999999999999XZUIENOTTBKJMDP'
245+
b'RXWGQYG9PWGTHNLFMVD99A99999999A99999999PDQWLVVDPUU9VIBODGMRIAZPGQX'
243246
b'DOGSEXIHKIBWSLDAWUKZCZMK9Z9YZSPCKBDJSVDPRQLJSTKUMTNVSXBGUEHHGAIWWQ'
244247
b'BCJZHZAQOWZMAIDAFUZBVMUVPWQJLUGGQKNKLMGTWXXNZKUCBJLEDAMYVRGABAWBY9'
245248
b'999MYIYBTGIOQYYZFJBLIAWMPSZEFFTXUZPCDIXSLLQDQSFYGQSQOGSPKCZNLVSZ9L'
@@ -285,8 +288,8 @@ def test_multiple_transactions(self):
285288
b'999999999999999999999999999999999999999999999999999999999999999999'
286289
b'999999999999999999999999999999999999999999999999999999999999999999'
287290
b'999999999999999999999999999999999999999999999999999999999999999999'
288-
b'999999999999999999999999999999999999999999999999999999999999999999'
289-
b'999999999999HNLFMVD99999999999A99999999PDQWLVVDPUU9VIBODGMRIAZPGQX'
291+
b'999999999999999999999999999999999999999999999999999SYRABNN9JD9PNDL'
292+
b'IKUNCECUELTOHNLFMVD99999999999A99999999PDQWLVVDPUU9VIBODGMRIAZPGQX'
290293
b'DOGSEXIHKIBWSLDAWUKZCZMK9Z9YZSPCKBDJSVDPRQLJSTKUMTNVSXFSEWUNJOEGNU'
291294
b'I9QOCRFMYSIFAZLJHKZBPQZZYFG9ORYCRDX9TOMJPFCRB9R9KPUUGFPVOWYXFIWEW9'
292295
b'999BGUEHHGAIWWQBCJZHZAQOWZMAIDAFUZBVMUVPWQJLUGGQKNKLMGTWXXNZKUCBJL'
@@ -353,7 +356,7 @@ def test_multiple_transactions(self):
353356
b'DRXICGYDGSVPXFTILFFGAPICYHGGJ9OHXINFX9999'
354357
),
355358
)
356-
359+
print(response['bundles'][0].as_tryte_strings())
357360
self.maxDiff = None
358361
self.assertListEqual(
359362
response['bundles'][0].as_json_compatible(),

test/commands/extended/get_transfers_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ def create_generator(ag, start, step=1):
410410
bundle_hash = None,
411411
trunk_transaction_hash = None,
412412
branch_transaction_hash = None,
413+
attachment_timestamp = 1483033814,
414+
attachment_timestamp_lower_bound = 12,
415+
attachment_timestamp_upper_bound = 0,
413416
nonce = None,
414417
)
415418
])
@@ -526,6 +529,9 @@ def create_generator(ag, start, step=1):
526529
bundle_hash = None,
527530
trunk_transaction_hash = None,
528531
branch_transaction_hash = None,
532+
attachment_timestamp = 1483033814,
533+
attachment_timestamp_lower_bound = 12,
534+
attachment_timestamp_upper_bound = 0,
529535
nonce = None,
530536
)
531537
])
@@ -601,6 +607,9 @@ def create_generator(ag, start, step=1):
601607
bundle_hash = None,
602608
trunk_transaction_hash = None,
603609
branch_transaction_hash = None,
610+
attachment_timestamp = 1483033814,
611+
attachment_timestamp_lower_bound = 12,
612+
attachment_timestamp_upper_bound = 0,
604613
nonce = None,
605614
)
606615
])

0 commit comments

Comments
 (0)