Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Commit

Permalink
fixed milestone index of split test, codacy and gal feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Brord van Wierst committed Mar 12, 2020
1 parent a5d3322 commit a0bb502
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Feature: Test Bootstrapping With LS
|keys |values |type |
|state |True |bool |


@getNodeInfo
Scenario: Old transactions are pruned
Takes a node with a large db and transaction pruning enabled, and checks to make sure that the transactions below
the pruning depth are no longer present.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Feature: Test transaction confirmation
|value |0 |int |
|tag |ZERO9VALUE |string |

Then a value transaction which does not move funds is generated referencing the previous transaction with:
Then a value bundle which moves funds back and forth from an address is generated referencing the previous transaction with:
|keys |values |type |
|seed |THE_BANK |staticList |
|value |100 |int |
Expand Down Expand Up @@ -138,7 +138,7 @@ Feature: Test transaction confirmation
Then a double spend is generated referencing the previous transaction with:
|keys |values |type |
|seed |DOUBLE_SPEND_SEED |staticValue |
|value |1000 |int |
|value |1000 |int |
|tag |FAKE9VALUE |string |

#In the default test, the latest sent index will be 53. The next milestone issued should be 54.
Expand All @@ -157,10 +157,10 @@ Feature: Test transaction confirmation
|keys |values |type |
|balances |1000 0 |intList |

@getNodeInfo
Scenario: Split transaction over 2 bundles
We want to ascertain that ledger state is always calculated correctly.
Even when there is a transaction used in 2 different bundles
Even when there is a transaction used in 2 different bundles. A split bundle is
a bundle that uses a transaction from another bundle.

Then "1" transaction is issued on "nodeA-m3" with:
|keys |values |type |
Expand All @@ -183,7 +183,7 @@ Feature: Test transaction confirmation
|tag |VALUE9TRANSACTION |string |

#In the default test, the latest sent index will be 54. The next milestone issued should be 55.
When a milestone is issued with index 51 and references:
When a milestone is issued with index 55 and references:
|keys |values |type |
|transactions |previousTransaction |responseValue |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def check_response_for_value(step, api_call):
if expected_value_key in response_values:
expected_value = expected_values[expected_value_key]
response_value = response_values[expected_value_key]

if isinstance(response_value, list) and isinstance(expected_value, list) != True and api_call != 'getTrytes' and api_call != 'getInclusionStates':
response_value = response_value[0]

Expand Down
6 changes: 3 additions & 3 deletions python-regression/tests/features/steps/transaction_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def create_incomplete_transfer(step):
set_world_object(node, 'incompleteTransactions', transaction_hash.hash)
set_previous_transaction(node, [transaction_hash.hash])

@step(r'a value transaction which does not move funds is generated referencing the previous transaction with:')
@step(r'Then a value bundle which moves funds back and forth from an address is generated referencing the previous transaction with:')
def fake_value_transaction(step):
"""
Creates a bundle that both receives and sends value between 2 addresses.
Expand Down Expand Up @@ -138,7 +138,7 @@ def fake_value_transaction(step):
def create_double_spent(step):
"""
Creates two bundles which both try to spend the same address.
This test fails if they are both confirmed
This test fails if they are both confirmed
:param step.hashes: A gherkin table present in the feature file specifying the
arguments and the associated type.
"""
Expand Down Expand Up @@ -364,7 +364,7 @@ def issue_a_milestone(step, index, node):

def set_previous_transaction(node, txHash):
set_world_object(node, 'previousTransaction', txHash)

def set_world_object(node, objectName, value):
if objectName not in world.responses:
world.responses[objectName] = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def custom_attach(trytes, mwm):
# put that back in the bundle
bundle.transactions[txn.current_index] = powed_txn
return bundle.as_tryte_strings()

def create_incomplete_bundle_trytes(address, tag):
"""
Creates an incomplete bundle by leaving out the first transaction
Expand Down

0 comments on commit a0bb502

Please sign in to comment.