Skip to content
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

fix: aztec js e2e #10837

Merged
merged 7 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions yarn-project/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ build:
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
RUN ./bootstrap.sh


build-dev:
FROM +build
SAVE ARTIFACT /usr/src /usr/src
Expand Down Expand Up @@ -195,7 +194,17 @@ export-aztec-faucet:
# We care about creating a slimmed down e2e image because we have to serialize it from earthly to docker for running.
end-to-end-prod:
BUILD ../spartan/+charts
FROM +cli-base
FROM +build
# A fast build is not enough for the end-to-end tests, we still need to run webpack
RUN cd end-to-end && yarn build:web
# Now that the web is compiled, we can trim down the image further
RUN rm -rf \
../noir-projects \
../l1-contracts \
../barretenberg/ts/src \
../barretenberg/ts/dest/node-cjs \
../barretenberg/ts/dest/browser
Comment on lines +200 to +206
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd wait for @ludamad to validate this change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was previously applied to +cli-base, but I cannot do it before building the web (need the bb ts artifacts before the cleanup). Now this step uses +build as base and performs this step manually


RUN yarn workspaces focus @aztec/end-to-end @aztec/cli-wallet --production && yarn cache clean
COPY --dir +rollup-verifier-contract/usr/src/bb /usr/src
COPY --dir +build-dev/usr/src/noir-projects/noir-contracts /usr/src/noir-projects/noir-contracts
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/archiver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/aztec-faucet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/aztec-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@
"engines": {
"node": ">=18"
}
}
}
8 changes: 5 additions & 3 deletions yarn-project/aztec.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"./interfaces/pxe": "./dest/api/interfaces/pxe.js",
"./abi": "./dest/api/abi.js",
"./account": "./dest/api/account.js",
"./aztec_address": "./dest/api/aztec_address.js",
"./addresses": "./dest/api/addresses.js",
"./contracts": "./dest/contract/index.js",
"./deployment": "./dest/api/deployment.js",
"./entrypoint": "./dest/api/entrypoint.js",
"./eth_address": "./dest/api/eth_address.js",
Expand All @@ -19,7 +20,8 @@
"./log_id": "./dest/api/log_id.js",
"./rpc": "./dest/rpc_clients/index.js",
"./tx_hash": "./dest/api/tx_hash.js",
"./wallet": "./dest/api/wallet.js"
"./wallet": "./dest/api/wallet.js",
"./utils": "./dest/utils/index.js"
},
"typedocOptions": {
"entryPoints": [
Expand Down Expand Up @@ -119,4 +121,4 @@
"engines": {
"node": ">=18"
}
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { AztecAddress } from '@aztec/foundation/aztec-address';
export { CompleteAddress } from '@aztec/circuits.js';
16 changes: 10 additions & 6 deletions yarn-project/aztec.js/src/contract/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@
*
* @packageDocumentation
*/
export * from './contract.js';
export * from './contract_function_interaction.js';
export * from './sent_tx.js';
export * from './contract_base.js';
export * from './batch_call.js';
export { Contract } from './contract.js';
export {
ContractFunctionInteraction,
type ProfileResult,
type SendMethodOptions,
} from './contract_function_interaction.js';
export { DefaultWaitOpts, SentTx, type WaitOpts } from './sent_tx.js';
export { ContractBase, type ContractMethod, type ContractNotes, type ContractStorageLayout } from './contract_base.js';
export { BatchCall } from './batch_call.js';
export { type DeployOptions, DeployMethod } from './deploy_method.js';
export * from './deploy_sent_tx.js';
export { DeploySentTx } from './deploy_sent_tx.js';
24 changes: 4 additions & 20 deletions yarn-project/aztec.js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,12 @@
* ```typescript
* import { TxHash } from '@aztec.js/tx_hash'
* import { type ContractArtifact, type FunctionArtifact, FunctionSelector } from '@aztec/aztec.js/abi';
* import { AztecAddress } from '@aztec/aztec.js/aztec_address';
* import { AztecAddress } from '@aztec/aztec.js/addresses';
* import { EthAddress } from '@aztec/aztec.js/eth_address';
* ```
*
* TODO: Ultimately reimplement this mega exporter by mega exporting a granular api (then deprecate it).
*/
export {
BatchCall,
Contract,
ContractBase,
ContractFunctionInteraction,
DefaultWaitOpts,
DeployMethod,
DeploySentTx,
SentTx,
type ContractMethod,
type ContractNotes,
type ContractStorageLayout,
type DeployOptions,
type ProfileResult,
type SendMethodOptions,
type WaitOpts,
} from './contract/index.js';

export { ContractDeployer } from './deployment/index.js';

Expand Down Expand Up @@ -79,7 +62,6 @@ export { AccountWallet, AccountWalletWithSecretKey, SignerlessWallet, type Walle
// // TODO https://github.com/AztecProtocol/aztec-packages/issues/2632 --> FunctionSelector might not need to be exposed
// // here once the issue is resolved.
export {
AztecAddress,
ContractClassWithId,
ContractInstanceWithAddress,
EthAddress,
Expand Down Expand Up @@ -110,7 +92,6 @@ export {
AuthWitness,
Body,
Comparator,
CompleteAddress,
ContractClass2BlockL2Logs,
EncryptedLogPayload,
EpochProofQuote,
Expand Down Expand Up @@ -174,3 +155,6 @@ export { EthCheatCodes, deployL1Contract, deployL1Contracts, type DeployL1Contra
export * from './api/abi.js';
export * from './api/fee.js';
export * from './api/init.js';
// Granular export, even if not in the api folder
export * from './contract/index.js';
export * from './api/addresses.js';
2 changes: 1 addition & 1 deletion yarn-project/bb-prover/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/circuit-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/cli/src/utils/commands.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FunctionSelector } from '@aztec/aztec.js/abi';
import { AztecAddress } from '@aztec/aztec.js/aztec_address';
import { AztecAddress } from '@aztec/aztec.js/addresses';
import { EthAddress } from '@aztec/aztec.js/eth_address';
import { Fr } from '@aztec/aztec.js/fields';
import { LogId } from '@aztec/aztec.js/log_id';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ const pageLogger = createLogger('e2e:aztec_browser.js:web:page');
* To run the test, do the following:
* 1) Build the whole repository,
* 2) go to `yarn-project/end-to-end` and build the web packed package with `yarn build:web`,
* 3) start anvil: `anvil`,
* 4) if you intend to use a remotely running environment then export the URL of your PXE e.g.
* 3) if you intend to use a remotely running environment then export the URL of your PXE e.g.
* `export PXE_URL='http://localhost:8080'`
* 5) go to `yarn-project/end-to-end` and run the test: `yarn test aztec_js_browser`
* 6) If you get dependency error run `apt install libnss3 libatk1.0-0t64 libatk-bridge2.0-0t64 libcups2t64 libxdamage1 libxkbcommon0 libpango-1.0-0 libcairo2 libasound2t64`.
* 4) go to `yarn-project/end-to-end` and run the test: `yarn test aztec_js_browser`
* 5) If you get dependency error run `apt install libnss3 libatk1.0-0t64 libatk-bridge2.0-0t64 libcups2t64 libxdamage1 libxkbcommon0 libpango-1.0-0 libcairo2 libasound2t64`.
*
* NOTE 1: If you see the logs spammed with unexpected logs there is probably a chrome process with a webpage
* unexpectedly running in the background. Kill it with `killall chrome`
Expand Down
18 changes: 14 additions & 4 deletions yarn-project/end-to-end/src/web/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
export * from '@aztec/aztec.js';
export * from '@aztec/accounts/testing';
export * from '@aztec/accounts/single_key';
export * from '@aztec/accounts/schnorr';
export { Fr } from '@aztec/aztec.js/fields';
export { createPXEClient } from '@aztec/aztec.js/rpc';
export { getSchnorrAccount } from '@aztec/accounts/schnorr';
export { getUnsafeSchnorrAccount } from '@aztec/accounts/single_key';
export {
getDeployedTestAccountsWallets,
INITIAL_TEST_SECRET_KEYS,
INITIAL_TEST_SIGNING_KEYS,
INITIAL_TEST_ACCOUNT_SALTS,
} from '@aztec/accounts/testing';
export { AztecAddress, CompleteAddress } from '@aztec/aztec.js/addresses';
export { Contract, DeployMethod } from '@aztec/aztec.js/contracts';
export { contractArtifactFromBuffer } from '@aztec/aztec.js/abi';
export { generatePublicKey } from '@aztec/aztec.js/utils';

export { Buffer } from 'buffer/';
2 changes: 1 addition & 1 deletion yarn-project/l1-artifacts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
"generated"
],
"types": "./dest/index.d.ts"
}
}
2 changes: 1 addition & 1 deletion yarn-project/p2p/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/proof-verifier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@
"../../foundation/src/jest/setup.mjs"
]
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/protocol-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/prover-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/prover-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/sequencer-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@
"../../foundation/src/jest/setup.mjs"
]
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/validator-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion yarn-project/world-state/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@
"engines": {
"node": ">=18"
}
}
}
Loading