-
Notifications
You must be signed in to change notification settings - Fork 598
chore: improve boxes #11656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
chore: improve boxes #11656
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
166790a
ensure ouside compilation
Thunkar 01e0183
fix
Thunkar 0bf2c58
added testing for vite box
b9fa4e3
enabled vite testing in bootstrap
518f90d
on the way to mobile
143695e
mobile friendlier
b4cde89
Merge remote-tracking branch 'origin' into gj/improve_boxes
45a5668
fixes
e220bdd
more testing
dd8f477
fixes
d584a46
moved build to ensure aztec_js test works
8c24fe9
fixes
0250ae2
now usable
0a7b7a2
fixes
2de454f
ready
f509274
Merge branch 'master' into gj/improve_boxes
Thunkar f47209b
play nice with docker
e3f42aa
fix
b791257
fixed env
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems weird? Why vite specific needed?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vite parses env variables prefixed with
VITE_only, and then we have specific code to inject it back into the process.env polyfill (in the browser vite makes them available by default atimport.meta.envhttps://vite.dev/guide/env-and-mode#env-files
We certainly abuse
process.envin the codebase and need a more universal approach, but this is a stopgap solution in the meantime. It would be ideal to do something similar to what's done on the webpack bundles, but it's not possible due to this bug: davidmyersdev/vite-plugin-node-polyfills#83