From cef03e7037d320b1175a948b549e6dd78a4814e3 Mon Sep 17 00:00:00 2001 From: "CZPR-PZIZKA\\pzizka" Date: Wed, 4 Jul 2018 09:53:39 +0200 Subject: [PATCH 1/2] fixes #191 --- examples/routingwrapper_pow.py | 2 +- examples/sandbox.py | 2 +- examples/send_transfer.py | 2 +- .../core/get_transactions_to_approve_test.py | 12 ++--- .../extended/promote_transaction_test.py | 20 +++---- test/commands/extended/replay_bundle_test.py | 24 ++++----- test/commands/extended/send_transfer_test.py | 52 +++++++++---------- test/commands/extended/send_trytes_test.py | 26 +++++----- 8 files changed, 70 insertions(+), 70 deletions(-) diff --git a/examples/routingwrapper_pow.py b/examples/routingwrapper_pow.py index 758f41db..e209c3c7 100644 --- a/examples/routingwrapper_pow.py +++ b/examples/routingwrapper_pow.py @@ -19,7 +19,7 @@ # Example of sending a transfer using the adapter. bundle = api.send_transfer( - depth = 100, + depth = 3, transfers = [ ProposedTransaction( # Recipient of the transfer. diff --git a/examples/sandbox.py b/examples/sandbox.py index 348834ff..239694a3 100644 --- a/examples/sandbox.py +++ b/examples/sandbox.py @@ -28,7 +28,7 @@ # For more information, see :py:meth:`Iota.send_transfer`. # noinspection SpellCheckingInspection iota.send_transfer( - depth = 100, + depth = 3, # One or more :py:class:`ProposedTransaction` objects to add to the # bundle. diff --git a/examples/send_transfer.py b/examples/send_transfer.py index 91b92b91..24eb564e 100644 --- a/examples/send_transfer.py +++ b/examples/send_transfer.py @@ -19,7 +19,7 @@ # For more information, see :py:meth:`Iota.send_transfer`. api.send_transfer( - depth = 100, + depth = 3, # One or more :py:class:`ProposedTransaction` objects to add to the # bundle. diff --git a/test/commands/core/get_transactions_to_approve_test.py b/test/commands/core/get_transactions_to_approve_test.py index 5875fdcf..bb56631f 100644 --- a/test/commands/core/get_transactions_to_approve_test.py +++ b/test/commands/core/get_transactions_to_approve_test.py @@ -32,7 +32,7 @@ def test_pass_happy_path_without_reference(self): Request is valid without reference. """ request = { - 'depth': 100, + 'depth': 3, } filter_ = self._filter(request) @@ -72,7 +72,7 @@ def test_fail_unexpected_parameters(self): """ self.assertFilterErrors( { - 'depth': 100, + 'depth': 3, # I knew I should have taken that left turn at Albuquerque. 'foo': 'bar', @@ -103,7 +103,7 @@ def test_fail_depth_float(self): """ self.assertFilterErrors( { - 'depth': 100.0, + 'depth': 3.0, }, { @@ -117,7 +117,7 @@ def test_fail_depth_string(self): """ self.assertFilterErrors( { - 'depth': '100', + 'depth': '3', }, { @@ -147,7 +147,7 @@ def test_fail_reference_wrong_type(self): { 'reference': 42, - 'depth': 100, + 'depth': 3, }, { @@ -163,7 +163,7 @@ def test_fail_reference_not_trytes(self): { 'reference': b'not valid; must contain only uppercase and "9"', - 'depth': 100, + 'depth': 3, }, { diff --git a/test/commands/extended/promote_transaction_test.py b/test/commands/extended/promote_transaction_test.py index 21f5b815..85c0f504 100644 --- a/test/commands/extended/promote_transaction_test.py +++ b/test/commands/extended/promote_transaction_test.py @@ -33,7 +33,7 @@ def test_pass_happy_path(self): Request is valid. """ request = { - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'transaction': TransactionHash(self.trytes1), } @@ -53,7 +53,7 @@ def test_pass_compatible_types(self): 'transaction': binary_type(self.trytes1), # These values must still be ints, however. - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }) @@ -88,7 +88,7 @@ def test_fail_unexpected_parameters(self): """ self.assertFilterErrors( { - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'transaction': TransactionHash(self.trytes1), @@ -109,7 +109,7 @@ def test_fail_transaction_null(self): { 'transaction': None, - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }, @@ -126,7 +126,7 @@ def test_fail_transaction_wrong_type(self): { 'transaction': 42, - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }, @@ -143,7 +143,7 @@ def test_fail_transaction_not_trytes(self): { 'transaction': b'not valid; must contain only uppercase and "9"', - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }, @@ -230,7 +230,7 @@ def test_fail_min_weight_magnitude_null(self): { 'minWeightMagnitude': None, - 'depth': 100, + 'depth': 3, 'transaction': TransactionHash(self.trytes1), }, @@ -248,7 +248,7 @@ def test_fail_min_weight_magnitude_string(self): # It's gotta be an int! 'minWeightMagnitude': '18', - 'depth': 100, + 'depth': 3, 'transaction': TransactionHash(self.trytes1), }, @@ -266,7 +266,7 @@ def test_fail_min_weight_magnitude_float(self): # Even with an empty fpart, float values are not valid. 'minWeightMagnitude': 18.0, - 'depth': 100, + 'depth': 3, 'transaction': TransactionHash(self.trytes1), }, @@ -283,7 +283,7 @@ def test_fail_min_weight_magnitude_too_small(self): { 'minWeightMagnitude': 0, - 'depth': 100, + 'depth': 3, 'transaction': TransactionHash(self.trytes1), }, diff --git a/test/commands/extended/replay_bundle_test.py b/test/commands/extended/replay_bundle_test.py index 27e14a89..d5b3a21f 100644 --- a/test/commands/extended/replay_bundle_test.py +++ b/test/commands/extended/replay_bundle_test.py @@ -34,7 +34,7 @@ def test_pass_happy_path(self): Request is valid. """ request = { - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'transaction': TransactionHash(self.trytes1), } @@ -54,7 +54,7 @@ def test_pass_compatible_types(self): 'transaction': binary_type(self.trytes1), # These values must still be ints, however. - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }) @@ -63,7 +63,7 @@ def test_pass_compatible_types(self): filter_.cleaned_data, { - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'transaction': TransactionHash(self.trytes1), }, @@ -89,7 +89,7 @@ def test_fail_unexpected_parameters(self): """ self.assertFilterErrors( { - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'transaction': TransactionHash(self.trytes1), @@ -110,7 +110,7 @@ def test_fail_transaction_null(self): { 'transaction': None, - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }, @@ -127,7 +127,7 @@ def test_fail_transaction_wrong_type(self): { 'transaction': 42, - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }, @@ -144,7 +144,7 @@ def test_fail_transaction_not_trytes(self): { 'transaction': b'not valid; must contain only uppercase and "9"', - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }, @@ -231,7 +231,7 @@ def test_fail_min_weight_magnitude_null(self): { 'minWeightMagnitude': None, - 'depth': 100, + 'depth': 3, 'transaction': TransactionHash(self.trytes1), }, @@ -249,7 +249,7 @@ def test_fail_min_weight_magnitude_string(self): # It's gotta be an int! 'minWeightMagnitude': '18', - 'depth': 100, + 'depth': 3, 'transaction': TransactionHash(self.trytes1), }, @@ -267,7 +267,7 @@ def test_fail_min_weight_magnitude_float(self): # Even with an empty fpart, float values are not valid. 'minWeightMagnitude': 18.0, - 'depth': 100, + 'depth': 3, 'transaction': TransactionHash(self.trytes1), }, @@ -284,7 +284,7 @@ def test_fail_min_weight_magnitude_too_small(self): { 'minWeightMagnitude': 0, - 'depth': 100, + 'depth': 3, 'transaction': TransactionHash(self.trytes1), }, @@ -616,7 +616,7 @@ def mock_send_trytes(_,request): mock_send_trytes, ): response = self.command( - depth = 100, + depth = 3, minWeightMagnitude = 18, transaction = bundle[0].hash, ) diff --git a/test/commands/extended/send_transfer_test.py b/test/commands/extended/send_transfer_test.py index aaedac8d..b1c1c14f 100644 --- a/test/commands/extended/send_transfer_test.py +++ b/test/commands/extended/send_transfer_test.py @@ -75,7 +75,7 @@ def test_pass_happy_path(self): """ request = { 'changeAddress': Address(self.trytes1), - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes2), @@ -120,7 +120,7 @@ def test_pass_compatible_types(self): self.transfer2 ], - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'securityLevel': None, }) @@ -131,7 +131,7 @@ def test_pass_compatible_types(self): { 'changeAddress': Address(self.trytes1), - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes2), 'reference': TransactionHash(self.trytes1), @@ -154,7 +154,7 @@ def test_pass_optional_parameters_omitted(self): Request omits optional parameters. """ filter_ = self._filter({ - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 13, 'seed': Seed(self.trytes2), @@ -173,7 +173,7 @@ def test_pass_optional_parameters_omitted(self): 'inputs': None, 'reference': None, - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 13, 'securityLevel': AddressGenerator.DEFAULT_SECURITY_LEVEL, 'seed': Seed(self.trytes2), @@ -206,7 +206,7 @@ def test_fail_unexpected_parameters(self): """ self.assertFilterErrors( { - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -229,7 +229,7 @@ def test_fail_seed_null(self): { 'seed': None, - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'transfers': [self.transfer1], }, @@ -247,7 +247,7 @@ def test_fail_seed_wrong_type(self): { 'seed': 42, - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'transfers': [self.transfer1], }, @@ -265,7 +265,7 @@ def test_fail_seed_not_trytes(self): { 'seed': b'not valid; must contain only uppercase and "9"', - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'transfers': [self.transfer1], }, @@ -283,7 +283,7 @@ def test_fail_transfers_wrong_type(self): { 'transfers': self.transfer1, - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), }, @@ -301,7 +301,7 @@ def test_fail_transfers_empty(self): { 'transfers': [], - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), }, @@ -327,7 +327,7 @@ def test_fail_transfers_contents_invalid(self): {'address': Address(self.trytes2), 'value': 42}, ], - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), }, @@ -346,7 +346,7 @@ def test_fail_change_address_wrong_type(self): { 'changeAddress': 42, - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -365,7 +365,7 @@ def test_fail_change_address_not_trytes(self): { 'changeAddress': b'not valid; must contain only uppercase and "9"', - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -385,7 +385,7 @@ def test_fail_inputs_wrong_type(self): # Must be an array, even if there's only one input. 'inputs': Address(self.trytes4), - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -416,7 +416,7 @@ def test_fail_inputs_contents_invalid(self): b'9' * 82, ], - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -476,7 +476,7 @@ def test_fail_depth_float(self): self.assertFilterErrors( { # Even with an empty fpart, floats are invalid. - 'depth': 100.0, + 'depth': 3.0, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), @@ -514,7 +514,7 @@ def test_fail_min_weight_magnitude_null(self): { 'minWeightMagnitude': None, - 'depth': 100, + 'depth': 3, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], }, @@ -533,7 +533,7 @@ def test_fail_min_weight_magnitude_string(self): # Nope; it's gotta be an int. 'minWeightMagnitude': '18', - 'depth': 100, + 'depth': 3, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], }, @@ -552,7 +552,7 @@ def test_fail_min_weight_magnitude_float(self): # Even with an empty fpart, floats are invalid. 'minWeightMagnitude': 18.0, - 'depth': 100, + 'depth': 3, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], }, @@ -570,7 +570,7 @@ def test_fail_min_weight_magnitude_too_small(self): { 'minWeightMagnitude': 0, - 'depth': 100, + 'depth': 3, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], }, @@ -589,7 +589,7 @@ def test_fail_reference_wrong_type(self): 'reference': 42, 'seed': Seed(self.trytes1), - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'transfers': [self.transfer1], }, @@ -608,7 +608,7 @@ def test_fail_reference_not_trytes(self): 'reference': b'not valid; must contain only uppercase and "9"', 'seed': Seed(self.trytes1), - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'transfers': [self.transfer1], }, @@ -624,7 +624,7 @@ def test_fail_wrong_security_level(self): """ self.assertFilterErrors( { - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -645,7 +645,7 @@ def test_fail_wrong_security_level_type(self): """ self.assertFilterErrors( { - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -747,7 +747,7 @@ def test_happy_path(self): mock_send_trytes, ): response = self.command( - depth = 100, + depth = 3, minWeightMagnitude = 18, seed = Seed.random(), diff --git a/test/commands/extended/send_trytes_test.py b/test/commands/extended/send_trytes_test.py index b2d4d02e..d90b7f52 100644 --- a/test/commands/extended/send_trytes_test.py +++ b/test/commands/extended/send_trytes_test.py @@ -33,7 +33,7 @@ def test_pass_happy_path(self): Request is valid. """ request = { - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'trytes': [ @@ -63,7 +63,7 @@ def test_pass_compatible_types(self): 'reference': binary_type(self.trytes2), # These still have to be ints, however. - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }) @@ -72,7 +72,7 @@ def test_pass_compatible_types(self): filter_.cleaned_data, { - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'trytes': [ @@ -103,7 +103,7 @@ def test_fail_request_unexpected_parameters(self): """ self.assertFilterErrors( { - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, 'trytes': [TryteString(self.trytes1)], @@ -194,7 +194,7 @@ def test_fail_min_weight_magnitude_null(self): { 'minWeightMagnitude': None, - 'depth': 100, + 'depth': 3, 'trytes': [TryteString(self.trytes1)], }, @@ -212,7 +212,7 @@ def test_fail_min_weight_magnitude_string(self): # It's gotta be an int! 'minWeightMagnitude': '18', - 'depth': 100, + 'depth': 3, 'trytes': [TryteString(self.trytes1)], }, @@ -230,7 +230,7 @@ def test_fail_min_weight_magnitude_float(self): # Even with an empty fpart, float values are not valid. 'minWeightMagnitude': 18.0, - 'depth': 100, + 'depth': 3, 'trytes': [TryteString(self.trytes1)], }, @@ -247,7 +247,7 @@ def test_fail_min_weight_magnitude_too_small(self): { 'minWeightMagnitude': 0, - 'depth': 100, + 'depth': 3, 'trytes': [TryteString(self.trytes1)], }, @@ -264,7 +264,7 @@ def test_fail_trytes_null(self): { 'trytes': None, - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }, @@ -283,7 +283,7 @@ def test_fail_trytes_wrong_type(self): # send. 'trytes': TryteString(self.trytes1), - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }, @@ -300,7 +300,7 @@ def test_fail_trytes_empty(self): { 'trytes': [], - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }, @@ -330,7 +330,7 @@ def test_fail_trytes_contents_invalid(self): b'9' * (TransactionTrytes.LEN + 1), ], - 'depth': 100, + 'depth': 3, 'minWeightMagnitude': 18, }, @@ -403,7 +403,7 @@ def test_happy_path(self): response = self.command( trytes = trytes, - depth = 100, + depth = 3, minWeightMagnitude = 18, ) From 3751bb02a3e15c3cdc60cbe2b98edf5a502a3e68 Mon Sep 17 00:00:00 2001 From: hribek25 Date: Thu, 5 Jul 2018 08:45:51 +0200 Subject: [PATCH 2/2] Reverting test changes --- .../core/get_transactions_to_approve_test.py | 12 ++--- .../extended/promote_transaction_test.py | 20 +++---- test/commands/extended/replay_bundle_test.py | 24 ++++----- test/commands/extended/send_transfer_test.py | 52 +++++++++---------- test/commands/extended/send_trytes_test.py | 26 +++++----- 5 files changed, 67 insertions(+), 67 deletions(-) diff --git a/test/commands/core/get_transactions_to_approve_test.py b/test/commands/core/get_transactions_to_approve_test.py index bb56631f..5875fdcf 100644 --- a/test/commands/core/get_transactions_to_approve_test.py +++ b/test/commands/core/get_transactions_to_approve_test.py @@ -32,7 +32,7 @@ def test_pass_happy_path_without_reference(self): Request is valid without reference. """ request = { - 'depth': 3, + 'depth': 100, } filter_ = self._filter(request) @@ -72,7 +72,7 @@ def test_fail_unexpected_parameters(self): """ self.assertFilterErrors( { - 'depth': 3, + 'depth': 100, # I knew I should have taken that left turn at Albuquerque. 'foo': 'bar', @@ -103,7 +103,7 @@ def test_fail_depth_float(self): """ self.assertFilterErrors( { - 'depth': 3.0, + 'depth': 100.0, }, { @@ -117,7 +117,7 @@ def test_fail_depth_string(self): """ self.assertFilterErrors( { - 'depth': '3', + 'depth': '100', }, { @@ -147,7 +147,7 @@ def test_fail_reference_wrong_type(self): { 'reference': 42, - 'depth': 3, + 'depth': 100, }, { @@ -163,7 +163,7 @@ def test_fail_reference_not_trytes(self): { 'reference': b'not valid; must contain only uppercase and "9"', - 'depth': 3, + 'depth': 100, }, { diff --git a/test/commands/extended/promote_transaction_test.py b/test/commands/extended/promote_transaction_test.py index 85c0f504..21f5b815 100644 --- a/test/commands/extended/promote_transaction_test.py +++ b/test/commands/extended/promote_transaction_test.py @@ -33,7 +33,7 @@ def test_pass_happy_path(self): Request is valid. """ request = { - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'transaction': TransactionHash(self.trytes1), } @@ -53,7 +53,7 @@ def test_pass_compatible_types(self): 'transaction': binary_type(self.trytes1), # These values must still be ints, however. - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }) @@ -88,7 +88,7 @@ def test_fail_unexpected_parameters(self): """ self.assertFilterErrors( { - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'transaction': TransactionHash(self.trytes1), @@ -109,7 +109,7 @@ def test_fail_transaction_null(self): { 'transaction': None, - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }, @@ -126,7 +126,7 @@ def test_fail_transaction_wrong_type(self): { 'transaction': 42, - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }, @@ -143,7 +143,7 @@ def test_fail_transaction_not_trytes(self): { 'transaction': b'not valid; must contain only uppercase and "9"', - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }, @@ -230,7 +230,7 @@ def test_fail_min_weight_magnitude_null(self): { 'minWeightMagnitude': None, - 'depth': 3, + 'depth': 100, 'transaction': TransactionHash(self.trytes1), }, @@ -248,7 +248,7 @@ def test_fail_min_weight_magnitude_string(self): # It's gotta be an int! 'minWeightMagnitude': '18', - 'depth': 3, + 'depth': 100, 'transaction': TransactionHash(self.trytes1), }, @@ -266,7 +266,7 @@ def test_fail_min_weight_magnitude_float(self): # Even with an empty fpart, float values are not valid. 'minWeightMagnitude': 18.0, - 'depth': 3, + 'depth': 100, 'transaction': TransactionHash(self.trytes1), }, @@ -283,7 +283,7 @@ def test_fail_min_weight_magnitude_too_small(self): { 'minWeightMagnitude': 0, - 'depth': 3, + 'depth': 100, 'transaction': TransactionHash(self.trytes1), }, diff --git a/test/commands/extended/replay_bundle_test.py b/test/commands/extended/replay_bundle_test.py index d5b3a21f..27e14a89 100644 --- a/test/commands/extended/replay_bundle_test.py +++ b/test/commands/extended/replay_bundle_test.py @@ -34,7 +34,7 @@ def test_pass_happy_path(self): Request is valid. """ request = { - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'transaction': TransactionHash(self.trytes1), } @@ -54,7 +54,7 @@ def test_pass_compatible_types(self): 'transaction': binary_type(self.trytes1), # These values must still be ints, however. - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }) @@ -63,7 +63,7 @@ def test_pass_compatible_types(self): filter_.cleaned_data, { - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'transaction': TransactionHash(self.trytes1), }, @@ -89,7 +89,7 @@ def test_fail_unexpected_parameters(self): """ self.assertFilterErrors( { - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'transaction': TransactionHash(self.trytes1), @@ -110,7 +110,7 @@ def test_fail_transaction_null(self): { 'transaction': None, - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }, @@ -127,7 +127,7 @@ def test_fail_transaction_wrong_type(self): { 'transaction': 42, - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }, @@ -144,7 +144,7 @@ def test_fail_transaction_not_trytes(self): { 'transaction': b'not valid; must contain only uppercase and "9"', - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }, @@ -231,7 +231,7 @@ def test_fail_min_weight_magnitude_null(self): { 'minWeightMagnitude': None, - 'depth': 3, + 'depth': 100, 'transaction': TransactionHash(self.trytes1), }, @@ -249,7 +249,7 @@ def test_fail_min_weight_magnitude_string(self): # It's gotta be an int! 'minWeightMagnitude': '18', - 'depth': 3, + 'depth': 100, 'transaction': TransactionHash(self.trytes1), }, @@ -267,7 +267,7 @@ def test_fail_min_weight_magnitude_float(self): # Even with an empty fpart, float values are not valid. 'minWeightMagnitude': 18.0, - 'depth': 3, + 'depth': 100, 'transaction': TransactionHash(self.trytes1), }, @@ -284,7 +284,7 @@ def test_fail_min_weight_magnitude_too_small(self): { 'minWeightMagnitude': 0, - 'depth': 3, + 'depth': 100, 'transaction': TransactionHash(self.trytes1), }, @@ -616,7 +616,7 @@ def mock_send_trytes(_,request): mock_send_trytes, ): response = self.command( - depth = 3, + depth = 100, minWeightMagnitude = 18, transaction = bundle[0].hash, ) diff --git a/test/commands/extended/send_transfer_test.py b/test/commands/extended/send_transfer_test.py index b1c1c14f..aaedac8d 100644 --- a/test/commands/extended/send_transfer_test.py +++ b/test/commands/extended/send_transfer_test.py @@ -75,7 +75,7 @@ def test_pass_happy_path(self): """ request = { 'changeAddress': Address(self.trytes1), - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes2), @@ -120,7 +120,7 @@ def test_pass_compatible_types(self): self.transfer2 ], - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'securityLevel': None, }) @@ -131,7 +131,7 @@ def test_pass_compatible_types(self): { 'changeAddress': Address(self.trytes1), - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes2), 'reference': TransactionHash(self.trytes1), @@ -154,7 +154,7 @@ def test_pass_optional_parameters_omitted(self): Request omits optional parameters. """ filter_ = self._filter({ - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 13, 'seed': Seed(self.trytes2), @@ -173,7 +173,7 @@ def test_pass_optional_parameters_omitted(self): 'inputs': None, 'reference': None, - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 13, 'securityLevel': AddressGenerator.DEFAULT_SECURITY_LEVEL, 'seed': Seed(self.trytes2), @@ -206,7 +206,7 @@ def test_fail_unexpected_parameters(self): """ self.assertFilterErrors( { - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -229,7 +229,7 @@ def test_fail_seed_null(self): { 'seed': None, - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'transfers': [self.transfer1], }, @@ -247,7 +247,7 @@ def test_fail_seed_wrong_type(self): { 'seed': 42, - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'transfers': [self.transfer1], }, @@ -265,7 +265,7 @@ def test_fail_seed_not_trytes(self): { 'seed': b'not valid; must contain only uppercase and "9"', - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'transfers': [self.transfer1], }, @@ -283,7 +283,7 @@ def test_fail_transfers_wrong_type(self): { 'transfers': self.transfer1, - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), }, @@ -301,7 +301,7 @@ def test_fail_transfers_empty(self): { 'transfers': [], - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), }, @@ -327,7 +327,7 @@ def test_fail_transfers_contents_invalid(self): {'address': Address(self.trytes2), 'value': 42}, ], - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), }, @@ -346,7 +346,7 @@ def test_fail_change_address_wrong_type(self): { 'changeAddress': 42, - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -365,7 +365,7 @@ def test_fail_change_address_not_trytes(self): { 'changeAddress': b'not valid; must contain only uppercase and "9"', - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -385,7 +385,7 @@ def test_fail_inputs_wrong_type(self): # Must be an array, even if there's only one input. 'inputs': Address(self.trytes4), - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -416,7 +416,7 @@ def test_fail_inputs_contents_invalid(self): b'9' * 82, ], - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -476,7 +476,7 @@ def test_fail_depth_float(self): self.assertFilterErrors( { # Even with an empty fpart, floats are invalid. - 'depth': 3.0, + 'depth': 100.0, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), @@ -514,7 +514,7 @@ def test_fail_min_weight_magnitude_null(self): { 'minWeightMagnitude': None, - 'depth': 3, + 'depth': 100, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], }, @@ -533,7 +533,7 @@ def test_fail_min_weight_magnitude_string(self): # Nope; it's gotta be an int. 'minWeightMagnitude': '18', - 'depth': 3, + 'depth': 100, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], }, @@ -552,7 +552,7 @@ def test_fail_min_weight_magnitude_float(self): # Even with an empty fpart, floats are invalid. 'minWeightMagnitude': 18.0, - 'depth': 3, + 'depth': 100, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], }, @@ -570,7 +570,7 @@ def test_fail_min_weight_magnitude_too_small(self): { 'minWeightMagnitude': 0, - 'depth': 3, + 'depth': 100, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], }, @@ -589,7 +589,7 @@ def test_fail_reference_wrong_type(self): 'reference': 42, 'seed': Seed(self.trytes1), - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'transfers': [self.transfer1], }, @@ -608,7 +608,7 @@ def test_fail_reference_not_trytes(self): 'reference': b'not valid; must contain only uppercase and "9"', 'seed': Seed(self.trytes1), - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'transfers': [self.transfer1], }, @@ -624,7 +624,7 @@ def test_fail_wrong_security_level(self): """ self.assertFilterErrors( { - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -645,7 +645,7 @@ def test_fail_wrong_security_level_type(self): """ self.assertFilterErrors( { - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'seed': Seed(self.trytes1), 'transfers': [self.transfer1], @@ -747,7 +747,7 @@ def test_happy_path(self): mock_send_trytes, ): response = self.command( - depth = 3, + depth = 100, minWeightMagnitude = 18, seed = Seed.random(), diff --git a/test/commands/extended/send_trytes_test.py b/test/commands/extended/send_trytes_test.py index d90b7f52..b2d4d02e 100644 --- a/test/commands/extended/send_trytes_test.py +++ b/test/commands/extended/send_trytes_test.py @@ -33,7 +33,7 @@ def test_pass_happy_path(self): Request is valid. """ request = { - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'trytes': [ @@ -63,7 +63,7 @@ def test_pass_compatible_types(self): 'reference': binary_type(self.trytes2), # These still have to be ints, however. - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }) @@ -72,7 +72,7 @@ def test_pass_compatible_types(self): filter_.cleaned_data, { - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'trytes': [ @@ -103,7 +103,7 @@ def test_fail_request_unexpected_parameters(self): """ self.assertFilterErrors( { - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, 'trytes': [TryteString(self.trytes1)], @@ -194,7 +194,7 @@ def test_fail_min_weight_magnitude_null(self): { 'minWeightMagnitude': None, - 'depth': 3, + 'depth': 100, 'trytes': [TryteString(self.trytes1)], }, @@ -212,7 +212,7 @@ def test_fail_min_weight_magnitude_string(self): # It's gotta be an int! 'minWeightMagnitude': '18', - 'depth': 3, + 'depth': 100, 'trytes': [TryteString(self.trytes1)], }, @@ -230,7 +230,7 @@ def test_fail_min_weight_magnitude_float(self): # Even with an empty fpart, float values are not valid. 'minWeightMagnitude': 18.0, - 'depth': 3, + 'depth': 100, 'trytes': [TryteString(self.trytes1)], }, @@ -247,7 +247,7 @@ def test_fail_min_weight_magnitude_too_small(self): { 'minWeightMagnitude': 0, - 'depth': 3, + 'depth': 100, 'trytes': [TryteString(self.trytes1)], }, @@ -264,7 +264,7 @@ def test_fail_trytes_null(self): { 'trytes': None, - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }, @@ -283,7 +283,7 @@ def test_fail_trytes_wrong_type(self): # send. 'trytes': TryteString(self.trytes1), - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }, @@ -300,7 +300,7 @@ def test_fail_trytes_empty(self): { 'trytes': [], - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }, @@ -330,7 +330,7 @@ def test_fail_trytes_contents_invalid(self): b'9' * (TransactionTrytes.LEN + 1), ], - 'depth': 3, + 'depth': 100, 'minWeightMagnitude': 18, }, @@ -403,7 +403,7 @@ def test_happy_path(self): response = self.command( trytes = trytes, - depth = 3, + depth = 100, minWeightMagnitude = 18, )