OpenST / mosaic-contracts

Mosaic-0: Gateways and anchors on top of Ethereum to scale DApps
https://discuss.openst.org/c/mosaic
MIT License
114 stars 31 forks source link

Write extensive tests for MerklePatriciaProof library #653

Closed 0xsarvesh closed 5 years ago

0xsarvesh commented 5 years ago

Step 0 should be implementing a way to generate random positive and negative proofs. With good permutations of node types and branch depths. That can be used to generate MPP proofs for unit tests. Input to the generator should be a given "form" of path. The input should define the order and number of branch and extension nodes. The input should also define whether there is a leaf node. It could correctly end on a branch node. Or it could be incorrectly constructed.

Step 1 should be generating good data sets for unit tests to cover many (edge) cases.

Step 2: add the unit tests.

At a later stage, we could use the generator code to implement something that continuously runs and tests MPP. We may also run fuzzy test suites (echidna) to find errors and/or interesting unit test cases.

Refer #652

schemar commented 5 years ago

Tests should contain positive and negative test cases. If it is possible to generate correct and incorrect proofs, then that would simplify this a lot.

schemar commented 5 years ago

Must be split into smaller issues.

benjaminbollen commented 5 years ago

@sarvesh, could you give this a go to write the separate tickets?