-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure compilation outside of the monorepo, improve webapp and bundling --------- Co-authored-by: thunkar <[email protected]>
- Loading branch information
Showing
28 changed files
with
1,132 additions
and
649 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ dist-ssr | |
|
||
artifacts/* | ||
codegenCache.json | ||
test-results/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { defineConfig, devices } from "@playwright/test"; | ||
|
||
export default defineConfig({ | ||
testDir: "./tests", | ||
testMatch: "**.spec.ts", | ||
fullyParallel: true, | ||
retries: 3, | ||
workers: process.env.CI ? 1 : 3, | ||
reporter: "list", | ||
use: { | ||
baseURL: "http://127.0.0.1:5173", | ||
trace: "on-first-retry", | ||
screenshot: "only-on-failure", | ||
video: "on-first-retry", | ||
}, | ||
expect: { | ||
timeout: 90000, | ||
}, | ||
projects: [ | ||
{ | ||
name: "chromium", | ||
use: { ...devices["Desktop Chrome"] }, | ||
}, | ||
{ | ||
name: "firefox", | ||
use: { ...devices["Desktop Firefox"] }, | ||
}, | ||
{ | ||
name: "webkit", | ||
use: { ...devices["Desktop Safari"] }, | ||
}, | ||
], | ||
webServer: { | ||
command: "yarn serve --host", | ||
port: 5173, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('test', async ({ page }) => { | ||
test.slow(); | ||
await page.goto('/'); | ||
|
||
// Deploy contract | ||
await page.getByRole('button', { name: 'Deploy dummy contract' }).click(); | ||
await expect(page.getByText('Deploying contract...')).toBeVisible(); | ||
await expect(page.getByText('Address:')).toBeVisible(); | ||
|
||
// Read number | ||
await page.getByRole('button', { name: 'Read' }).click(); | ||
await expect(page.getByText('Number is:')).toBeVisible(); | ||
|
||
// Set number | ||
await page.locator('#numberToSet').fill('1'); | ||
await page.getByRole('button', { name: 'Write' }).click(); | ||
await expect(page.getByText('Setting number...')).toBeVisible(); | ||
await expect(page.getByText('Number set to: 1')).toBeVisible(); | ||
|
||
// Read number | ||
await page.getByRole('button', { name: 'Read' }).click(); | ||
await expect(page.getByText('Number is: 1')).toBeVisible(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { AccountWallet, CompleteAddress, Contract, Fr, createLogger } from '@aztec/aztec.js'; | ||
import { BoxReactContract } from '../artifacts/BoxReact.js'; | ||
import { deployerEnv } from '../src/config.js'; | ||
|
||
const logger = createLogger('aztec:http-pxe-client'); | ||
|
||
describe('BoxReact Contract Tests', () => { | ||
let wallet: AccountWallet; | ||
let contract: Contract; | ||
const numberToSet = Fr.random(); | ||
let accountCompleteAddress: CompleteAddress; | ||
|
||
beforeAll(async () => { | ||
wallet = await deployerEnv.getWallet(); | ||
accountCompleteAddress = wallet.getCompleteAddress(); | ||
const salt = Fr.random(); | ||
|
||
contract = await BoxReactContract.deploy( | ||
wallet, | ||
Fr.random(), | ||
accountCompleteAddress.address | ||
) | ||
.send({ contractAddressSalt: salt }) | ||
.deployed(); | ||
|
||
logger.info(`L2 contract deployed at ${contract.address}`); | ||
}, 60000); | ||
|
||
test('Can set a number', async () => { | ||
logger.info(`${await wallet.getRegisteredAccounts()}`); | ||
|
||
await contract.methods | ||
.setNumber( | ||
numberToSet, | ||
accountCompleteAddress.address | ||
) | ||
.send() | ||
.wait(); | ||
}, 40000); | ||
|
||
test('Can read a number', async () => { | ||
const viewTxReceipt = await contract.methods.getNumber(accountCompleteAddress.address).simulate(); | ||
expect(numberToSet.toBigInt()).toEqual(viewTxReceipt.value); | ||
}, 40000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "vite", | ||
"name": "gaztec", | ||
"packageManager": "[email protected]", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
|
@@ -26,6 +27,7 @@ | |
"@mui/icons-material": "^6.3.1", | ||
"@mui/material": "^6.3.1", | ||
"@mui/styles": "^6.3.1", | ||
"nosleep.js": "^0.12.0", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"react-dropzone": "^14.3.5" | ||
|
@@ -42,8 +44,8 @@ | |
"globals": "^15.14.0", | ||
"typescript": "~5.7.3", | ||
"typescript-eslint": "^8.11.0", | ||
"vite": "^6.0.7", | ||
"vite-plugin-node-polyfills": "^0.22.0", | ||
"vite": "^6.0.11", | ||
"vite-plugin-node-polyfills": "^0.23.0", | ||
"vite-plugin-static-copy": "^2.2.0" | ||
} | ||
} |
Oops, something went wrong.