From 53eb2d9821d8b8c18a18fe43ee503f93f84a67af Mon Sep 17 00:00:00 2001 From: Saleel Date: Wed, 31 Jan 2024 14:39:07 +0530 Subject: [PATCH] chore: add circuit tests to CI --- .github/workflows/action.yml | 43 ++++ .gitignore | 2 - emls/test_twitter.eml | 404 +++++++++++++++++++++++++++++++++++ 3 files changed, 447 insertions(+), 2 deletions(-) create mode 100644 emls/test_twitter.eml diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index e05a5fd..cb29dd3 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -1,5 +1,48 @@ +name: Proof of Twitter tests on: [push] jobs: + run_circuit_tests: + runs-on: ubuntu-latest + environment: development + steps: + - uses: actions/checkout@v3 + + # Circom installation from https://github.com/erhant/circomkit/blob/main/.github/workflows/tests.yml + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install --yes \ + build-essential \ + libgmp-dev \ + libsodium-dev \ + nasm \ + nlohmann-json3-dev + + - name: Set Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Download Circom Binary v2.1.5 + run: | + wget -qO /home/runner/work/circom https://github.com/iden3/circom/releases/download/v2.1.5/circom-linux-amd64 + chmod +x /home/runner/work/circom + sudo mv /home/runner/work/circom /bin/circom + + - name: Print Circom version + run: circom --version + + - name: Install Yarn dependencies + working-directory: ./packages/circuits + run: yarn install --immutable + + - name: Run Tests + working-directory: ./packages/circuits + run: yarn test + run_contract_tests: runs-on: ubuntu-latest environment: development diff --git a/.gitignore b/.gitignore index d11282e..0152107 100644 --- a/.gitignore +++ b/.gitignore @@ -55,8 +55,6 @@ node_modules.nosync *wallet* circuits/regexes/subject_regex* -# Files that never should be committed, but can be obtained by asking Aayush or generating them yourself -*.eml *_email.txt *email_cache.json *input.json diff --git a/emls/test_twitter.eml b/emls/test_twitter.eml new file mode 100644 index 0000000..5edae09 --- /dev/null +++ b/emls/test_twitter.eml @@ -0,0 +1,404 @@ +Delivered-To: zkemailverify@gmail.com +Received: by 2002:a2e:86cc:0:b0:2c5:4c8d:4156 with SMTP id n12csp458172ljj; + Fri, 17 Nov 2023 10:51:51 -0800 (PST) +X-Google-Smtp-Source: AGHT+IErAUsOShVy/SydlHmMfxGKmD3rPXtdOGPFOFsGwDAOa37CDTfbJWIRwIR5MQ9Wn3xvbZIB +X-Received: by 2002:a25:b088:0:b0:da0:365c:ff67 with SMTP id f8-20020a25b088000000b00da0365cff67mr357032ybj.12.1700247111386; + Fri, 17 Nov 2023 10:51:51 -0800 (PST) +ARC-Seal: i=1; a=rsa-sha256; t=1700247111; cv=none; + d=google.com; s=arc-20160816; + b=l2f3anN6X5STLWnzmfwQ+tLXCddnXIhBo01AYPbVjAY1NbooJMwPT0AZrBQEDPWRGA + DdW0i1GT2HxEx6O79HGalFQPjHla41Ua2YVO6/brj51n2yqBciC9FRyA5MrfiHGl57rI + YAnFSUEtXuCtyzKbu+uNViIomvWWSWn2q8tFX5gktvDYNY99XRJfeFxOAmVVOn7rcqw7 + sXzQJ7VrQns4O9NKqvL6S+Yz6N2RPsNj1ejPnM4J7KrbW/FEoMCXrtQvIQ0X/QCwL7EX + pKCIJAUySjQ5B2tLwNKdnBg7X3xbT6+XtVxUqzvkoC5+RpS5K+3M3a7GpZ8e6tzrvYk+ + H9NA== +ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; + h=feedback-id:message-id:mime-version:subject:to:from:date + :dkim-signature; + bh=YV00MHhJux22qGziFWSFbBXZ2W1TfXtQouchTjrBWjY=; + fh=Qucd5jr0BRTm6OpFMmwLcT3PVc7bDi7S8Smuj215K70=; + b=dSvVjMKtkrZSRvFriAAWR5GXradAalUxdC5ctI6d08R6Tmh9zDLJeZ8mlGNVo+tlDA + NGeNBj6NHCdqQ7sj5rdmKJ5LBot9wTQen7OYh8PGgeX34JlZdbNmOaDKVDFONaa9Hl8b + h2L6UE7goJTTe0S305TcfqfDPObp9rwGth3DNMsrOgRZKkCcxaG6NYjP/vF1kwhxmhgd + eGVNHzz3hY1YDqDOo9Z9jWZtvR83DUOY9CaNeZhKf0cmhAIpFO44OijcjtPuzKGAWi+Q + GR9QpB/A/WwlsuL1woE0FQrAESThrFeWq9YsC1OD3XCyNPgx6Ccwf77puY/dY69ENI0T + D04A== +ARC-Authentication-Results: i=1; mx.google.com; + dkim=pass header.i=@x.com header.s=dkim-202308 header.b=sMbjywAn; + spf=pass (google.com: domain of n06789e9b5c-e3cd8db39638424c-zkemailverify===gmail.com@bounce.x.com designates 199.16.156.147 as permitted sender) smtp.mailfrom="n06789e9b5c-e3cd8db39638424c-zkemailverify===gmail.com@bounce.x.com"; + dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=x.com +Return-Path: +Received: from spring-chicken-ah.x.com (spring-chicken-ah.twitter.com. [199.16.156.147]) + by mx.google.com with ESMTPS id j65-20020a255544000000b00da160dbe3a2si1317978ybb.355.2023.11.17.10.51.51 + for + (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); + Fri, 17 Nov 2023 10:51:51 -0800 (PST) +Received-SPF: pass (google.com: domain of n06789e9b5c-e3cd8db39638424c-zkemailverify===gmail.com@bounce.x.com designates 199.16.156.147 as permitted sender) client-ip=199.16.156.147; +Authentication-Results: mx.google.com; + dkim=pass header.i=@x.com header.s=dkim-202308 header.b=sMbjywAn; + spf=pass (google.com: domain of n06789e9b5c-e3cd8db39638424c-zkemailverify===gmail.com@bounce.x.com designates 199.16.156.147 as permitted sender) smtp.mailfrom="n06789e9b5c-e3cd8db39638424c-zkemailverify===gmail.com@bounce.x.com"; + dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=x.com +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=x.com; + s=dkim-202308; t=1700247111; + bh=YV00MHhJux22qGziFWSFbBXZ2W1TfXtQouchTjrBWjY=; + h=Date:From:To:Subject:MIME-Version:Content-Type:Message-ID; + b=sMbjywAnkykug8qkzKFezrQ02HaXhXunHMQUHURzUq9IEeeRREHgwhuafSA5ehJ2j + NWA2a+osbJ99EGhuBd75WIzYrWBVaehpeJ7Fbse7vzzSa49+lHvcIgZgxmwaES1yOr + sYm0QsOp0wDVX+wEifRTqqAtJwaped7tAjtl9EX5iZrqScnDi3B4qu+rriWpxymlRy + n/x3H5LUfKcipZARs9yz+1MVVlKJQ8a870Hr06mVIaxESxH38+++w2+IkgD/kl5DrE + EOLW4xlfZvAbWKrwzDND/5tHwLR+RwaJ1tEEbInOmFSeYk+MSsWP4as9cnmYK3ORGK + 5Cy/FY+YvwAGQ== +X-MSFBL: ZP95sgd7MYs5w6zVdVQBqAUgV5kHgEUV1shXV5/ku9E=|eyJiIjoiYXRsYS1iamo + tMjItc3IxLUJ1bGsuMTY3IiwiciI6InprZW1haWx2ZXJpZnlAZ21haWwuY29tIiw + iZyI6IkJ1bGsiLCJ1IjoiemtlbWFpbHZlcmlmeUBnbWFpbC5jb21AaWlkIyNlM2N + kOGRiMzk2Mzg0MjRjODI0NDQyZTdkYzE2N2ZiOEB1c2IjIzI0QDI5NkAxNjI0NDU + 3Nzc1ODk0OTg2NzU0QDBAMTExYjVjNjViYTMwMjM2MWQwOGMxY2U4MGRhZDQ0ODY + 0ODJjNzM0MCJ9 +Date: Fri, 17 Nov 2023 18:51:51 +0000 +From: Twitter +To: zk_practice +Subject: Password reset request +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_15608526_1728745155.1700247111137" +X-Twitter-CID: ibis2-password_reset_pin_based_email +Message-ID: +Feedback-ID: atla.c5bbd1c7e491b5023ff4b22a03711997:X + +------=_Part_15608526_1728745155.1700247111137 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 7bit + +Twitter + +Reset your password? + +If you requested a password reset for zktestemail, use the confirmation code below to complete the process. If you didn't make this request, ignore this email. + +> 9hngewaq + + +Getting a lot of password reset emails? +You can change your account settings to require personal information to reset your password. + +account settings +> https://twitter.com/settings/security + +------------------------ +Help +> https://support.twitter.com/articles/14663 + +Not my account +> https://twitter.com/account/not_my_account/1624457775894986754/42752-7AG53-170024?ut=1&cn=cGFzc3dvcmRfcmVzZXRfcGluX2Jhc2VkX2VtYWls + +Email security tips +> https://support.twitter.com/articles/204820-fake-twitter-emails + +X Corp. 1355 Market Street, Suite 900 San Francisco, CA 94103 + +------=_Part_15608526_1728745155.1700247111137 +Content-Type: text/html; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + +
 
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Reset your password?
If you requested a password reset for @zktestemail, use the conf= +irmation code below to complete the process. If you didn't make this reques= +t, ignore this email.
9hngewaq
Getting a lot of password reset emails?
You can change your account settings to require personal information to = +reset your password.
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Help  |  Not my account  |  Em= +ail security tips
This email was meant for @zktestemail
X Corp. 1355 Market Street, Suite 900= + San Francisco, CA 94103
+
+ + +------=_Part_15608526_1728745155.1700247111137-- \ No newline at end of file