Skip to content

Commit

Permalink
picking things from stacked branch
Browse files Browse the repository at this point in the history
  • Loading branch information
signorecello committed Mar 1, 2024
1 parent aa9e56a commit b9776ba
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 237 deletions.
98 changes: 0 additions & 98 deletions boxes/boxes/react/artifacts/BoxReact.ts

This file was deleted.

This file was deleted.

98 changes: 0 additions & 98 deletions boxes/boxes/vanilla/artifacts/Vanilla.ts

This file was deleted.

1 change: 0 additions & 1 deletion boxes/boxes/vanilla/dist/index.html

This file was deleted.

3 changes: 0 additions & 3 deletions boxes/boxes/vanilla/dist/main.js

This file was deleted.

12 changes: 0 additions & 12 deletions boxes/boxes/vanilla/dist/main.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion boxes/boxes/vanilla/dist/main.js.map

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion boxes/vanilla-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@aztec/aztec.js": "latest"
},
"devDependencies": {
"@playwright/test": "^1.41.2",
"@playwright/test": "1.42.0",
"@types/node": "^20.11.17",
"copy-webpack-plugin": "^11.0.0",
"html-webpack-plugin": "^5.6.0",
Expand Down
11 changes: 1 addition & 10 deletions boxes/vanilla-js/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
fullyParallel: true,
retries: 3,
workers: 1,
workers: process.env.CI ? 1 : 3,
reporter: 'list',
use: {
baseURL: 'http://127.0.0.1:5173',
Expand Down
16 changes: 5 additions & 11 deletions boxes/vanilla-js/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
import {
GrumpkinScalar,
createPXEClient,
AccountManager,
ContractDeployer,
Fr,
AccountWalletWithPrivateKey,
} from '@aztec/aztec.js';
import { GrumpkinScalar, createPXEClient, AccountManager, ContractDeployer, Fr, Wallet } from '@aztec/aztec.js';

import { SingleKeyAccountContract } from '@aztec/accounts/single_key';
import { VanillaContract } from '../artifacts/Vanilla';

const privateKey: GrumpkinScalar = GrumpkinScalar.random();
const pxe = createPXEClient(process.env.PXE_URL || 'http://localhost:8080');

const account = new AccountManager(pxe, privateKey, new SingleKeyAccountContract(privateKey));
let contract: any = null;
let wallet: AccountWalletWithPrivateKey | null = null;
let wallet: Wallet | null = null;

const setWait = (state: boolean): void =>
document.querySelectorAll('*').forEach((e: HTMLElement & HTMLButtonElement) => {
Expand All @@ -33,11 +27,11 @@ document.querySelector('#deploy').addEventListener('click', async ({ target }: a
.send({ contractAddressSalt: Fr.random() })
.deployed();
contract = await at(contractAddress, wallet);
setWait(false);

alert(`Contract deployed at ${contractAddress}`);

target.hidden = true;
document.querySelectorAll('#get, #set').forEach((e: HTMLButtonElement & HTMLFormElement) => (e.hidden = false));
setWait(false);
});

document.querySelector('#set').addEventListener('submit', async (e: Event) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test';

test('Deploying, setting, and getting a number', async ({ page }) => {
test.slow();
await page.goto('/');

const handleDialog = (expectedMessage: string) => {
Expand Down

0 comments on commit b9776ba

Please sign in to comment.