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

[DRAFT] Test: (In)valid bundle regression: split test #1807

Open
wants to merge 25 commits into
base: dev
Choose a base branch
from

Conversation

kwek20
Copy link
Contributor

@kwek20 kwek20 commented Mar 24, 2020

Description

After the split test in #1784 was found to cause trouble with milestones, we decided to remove the test from the original PR and move it to this one.
Thus this PR should not be merged before the original.

Thus only commit from this PR should be: bed7f4a

Fixes #1590

Type of change

  • Enhancement (a non-breaking change which adds functionality)

Current blocker

Half the time a milestone selects both bundles and corrupts the state
Other half its all good and test succeeds, and like 1 in 20 there is an invalid mwm message from the node as return.

@kwek20 kwek20 force-pushed the invalid-bundle-regression-split branch from bed7f4a to fc6a005 Compare March 25, 2020 19:09
@kwek20 kwek20 force-pushed the invalid-bundle-regression-split branch from fc6a005 to 7b2619a Compare March 25, 2020 19:21
@@ -0,0 +1,186 @@
from iota.crypto.signing import KeyGenerator

from iota import Iota, ProposedTransaction, Address, Bundle, TransactionHash, \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# only updae the trunk reference
txn.trunk_transaction_hash = previoustx # the previous transaction
txn.attachment_timestamp = get_current_ms()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy Issue found: Trailing whitespace


api.broadcast_and_store(bundles[0].as_tryte_strings())
api.broadcast_and_store(bundles[1].as_tryte_strings())

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy Issue found: Trailing whitespace


argument_list = {'trunk_transaction': trunk2, 'branch_transaction': branch2,
'trytes': bundles[1].as_tryte_strings(), 'min_weight_magnitude': 14}
secondDoubleSpend = Transaction.from_tryte_string( transactions.attach_store_and_broadcast(api, argument_list).get('trytes')[0] )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a regression test that checks balances in presence of invalid bundles
2 participants