@aztec/end-to-end 0.0.1-commit.ec5f612 → 0.0.1-commit.ec7ac5448
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +19 -26
- package/dest/bench/utils.d.ts +1 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +6 -3
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +3 -2
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +15 -15
- package/dest/e2e_epochs/epochs_test.d.ts +3 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +8 -5
- package/dest/e2e_fees/fees_test.d.ts +1 -1
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +13 -6
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +4 -6
- package/dest/e2e_p2p/inactivity_slash_test.js +3 -3
- package/dest/e2e_p2p/p2p_network.d.ts +8 -9
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +33 -29
- package/dest/e2e_p2p/reqresp/utils.d.ts +1 -1
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
- package/dest/e2e_p2p/reqresp/utils.js +16 -3
- package/dest/e2e_p2p/shared.d.ts +25 -7
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +49 -44
- package/dest/e2e_token_contract/token_contract_test.d.ts +1 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +11 -11
- package/dest/fixtures/authwit_proxy.d.ts +3 -3
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
- package/dest/fixtures/authwit_proxy.js +4 -0
- package/dest/fixtures/e2e_prover_test.d.ts +4 -3
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +11 -16
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +5 -5
- package/dest/fixtures/setup.d.ts +17 -9
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +27 -21
- package/dest/fixtures/setup_p2p_test.d.ts +6 -6
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +8 -8
- package/dest/fixtures/token_utils.d.ts +1 -1
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +2 -5
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/shared/cross_chain_test_harness.d.ts +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +13 -13
- package/dest/shared/gas_portal_test_harness.js +2 -2
- package/dest/shared/jest_setup.js +32 -1
- package/dest/shared/submit-transactions.d.ts +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +14 -17
- package/dest/simulators/lending_simulator.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +4 -4
- package/dest/simulators/token_simulator.d.ts +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +4 -2
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +69 -38
- package/dest/spartan/tx_metrics.js +1 -1
- package/dest/spartan/utils/config.d.ts +4 -1
- package/dest/spartan/utils/config.d.ts.map +1 -1
- package/dest/spartan/utils/config.js +1 -0
- package/dest/spartan/utils/index.d.ts +2 -1
- package/dest/spartan/utils/index.d.ts.map +1 -1
- package/dest/spartan/utils/index.js +2 -0
- package/dest/spartan/utils/pod_logs.d.ts +25 -0
- package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
- package/dest/spartan/utils/pod_logs.js +74 -0
- package/dest/test-wallet/test_wallet.d.ts +24 -23
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +115 -80
- package/dest/test-wallet/worker_wallet.d.ts +4 -4
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet_schema.d.ts +4 -4
- package/package.json +43 -44
- package/src/bench/client_flows/client_flows_benchmark.ts +27 -10
- package/src/bench/utils.ts +7 -2
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +21 -20
- package/src/e2e_epochs/epochs_test.ts +17 -5
- package/src/e2e_fees/fees_test.ts +13 -6
- package/src/e2e_nested_contract/nested_contract_test.ts +6 -4
- package/src/e2e_p2p/inactivity_slash_test.ts +3 -3
- package/src/e2e_p2p/p2p_network.ts +47 -48
- package/src/e2e_p2p/reqresp/utils.ts +24 -3
- package/src/e2e_p2p/shared.ts +71 -59
- package/src/e2e_token_contract/token_contract_test.ts +16 -8
- package/src/fixtures/authwit_proxy.ts +4 -0
- package/src/fixtures/e2e_prover_test.ts +19 -18
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/setup.ts +43 -28
- package/src/fixtures/setup_p2p_test.ts +9 -9
- package/src/fixtures/token_utils.ts +1 -2
- package/src/legacy-jest-resolver.cjs +135 -0
- package/src/shared/cross_chain_test_harness.ts +13 -9
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/jest_setup.ts +36 -1
- package/src/shared/submit-transactions.ts +1 -4
- package/src/shared/uniswap_l1_l2.ts +35 -28
- package/src/simulators/lending_simulator.ts +8 -4
- package/src/simulators/token_simulator.ts +6 -2
- package/src/spartan/setup_test_wallets.ts +90 -35
- package/src/spartan/tx_metrics.ts +1 -1
- package/src/spartan/utils/config.ts +1 -0
- package/src/spartan/utils/index.ts +3 -0
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/test-wallet/test_wallet.ts +144 -99
- package/src/test-wallet/worker_wallet.ts +3 -2
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec/accounts/ecdsa';
|
|
2
2
|
import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { StubEcdsaAccountContractArtifact, createStubEcdsaAccount } from '@aztec/accounts/stub/ecdsa';
|
|
4
|
+
import { StubSchnorrAccountContractArtifact, createStubSchnorrAccount } from '@aztec/accounts/stub/schnorr';
|
|
5
|
+
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
5
6
|
import { SetPublicAuthwitContractInteraction, computeInnerAuthWitHashFromAction, isContractFunctionInteractionCallIntent, lookupValidity } from '@aztec/aztec.js/authorization';
|
|
6
7
|
import { AccountManager } from '@aztec/aztec.js/wallet';
|
|
8
|
+
import { TxSimulationResultWithAppOffset } from '@aztec/aztec.js/wallet';
|
|
9
|
+
import { DefaultEntrypoint } from '@aztec/entrypoints/default';
|
|
7
10
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
11
|
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
9
12
|
import { getPXEConfig } from '@aztec/pxe/config';
|
|
10
13
|
import { createPXE } from '@aztec/pxe/server';
|
|
11
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
12
14
|
import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
13
15
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
16
|
+
import { SimulationOverrides } from '@aztec/stdlib/tx';
|
|
14
17
|
import { mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
15
18
|
import { BaseWallet } from '@aztec/wallet-sdk/base-wallet';
|
|
16
19
|
import { AztecNodeProxy, ProvenTx } from './utils.js';
|
|
@@ -21,7 +24,7 @@ import { AztecNodeProxy, ProvenTx } from './utils.js';
|
|
|
21
24
|
*/ export class TestWallet extends BaseWallet {
|
|
22
25
|
nodeRef;
|
|
23
26
|
constructor(pxe, nodeRef){
|
|
24
|
-
super(pxe, nodeRef), this.nodeRef = nodeRef, this.accounts = new Map(), this.
|
|
27
|
+
super(pxe, nodeRef), this.nodeRef = nodeRef, this.accounts = new Map(), this.simulationMode = 'kernelless';
|
|
25
28
|
}
|
|
26
29
|
static async create(node, overridePXEConfig, options = {
|
|
27
30
|
loggers: {}
|
|
@@ -42,94 +45,111 @@ import { AztecNodeProxy, ProvenTx } from './utils.js';
|
|
|
42
45
|
}
|
|
43
46
|
createSchnorrAccount(secret, salt, signingKey) {
|
|
44
47
|
signingKey = signingKey ?? deriveSigningKey(secret);
|
|
45
|
-
|
|
48
|
+
return this.createAccount({
|
|
46
49
|
secret,
|
|
47
50
|
salt,
|
|
51
|
+
type: 'schnorr',
|
|
48
52
|
contract: new SchnorrAccountContract(signingKey)
|
|
49
|
-
};
|
|
50
|
-
return this.createAccount(accountData);
|
|
53
|
+
});
|
|
51
54
|
}
|
|
52
55
|
createECDSARAccount(secret, salt, signingKey) {
|
|
53
|
-
|
|
56
|
+
return this.createAccount({
|
|
54
57
|
secret,
|
|
55
58
|
salt,
|
|
59
|
+
type: 'ecdsasecp256r1',
|
|
56
60
|
contract: new EcdsaRAccountContract(signingKey)
|
|
57
|
-
};
|
|
58
|
-
return this.createAccount(accountData);
|
|
61
|
+
});
|
|
59
62
|
}
|
|
60
63
|
createECDSAKAccount(secret, salt, signingKey) {
|
|
61
|
-
|
|
64
|
+
return this.createAccount({
|
|
62
65
|
secret,
|
|
63
66
|
salt,
|
|
67
|
+
type: 'ecdsasecp256k1',
|
|
64
68
|
contract: new EcdsaKAccountContract(signingKey)
|
|
65
|
-
};
|
|
66
|
-
return this.createAccount(accountData);
|
|
69
|
+
});
|
|
67
70
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Builds contract overrides for all provided addresses by replacing their account contracts with stub implementations.
|
|
73
|
+
*/ async buildAccountOverrides(addresses) {
|
|
74
|
+
const accounts = await this.getAccounts();
|
|
75
|
+
const contracts = {};
|
|
76
|
+
const filtered = accounts.filter((acc)=>addresses.some((addr)=>addr.equals(acc.item)));
|
|
77
|
+
for (const account of filtered){
|
|
78
|
+
const address = account.item;
|
|
79
|
+
const originalAccount = await this.getAccountFromAddress(address);
|
|
80
|
+
const completeAddress = originalAccount.getCompleteAddress();
|
|
81
|
+
const contractInstance = await this.pxe.getContractInstance(completeAddress.address);
|
|
82
|
+
if (!contractInstance) {
|
|
83
|
+
throw new Error(`No contract instance found for address: ${completeAddress.address} during account override building. This is a bug!`);
|
|
84
|
+
}
|
|
85
|
+
const stubArtifact = this.getStubArtifactFor(address);
|
|
86
|
+
const stubConstructorArgs = this.getTypeFor(address) === 'schnorr' ? [
|
|
87
|
+
Fr.ZERO,
|
|
88
|
+
Fr.ZERO
|
|
89
|
+
] : [
|
|
90
|
+
Buffer.alloc(32),
|
|
91
|
+
Buffer.alloc(32)
|
|
92
|
+
];
|
|
93
|
+
const stubInstance = await getContractInstanceFromInstantiationParams(stubArtifact, {
|
|
94
|
+
salt: Fr.random(),
|
|
95
|
+
constructorArgs: stubConstructorArgs
|
|
96
|
+
});
|
|
97
|
+
contracts[address.toString()] = {
|
|
98
|
+
instance: stubInstance,
|
|
99
|
+
artifact: stubArtifact
|
|
100
|
+
};
|
|
77
101
|
}
|
|
78
|
-
|
|
79
|
-
const instance = await getContractInstanceFromInstantiationParams(StubAccountContractArtifact, {
|
|
80
|
-
salt: Fr.random()
|
|
81
|
-
});
|
|
82
|
-
return {
|
|
83
|
-
account: stubAccount,
|
|
84
|
-
instance,
|
|
85
|
-
artifact: StubAccountContractArtifact
|
|
86
|
-
};
|
|
102
|
+
return contracts;
|
|
87
103
|
}
|
|
88
104
|
accounts;
|
|
105
|
+
getTypeFor(address) {
|
|
106
|
+
return this.accounts.get(address.toString())?.type ?? 'schnorr';
|
|
107
|
+
}
|
|
108
|
+
getStubArtifactFor(address) {
|
|
109
|
+
return this.getTypeFor(address) === 'schnorr' ? StubSchnorrAccountContractArtifact : StubEcdsaAccountContractArtifact;
|
|
110
|
+
}
|
|
111
|
+
getStubAccountFor(address, completeAddress) {
|
|
112
|
+
return this.getTypeFor(address) === 'schnorr' ? createStubSchnorrAccount(completeAddress) : createStubEcdsaAccount(completeAddress);
|
|
113
|
+
}
|
|
89
114
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
enableSimulatedSimulations() {
|
|
98
|
-
this.simulatedSimulations = true;
|
|
99
|
-
}
|
|
100
|
-
disableSimulatedSimulations() {
|
|
101
|
-
this.simulatedSimulations = false;
|
|
115
|
+
* Controls how the test wallet simulates transactions:
|
|
116
|
+
* - `kernelless`: Skips kernel circuits but uses the real account contract. Default.
|
|
117
|
+
* - `kernelless-override`: Skips kernels and replaces the account with a stub that doesn't do authwit validation.
|
|
118
|
+
* - `full`: Uses real kernel circuits and real account contracts. Slow!
|
|
119
|
+
*/ simulationMode;
|
|
120
|
+
setSimulationMode(mode) {
|
|
121
|
+
this.simulationMode = mode;
|
|
102
122
|
}
|
|
103
123
|
setMinFeePadding(value) {
|
|
104
124
|
this.minFeePadding = value ?? 0.5;
|
|
105
125
|
}
|
|
106
126
|
getAccountFromAddress(address) {
|
|
107
|
-
|
|
108
|
-
if (
|
|
109
|
-
account = new SignerlessAccount();
|
|
110
|
-
} else {
|
|
111
|
-
account = this.accounts.get(address?.toString() ?? '');
|
|
112
|
-
}
|
|
113
|
-
if (!account) {
|
|
127
|
+
const entry = this.accounts.get(address?.toString() ?? '');
|
|
128
|
+
if (!entry) {
|
|
114
129
|
throw new Error(`Account not found in wallet for address: ${address}`);
|
|
115
130
|
}
|
|
116
|
-
return Promise.resolve(account);
|
|
131
|
+
return Promise.resolve(entry.account);
|
|
117
132
|
}
|
|
118
133
|
getAccounts() {
|
|
119
|
-
return Promise.resolve(Array.from(this.accounts.values()).map((
|
|
134
|
+
return Promise.resolve(Array.from(this.accounts.values()).map((entry)=>({
|
|
120
135
|
alias: '',
|
|
121
|
-
item:
|
|
136
|
+
item: entry.account.getAddress()
|
|
122
137
|
})));
|
|
123
138
|
}
|
|
124
139
|
async createAccount(accountData) {
|
|
125
140
|
const secret = accountData?.secret ?? Fr.random();
|
|
126
141
|
const salt = accountData?.salt ?? Fr.random();
|
|
142
|
+
const type = accountData?.type ?? 'schnorr';
|
|
127
143
|
const contract = accountData?.contract ?? new SchnorrAccountContract(GrumpkinScalar.random());
|
|
128
144
|
const accountManager = await AccountManager.create(this, secret, contract, salt);
|
|
129
145
|
const instance = accountManager.getInstance();
|
|
130
146
|
const artifact = await contract.getContractArtifact();
|
|
131
147
|
await this.registerContract(instance, artifact, secret);
|
|
132
|
-
|
|
148
|
+
const address = accountManager.address.toString();
|
|
149
|
+
this.accounts.set(address, {
|
|
150
|
+
account: await accountManager.getAccount(),
|
|
151
|
+
type
|
|
152
|
+
});
|
|
133
153
|
return accountManager;
|
|
134
154
|
}
|
|
135
155
|
lookupValidity(onBehalfOf, intent, witness) {
|
|
@@ -154,44 +174,59 @@ import { AztecNodeProxy, ProvenTx } from './utils.js';
|
|
|
154
174
|
}
|
|
155
175
|
return account.createAuthWit(intentInnerHash, chainInfo);
|
|
156
176
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return super.simulateViaEntrypoint(executionPayload, from, feeOptions, scopes, skipTxValidation, skipFeeEnforcement);
|
|
163
|
-
}
|
|
177
|
+
async simulateViaEntrypoint(executionPayload, opts) {
|
|
178
|
+
const { from, feeOptions, additionalScopes, skipTxValidation, skipFeeEnforcement } = opts;
|
|
179
|
+
const scopes = this.scopesFrom(from, additionalScopes);
|
|
180
|
+
const skipKernels = this.simulationMode !== 'full';
|
|
181
|
+
const useOverride = this.simulationMode === 'kernelless-override';
|
|
164
182
|
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
165
|
-
const executionOptions = {
|
|
166
|
-
txNonce: Fr.random(),
|
|
167
|
-
cancellable: this.cancellableTransactions,
|
|
168
|
-
feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions
|
|
169
|
-
};
|
|
170
183
|
const finalExecutionPayload = feeExecutionPayload ? mergeExecutionPayloads([
|
|
171
184
|
feeExecutionPayload,
|
|
172
185
|
executionPayload
|
|
173
186
|
]) : executionPayload;
|
|
174
|
-
const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(from);
|
|
175
187
|
const chainInfo = await this.getChainInfo();
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
188
|
+
let overrides;
|
|
189
|
+
let txRequest;
|
|
190
|
+
if (useOverride) {
|
|
191
|
+
const accountOverrides = await this.buildAccountOverrides(scopes);
|
|
192
|
+
overrides = new SimulationOverrides(accountOverrides);
|
|
193
|
+
}
|
|
194
|
+
if (from === NO_FROM) {
|
|
195
|
+
const entrypoint = new DefaultEntrypoint();
|
|
196
|
+
txRequest = await entrypoint.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo);
|
|
197
|
+
} else {
|
|
198
|
+
let fromAccount;
|
|
199
|
+
if (useOverride) {
|
|
200
|
+
const originalAccount = await this.getAccountFromAddress(from);
|
|
201
|
+
fromAccount = this.getStubAccountFor(from, originalAccount.getCompleteAddress());
|
|
202
|
+
} else {
|
|
203
|
+
fromAccount = await this.getAccountFromAddress(from);
|
|
181
204
|
}
|
|
182
|
-
|
|
183
|
-
|
|
205
|
+
const executionOptions = {
|
|
206
|
+
txNonce: Fr.random(),
|
|
207
|
+
cancellable: this.cancellableTransactions,
|
|
208
|
+
// If from is an address, feeOptions include the way the account contract should handle the fee payment
|
|
209
|
+
feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions
|
|
210
|
+
};
|
|
211
|
+
txRequest = await fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo, executionOptions);
|
|
212
|
+
}
|
|
213
|
+
const result = await this.pxe.simulateTx(txRequest, {
|
|
184
214
|
simulatePublic: true,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
},
|
|
215
|
+
skipKernels,
|
|
216
|
+
skipFeeEnforcement,
|
|
217
|
+
skipTxValidation,
|
|
218
|
+
overrides,
|
|
190
219
|
scopes
|
|
191
220
|
});
|
|
221
|
+
const appCallOffset = await this.computeAppCallOffset(from, feeOptions);
|
|
222
|
+
return TxSimulationResultWithAppOffset.fromResultAndOffset(result, appCallOffset);
|
|
192
223
|
}
|
|
193
224
|
async proveTx(exec, opts) {
|
|
194
|
-
const fee = await this.completeFeeOptions(
|
|
225
|
+
const fee = await this.completeFeeOptions({
|
|
226
|
+
from: opts.from,
|
|
227
|
+
feePayer: exec.feePayer,
|
|
228
|
+
gasSettings: opts.fee?.gasSettings
|
|
229
|
+
});
|
|
195
230
|
const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee);
|
|
196
231
|
const txProvingResult = await this.pxe.proveTx(txRequest, this.scopesFrom(opts.from, opts.additionalScopes));
|
|
197
232
|
return new ProvenTx(this.aztecNode, await txProvingResult.toTx(), txProvingResult.getOffchainEffects(), txProvingResult.stats);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CallIntent, IntentInnerHash } from '@aztec/aztec.js/authorization';
|
|
2
2
|
import type { InteractionWaitOptions, SendReturn } from '@aztec/aztec.js/contracts';
|
|
3
|
-
import type { Aliased, AppCapabilities, BatchResults, BatchedMethod, ContractClassMetadata, ContractMetadata, ExecuteUtilityOptions, PrivateEvent, PrivateEventFilter, ProfileOptions, SendOptions, SimulateOptions, Wallet, WalletCapabilities } from '@aztec/aztec.js/wallet';
|
|
3
|
+
import type { Aliased, AppCapabilities, BatchResults, BatchedMethod, ContractClassMetadata, ContractMetadata, ExecuteUtilityOptions, PrivateEvent, PrivateEventFilter, ProfileOptions, SendOptions, SimulateOptions, TxSimulationResultWithAppOffset, Wallet, WalletCapabilities } from '@aztec/aztec.js/wallet';
|
|
4
4
|
import type { ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
5
5
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
6
|
import type { PXEConfig } from '@aztec/pxe/config';
|
|
@@ -8,7 +8,7 @@ import type { ContractArtifact, EventMetadataDefinition, FunctionCall } from '@a
|
|
|
8
8
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
9
9
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
10
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
11
|
-
import type { ExecutionPayload, TxProfileResult,
|
|
11
|
+
import type { ExecutionPayload, TxProfileResult, UtilityExecutionResult } from '@aztec/stdlib/tx';
|
|
12
12
|
import { Tx } from '@aztec/stdlib/tx';
|
|
13
13
|
/**
|
|
14
14
|
* Wallet implementation that offloads all work to a worker thread.
|
|
@@ -36,7 +36,7 @@ export declare class WorkerWallet implements Wallet {
|
|
|
36
36
|
getAddressBook(): Promise<Aliased<AztecAddress>[]>;
|
|
37
37
|
getAccounts(): Promise<Aliased<AztecAddress>[]>;
|
|
38
38
|
registerContract(instance: ContractInstanceWithAddress, artifact?: ContractArtifact, secretKey?: Fr): Promise<ContractInstanceWithAddress>;
|
|
39
|
-
simulateTx(exec: ExecutionPayload, opts: SimulateOptions): Promise<
|
|
39
|
+
simulateTx(exec: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResultWithAppOffset>;
|
|
40
40
|
executeUtility(call: FunctionCall, opts: ExecuteUtilityOptions): Promise<UtilityExecutionResult>;
|
|
41
41
|
profileTx(exec: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult>;
|
|
42
42
|
sendTx<W extends InteractionWaitOptions = undefined>(exec: ExecutionPayload, opts: SendOptions<W>): Promise<SendReturn<W>>;
|
|
@@ -49,4 +49,4 @@ export declare class WorkerWallet implements Wallet {
|
|
|
49
49
|
/** Shuts down the worker thread and closes the transport. */
|
|
50
50
|
stop(): Promise<void>;
|
|
51
51
|
}
|
|
52
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
52
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2VyX3dhbGxldC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3Qtd2FsbGV0L3dvcmtlcl93YWxsZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLGVBQWUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ2pGLE9BQU8sS0FBSyxFQUFFLHNCQUFzQixFQUFFLFVBQVUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ3BGLE9BQU8sS0FBSyxFQUNWLE9BQU8sRUFDUCxlQUFlLEVBQ2YsWUFBWSxFQUNaLGFBQWEsRUFDYixxQkFBcUIsRUFDckIsZ0JBQWdCLEVB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QUVwRjtJQUVELDZEQUE2RDtJQUN2RCxJQUFJLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxDQUcxQjtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker_wallet.d.ts","sourceRoot":"","sources":["../../src/test-wallet/worker_wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAAK,EACV,OAAO,EACP,eAAe,EACf,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,eAAe,EACf,MAAM,EACN,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAOzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"worker_wallet.d.ts","sourceRoot":"","sources":["../../src/test-wallet/worker_wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAA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C,CAE5E;IAED,wFAAwF;IACxF,eAAe,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAE3D;IAED,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,GAAG,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAEzG;IAED,mBAAmB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAE1E;IAED,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,SAAS,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAEpF;IAED,6DAA6D;IACvD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAG1B;CACF"}
|
|
@@ -11,10 +11,10 @@ export declare const WorkerWalletSchema: {
|
|
|
11
11
|
getAddressBook: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], z.ZodTypeDef, any>>;
|
|
12
12
|
getAccounts: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], z.ZodTypeDef, any>>;
|
|
13
13
|
registerContract: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/contract").ContractInstanceWithAddress, z.ZodTypeDef, any>, artifact?: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodType<import("@aztec/stdlib/abi").ContractArtifact | undefined, z.ZodTypeDef, any>> | undefined, secretKey?: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodType<import("@aztec/foundation/schemas").Fr | undefined, z.ZodTypeDef, any>> | undefined], z.ZodUnknown>, z.ZodType<import("@aztec/stdlib/contract").ContractInstanceWithAddress, z.ZodTypeDef, any>>;
|
|
14
|
-
simulateTx: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, z.ZodTypeDef, any>, opts: z.ZodType<import("@aztec/aztec.js/wallet").SimulateOptions, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/
|
|
14
|
+
simulateTx: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, z.ZodTypeDef, any>, opts: z.ZodType<import("@aztec/aztec.js/wallet").SimulateOptions, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/aztec.js/wallet").TxSimulationResultWithAppOffset, z.ZodTypeDef, any>>;
|
|
15
15
|
executeUtility: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/abi").FunctionCall, z.ZodTypeDef, any>, opts: z.ZodType<import("@aztec/aztec.js/wallet").ExecuteUtilityOptions, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/stdlib/tx").UtilityExecutionResult, z.ZodTypeDef, any>>;
|
|
16
16
|
profileTx: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, z.ZodTypeDef, any>, opts: z.ZodType<import("@aztec/aztec.js/wallet").ProfileOptions, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/stdlib/tx").TxProfileResult, z.ZodTypeDef, any>>;
|
|
17
|
-
sendTx: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, z.ZodTypeDef, any>, opts: z.ZodType<import("@aztec/aztec.js/wallet").SendOptions<import("@aztec/aztec.js/contracts").InteractionWaitOptions>, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/
|
|
17
|
+
sendTx: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, z.ZodTypeDef, any>, opts: z.ZodType<import("@aztec/aztec.js/wallet").SendOptions<import("@aztec/aztec.js/contracts").InteractionWaitOptions>, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/aztec.js/contracts").TxSendResultImmediate | import("@aztec/aztec.js/contracts").TxSendResultMined<import("@aztec/stdlib/tx").TxReceipt>, z.ZodTypeDef, any>>;
|
|
18
18
|
createAuthWit: z.ZodFunction<z.ZodTuple<[z.ZodType<AztecAddress, z.ZodTypeDef, any>, messageHashOrIntent: z.ZodType<import("@aztec/aztec.js/authorization").CallIntent | import("@aztec/aztec.js/authorization").IntentInnerHash, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/stdlib/auth-witness").AuthWitness, z.ZodTypeDef, any>>;
|
|
19
19
|
requestCapabilities: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/aztec.js/wallet").AppCapabilities, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/aztec.js/wallet").WalletCapabilities, z.ZodTypeDef, any>>;
|
|
20
20
|
batch: z.ZodFunction<z.ZodTuple<[z.ZodType<readonly import("@aztec/aztec.js/wallet").BatchedMethod[], z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<readonly import("@aztec/aztec.js/wallet").BatchedMethodResultWrapper<import("@aztec/aztec.js/wallet").BatchedMethod>[], z.ZodTypeDef, any>>;
|
|
@@ -82,7 +82,7 @@ export declare const WorkerWalletSchema: {
|
|
|
82
82
|
extraHashedArgs: any[];
|
|
83
83
|
feePayer?: any;
|
|
84
84
|
}>, z.ZodObject<{
|
|
85
|
-
from: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
|
|
85
|
+
from: z.ZodUnion<[import("@aztec/foundation/schemas").ZodFor<AztecAddress>, z.ZodLiteral<"NO_FROM">]>;
|
|
86
86
|
authWitnesses: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodArray<z.ZodType<import("@aztec/stdlib/auth-witness").AuthWitness, any, string>, "many">>;
|
|
87
87
|
capsules: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodArray<z.ZodType<import("@aztec/stdlib/tx").Capsule, any, string>, "many">>;
|
|
88
88
|
fee: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodObject<{
|
|
@@ -213,7 +213,7 @@ export declare const WorkerWalletSchema: {
|
|
|
213
213
|
}>]>>;
|
|
214
214
|
additionalScopes: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodArray<import("@aztec/foundation/schemas").ZodFor<AztecAddress>, "many">>;
|
|
215
215
|
}, "strip", z.ZodTypeAny, {
|
|
216
|
-
from: AztecAddress;
|
|
216
|
+
from: "NO_FROM" | AztecAddress;
|
|
217
217
|
authWitnesses?: import("@aztec/stdlib/auth-witness").AuthWitness[] | undefined;
|
|
218
218
|
capsules?: import("@aztec/stdlib/tx").Capsule[] | undefined;
|
|
219
219
|
fee?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.ec7ac5448",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"build:dev": "../scripts/tsc.sh --watch",
|
|
13
13
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
14
14
|
"test:with-alerts": "./scripts/test-with-alerts.sh",
|
|
15
|
-
"test:e2e": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000
|
|
15
|
+
"test:e2e": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000",
|
|
16
16
|
"test:e2e-docker": "./scripts/run_test.sh simple",
|
|
17
17
|
"test:e2e-no-docker": "echo 'The command test:e2e-no-docker is now the same as test:e2e. You can now run this dropping the no-docker suffix.'; yarn test:e2e",
|
|
18
|
-
"test:profile": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 0x --output-dir \"flame_graph/{pid}.0x\" -- node --experimental-vm-modules ../node_modules/jest/bin/jest.js --runInBand --testTimeout=300000
|
|
18
|
+
"test:profile": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 0x --output-dir \"flame_graph/{pid}.0x\" -- node --experimental-vm-modules ../node_modules/jest/bin/jest.js --runInBand --testTimeout=300000",
|
|
19
19
|
"serve:flames": "python3 -m http.server --directory \"flame_graph\" 8000",
|
|
20
|
-
"test:debug": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --inspect --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000
|
|
20
|
+
"test:debug": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --inspect --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000",
|
|
21
21
|
"test:integration": "concurrently -k -s first -c reset,dim -n test,anvil \"yarn test:integration:run\" \"anvil\"",
|
|
22
22
|
"test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --no-cache --runInBand --config jest.integration.config.json",
|
|
23
23
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests src/fixtures",
|
|
@@ -26,45 +26,44 @@
|
|
|
26
26
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
30
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
31
|
-
"@aztec/aztec": "0.0.1-commit.
|
|
32
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
33
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
34
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
35
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
36
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
37
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
38
|
-
"@aztec/bot": "0.0.1-commit.
|
|
39
|
-
"@aztec/cli": "0.0.1-commit.
|
|
40
|
-
"@aztec/constants": "0.0.1-commit.
|
|
41
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
42
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
43
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
44
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
45
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
46
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
47
|
-
"@aztec/
|
|
48
|
-
"@aztec/
|
|
49
|
-
"@aztec/noir-
|
|
50
|
-
"@aztec/noir-
|
|
51
|
-
"@aztec/noir-
|
|
52
|
-
"@aztec/
|
|
53
|
-
"@aztec/
|
|
54
|
-
"@aztec/
|
|
55
|
-
"@aztec/prover-
|
|
56
|
-
"@aztec/
|
|
57
|
-
"@aztec/
|
|
58
|
-
"@aztec/
|
|
59
|
-
"@aztec/
|
|
60
|
-
"@aztec/
|
|
61
|
-
"@aztec/
|
|
62
|
-
"@aztec/
|
|
63
|
-
"@aztec/validator-
|
|
64
|
-
"@aztec/
|
|
65
|
-
"@aztec/
|
|
66
|
-
"@aztec/
|
|
67
|
-
"@aztec/world-state": "0.0.1-commit.ec5f612",
|
|
29
|
+
"@aztec/accounts": "0.0.1-commit.ec7ac5448",
|
|
30
|
+
"@aztec/archiver": "0.0.1-commit.ec7ac5448",
|
|
31
|
+
"@aztec/aztec": "0.0.1-commit.ec7ac5448",
|
|
32
|
+
"@aztec/aztec-node": "0.0.1-commit.ec7ac5448",
|
|
33
|
+
"@aztec/aztec.js": "0.0.1-commit.ec7ac5448",
|
|
34
|
+
"@aztec/bb-prover": "0.0.1-commit.ec7ac5448",
|
|
35
|
+
"@aztec/bb.js": "0.0.1-commit.ec7ac5448",
|
|
36
|
+
"@aztec/blob-client": "0.0.1-commit.ec7ac5448",
|
|
37
|
+
"@aztec/blob-lib": "0.0.1-commit.ec7ac5448",
|
|
38
|
+
"@aztec/bot": "0.0.1-commit.ec7ac5448",
|
|
39
|
+
"@aztec/cli": "0.0.1-commit.ec7ac5448",
|
|
40
|
+
"@aztec/constants": "0.0.1-commit.ec7ac5448",
|
|
41
|
+
"@aztec/entrypoints": "0.0.1-commit.ec7ac5448",
|
|
42
|
+
"@aztec/epoch-cache": "0.0.1-commit.ec7ac5448",
|
|
43
|
+
"@aztec/ethereum": "0.0.1-commit.ec7ac5448",
|
|
44
|
+
"@aztec/foundation": "0.0.1-commit.ec7ac5448",
|
|
45
|
+
"@aztec/kv-store": "0.0.1-commit.ec7ac5448",
|
|
46
|
+
"@aztec/l1-artifacts": "0.0.1-commit.ec7ac5448",
|
|
47
|
+
"@aztec/node-keystore": "0.0.1-commit.ec7ac5448",
|
|
48
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.ec7ac5448",
|
|
49
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.ec7ac5448",
|
|
50
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.ec7ac5448",
|
|
51
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.ec7ac5448",
|
|
52
|
+
"@aztec/p2p": "0.0.1-commit.ec7ac5448",
|
|
53
|
+
"@aztec/protocol-contracts": "0.0.1-commit.ec7ac5448",
|
|
54
|
+
"@aztec/prover-client": "0.0.1-commit.ec7ac5448",
|
|
55
|
+
"@aztec/prover-node": "0.0.1-commit.ec7ac5448",
|
|
56
|
+
"@aztec/pxe": "0.0.1-commit.ec7ac5448",
|
|
57
|
+
"@aztec/sequencer-client": "0.0.1-commit.ec7ac5448",
|
|
58
|
+
"@aztec/simulator": "0.0.1-commit.ec7ac5448",
|
|
59
|
+
"@aztec/slasher": "0.0.1-commit.ec7ac5448",
|
|
60
|
+
"@aztec/stdlib": "0.0.1-commit.ec7ac5448",
|
|
61
|
+
"@aztec/telemetry-client": "0.0.1-commit.ec7ac5448",
|
|
62
|
+
"@aztec/validator-client": "0.0.1-commit.ec7ac5448",
|
|
63
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.ec7ac5448",
|
|
64
|
+
"@aztec/wallet-sdk": "0.0.1-commit.ec7ac5448",
|
|
65
|
+
"@aztec/wallets": "0.0.1-commit.ec7ac5448",
|
|
66
|
+
"@aztec/world-state": "0.0.1-commit.ec7ac5448",
|
|
68
67
|
"@iarna/toml": "^2.2.5",
|
|
69
68
|
"@jest/globals": "^30.0.0",
|
|
70
69
|
"@noble/curves": "=1.0.0",
|
|
@@ -76,7 +75,6 @@
|
|
|
76
75
|
"@types/koa-static": "^4.0.2",
|
|
77
76
|
"@types/lodash.every": "^4.6.7",
|
|
78
77
|
"@types/node": "^22.15.17",
|
|
79
|
-
"@viem/anvil": "^0.0.9",
|
|
80
78
|
"buffer": "^6.0.3",
|
|
81
79
|
"crypto-browserify": "^3.12.1",
|
|
82
80
|
"fs-extra": "^11.2.0",
|
|
@@ -161,6 +159,7 @@
|
|
|
161
159
|
"moduleNameMapper": {
|
|
162
160
|
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
|
|
163
161
|
},
|
|
162
|
+
"resolver": "<rootDir>/legacy-jest-resolver.cjs",
|
|
164
163
|
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
|
|
165
164
|
"rootDir": "./src",
|
|
166
165
|
"testTimeout": 120000,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
1
2
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
3
|
import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
|
|
3
4
|
import { type FeePaymentMethod, PrivateFeePaymentMethod, SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
|
|
4
5
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
5
6
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
6
7
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
7
|
-
import { CheatCodes } from '@aztec/aztec/testing';
|
|
8
|
+
import { CheatCodes, getTokenAllowedSetupFunctions } from '@aztec/aztec/testing';
|
|
8
9
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
9
10
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
10
11
|
import type { DeployAztecL1ContractsArgs } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
@@ -130,11 +131,14 @@ export class ClientFlowsBenchmark {
|
|
|
130
131
|
|
|
131
132
|
async setup() {
|
|
132
133
|
this.logger.info('Setting up subsystems from fresh');
|
|
134
|
+
// Token allowlist entries are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
|
|
135
|
+
const tokenAllowList = await getTokenAllowedSetupFunctions();
|
|
133
136
|
this.context = await setup(0, {
|
|
134
137
|
...this.setupOptions,
|
|
135
138
|
fundSponsoredFPC: true,
|
|
136
139
|
skipAccountDeployment: true,
|
|
137
140
|
l1ContractsArgs: this.setupOptions,
|
|
141
|
+
txPublicSetupAllowListExtend: [...(this.setupOptions.txPublicSetupAllowListExtend ?? []), ...tokenAllowList],
|
|
138
142
|
});
|
|
139
143
|
await this.applyBaseSetup();
|
|
140
144
|
|
|
@@ -148,6 +152,7 @@ export class ClientFlowsBenchmark {
|
|
|
148
152
|
|
|
149
153
|
async teardown() {
|
|
150
154
|
await this.chainMonitor.stop();
|
|
155
|
+
await this.userWallet?.stop();
|
|
151
156
|
await teardown(this.context);
|
|
152
157
|
}
|
|
153
158
|
|
|
@@ -161,11 +166,15 @@ export class ClientFlowsBenchmark {
|
|
|
161
166
|
|
|
162
167
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */
|
|
163
168
|
async mintPrivateBananas(amount: bigint, address: AztecAddress) {
|
|
164
|
-
const balanceBefore = await this.bananaCoin.methods
|
|
169
|
+
const { result: balanceBefore } = await this.bananaCoin.methods
|
|
170
|
+
.balance_of_private(address)
|
|
171
|
+
.simulate({ from: address });
|
|
165
172
|
|
|
166
173
|
await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
|
|
167
174
|
|
|
168
|
-
const balanceAfter = await this.bananaCoin.methods
|
|
175
|
+
const { result: balanceAfter } = await this.bananaCoin.methods
|
|
176
|
+
.balance_of_private(address)
|
|
177
|
+
.simulate({ from: address });
|
|
169
178
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
170
179
|
}
|
|
171
180
|
|
|
@@ -247,7 +256,9 @@ export class ClientFlowsBenchmark {
|
|
|
247
256
|
'BC',
|
|
248
257
|
'BC',
|
|
249
258
|
18n,
|
|
250
|
-
).send({
|
|
259
|
+
).send({
|
|
260
|
+
from: this.adminAddress,
|
|
261
|
+
});
|
|
251
262
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
252
263
|
this.bananaCoin = bananaCoin;
|
|
253
264
|
this.bananaCoinInstance = bananaCoinInstance;
|
|
@@ -261,7 +272,9 @@ export class ClientFlowsBenchmark {
|
|
|
261
272
|
'CBC',
|
|
262
273
|
'CBC',
|
|
263
274
|
18n,
|
|
264
|
-
).send({
|
|
275
|
+
).send({
|
|
276
|
+
from: this.adminAddress,
|
|
277
|
+
});
|
|
265
278
|
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
266
279
|
this.candyBarCoin = candyBarCoin;
|
|
267
280
|
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
@@ -277,7 +290,9 @@ export class ClientFlowsBenchmark {
|
|
|
277
290
|
this.adminWallet,
|
|
278
291
|
bananaCoin.address,
|
|
279
292
|
this.adminAddress,
|
|
280
|
-
).send({
|
|
293
|
+
).send({
|
|
294
|
+
from: this.adminAddress,
|
|
295
|
+
});
|
|
281
296
|
|
|
282
297
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
283
298
|
|
|
@@ -326,7 +341,7 @@ export class ClientFlowsBenchmark {
|
|
|
326
341
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
|
|
327
342
|
const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
|
|
328
343
|
await behchysDeployMethod.send({
|
|
329
|
-
from:
|
|
344
|
+
from: NO_FROM,
|
|
330
345
|
fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
|
|
331
346
|
});
|
|
332
347
|
// Register benchy on the user's Wallet, where we're going to be interacting from
|
|
@@ -346,13 +361,15 @@ export class ClientFlowsBenchmark {
|
|
|
346
361
|
'LPT',
|
|
347
362
|
'LPT',
|
|
348
363
|
18n,
|
|
349
|
-
).send({
|
|
364
|
+
).send({
|
|
365
|
+
from: this.adminAddress,
|
|
366
|
+
});
|
|
350
367
|
const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
|
|
351
368
|
this.adminWallet,
|
|
352
369
|
this.bananaCoin.address,
|
|
353
370
|
this.candyBarCoin.address,
|
|
354
371
|
liquidityToken.address,
|
|
355
|
-
).send({ from: this.adminAddress
|
|
372
|
+
).send({ from: this.adminAddress });
|
|
356
373
|
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
357
374
|
await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
|
|
358
375
|
this.liquidityToken = liquidityToken;
|
|
@@ -370,7 +387,7 @@ export class ClientFlowsBenchmark {
|
|
|
370
387
|
// The private fee paying method assembled on the app side requires knowledge of the maximum
|
|
371
388
|
// fee the user is willing to pay
|
|
372
389
|
const maxFeesPerGas = (await this.aztecNode.getCurrentMinFees()).mul(1.5);
|
|
373
|
-
const gasSettings = GasSettings.
|
|
390
|
+
const gasSettings = GasSettings.fallback({ maxFeesPerGas });
|
|
374
391
|
return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
|
|
375
392
|
}
|
|
376
393
|
|