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

Create a regression test that checks balances in presence of invalid bundles #1590

@GalRogozinski

Description

Description

We want to ascertain that ledger state is always calculated correctly.
Even in the presence of invalid bundles being approved.

Motivation

The following fix:
#1588

Currently milestones are generated via a random walk, and we have a WalkValidator that ensures that we will not walk on an invalid bundle. So hopefully the above regression wouldn't have been such a disaster.

Still, the LedgerService that calculates the ledger state should be oblivious to that and ignore invalid bundles correctly.

Issues / Scenarios

A node recieves a milestone that approves invalid bundles.

How to test for this

Describe the issues/scenarios addressed by this test

  1. Given a node with a known ledger state.
  2. Then at least one valid transfer is being created that doesn't transfer funds.

Then do the following cases on a per test base

  1. And at least one valid transfer is being created that doesn't transfer funds. (back and forth in same bundle, https://devnet.thetangle.org/bundle/LVDFKLDYXVIRKCBOWLTOGLUSCFVXTRPVQJEKNHENABCNBIAVKHCTGVAYBHBTGONIQKEGHEIURSHLXPYUX)
  2. And at least double bundle as described below
  3. And at least one double spend case

And end all cases with the following:

  1. And at least one valid bundle that transfers funds.
  2. Then ascertain the correct ledger state

Unit tests:

  1. And at least one incomplete but valid bundle (missing an index) approves the former
  • Already exists: BundleValidatorTest.validateSemanticsOfBundleWithMissingTransaction
  1. And at least one invalid bundle approves the former. (send without input)
  • Already exists: BundleValidatorTest.validationModeAllWithInvalidBundle

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions