diff --git a/.travis.yml b/.travis.yml index 072f4bf..bd89a76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ deploy: python: '3.6' tags: true provider: pypi - distribution: 'bdist_wheel sdist' + distributions: 'bdist_wheel sdist' skip_upload_docs: true user: phx password: diff --git a/README.rst b/README.rst index 830d1a6..4340460 100644 --- a/README.rst +++ b/README.rst @@ -4,10 +4,6 @@ ===== PyOTA ===== -.. warning:: - ⚠️ This is pre-release software; it may have performance or stability issues. - Please do not use this software on mainnet until v2.0.0 stable is released. ⚠️ - This is the official Python library for the IOTA Core. It implements both the `official API`_, as well as newly-proposed functionality @@ -32,13 +28,9 @@ PyOTA is compatible with Python 3.6, 3.5 and 2.7. ============ Installation ============ -.. warning:: - ⚠️ This is pre-release software; it may have performance or stability issues. - Please do not use this software on mainnet until v2.0.0 stable is released. ⚠️ - To install the latest version:: - pip install --pre pyota + pip install pyota Optional C Extension ==================== @@ -47,7 +39,7 @@ cryptography features significantly (speedups of **60x** are common!). To install this extension, use the following command:: - pip install --pre pyota[ccurl] + pip install pyota[ccurl] Installing from Source @@ -75,7 +67,7 @@ For the full documentation of this library, please refer to the `official API`_ -.. _Create virtualenv: https://virtualenvwrapper.readthedocs.io/ +.. _Create virtualenv: https://realpython.com/blog/python/python-virtual-environments-a-primer/ .. _PyOTA Bug Tracker: https://github.com/iotaledger/iota.lib.py/issues .. _Slack: https://slack.iota.org/ .. _dedicated forum: https://forum.iota.org/ diff --git a/iota/commands/extended/replay_bundle.py b/iota/commands/extended/replay_bundle.py index 94cafce..e29eb35 100644 --- a/iota/commands/extended/replay_bundle.py +++ b/iota/commands/extended/replay_bundle.py @@ -47,7 +47,7 @@ def _execute(self, request): minWeightMagnitude = min_weight_magnitude, - trytes = bundle.as_tryte_strings(head_to_tail=True), + trytes = bundle.as_tryte_strings(), ) diff --git a/iota/json.py b/iota/json.py index 138ae8d..eab810b 100644 --- a/iota/json.py +++ b/iota/json.py @@ -4,7 +4,7 @@ from abc import ABCMeta, abstractmethod as abstract_method from json.encoder import JSONEncoder as BaseJsonEncoder -from typing import Mapping, Iterable +from typing import Iterable, Mapping, Text from six import with_metaclass diff --git a/iota/transaction/base.py b/iota/transaction/base.py index e583fbe..a8cf296 100644 --- a/iota/transaction/base.py +++ b/iota/transaction/base.py @@ -10,7 +10,7 @@ from iota.crypto import Curl, HASH_LENGTH from iota.json import JsonSerializable from iota.transaction.types import BundleHash, Fragment, TransactionHash, \ - TransactionTrytes + TransactionTrytes, Nonce from iota.types import Address, Hash, Tag, TryteString, TrytesCompatible, \ int_from_trits, trits_from_int @@ -53,14 +53,18 @@ def from_tryte_string(cls, trytes, hash_=None): signature_message_fragment = Fragment(tryte_string[0:2187]), address = Address(tryte_string[2187:2268]), value = int_from_trits(tryte_string[2268:2295].as_trits()), - tag = Tag(tryte_string[2295:2322]), + legacy_tag = Tag(tryte_string[2295:2322]), timestamp = int_from_trits(tryte_string[2322:2331].as_trits()), current_index = int_from_trits(tryte_string[2331:2340].as_trits()), last_index = int_from_trits(tryte_string[2340:2349].as_trits()), bundle_hash = BundleHash(tryte_string[2349:2430]), trunk_transaction_hash = TransactionHash(tryte_string[2430:2511]), branch_transaction_hash = TransactionHash(tryte_string[2511:2592]), - nonce = Hash(tryte_string[2592:2673]), + tag = Tag(tryte_string[2592:2619]), + attachment_timestamp = int_from_trits(tryte_string[2619:2628].as_trits()), + attachment_timestamp_lower_bound = int_from_trits(tryte_string[2628:2637].as_trits()), + attachment_timestamp_upper_bound = int_from_trits(tryte_string[2637:2646].as_trits()), + nonce = Nonce(tryte_string[2646:2673]), ) def __init__( @@ -69,16 +73,20 @@ def __init__( signature_message_fragment, address, value, - tag, timestamp, current_index, last_index, bundle_hash, trunk_transaction_hash, branch_transaction_hash, + tag, + attachment_timestamp, + attachment_timestamp_lower_bound, + attachment_timestamp_upper_bound, nonce, + legacy_tag = None ): - # type: (Optional[TransactionHash], Optional[Fragment], Address, int, Optional[Tag], int, Optional[int], Optional[int], Optional[BundleHash], Optional[TransactionHash], Optional[TransactionHash], Optional[Hash]) -> None + # type: (Optional[TransactionHash], Optional[Fragment], Address, int, int, Optional[int], Optional[int], Optional[BundleHash], Optional[TransactionHash], Optional[TransactionHash], Optional[Tag], Optional[int], Optional[int], Optional[int] Optional[Hash]) -> None self.hash = hash_ # type: Optional[TransactionHash] """ Transaction ID, generated by taking a hash of the transaction @@ -104,12 +112,12 @@ def __init__( Can be negative (i.e., for spending inputs). """ - self.tag = tag # type: Optional[Tag] + self._legacy_tag = legacy_tag # type: Optional[Tag] """ - Optional classification tag applied to this transaction. + Optional classification legacy_tag applied to this transaction. """ - self.nonce = nonce # type: Optional[Hash] + self.nonce = nonce # type: Optional[Nonce] """ Unique value used to increase security of the transaction hash. """ @@ -154,6 +162,17 @@ def __init__( The branch transaction generally has no significance. """ + + self.tag = tag # type: Optional[Tag] + """ + Optional classification tag applied to this transaction. + """ + + self.attachment_timestamp = attachment_timestamp # type: int + + self.attachment_timestamp_lower_bound = attachment_timestamp_lower_bound # type: int + + self.attachment_timestamp_upper_bound = attachment_timestamp_upper_bound # type: int self.signature_message_fragment = signature_message_fragment # type: Optional[Fragment] """ @@ -227,6 +246,36 @@ def last_index_as_trytes(self): """ # Note that we are padding to 27 _trits_. return TryteString.from_trits(trits_from_int(self.last_index, pad=27)) + + @property + def attachment_timestamp_as_trytes(self): + # type: () -> TryteString + """ + Returns a TryteString representation of the transaction's + attachment timestamp. + """ + #Note that we are padding to 27 _trits_. + return TryteString.from_trits(trits_from_int(self.attachment_timestamp, pad=27)) + + @property + def attachment_timestamp_lower_bound_as_trytes(self): + # type: () -> TryteString + """ + Returns a TryteString representation of the transaction's + attachment timestamp lower bound. + """ + #Note that we are padding to 27 _trits_. + return TryteString.from_trits(trits_from_int(self.attachment_timestamp_lower_bound, pad=27)) + + @property + def attachment_timestamp_upper_bound_as_trytes(self): + # type: () -> TryteString + """ + Returns a TryteString representation of the transaction's + attachment timestamp upper bound. + """ + #Note that we are padding to 27 _trits_. + return TryteString.from_trits(trits_from_int(self.attachment_timestamp_upper_bound, pad=27)) def as_json_compatible(self): # type: () -> dict @@ -237,18 +286,22 @@ def as_json_compatible(self): - :py:class:`iota.json.JsonEncoder`. """ return { - 'hash_': self.hash, - 'signature_message_fragment': self.signature_message_fragment, - 'address': self.address, - 'value': self.value, - 'tag': self.tag, - 'timestamp': self.timestamp, - 'current_index': self.current_index, - 'last_index': self.last_index, - 'bundle_hash': self.bundle_hash, - 'trunk_transaction_hash': self.trunk_transaction_hash, - 'branch_transaction_hash': self.branch_transaction_hash, - 'nonce': self.nonce, + 'hash_': self.hash, + 'signature_message_fragment': self.signature_message_fragment, + 'address': self.address, + 'value': self.value, + 'legacy_tag': self.legacy_tag, + 'timestamp': self.timestamp, + 'current_index': self.current_index, + 'last_index': self.last_index, + 'bundle_hash': self.bundle_hash, + 'trunk_transaction_hash': self.trunk_transaction_hash, + 'branch_transaction_hash': self.branch_transaction_hash, + 'tag': self.tag, + 'attachment_timestamp': self.attachment_timestamp, + 'attachment_timestamp_lower_bound': self.attachment_timestamp_lower_bound, + 'attachment_timestamp_upper_bound': self.attachment_timestamp_upper_bound, + 'nonce': self.nonce, } def as_tryte_string(self): @@ -260,13 +313,17 @@ def as_tryte_string(self): self.signature_message_fragment + self.address.address + self.value_as_trytes - + self.tag + + self.legacy_tag + self.timestamp_as_trytes + self.current_index_as_trytes + self.last_index_as_trytes + self.bundle_hash + self.trunk_transaction_hash + self.branch_transaction_hash + + self.tag + + self.attachment_timestamp_as_trytes + + self.attachment_timestamp_lower_bound_as_trytes + + self.attachment_timestamp_upper_bound_as_trytes + self.nonce ) @@ -279,11 +336,20 @@ def get_signature_validation_trytes(self): return ( self.address.address + self.value_as_trytes - + self.tag + + self.legacy_tag + self.timestamp_as_trytes + self.current_index_as_trytes + self.last_index_as_trytes ) + + @property + def legacy_tag(self): + # type: () -> Tag + """ + Return the legacy tag of the transaction. + If no legacy tag was set, returns the tag instead. + """ + return self._legacy_tag or self.tag class Bundle(JsonSerializable, Sequence[Transaction]): diff --git a/iota/transaction/creation.py b/iota/transaction/creation.py index c0875fe..25c0a0b 100644 --- a/iota/transaction/creation.py +++ b/iota/transaction/creation.py @@ -13,7 +13,7 @@ from iota.crypto.types import PrivateKey from iota.exceptions import with_context from iota.transaction.base import Bundle, Transaction -from iota.transaction.types import BundleHash, Fragment, TransactionHash +from iota.transaction.types import BundleHash, Fragment, TransactionHash, Nonce from iota.transaction.utils import get_current_timestamp from iota.types import Address, Hash, Tag, TryteString @@ -36,23 +36,26 @@ def __init__(self, address, value, tag=None, message=None, timestamp=None): timestamp = get_current_timestamp() super(ProposedTransaction, self).__init__( - address = address, - tag = Tag(b'') if tag is None else tag, - timestamp = timestamp, - value = value, + address = address, + tag = Tag(b'') if tag is None else tag, + timestamp = timestamp, + value = value, # These values will be populated when the bundle is finalized. - bundle_hash = None, - current_index = None, - hash_ = None, - last_index = None, - signature_message_fragment = None, + bundle_hash = None, + current_index = None, + hash_ = None, + last_index = None, + signature_message_fragment = None, + attachment_timestamp = 0, + attachment_timestamp_lower_bound = 0, + attachment_timestamp_upper_bound = 0, # These values start out empty; they will be populated when the # node does PoW. - branch_transaction_hash = TransactionHash(b''), - nonce = Hash(b''), - trunk_transaction_hash = TransactionHash(b''), + branch_transaction_hash = TransactionHash(b''), + nonce = Nonce(b''), + trunk_transaction_hash = TransactionHash(b''), ) self.message = TryteString(b'') if message is None else message diff --git a/iota/transaction/types.py b/iota/transaction/types.py index a3a4578..3a32c57 100644 --- a/iota/transaction/types.py +++ b/iota/transaction/types.py @@ -11,6 +11,7 @@ 'Fragment', 'TransactionHash', 'TransactionTrytes', + 'Nonce' ] @@ -72,3 +73,25 @@ def __init__(self, trytes): 'trytes': trytes, }, ) + +class Nonce(TryteString): + """ + A TryteString that acts as a transaction nonce. + """ + LEN = 27 + + def __init__(self, trytes): + # type: (TrytesCompatible) -> None + super(Nonce, self).__init__(trytes, pad=self.LEN) + + if len(self._trytes) > self.LEN: + raise with_context( + exc = ValueError('{cls} values must be {len} trytes long.'.format( + cls = type(self).__name__, + len = self.LEN + )), + + context = { + 'trytes': trytes, + }, + ) \ No newline at end of file diff --git a/setup.py b/setup.py index 69470d9..e214a29 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ name = 'PyOTA', description = 'IOTA API library for Python', url = 'https://github.com/iotaledger/iota.lib.py', - version = '2.0.0b2', + version = '2.0.0', long_description = long_description, @@ -66,7 +66,7 @@ license = 'MIT', classifiers = [ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', diff --git a/test/commands/extended/get_bundles_test.py b/test/commands/extended/get_bundles_test.py index 7ca24c1..633dee9 100644 --- a/test/commands/extended/get_bundles_test.py +++ b/test/commands/extended/get_bundles_test.py @@ -8,7 +8,7 @@ from filters.test import BaseFilterTestCase from iota import Address, BadApiResponse, Bundle, BundleHash, Fragment, Hash, \ - Iota, Tag, Transaction, TransactionHash, TransactionTrytes + Iota, Tag, Transaction, TransactionHash, TransactionTrytes, Nonce from iota.adapter import MockAdapter from iota.commands.extended.get_bundles import GetBundlesCommand from iota.filters import Trytes @@ -141,21 +141,24 @@ def test_single_transaction(self): """ transaction =\ Transaction( - current_index = 0, - last_index = 0, - tag = Tag(b''), - timestamp = 1484960990, - value = 0, + current_index = 0, + last_index = 0, + tag = Tag(b''), + timestamp = 1484960990, + value = 0, + attachment_timestamp = 1484960990, + attachment_timestamp_lower_bound = 12, + attachment_timestamp_upper_bound = 0, # These values are not relevant for 0-value transactions. - nonce = Hash(b''), + nonce = Nonce(b''), signature_message_fragment = Fragment(b''), # This value is computed automatically, so it has to be real. hash_ = TransactionHash( - b'UGQBSMKGNXXWDCS9XZCFTPUXFADCT9I9KCNQGUXK' - b'NDJDUXLWODOVJQWJHCLWTODAELDXGL9SMQYQZFWHE', + b'XPJIYZWPF9LBCYZPNBFARDRCSUGJGF9TWZT9K9PX' + b'VYDFPZOZBGXUCKLTJEUCFBEKQQ9VCSQVQDMMJQAY9', ), address = @@ -238,8 +241,8 @@ def test_multiple_transactions(self): b'999999999999999999999999999999999999999999999999999999999999999999' b'999999999999999999999999999999999999999999999999999999999999999999' b'999999999WUQXEGBVIECGIWO9IGSYKWWPYCIVUJJGSJPWGIAFJPYSF9NSQOHWAHS9P' - b'9PWQHOBXNNQIF9IRHVQXKPZW999999999999999999999999999999999999999999' - b'999999999999HNLFMVD99A99999999A99999999PDQWLVVDPUU9VIBODGMRIAZPGQX' + b'9PWQHOBXNNQIF9IRHVQXKPZW999999999999999999999999999XZUIENOTTBKJMDP' + b'RXWGQYG9PWGTHNLFMVD99A99999999A99999999PDQWLVVDPUU9VIBODGMRIAZPGQX' b'DOGSEXIHKIBWSLDAWUKZCZMK9Z9YZSPCKBDJSVDPRQLJSTKUMTNVSXBGUEHHGAIWWQ' b'BCJZHZAQOWZMAIDAFUZBVMUVPWQJLUGGQKNKLMGTWXXNZKUCBJLEDAMYVRGABAWBY9' b'999MYIYBTGIOQYYZFJBLIAWMPSZEFFTXUZPCDIXSLLQDQSFYGQSQOGSPKCZNLVSZ9L' @@ -285,8 +288,8 @@ def test_multiple_transactions(self): b'999999999999999999999999999999999999999999999999999999999999999999' b'999999999999999999999999999999999999999999999999999999999999999999' b'999999999999999999999999999999999999999999999999999999999999999999' - b'999999999999999999999999999999999999999999999999999999999999999999' - b'999999999999HNLFMVD99999999999A99999999PDQWLVVDPUU9VIBODGMRIAZPGQX' + b'999999999999999999999999999999999999999999999999999SYRABNN9JD9PNDL' + b'IKUNCECUELTOHNLFMVD99999999999A99999999PDQWLVVDPUU9VIBODGMRIAZPGQX' b'DOGSEXIHKIBWSLDAWUKZCZMK9Z9YZSPCKBDJSVDPRQLJSTKUMTNVSXFSEWUNJOEGNU' b'I9QOCRFMYSIFAZLJHKZBPQZZYFG9ORYCRDX9TOMJPFCRB9R9KPUUGFPVOWYXFIWEW9' b'999BGUEHHGAIWWQBCJZHZAQOWZMAIDAFUZBVMUVPWQJLUGGQKNKLMGTWXXNZKUCBJL' @@ -353,7 +356,6 @@ def test_multiple_transactions(self): b'DRXICGYDGSVPXFTILFFGAPICYHGGJ9OHXINFX9999' ), ) - self.maxDiff = None self.assertListEqual( response['bundles'][0].as_json_compatible(), diff --git a/test/commands/extended/get_transfers_test.py b/test/commands/extended/get_transfers_test.py index 011b584..ff2f4f6 100644 --- a/test/commands/extended/get_transfers_test.py +++ b/test/commands/extended/get_transfers_test.py @@ -410,6 +410,9 @@ def create_generator(ag, start, step=1): bundle_hash = None, trunk_transaction_hash = None, branch_transaction_hash = None, + attachment_timestamp = 1483033814, + attachment_timestamp_lower_bound = 12, + attachment_timestamp_upper_bound = 0, nonce = None, ) ]) @@ -526,6 +529,9 @@ def create_generator(ag, start, step=1): bundle_hash = None, trunk_transaction_hash = None, branch_transaction_hash = None, + attachment_timestamp = 1483033814, + attachment_timestamp_lower_bound = 12, + attachment_timestamp_upper_bound = 0, nonce = None, ) ]) @@ -601,6 +607,9 @@ def create_generator(ag, start, step=1): bundle_hash = None, trunk_transaction_hash = None, branch_transaction_hash = None, + attachment_timestamp = 1483033814, + attachment_timestamp_lower_bound = 12, + attachment_timestamp_upper_bound = 0, nonce = None, ) ]) diff --git a/test/commands/extended/prepare_transfer_test.py b/test/commands/extended/prepare_transfer_test.py index ea24359..e266995 100644 --- a/test/commands/extended/prepare_transfer_test.py +++ b/test/commands/extended/prepare_transfer_test.py @@ -566,7 +566,7 @@ def test_pass_inputs_not_needed(self): self.assertEqual( response['trytes'][1], - TryteString(b'999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999TESTVALUE9DONTUSEINPRODUCTION99999KJUPKNRMTHKVJYWNBKBGCKOQWBTKBOBJIZZYQITTFJZKLOI999999999999999999999999999PYOTA9UNIT9TESTS99999999999NYBKIVD99999999999A99999999LK9ZCHYABJFCM9UGKNWDKPAH9KSSXJPOMYYHLHRAGVAZDDFUJLJBONPLNYQCEBEPVEELEZINMNC9QZYQW999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'), + TryteString(b'999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999TESTVALUE9DONTUSEINPRODUCTION99999KJUPKNRMTHKVJYWNBKBGCKOQWBTKBOBJIZZYQITTFJZKLOI999999999999999999999999999PYOTA9UNIT9TESTS99999999999NYBKIVD99999999999A99999999LK9ZCHYABJFCM9UGKNWDKPAH9KSSXJPOMYYHLHRAGVAZDDFUJLJBONPLNYQCEBEPVEELEZINMNC9QZYQW999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999PYOTA9UNIT9TESTS99999999999999999999999999999999999999999999999999999999999999999'), ) @@ -1135,7 +1135,7 @@ def test_pass_message_short(self): self.assertEqual( response['trytes'][0], - TryteString(b'HHVFHFHHVFEFHHVFOFHHVFHFHHVFMEHHVFSFHHVFCEHHVFPFHHVFEFHHWFVDHHVFCFHHVFUDFA9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999TESTVALUE9DONTUSEINPRODUCTION99999YMSWGXVNDMLXPT9HMVAOWUUZMLSJZFWGKDVGXPSQAWAEBJN999999999999999999999999999PYOTA9UNIT9TESTS99999999999NYBKIVD99999999999999999999XYAMEGAPMZ9HQCPAOUEQLDKHPMLJGJFEOGDAHWNSMRETQRKBKFNBVSEESVOIGRFDRMXWOG9LARRSIZ9QD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'), + TryteString(b'HHVFHFHHVFEFHHVFOFHHVFHFHHVFMEHHVFSFHHVFCEHHVFPFHHVFEFHHWFVDHHVFCFHHVFUDFA9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999TESTVALUE9DONTUSEINPRODUCTION99999YMSWGXVNDMLXPT9HMVAOWUUZMLSJZFWGKDVGXPSQAWAEBJN999999999999999999999999999PYOTA9UNIT9TESTS99999999999NYBKIVD99999999999999999999XYAMEGAPMZ9HQCPAOUEQLDKHPMLJGJFEOGDAHWNSMRETQRKBKFNBVSEESVOIGRFDRMXWOG9LARRSIZ9QD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999PYOTA9UNIT9TESTS99999999999999999999999999999999999999999999999999999999999999999'), ) def test_pass_message_long(self): @@ -1189,18 +1189,17 @@ def test_pass_message_long(self): self.assertEqual(len(response['trytes']), 3) # Note that the transactions are returned in reverse order. - self.assertEqual( response['trytes'][0], - TryteString(b'EASGBGTGTDSGNFSGPFSGAGFA999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999TESTVALUE9DONTUSEINPRODUCTION99999YMSWGXVNDMLXPT9HMVAOWUUZMLSJZFWGKDVGXPSQAWAEBJN999999999999999999999999999PYOTA9UNIT9TESTS99999999999NYBKIVD99B99999999B99999999WNFMWSPCSGGIFVNVMLOFYLWQXKIRFEVEHVNBSCRHJ9XLSWYSKAO9LIZSYRJAGNNLBJBZKGCVPZEWKYXAW999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'), + TryteString(b'EASGBGTGTDSGNFSGPFSGAGFA999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999TESTVALUE9DONTUSEINPRODUCTION99999YMSWGXVNDMLXPT9HMVAOWUUZMLSJZFWGKDVGXPSQAWAEBJN999999999999999999999999999PYOTA9UNIT9TESTS99999999999NYBKIVD99B99999999B99999999WNFMWSPCSGGIFVNVMLOFYLWQXKIRFEVEHVNBSCRHJ9XLSWYSKAO9LIZSYRJAGNNLBJBZKGCVPZEWKYXAW999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999PYOTA9UNIT9TESTS99999999999999999999999999999999999999999999999999999999999999999'), ) - + self.assertEqual( response['trytes'][1], - TryteString(b'FSG9GTGHEEASG9GSGNFEATGFETGVDSGAGSGWFEATGUDTGVDSGSFSG9GSGSFSAEASGKETGDEEASGRFSGAGSGYFSGTFSG9GTGDEEASGZFSGSFSG9GTGHEEASG9GSGNFEATGFETGVDSGAGSGWFEATGUDTGVDSGSFSG9GSGSFSAEASGUETGDEEASGVFTGUDSGBGSGAGSGYFTGEESGUFTGWDSGSFSGZFEATGVDSGNFSGXFSGVFSGSFEATGUDSGYFSGAGSGPFSGNFQAEASGXFSGNFSGXFEATG9ESGSFTGUDTGVDTGEEQAEASGXFSGAGSGRFQAEASGPFSGSFTGTDSG9GSGAGTGUDTGVDTGEEEASASASAEASGZFTGDEEASGVFTGUDSGBGSGAGSGYFTGEESGUFTGWDSGSFSGZFEATGFETGVDSGVFEATGUDSGYFSGAGSGPFSGNFEASGPFEASGXFSGNFTG9ESGSFTGUDTGVDSGPFSGSFEASGAGTGUDSG9GSGAGSGPFTGDEEASGXFEASGTFSGVFSGUFSG9GSGVFEASGBGTGTDSGAGSGPFSGSFSGYFQAEASGUFSGNFTGBESGVFTGBESGNFTGHEEATG9ETGVDSGAGRATGVDSGAGSAEASGKETGDEEASGZFSGAGSGTFSGSFTGVDSGSFEASGVFTGUDSGBGSGAGSGYFTGEESGUFSGAGSGPFSGNFTGVDTGEEEASGVFSGZFQAEASGXFSGNFSGXFEASGBGTGWDSGNFSG9GTGVDSGNFSAEASGAFEASGZFSGSFSG9GTGHEEASG9GSGSFTGVDEASG9GSGVFEASGPFTGTDSGSFSGZFSGSFSG9GSGVFQAEASG9GSGVFEASGTFSGSFSGYFSGNFSG9GSGVFTGHEQAEATG9ETGVDSGAGSGOFTGDEEASGAGSGOFTGCETGHETGUDSG9GSGVFTGVDTGEETGUDTGHEEATGUDEATG9ESGSFSGYFSGAGSGPFSGSFSGXFSGAGSGZFQAEASGXFSGAGTGVDSGAGTGTDTGDESGWFE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WDSGZFSGNFSGSFTGVDSGSFQAEATG9ETGVDSGAGEASGPFTGDEEASGVFSGZFSGSFSGSFTGVDSGSFTESTVALUE9DONTUSEINPRODUCTION99999YMSWGXVNDMLXPT9HMVAOWUUZMLSJZFWGKDVGXPSQAWAEBJN999999999999999999999999999PYOTA9UNIT9TESTS99999999999NYBKIVD99A99999999B99999999WNFMWSPCSGGIFVNVMLOFYLWQXKIRFEVEHVNBSCRHJ9XLSWYSKAO9LIZSYRJAGNNLBJBZKGCVPZEWKYXAW999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'), + TryteString(b'FSG9GTGHEEASG9GSGNFEATGFETGVDSGAGSGWFEATGUDTGVDSGSFSG9GSGSFSAEASGKETGDEEASGRFSGAGSGYFSGTFSG9GTGDEEASGZFSGSFSG9GTGHEEASG9GSGNFEATGFETGVDSGAGSGWFEATGUDTGVDSGSFSG9GSGSFSAEASGUETGDEEASGVFTGUDSGBGSGAGSGYFTGEESGUFTGWDSGSFSGZFEATGVDSGNFSGXFSGVFSGSFEATGUDSGYFSGAGSGPFSGNFQAEASGXFSGNFSGXFEATG9ESGSFTGUDTGVDTGEEQAEASGXFSGAGSGRFQAEASGPFSGSFTGTDSG9GSGAGTGUDTGVDTGEEEASASASAEASGZFTGDEEASGVFTGUDSGBGSGAGSGYFTGEESGUFTGWDSGSFSGZFEATGFETGVDSGVFEATGUDSGYFSGAGSGPFSGNFEASGPFEASGXFSGNFTG9ESGSFTGUDTGVDSGPFSGSFEASGAGTGUDSG9GSGAGSGPFTGDEEASGXFEASGTFSGVFSGUFSG9GSGVFEASGBGTGTDSGAGSGPFSGSFSGYFQAEASGUFSGNFTGBESGVFTGBESGNFTGHEEATG9ETGVDSGAGRATGVDSGAGSAEASGKETGDEEASGZFSGAGSGTFSGSFTGVDSGSFEASGVFTGUDSGBGSGAGSGYFTGEESGUFSGAGSGPFSGNFTGVDTGE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FQAEATGHEEASGBGTGTDSGSFSGRFSGYFSGNFSGQFSGNFTGGEEASGPFSGNFSGZFEASGBGSGAGSGRFSGAGSGOFTGTDSGNFTGVDTGEEEASGAGTGTDTGWDSGTFSGVFSGSFEASGVFEASGPFTGUDTGVDSGNFTGVDTGEEEASGBGSGAGTGUDTGVDSAEASGKEEASGYFTGGESGOFSGAGSGZFEATGUDSGYFTGWDTG9ESGNFSGSFQAEATGHEEASG9GSGSFEASG9GSGNFSGBGSGYFSGSFSGPFSGNFTGVDTGEEQAEATG9ETGVDSGAGEASGPFTGDEEASGRFTGWDSGZFSGNFSGSFTGVDSGSFQAEATG9ETGVDSGAGEASGPFTGDEEASGVFSGZFSGSFSGSFTGVDSGSFTESTVALUE9DONTUSEINPRODUCTION99999YMSWGXVNDMLXPT9HMVAOWUUZMLSJZFWGKDVGXPSQAWAEBJN999999999999999999999999999PYOTA9UNIT9TESTS99999999999NYBKIVD99A99999999B99999999WNFMWSPCSGGIFVNVMLOFYLWQXKIRFEVEHVNBSCRHJ9XLSWYSKAO9LIZSYRJAGNNLBJBZKGCVPZEWKYXAW999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999PYOTA9UNIT9TESTS99999999999999999999999999999999999999999999999999999999999999999'), ) self.assertEqual( response['trytes'][2], - TryteString(b'SGKETGDEEASG9GSGSFEASGZFSGAGSGTFSGSFTGVDSGSFEATGUDSGBGTGTDSGNFSGPFSGVFTGVDTGEETGUDTGHEEASGBGTGTDSGNFSGPFSGRFTGWDFAEASGZETGDESG9GQAEASGZFTGDEEASGTFSGVFSGPFSGSFSGZFEASGPFEASGZFSGVFTGTDSGSFQAEASGXFSGAGTGVDSGAGTGTDTGDESGWFEASGVFSGZFSGSFSGSFTGVDEATGUDTGVDSGSFSG9GTGDESAEASGQEEATGFETGVDSGVFEATGUDTGVDSGSFSG9GTGDEEASGRFSGAGSGYFSGTFSG9GTGDEEASGOFTGDETGVDTGEEEASGAGTGY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GSGNFTGUDEASGTFSGVFSGUFSG9GTGEESAEASGQEEASGZFSGAGSGSFEATGUDTGWDTGBESGSFTGUDTGVDSGPFSGAGSGPFSGNFSG9GSGVFSGSFQAEASGPFEATGVDSGAGEASGPFTGTDSGSFSGZFTGHEEASGXFSGNFSGXFEASGQFTGTDSGAGTGVDSGSFTGUDSGXFEASGVFEASG9GSGSFSGBGSGAGSG9GTGHETGVDSG9GTGDESGZFSGVFEASGRFSGYFTGHEEASGPFSGNFTGUDQAEATGUDSGBGSGNFTGUDSGNFSGSFTGVDEASGTFSGVFSGUFSG9GSGVFEASASASAEASGKETGDEEASG9GSGSFEATGYDSGAGTGVDSGVFTGVDSGSFEASGUFSG9GSGNFTGVDTGEEEASGBGTGTDSGNFSGPFSGRFTGWDSAEASGXESGAGTGVDSGAGSGZFTGWDEATG9ETGVDSGAGEASGPFEASGQFSGYFTGWDSGOFSGVFSG9GSGSFEASGRFTGWDTGAESGVFQAEASGPFEATGVDSGSFTGYDEASGZFSGSFTGUDTGVDSGNFTGYDQAEASGPFTGDEEASG9GSGSFEASGQFSGAGSGPFSGAGTGTDSGVFTGVDSGSFEASGAGEASG9GSGNFEASGPFSGSFTG9ESGSFTGTDSGVFSG9GSGXFSGNFTGYDQAEASGPFTGDEEATGYDSGAGTGVDSGVFTGVDSGSFEASGZFSGSTESTVALUE9DONTUSEINPRODUCTION99999YMSWGXVNDMLXPT9HMVAOWUUZMLSJZFWGKDVGXPSQAWAEBJN999999999999999999999999999PYOTA9UNIT9TESTS99999999999NYBKIVD99999999999B99999999WNFMWSPCSGGIFVNVMLOFYLWQXKIRFEVEHVNBSCRHJ9XLSWYSKAO9LIZSYRJAGNNLBJBZKGCVPZEWKYXAW999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'), + TryteString(b'SGKETGDEEASG9GSGSFEASGZFSGAGSGTFSGSFTGVDSGSFEATGUDSGBGTG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VGXPSQAWAEBJN999999999999999999999999999PYOTA9UNIT9TESTS99999999999NYBKIVD99999999999B99999999WNFMWSPCSGGIFVNVMLOFYLWQXKIRFEVEHVNBSCRHJ9XLSWYSKAO9LIZSYRJAGNNLBJBZKGCVPZEWKYXAW999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999PYOTA9UNIT9TESTS99999999999999999999999999999999999999999999999999999999999999999'), ) diff --git a/test/commands/extended/replay_bundle_test.py b/test/commands/extended/replay_bundle_test.py index 62668ef..d041078 100644 --- a/test/commands/extended/replay_bundle_test.py +++ b/test/commands/extended/replay_bundle_test.py @@ -9,7 +9,7 @@ from six import binary_type from iota import Address, Bundle, BundleHash, Fragment, Hash, Iota, Tag, \ - Transaction, TransactionHash + Transaction, TransactionHash, Nonce from iota.adapter import MockAdapter from iota.commands.extended.replay_bundle import ReplayBundleCommand from iota.filters import Trytes @@ -343,9 +343,8 @@ def test_happy_path(self): ), nonce = - Hash( - b'LIJVXBVTYMEEPCKJRIQTGAKWJRAMYNPJEGHEWAUL' - b'XPBBUQPCJTJPRZTISQPJRJGMSBGQLER9OXYQXFGQO' + Nonce( + b'LIJVXBVTYMEEPCKJRIQTGAKWJRA' ), trunk_transaction_hash = @@ -356,11 +355,14 @@ def test_happy_path(self): signature_message_fragment = Fragment(b''), - current_index = 0, - last_index = 3, - tag = Tag(b''), - timestamp = 1483033814, - value = 1, + current_index = 0, + last_index = 3, + tag = Tag(b''), + timestamp = 1483033814, + value = 1, + attachment_timestamp = 0, + attachment_timestamp_lower_bound = 0, + attachment_timestamp_upper_bound = 0, ), # Input #1, Part 1 of 2 @@ -390,9 +392,8 @@ def test_happy_path(self): ), nonce = - Hash( - b'VRYLDCKEWZJXPQVSWOJVYVBJSCWZQEVKPBG9KGEZ' - b'GPRQFKFSRNBPXCSVQNJINBRNEPIKAXNHOTJFIVYJO' + Nonce( + b'VRYLDCKEWZJXPQVSWOJVYVBJSCW' ), trunk_transaction_hash = @@ -440,11 +441,14 @@ def test_happy_path(self): b'G9CM9VLMQZA' ), - current_index = 1, - last_index = 3, - tag = Tag(b''), - timestamp = 1483033814, - value = -99, + current_index = 1, + last_index = 3, + tag = Tag(b''), + timestamp = 1483033814, + value = -99, + attachment_timestamp = 0, + attachment_timestamp_lower_bound = 0, + attachment_timestamp_upper_bound = 0, ), # Input #1, Part 2 of 2 @@ -474,9 +478,8 @@ def test_happy_path(self): ), nonce = - Hash( - b'AAKVYZOEZSOXTX9LOLHZYLNAS9CXBLSWVZQAMRGW' - b'YW9GHHMVIOHWBMTXHDBXRTF9DEFFQFQESNVJORNXK' + Nonce( + b'AAKVYZOEZSOXTX9LOLHZYLNAS9C' ), trunk_transaction_hash = @@ -524,11 +527,14 @@ def test_happy_path(self): b'WVLUITJQ9JM' ), - current_index = 2, - last_index = 3, - tag = Tag(b''), - timestamp = 1483033814, - value = 0, + current_index = 2, + last_index = 3, + tag = Tag(b''), + timestamp = 1483033814, + value = 0, + attachment_timestamp = 0, + attachment_timestamp_lower_bound = 0, + attachment_timestamp_upper_bound = 0, ), # "Change" transaction, Part 1 of 1 @@ -558,9 +564,8 @@ def test_happy_path(self): ), nonce = - Hash( - b'TPGXQFUGNEYYFFKPFWJSXKTWEUKUFTRJCQKKXLXL' - b'PSOHBZTGIBFPGLSVRIVYAC9NZMOMZLARFZYCNNRCM' + Nonce( + b'TPGXQFUGNEYYFFKPFWJSXKTWEUK' ), trunk_transaction_hash = @@ -571,11 +576,14 @@ def test_happy_path(self): signature_message_fragment = Fragment(b''), - current_index = 3, - last_index = 3, - tag = Tag(b''), - timestamp = 1483033814, - value = 98, + current_index = 3, + last_index = 3, + tag = Tag(b''), + timestamp = 1483033814, + value = 98, + attachment_timestamp = 0, + attachment_timestamp_lower_bound = 0, + attachment_timestamp_upper_bound = 0, ), ]) @@ -585,10 +593,19 @@ def test_happy_path(self): }) send_trytes_response = { - 'trytes': bundle.as_tryte_strings(head_to_tail=True), + 'trytes': bundle.as_tryte_strings(), } - mock_send_trytes = mock.Mock(return_value=send_trytes_response) + def mock_send_trytes(_,request): + """ + Ensures that the correct trytes are sent to the ``sendTrytes`` command + to replay the bundle. + + References: + - https://github.com/iotaledger/iota.lib.py/issues/74 + """ + self.assertEqual(request['trytes'], send_trytes_response['trytes']) + return send_trytes_response with mock.patch( 'iota.commands.extended.get_bundles.GetBundlesCommand._execute', diff --git a/test/transaction/base_test.py b/test/transaction/base_test.py index 517b0f4..868305c 100644 --- a/test/transaction/base_test.py +++ b/test/transaction/base_test.py @@ -5,7 +5,7 @@ from unittest import TestCase from iota import Address, Bundle, BundleHash, Fragment, Hash, \ - Tag, Transaction, TransactionHash, TransactionTrytes + Tag, Transaction, TransactionHash, TransactionTrytes, TryteString, Nonce class BundleTestCase(TestCase): @@ -24,18 +24,21 @@ def setUp(self): b'XCQANAWGJBTFWEAEQCN9WBZB9BJAIIY9UDLIGFOAA' ), - current_index = 0, - last_index = 7, - value = 0, + current_index = 0, + last_index = 7, + value = 0, # These values are not relevant to the tests. - branch_transaction_hash = TransactionHash(b''), - bundle_hash = BundleHash(b''), - hash_ = TransactionHash(b''), - nonce = Hash(b''), - tag = Tag(b''), - timestamp = 1485020456, - trunk_transaction_hash = TransactionHash(b''), + branch_transaction_hash = TransactionHash(b''), + bundle_hash = BundleHash(b''), + hash_ = TransactionHash(b''), + nonce = Nonce(b''), + timestamp = 1485020456, + trunk_transaction_hash = TransactionHash(b''), + tag = Tag(b''), + attachment_timestamp = 1485020456, + attachment_timestamp_upper_bound = 1485020456, + attachment_timestamp_lower_bound = 1485020456, ), # This transaction has something that can't be decoded as a UTF-8 @@ -50,18 +53,21 @@ def setUp(self): b'MHCGKEUGYFUBIARAXBFASGLCHCBEVGTBDCSAEBTBM' ), - current_index = 1, - last_index = 7, - value = 10, + current_index = 1, + last_index = 7, + value = 10, # These values are not relevant to the tests. - branch_transaction_hash = TransactionHash(b''), - bundle_hash = BundleHash(b''), - hash_ = TransactionHash(b''), - nonce = Hash(b''), - tag = Tag(b''), - timestamp = 1485020456, - trunk_transaction_hash = TransactionHash(b''), + branch_transaction_hash = TransactionHash(b''), + bundle_hash = BundleHash(b''), + hash_ = TransactionHash(b''), + nonce = Nonce(b''), + timestamp = 1485020456, + trunk_transaction_hash = TransactionHash(b''), + tag = Tag(b''), + attachment_timestamp = 1485020456, + attachment_timestamp_upper_bound = 1485020456, + attachment_timestamp_lower_bound = 1485020456, ), # This transaction has a message that fits into a single @@ -76,18 +82,21 @@ def setUp(self): b'M9XADCPFJDFANCIHR9OBDHTAGGE9TGCI9EO9ZCRBN' ), - current_index = 2, - last_index = 7, - value = 20, + current_index = 2, + last_index = 7, + value = 20, # These values are not relevant to the tests. - branch_transaction_hash = TransactionHash(b''), - bundle_hash = BundleHash(b''), - hash_ = TransactionHash(b''), - nonce = Hash(b''), - tag = Tag(b''), - timestamp = 1485020456, - trunk_transaction_hash = TransactionHash(b''), + branch_transaction_hash = TransactionHash(b''), + bundle_hash = BundleHash(b''), + hash_ = TransactionHash(b''), + nonce = Nonce(b''), + timestamp = 1485020456, + trunk_transaction_hash = TransactionHash(b''), + tag = Tag(b''), + attachment_timestamp = 1485020456, + attachment_timestamp_upper_bound = 1485020456, + attachment_timestamp_lower_bound = 1485020456, ), # This transaction has a message that spans multiple fragments. @@ -142,13 +151,16 @@ def setUp(self): value = 30, # These values are not relevant to the tests. - branch_transaction_hash = TransactionHash(b''), - bundle_hash = BundleHash(b''), - hash_ = TransactionHash(b''), - nonce = Hash(b''), - tag = Tag(b''), - timestamp = 1485020456, - trunk_transaction_hash = TransactionHash(b''), + branch_transaction_hash = TransactionHash(b''), + bundle_hash = BundleHash(b''), + hash_ = TransactionHash(b''), + nonce = Nonce(b''), + timestamp = 1485020456, + trunk_transaction_hash = TransactionHash(b''), + tag = Tag(b''), + attachment_timestamp = 1485020456, + attachment_timestamp_upper_bound = 1485020456, + attachment_timestamp_lower_bound = 1485020456, ), Transaction( @@ -173,18 +185,21 @@ def setUp(self): b'XCQANAWGJBTFWEAEQCN9WBZB9BJAIIY9UDLIGFOAA' ), - current_index = 4, - last_index = 7, - value = 0, + current_index = 4, + last_index = 7, + value = 0, # These values are not relevant to the tests. - branch_transaction_hash = TransactionHash(b''), - bundle_hash = BundleHash(b''), - hash_ = TransactionHash(b''), - nonce = Hash(b''), - tag = Tag(b''), - timestamp = 1485020456, - trunk_transaction_hash = TransactionHash(b''), + branch_transaction_hash = TransactionHash(b''), + bundle_hash = BundleHash(b''), + hash_ = TransactionHash(b''), + nonce = Nonce(b''), + timestamp = 1485020456, + trunk_transaction_hash = TransactionHash(b''), + tag = Tag(b''), + attachment_timestamp = 1485020456, + attachment_timestamp_upper_bound = 1485020456, + attachment_timestamp_lower_bound = 1485020456, ), # Input, Part 1 of 2 @@ -200,18 +215,21 @@ def setUp(self): b'HDVHYHOBHGP9VCGIZHNCAAQFJGE9YHEHEFTDAGXHY' ), - current_index = 5, - last_index = 7, - value = -100, + current_index = 5, + last_index = 7, + value = -100, # These values are not relevant to the tests. - branch_transaction_hash = TransactionHash(b''), - bundle_hash = BundleHash(b''), - hash_ = TransactionHash(b''), - nonce = Hash(b''), - tag = Tag(b''), - timestamp = 1485020456, - trunk_transaction_hash = TransactionHash(b''), + branch_transaction_hash = TransactionHash(b''), + bundle_hash = BundleHash(b''), + hash_ = TransactionHash(b''), + nonce = Nonce(b''), + timestamp = 1485020456, + trunk_transaction_hash = TransactionHash(b''), + tag = Tag(b''), + attachment_timestamp = 1485020456, + attachment_timestamp_upper_bound = 1485020456, + attachment_timestamp_lower_bound = 1485020456, ), # Input, Part 2 of 2 @@ -227,18 +245,21 @@ def setUp(self): b'HDVHYHOBHGP9VCGIZHNCAAQFJGE9YHEHEFTDAGXHY' ), - current_index = 6, - last_index = 7, - value = 0, + current_index = 6, + last_index = 7, + value = 0, # These values are not relevant to the tests. - branch_transaction_hash = TransactionHash(b''), - bundle_hash = BundleHash(b''), - hash_ = TransactionHash(b''), - nonce = Hash(b''), - tag = Tag(b''), - timestamp = 1485020456, - trunk_transaction_hash = TransactionHash(b''), + branch_transaction_hash = TransactionHash(b''), + bundle_hash = BundleHash(b''), + hash_ = TransactionHash(b''), + nonce = Nonce(b''), + timestamp = 1485020456, + trunk_transaction_hash = TransactionHash(b''), + tag = Tag(b''), + attachment_timestamp = 1485020456, + attachment_timestamp_upper_bound = 1485020456, + attachment_timestamp_lower_bound = 1485020456, ), # Change @@ -254,18 +275,21 @@ def setUp(self): b'N9ACYCP99GZBSDK9CECFI9RAIH9BRCCAHAIAWEFAN' ), - current_index = 7, - last_index = 7, - value = 40, + current_index = 7, + last_index = 7, + value = 40, # These values are not relevant to the tests. - branch_transaction_hash = TransactionHash(b''), - bundle_hash = BundleHash(b''), - hash_ = TransactionHash(b''), - nonce = Hash(b''), - tag = Tag(b''), - timestamp = 1485020456, - trunk_transaction_hash = TransactionHash(b''), + branch_transaction_hash = TransactionHash(b''), + bundle_hash = BundleHash(b''), + hash_ = TransactionHash(b''), + nonce = Nonce(b''), + timestamp = 1485020456, + trunk_transaction_hash = TransactionHash(b''), + tag = Tag(b''), + attachment_timestamp = 1485020456, + attachment_timestamp_upper_bound = 1485020456, + attachment_timestamp_lower_bound = 1485020456, ), ]) @@ -411,8 +435,8 @@ def test_from_tryte_string(self): b'XRHWWTZFBXMPSQHEDFWZULBZFEOMNLRNIDQKDNNIELAOXOVMYEI9PGTKORV9IKTJZQ' b'UBQAWTKBKZ9NEZHBFIMCLV9TTNJNQZUIJDFPTTCTKBJRHAITVSKUCUEMD9M9SQJ999' b'999TKORV9IKTJZQUBQAWTKBKZ9NEZHBFIMCLV9TTNJNQZUIJDFPTTCTKBJRHAITVSK' - b'UCUEMD9M9SQJ999999999999999999999999999999999999999999999999999999' - b'999999999999999999999999999999999' + b'UCUEMD9M9SQJ999999999999999999999999999999999RKWEEVD99RKWEEVD99RKW' + b'EEVD99999999999999999999999999999' ) transaction = Transaction.from_tryte_string(trytes) @@ -423,8 +447,8 @@ def test_from_tryte_string(self): transaction.hash, Hash( - b'SYABNCYPLULQQBTDCUWJPVVMYNWHKEHGAZPKRBGE' - b'QKEHUIKJCHWGAUKLSYMDOUUBMXPKCPTNFWUFU9JKW', + b'JBVVEWEPYNZ9KRHNUUTRENXXAVXT9MKAVPAUQ9SJ' + b'NSIHDCPQM9LJHIZGXO9PIRWUUVBOXNCBE9XJGMOZF' ), ) @@ -479,7 +503,7 @@ def test_from_tryte_string(self): ) self.assertEqual(transaction.value, 0) - self.assertEqual(transaction.tag, Tag(b'999999999999999999999999999')) + self.assertEqual(transaction.legacy_tag, Tag(b'999999999999999999999999999')) self.assertEqual(transaction.timestamp, 1480690413) self.assertEqual(transaction.current_index, 1) self.assertEqual(transaction.last_index, 1) @@ -510,13 +534,17 @@ def test_from_tryte_string(self): b'QZUIJDFPTTCTKBJRHAITVSKUCUEMD9M9SQJ999999' ), ) + + self.assertEqual(transaction.tag, Tag(b'999999999999999999999999999')) + self.assertEqual(transaction.attachment_timestamp,1480690413) + self.assertEqual(transaction.attachment_timestamp_lower_bound,1480690413) + self.assertEqual(transaction.attachment_timestamp_upper_bound,1480690413) self.assertEqual( transaction.nonce, - Hash( - b'9999999999999999999999999999999999999999' - b'99999999999999999999999999999999999999999' + Nonce( + b'999999999999999999999999999' ), ) @@ -544,8 +572,8 @@ def test_as_tryte_string(self): transaction = Transaction( hash_ = TransactionHash( - b'QODOAEJHCFUYFTTPRONYSMMSFDNFWFX9UCMESVWA' - b'FCVUQYOIJGJMBMGQSFIAFQFMVECYIFXHRGHHEOTMK' + b'SYABNCYPLULQQBTDCUWJPVVMYNWHKEHGAZPKRBGE' + b'QKEHUIKJCHWGAUKLSYMDOUUBMXPKCPTNFWUFU9JKW' ), signature_message_fragment = @@ -588,12 +616,11 @@ def test_as_tryte_string(self): address = Address( - b'9999999999999999999999999999999999999999' b'99999999999999999999999999999999999999999' + b'9999999999999999999999999999999999999999' ), value = 0, - tag = Tag(b'999999999999999999999999999'), timestamp = 1480690413, current_index = 1, last_index = 1, @@ -615,18 +642,23 @@ def test_as_tryte_string(self): b'TKORV9IKTJZQUBQAWTKBKZ9NEZHBFIMCLV9TTNJN' b'QZUIJDFPTTCTKBJRHAITVSKUCUEMD9M9SQJ999999' ), + + tag = Tag(b'999999999999999999999999999'), + attachment_timestamp = 1480690413, + attachment_timestamp_lower_bound = 1480690413, + attachment_timestamp_upper_bound = 1480690413, + nonce = - Hash( - b'9999999999999999999999999999999999999999' - b'99999999999999999999999999999999999999999' + Nonce( + b'999999999999999999999999999' ), ) self.assertEqual( transaction.as_tryte_string(), - TransactionTrytes( + TransactionTrytes( b'GYPRVHBEZOOFXSHQBLCYW9ICTCISLHDBNMMVYD9JJHQMPQCTIQAQTJNNNJ9IDXLRCC' b'OYOXYPCLR9PBEY9ORZIEPPDNTI9CQWYZUOTAVBXPSBOFEQAPFLWXSWUIUSJMSJIIIZ' b'WIKIRH9GCOEVZFKNXEVCUCIIWZQCQEUVRZOCMEL9AMGXJNMLJCIA9UWGRPPHCEOPTS' @@ -666,7 +698,7 @@ def test_as_tryte_string(self): b'XRHWWTZFBXMPSQHEDFWZULBZFEOMNLRNIDQKDNNIELAOXOVMYEI9PGTKORV9IKTJZQ' b'UBQAWTKBKZ9NEZHBFIMCLV9TTNJNQZUIJDFPTTCTKBJRHAITVSKUCUEMD9M9SQJ999' b'999TKORV9IKTJZQUBQAWTKBKZ9NEZHBFIMCLV9TTNJNQZUIJDFPTTCTKBJRHAITVSK' - b'UCUEMD9M9SQJ999999999999999999999999999999999999999999999999999999' - b'999999999999999999999999999999999', + b'UCUEMD9M9SQJ999999999999999999999999999999999RKWEEVD99RKWEEVD99RKW' + b'EEVD99999999999999999999999999999' ), )