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

Commit

Permalink
moved regression test on top of dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Brord van Wierst committed Mar 11, 2020
1 parent 339a7d7 commit f060918
Show file tree
Hide file tree
Showing 13 changed files with 831 additions and 23 deletions.
199 changes: 199 additions & 0 deletions python-regression/tests/features/machine2/2_transaction_tests.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
Feature: Test transaction confirmation

Scenario: Zero Value Transactions are confirmed
In this test, a number of zero value transactions will be made to a specified node.
A milestone will be issued that references these transactions, and this should
confirm the transations.

Given "10" transactions are issued on "nodeA-m2" with:
|keys |values |type |
|address |TEST_ADDRESS |staticValue |
|value |0 |int |
|tag |ZERO9VALUE |string |

#In the default DB, the current index is 50. The next milestone issued should be 51.
When a milestone is issued with index 51 and references:
|keys |values |type |
|transactions |evaluate_and_send |responseValue |

#Give the node 10 seconds to solidify the milestone
And we wait "15" second/seconds

Then "getInclusionStates" is called on "nodeA-m2" with:
|keys |values |type |
|transactions |evaluate_and_send |responseValue |
|tips |latestMilestone |configValue |

And the response for "getInclusionStates" should return with:
|keys |values |type |
| states | True True True True True True True True True True | boolListMixed |


When a transaction is generated and attached on "nodeA-m2" with:
| keys | values | type |
| address | TEST_ADDRESS | staticValue |
| value | 0 | int |

And "getInclusionStates" is called on "nodeA-m2" with:
| keys | values | type |
| transactions | TEST_STORE_ADDRESS | staticList |
| tips | latestMilestone | configValue |

Then the response for "getInclusionStates" should return with:
| keys | values | type |
| states | False | boolListMixed |

Scenario: Value Transactions are confirmed
In this test, a number of value transactions will be made to a specified node.
A milestone will be issued that references these transactions, and this should
confirm the transations.

Given "10" transactions are issued on "nodeA-m2" with:
|keys |values |type |
|seed |THE_BANK |staticList |
|address |TEST_ADDRESS |staticValue |
|value |10 |int |
|tag |VALUE9TRANSACTION |string |

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

#Give the node time to solidify the milestone
And we wait "15" second/seconds

Then "getInclusionStates" is called on "nodeA-m2" with:
|keys |values |type |
|transactions |evaluate_and_send |responseValue |
|tips |latestMilestone |configValue |

And the response for "getInclusionStates" should return with:
|keys |values |type |
| states | True True True True True True True True True False | boolListMixed |

When a transaction is generated and attached on "nodeA-m2" with:
| keys | values | type |
| address | TEST_ADDRESS | staticValue |
| value | 0 | int |

And "getInclusionStates" is called on "nodeA-m2" with:
| keys | values | type |
| transactions | TEST_STORE_ADDRESS | staticList |
| tips | latestMilestone | configValue |

Then the response for "getInclusionStates" should return with:
| keys | values | type |
| states | False | boolListMixed |

Scenario: Valid value transfer bundle that doesnt affect ledger state
We want to ascertain that ledger state is always calculated correctly.
Even in the presence of a bundle that handles funds but without changing address

Then "1" transaction is issued on "nodeA-m2" with:
|keys |values |type |
|address |TEST_ADDRESS |staticValue |
|value |0 |int |
|tag |ZERO9VALUE |string |

Then a value transaction which does not move funds is generated referencing the previous transaction with:
|keys |values |type |
|seed |THE_BANK |staticList |
|value |100 |int |
|tag |FAKE9VALUE |string |

Then a transaction is issued referencing the previous transaction
|keys |values |type |
|seed |THE_BANK |staticList |
|address |TEST_ADDRESS |staticValue |
|value |11 |int |
|tag |VALUE9TRANSACTION |string |

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

#Give the node time to solidify the milestone
And we wait "15" second/seconds

Given "getBalances" is called on "nodeA-m2" with:
|keys |values |type |
|addresses |FAKE_SPEND_ADDRESSES |staticList |

Then the response for "getBalances" should return with:
|keys |values |type |
|balances |0 |int |

Scenario: Double spend only affects the ledger once
We want to ascertain that ledger state is always calculated correctly.
Even in the presence of double spend, the confirmed state should have spent only once

Then "1" transaction is issued on "nodeA-m2" with:
|keys |values |type |
|address |TEST_ADDRESS |staticValue |
|value |0 |int |
|tag |ZERO9VALUE |string |

Then a double spend is generated referencing the previous transaction with:
|keys |values |type |
|seed |DOUBLE_SPEND_SEED |staticValue |
|value |1000 |int |
|tag |FAKE9VALUE |string |

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

#Give the node time to solidify the milestone
And we wait "15" second/seconds

Given "getBalances" is called on "nodeA-m2" with:
|keys |values |type |
|addresses |DOUBLE_SPEND_ADDRESSES |staticList |

Then the response for "getBalances" should return with:
|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

Then "1" transaction is issued on "nodeA-m2" with:
|keys |values |type |
|address |TEST_ADDRESS |staticValue |
|value |0 |int |
|tag |ZERO9VALUE |string |

