Skip to content

Circuit: Add tests for orchard circuit#63

Merged
ConstanceBeguier merged 5 commits intozsa1from
circuit_test
Jun 1, 2023
Merged

Circuit: Add tests for orchard circuit#63
ConstanceBeguier merged 5 commits intozsa1from
circuit_test

Conversation

@ConstanceBeguier
Copy link
Collaborator

@ConstanceBeguier ConstanceBeguier commented May 26, 2023

Add some positive and negative tests for Orchard circuit

@ConstanceBeguier ConstanceBeguier requested a review from PaulLaux May 26, 2023 08:51
@what-the-diff
Copy link

what-the-diff bot commented May 26, 2023

PR Summary

  • Introduce new function for generating dummy circuit instances
    A new function called generate_dummy_circuit_instance has been added to replace the old one, enhancing code quality.
  • Modify test function and add split flag
    The test function generate_circuit_instance has undergone type changes, and a split flag parameter has been added in order to test the Orchard Circuit with split and merge cases.
  • Remove redundant code from a test function
    Unused code has been removed from tests::test1() for better readability and maintenance.
  • Implement test case for Orchard Circuit
    New test cases have been added to verify the correct functioning of the Orchard Circuit by checking if proofs can be verified correctly under valid conditions, and ensuring proofs cannot be verified when any parameter is incorrect.

Copy link
Collaborator

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

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

Approved with minor comment

src/circuit.rs Outdated
}

#[test]
fn test_orchard_circuit() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's call this orchard_circuit_negative_test()

@PaulLaux PaulLaux self-requested a review May 31, 2023 17:48
Copy link
Collaborator

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

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

Approved with minor comments.

let (circuit, instance) =
generate_circuit_instance(is_native_asset, split_flag, &mut rng);

check_proof_of_orchard_circuit(&circuit, &instance, true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very nice.

@ConstanceBeguier ConstanceBeguier merged commit bedc732 into zsa1 Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants