This repository has been archived by the owner on Aug 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brord van Wierst
committed
Mar 11, 2020
1 parent
339a7d7
commit f060918
Showing
13 changed files
with
831 additions
and
23 deletions.
There are no files selected for viewing
199 changes: 199 additions & 0 deletions
199
python-regression/tests/features/machine2/2_transaction_tests.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.