From d9e48cbdbbeffee78e6087da2725945622e84e6c Mon Sep 17 00:00:00 2001 From: Stefan Nikolov Date: Fri, 23 Jun 2023 19:16:41 +0300 Subject: [PATCH] feat(circom): Add tests to IsEqaulArrays --- .../circom/test/is_equal_arrays/circuit.circom | 5 +++++ .../circom/test/is_equal_arrays/data/case01/input.json | 1 + .../circom/test/is_equal_arrays/data/case01/output.json | 1 + .../circom/test/is_equal_arrays/data/case02/input.json | 1 + .../circom/test/is_equal_arrays/data/case02/output.json | 1 + .../circom/test/is_equal_arrays/data/case03/input.json | 1 + .../circom/test/is_equal_arrays/data/case03/output.json | 1 + 7 files changed, 11 insertions(+) create mode 100644 beacon-light-client/circom/test/is_equal_arrays/circuit.circom create mode 100644 beacon-light-client/circom/test/is_equal_arrays/data/case01/input.json create mode 100644 beacon-light-client/circom/test/is_equal_arrays/data/case01/output.json create mode 100644 beacon-light-client/circom/test/is_equal_arrays/data/case02/input.json create mode 100644 beacon-light-client/circom/test/is_equal_arrays/data/case02/output.json create mode 100644 beacon-light-client/circom/test/is_equal_arrays/data/case03/input.json create mode 100644 beacon-light-client/circom/test/is_equal_arrays/data/case03/output.json diff --git a/beacon-light-client/circom/test/is_equal_arrays/circuit.circom b/beacon-light-client/circom/test/is_equal_arrays/circuit.circom new file mode 100644 index 000000000..af7cb9c21 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/circuit.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.5; + +include "../../circuits/utils/arrays.circom"; + +component main = IsEqualArrays(3) // N must be equal to length in both arrays in input["in"] diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case01/input.json b/beacon-light-client/circom/test/is_equal_arrays/data/case01/input.json new file mode 100644 index 000000000..3f047d2c5 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case01/input.json @@ -0,0 +1 @@ +{"in": [["1","2","2"],["1","2","2"]]} diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case01/output.json b/beacon-light-client/circom/test/is_equal_arrays/data/case01/output.json new file mode 100644 index 000000000..f4209a168 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case01/output.json @@ -0,0 +1 @@ +{"out": "1"} diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case02/input.json b/beacon-light-client/circom/test/is_equal_arrays/data/case02/input.json new file mode 100644 index 000000000..23271aee5 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case02/input.json @@ -0,0 +1 @@ +{"in": [["100","2","2"],["1","2","101"]]} diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case02/output.json b/beacon-light-client/circom/test/is_equal_arrays/data/case02/output.json new file mode 100644 index 000000000..8b71f4187 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case02/output.json @@ -0,0 +1 @@ +{"out": "0"} diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case03/input.json b/beacon-light-client/circom/test/is_equal_arrays/data/case03/input.json new file mode 100644 index 000000000..9a6d16302 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case03/input.json @@ -0,0 +1 @@ +{"in": [["10","8","7"],["7","8","10"]]} diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case03/output.json b/beacon-light-client/circom/test/is_equal_arrays/data/case03/output.json new file mode 100644 index 000000000..8b71f4187 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case03/output.json @@ -0,0 +1 @@ +{"out": "0"}