Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript Unittest For Ledger RPC #579

Closed
stechu opened this issue Jun 8, 2022 · 0 comments · Fixed by #603 or #628
Closed

Typescript Unittest For Ledger RPC #579

stechu opened this issue Jun 8, 2022 · 0 comments · Fixed by #603 or #628
Assignees
Labels
A-dolphin Area: Issues and PRs related to the Dolphin Runtime P-high Priority: High
Milestone

Comments

@stechu
Copy link
Collaborator

stechu commented Jun 8, 2022

Add a typescript unittest for ledger RPC.

Unit Test Spec

Use sudo to set the storage to random UTXO and void numbers: for each round add random number (1 to 2) of random (UTXO, EncryptedNote) pairs and a random number (0 to 2) of random VoidNumbers:

  • Shards: Add random (UTXO, EncryptedNote) pairs with a random first key and increasing second key
  • InsertionOrderedVoidNumbers: Add random VoidNumbers with increasing key

Checkpoint Description:

  • receiver_index: [usize; 256]: Lengths of each first key in Shards
  • sender_index: usize: Length of InsertionOrderedVoidNumber

Testing correctness of Normal Usage:

  1. Add random elements to ledger
  2. Select a random checkpoint that's below the current one
  3. Pull the latest state and check that it returns the data items (in order!) up to the checkpoint returned in the diff
  4. If should_continue == true then pull should be called again with the returned checkpoint (GOTO step 3)
  5. If it passes GOTO step 1

Testing correctness of Abnormal Usage: Same as the previous test except try to get from a checkpoint later than the current one. The pull should return nothing.

@stechu stechu added A-dolphin Area: Issues and PRs related to the Dolphin Runtime P-high Priority: High labels Jun 8, 2022
@stechu stechu added this to the v3.2.1 milestone Jun 10, 2022
@ghzlatarev ghzlatarev linked a pull request Jun 15, 2022 that will close this issue
10 tasks
@ghzlatarev ghzlatarev mentioned this issue Jun 15, 2022
10 tasks
@ghzlatarev ghzlatarev linked a pull request Jun 28, 2022 that will close this issue
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dolphin Area: Issues and PRs related to the Dolphin Runtime P-high Priority: High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants