Skip to content

Commit ffc02de

Browse files
author
Esau
committed
address
abc
1 parent 86ecc2d commit ffc02de

File tree

4 files changed

+109
-1
lines changed

4 files changed

+109
-1
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Test Wallet Webapp Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
paths:
11+
- "test-wallet-webapp/**"
12+
- ".github/workflows/test-wallet-webapp-tests.yml"
13+
workflow_dispatch:
14+
15+
jobs:
16+
test-wallet-webapp-tests:
17+
name: Test Wallet Webapp Tests
18+
runs-on: ubuntu-latest
19+
env:
20+
AZTEC_VERSION: 3.0.0-devnet.5
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v5
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: "22"
30+
31+
- name: Enable Corepack
32+
run: corepack enable
33+
34+
- name: Set up Docker
35+
uses: docker/setup-buildx-action@v3
36+
37+
- name: Install Aztec CLI
38+
run: |
39+
curl -s https://install.aztec.network > tmp.sh
40+
NON_INTERACTIVE=1 bash tmp.sh
41+
rm tmp.sh
42+
43+
- name: Update path
44+
run: echo "$HOME/.aztec/bin" >> $GITHUB_PATH
45+
46+
- name: Set Aztec version and start sandbox
47+
run: |
48+
aztec-up ${{ env.AZTEC_VERSION }}
49+
docker tag aztecprotocol/aztec:${{ env.AZTEC_VERSION }} aztecprotocol/aztec:latest
50+
aztec start --sandbox &
51+
52+
- name: Wait for sandbox to be ready
53+
run: |
54+
echo "Waiting for sandbox to start..."
55+
MAX_RETRIES=60
56+
for i in $(seq 1 $MAX_RETRIES); do
57+
if curl -s http://localhost:8080/status >/dev/null 2>&1; then
58+
echo "✅ Sandbox is ready!"
59+
break
60+
fi
61+
if [ $i -eq $MAX_RETRIES ]; then
62+
echo "❌ Sandbox failed to start after $MAX_RETRIES attempts"
63+
exit 1
64+
fi
65+
echo "Waiting... ($i/$MAX_RETRIES)"
66+
sleep 2
67+
done
68+
69+
- name: Install project dependencies
70+
working-directory: test-wallet-webapp
71+
run: yarn install --frozen-lockfile
72+
73+
- name: Run lint
74+
working-directory: test-wallet-webapp
75+
run: yarn lint
76+
77+
- name: Build project
78+
working-directory: test-wallet-webapp
79+
run: yarn build
80+
81+
- name: Upload build artifacts if failed
82+
if: failure()
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: build-artifacts
86+
path: |
87+
test-wallet-webapp/dist/
88+
test-wallet-webapp/node_modules/.vite/
89+
retention-days: 7
90+
91+
- name: Cleanup
92+
if: always()
93+
run: |
94+
echo "Stopping Aztec sandbox..."
95+
pkill -f "aztec" || true
96+
docker stop $(docker ps -q) || true
97+
docker rm $(docker ps -a -q) || true

test-wallet-webapp/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
This tutorial demonstrates how to build a browser-based wallet application for Aztec using React and Vite. It showcases creating wallets, deploying contracts, and interacting with the Aztec network directly from a web browser.
44

5+
## Aztec Version Compatibility
6+
7+
This example is compatible with **Aztec v3.0.0-devnet.5**.
8+
9+
To set this version:
10+
11+
```bash
12+
aztec-up 3.0.0-devnet.5
13+
```
14+
515
## What You'll Build
616

717
A web application that demonstrates three core Aztec operations:

test-wallet-webapp/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function App() {
112112

113113
try {
114114
const contract = await PrivateVotingContract.at(contractAddress, wallet);
115-
await contract.methods.cast_vote(AztecAddress.random()).send({
115+
await contract.methods.cast_vote(1n).send({
116116
from: address
117117
}).wait();
118118

test-wallet-webapp/src/consoleInterceptor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
// Global console interceptor for capturing all logs
23
type LogCallback = (prefix: string, message: string) => void;
34

0 commit comments

Comments
 (0)