11import { SPONSORED_FPC_SALT } from '@aztec/constants' ;
22import { SponsoredFPCContractArtifact } from '@aztec/noir-contracts.js/SponsoredFPC' ;
33import { getPXEConfig } from '@aztec/pxe/server' ;
4- import { TestWallet } from '@aztec/test-wallet/server ' ;
4+ import { EmbeddedWallet } from '@aztec/wallets/embedded ' ;
55import fs from 'fs' ;
66import path from 'path' ;
77
@@ -39,12 +39,12 @@ const NETWORK = getNetworkFromArgs();
3939// Network-specific node URLs (hardcoded, not configurable)
4040const NETWORK_URLS : Record < string , string > = {
4141 local : 'http://localhost:8080' ,
42- devnet : 'https://v4-devnet-1 .aztec-labs.com' ,
42+ devnet : 'https://v4-devnet-2 .aztec-labs.com' ,
4343 nextnet : 'https://nextnet.aztec-labs.com' ,
4444} ;
4545
4646const AZTEC_NODE_URL = NETWORK_URLS [ NETWORK ] ;
47- const PROVER_ENABLED = process . env . PROVER_ENABLED === 'false' ? false : true ;
47+ const PROVER_ENABLED = NETWORK !== 'local' ; // Disable prover for local to speed up deployment
4848
4949const PASSWORD = process . env . PASSWORD ? process . env . PASSWORD : undefined ;
5050
@@ -57,16 +57,9 @@ const PXE_STORE_DIR = path.join(import.meta.dirname, '.pxe-store');
5757const INITIAL_TOKEN_BALANCE = 1_000_000_000n ;
5858
5959async function setupWallet ( aztecNode : AztecNode ) {
60- fs . rmSync ( PXE_STORE_DIR , { recursive : true , force : true } ) ;
61-
62- const config = getPXEConfig ( ) ;
63- //config.dataDirectory = PXE_STORE_DIR;
64- config . proverEnabled = PROVER_ENABLED ;
65-
66- return await TestWallet . create ( aztecNode , config , {
67- proverOrOptions : {
68- logger : createLogger ( 'bb:native' ) ,
69- } ,
60+ return await EmbeddedWallet . create ( aztecNode , {
61+ ephemeral : true ,
62+ pxeConfig : { ...getPXEConfig ( ) , proverEnabled : PROVER_ENABLED } ,
7063 } ) ;
7164}
7265
@@ -78,7 +71,7 @@ async function getSponsoredPFCContract() {
7871 return instance ;
7972}
8073
81- async function createAccount ( wallet : TestWallet ) {
74+ async function createAccount ( wallet : EmbeddedWallet ) {
8275 const salt = Fr . random ( ) ;
8376 const secretKey = Fr . random ( ) ;
8477 const signingKey = deriveSigningKey ( secretKey ) ;
@@ -105,7 +98,7 @@ async function createAccount(wallet: TestWallet) {
10598 } ;
10699}
107100
108- async function deployContracts ( wallet : TestWallet , deployer : AztecAddress ) {
101+ async function deployContracts ( wallet : EmbeddedWallet , deployer : AztecAddress ) {
109102 const sponsoredPFCContract = await getSponsoredPFCContract ( ) ;
110103 const paymentMethod = new SponsoredFeePaymentMethod ( sponsoredPFCContract . address ) ;
111104
@@ -148,21 +141,25 @@ async function deployContracts(wallet: TestWallet, deployer: AztecAddress) {
148141 const nonceForAuthwits = Fr . random ( ) ;
149142 const token0Authwit = await wallet . createAuthWit ( deployer , {
150143 caller : amm . address ,
151- action : gregoCoin . methods . transfer_to_public_and_prepare_private_balance_increase (
152- deployer ,
153- amm . address ,
154- INITIAL_TOKEN_BALANCE ,
155- nonceForAuthwits ,
156- ) ,
144+ call : await gregoCoin . methods
145+ . transfer_to_public_and_prepare_private_balance_increase (
146+ deployer ,
147+ amm . address ,
148+ INITIAL_TOKEN_BALANCE ,
149+ nonceForAuthwits ,
150+ )
151+ . getFunctionCall ( ) ,
157152 } ) ;
158153 const token1Authwit = await wallet . createAuthWit ( deployer , {
159154 caller : amm . address ,
160- action : gregoCoinPremium . methods . transfer_to_public_and_prepare_private_balance_increase (
161- deployer ,
162- amm . address ,
163- INITIAL_TOKEN_BALANCE ,
164- nonceForAuthwits ,
165- ) ,
155+ call : await gregoCoinPremium . methods
156+ . transfer_to_public_and_prepare_private_balance_increase (
157+ deployer ,
158+ amm . address ,
159+ INITIAL_TOKEN_BALANCE ,
160+ nonceForAuthwits ,
161+ )
162+ . getFunctionCall ( ) ,
166163 } ) ;
167164
168165 await new BatchCall ( wallet , [
0 commit comments