Skip to content

Commit

Permalink
feat(circom): Add tests for RangeCheck circuit.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-nikolov96 committed Jun 27, 2023
1 parent a6a522e commit dfb10fe
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ pragma circom 2.1.5;

include "../../circuits/utils/arrays.circom";

<<<<<<< HEAD
<<<<<<< HEAD
component main = LessThanOrEqualBitsCheck(32);
=======
component main = Selector(8) // N must be equal to input["in"] length
>>>>>>> 7f6ce53 (feat(circom) Add tests for Selector circuit.)
=======
component main = LessThanOrEqualBitsCheck(32)
>>>>>>> 5452718 (fix(circom): Fix wrong main call for selector and less_than_eq_bits_check.)
5 changes: 5 additions & 0 deletions beacon-light-client/circom/test/range_check/circuit.circom
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pragma circom 2.1.5;

include "../../circuits/utils/numerical.circom";

component main = RangeCheck(32);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"in": ["1","2","3"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"out": "1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"in": ["3","2","1"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"out": "0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"in": ["2","2","3"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"out": "0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"in": ["1","2","2"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"out": "0"
}
4 changes: 2 additions & 2 deletions beacon-light-client/circom/test/selector/circuit.circom
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pragma circom 2.1.5;

include "../../circuits/utils/numerical.circom";
include "../../circuits/utils/arrays.circom";

component main = LessThanOrEqualBitsCheck(32)
component main = Selector(32) // N must be equal to input["in"] length

0 comments on commit dfb10fe

Please sign in to comment.