diff --git a/circuits-circom/regexes/venmo/venmo_payee_id.circom b/circuits-circom/regexes/venmo/venmo_send_id.circom similarity index 99% rename from circuits-circom/regexes/venmo/venmo_payee_id.circom rename to circuits-circom/regexes/venmo/venmo_send_id.circom index 9f4bdd5ed..eda7db300 100644 --- a/circuits-circom/regexes/venmo/venmo_payee_id.circom +++ b/circuits-circom/regexes/venmo/venmo_send_id.circom @@ -2,7 +2,7 @@ pragma circom 2.1.5; include "@zk-email/circuits/regexes/regex_helpers.circom"; -template VenmoPayeeIdRegex(msg_bytes) { +template VenmoSendIdRegex(msg_bytes) { signal input msg[msg_bytes]; signal output out; diff --git a/circuits-circom/regexes/venmo/venmo_payee_id.json b/circuits-circom/regexes/venmo/venmo_send_id.json similarity index 100% rename from circuits-circom/regexes/venmo/venmo_payee_id.json rename to circuits-circom/regexes/venmo/venmo_send_id.json diff --git a/circuits-circom/test/mocks/venmo/test_venmo_payee_id.circom b/circuits-circom/test/mocks/venmo/test_venmo_payee_id.circom deleted file mode 100644 index 67e65b337..000000000 --- a/circuits-circom/test/mocks/venmo/test_venmo_payee_id.circom +++ /dev/null @@ -1,3 +0,0 @@ -include "../../../regexes/venmo/venmo_payee_id.circom"; - -component main = VenmoPayeeIdRegex(430); \ No newline at end of file diff --git a/circuits-circom/test/mocks/venmo/test_venmo_send_id.circom b/circuits-circom/test/mocks/venmo/test_venmo_send_id.circom new file mode 100644 index 000000000..8b4fb37e4 --- /dev/null +++ b/circuits-circom/test/mocks/venmo/test_venmo_send_id.circom @@ -0,0 +1,3 @@ +include "../../../regexes/venmo/venmo_send_id.circom"; + +component main = VenmoSendIdRegex(430); \ No newline at end of file diff --git a/circuits-circom/test/regexes/venmo/venmo_payee_id.spec.ts b/circuits-circom/test/regexes/venmo/venmo_send_id.spec.ts similarity index 96% rename from circuits-circom/test/regexes/venmo/venmo_payee_id.spec.ts rename to circuits-circom/test/regexes/venmo/venmo_send_id.spec.ts index 7aeb02360..8fb4574bd 100644 --- a/circuits-circom/test/regexes/venmo/venmo_payee_id.spec.ts +++ b/circuits-circom/test/regexes/venmo/venmo_send_id.spec.ts @@ -11,7 +11,7 @@ const wasm_tester = require("circom_tester").wasm; const fs = require('fs'); -describe("Venmo payee id", function () { +describe("Venmo send id", function () { jest.setTimeout(10 * 60 * 1000); // 10 minutes let cir; @@ -22,10 +22,10 @@ describe("Venmo payee id", function () { beforeAll(async () => { cir = await wasm_tester( - path.join(__dirname, "../../mocks/venmo/test_venmo_payee_id.circom"), + path.join(__dirname, "../../mocks/venmo/test_venmo_send_id.circom"), { include: path.join(__dirname, "../../../node_modules"), - output: path.join(__dirname, "../../../build/test_venmo_payee_id"), + output: path.join(__dirname, "../../../build/test_venmo_send_id"), recompile: true, verbose: true, } @@ -146,7 +146,7 @@ describe("Venmo payee id", function () { it("Should fail to match regex", async () => { const input = { "msg": textToAsciiArray( - "EEEEEEEEEEE\r\n" // Update to `p` + "EEEEEEEEEEE\r\n" + " \r\n" + " =20\r\n" + " \r\n" - + " \r\n" + + " \r\n" + "
\r\n" + "

" ) diff --git a/circuits-circom/venmo_send.circom b/circuits-circom/venmo_send.circom index c727f5e19..e5ca009ba 100644 --- a/circuits-circom/venmo_send.circom +++ b/circuits-circom/venmo_send.circom @@ -7,9 +7,9 @@ include "./utils/email_nullifier.circom"; include "./utils/extract.circom"; include "./utils/hash_sign_gen_rand.circom"; include "./regexes/common/from_regex.circom"; -include "./regexes/venmo/venmo_send_amount.circom"; include "./regexes/venmo/venmo_p2p_check.circom"; -include "./regexes/venmo/venmo_payee_id.circom"; +include "./regexes/venmo/venmo_send_amount.circom"; +include "./regexes/venmo/venmo_send_id.circom"; include "./regexes/venmo/venmo_timestamp.circom"; template VenmoSendEmail(max_header_bytes, max_body_bytes, n, k, pack_size) { @@ -100,7 +100,7 @@ template VenmoSendEmail(max_header_bytes, max_body_bytes, n, k, pack_size) { signal input venmo_payer_id_idx; signal reveal_payer_packed[max_venmo_id_packed_bytes]; - signal (payee_regex_out, payee_regex_reveal[max_body_bytes], payer_regex_reveal[max_body_bytes]) <== VenmoPayeeIdRegex(max_body_bytes)(in_body_padded); + signal (payee_regex_out, payee_regex_reveal[max_body_bytes], payer_regex_reveal[max_body_bytes]) <== VenmoSendIdRegex(max_body_bytes)(in_body_padded); signal is_found_payee <== IsZero()(payee_regex_out); is_found_payee === 0;