Then a split bundle is generated referencing the previous transaction with:
|keys |values |type |
|seed |SPLIT_BUNDLE_SEED |staticValue |
|value |2000 |int |
|tag |FAKE9VALUE |string |
|address |SPLIT_TO_ADDRESS |staticValue |

Then a transaction is issued referencing the previous transaction
|keys |values |type |
|seed |THE_BANK |staticList |
|address |TEST_ADDRESS |staticValue |
|value |11 |int |
|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:
|keys |values |type |
|transactions |previousTransaction |responseValue |

#Give the node time to solidify the milestone
And we wait "15" second/seconds

Given "getBalances" is called on "nodeA-m2" with:
|keys |values |type |
|addresses |SPLIT_TO_ADDRESS |staticList |

Then the response for "getBalances" should return with:
|keys |values |type |
|balances |2000 |intList |
6 changes: 3 additions & 3 deletions python-regression/tests/features/machine2/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defaults: &blowball_tests_config_files
db: https://s3.eu-central-1.amazonaws.com/iotaledger-dbfiles/dev/Blowball_Tests_db.tar
db_checksum: cf4da9fef58f74d8721eee7e2726f3321ecc2257ef111e6b8b2f4c348b40c980
defaults: &transaction_tests_config_files
db: https://s3.eu-central-1.amazonaws.com/iotaledger-dbfiles/dev/TransactionsTestsDb.tar
db_checksum: 4d94ae65b38ea0f8461d5ec24e5140b20eb86590d54e87e30aa9a72b26a131be
iri_args: ['--testnet-coordinator',
'EFPNKGPCBXXXLIBYFGIGYBYTFFPIOQVNNVVWTTIYZO9NFREQGVGDQQHUUQ9CLWAEMXVDFSSMOTGAHVIBH',
'--milestone-keys',
Expand Down
112 changes: 111 additions & 1 deletion python-regression/tests/features/machine3/3_transaction_tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Feature: Test transaction confirmation
| keys | values | type |
| states | False | boolListMixed |


Scenario: Value Transactions are confirmed
In this test, a number of value transactions will be made to a specified node.
A milestone will be issued that references these transactions, and this should
Expand Down Expand Up @@ -87,3 +86,114 @@ Feature: Test transaction confirmation
| keys | values | type |
| states | False | boolListMixed |

Scenario: Valid value transfer bundle that doesnt affect ledger state
We want to ascertain that ledger state is always calculated correctly.
Even in the presence of a bundle that handles funds but without changing address

Then "1" transaction is issued on "nodeA-m2" with:
|keys |values |type |
|address |TEST_ADDRESS |staticValue |
|value |0 |int |
|tag |ZERO9VALUE |string |

Then a value transaction which does not move funds is generated referencing the previous transaction with:
|keys |values |type |
|seed |THE_BANK |staticList |
|value |100 |int |
|tag |FAKE9VALUE |string |

Then a transaction is issued referencing the previous transaction
|keys |values |type |
|seed |THE_BANK |staticList |
|address |TEST_ADDRESS |staticValue |
|value |11 |int |
|tag |VALUE9TRANSACTION |string |

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

#Give the node time to solidify the milestone
And we wait "15" second/seconds

Given "getBalances" is called on "nodeA-m2" with:
|keys |values |type |
|addresses |FAKE_SPEND_ADDRESSES |staticList |

Then the response for "getBalances" should return with:
|keys |values |type |
|balances |0 |int |

Scenario: Double spend only affects the ledger once
We want to ascertain that ledger state is always calculated correctly.
Even in the presence of double spend, the confirmed state should have spent only once

Then "1" transaction is issued on "nodeA-m2" with:
|keys |values |type |
|address |TEST_ADDRESS |staticValue |
|value |0 |int |
|tag |ZERO9VALUE |string |

Then a double spend is generated referencing the previous transaction with:
|keys |values |type |
|seed |DOUBLE_SPEND_SEED |staticValue |
|value |1000 |int |
|tag |FAKE9VALUE |string |

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

#Give the node time to solidify the milestone
And we wait "15" second/seconds

Given "getBalances" is called on "nodeA-m2" with:
|keys |values |type |
|addresses |DOUBLE_SPEND_ADDRESSES |staticList |

Then the response for "getBalances" should return with:
|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

Then "1" transaction is issued on "nodeA-m2" with:
|keys |values |type |
|address |TEST_ADDRESS |staticValue |
|value |0 |int |
|tag |ZERO9VALUE |string |

Then a split bundle is generated referencing the previous transaction with:
|keys |values |type |
|seed |SPLIT_BUNDLE_SEED |staticValue |
|value |2000 |int |
|tag |FAKE9VALUE |string |
|address |SPLIT_TO_ADDRESS |staticValue |

Then a transaction is issued referencing the previous transaction
|keys |values |type |
|seed |THE_BANK |staticList |
|address |TEST_ADDRESS |staticValue |
|value |11 |int |
|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:
|keys |values |type |
|transactions |previousTransaction |responseValue |

#Give the node time to solidify the milestone
And we wait "15" second/seconds

Given "getBalances" is called on "nodeA-m2" with:
|keys |values |type |
|addresses |SPLIT_TO_ADDRESS |staticList |

Then the response for "getBalances" should return with:
|keys |values |type |
|balances |2000 |intList |
Loading

0 comments on commit f060918

Please sign in to comment.