@aztec/end-to-end 0.0.1-commit.8afd444 → 0.0.1-commit.8f9871590
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/dest/bench/client_flows/client_flows_benchmark.d.ts +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +3 -3
- package/dest/bench/client_flows/config.d.ts +2 -2
- package/dest/bench/client_flows/config.d.ts.map +1 -1
- package/dest/bench/client_flows/config.js +18 -0
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +4 -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 +10 -0
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +2 -2
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +3 -2
- package/dest/e2e_deploy_contract/deploy_test.d.ts +2 -2
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +9 -3
- package/dest/e2e_fees/fees_test.d.ts +2 -2
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +5 -5
- package/dest/e2e_p2p/p2p_network.d.ts +2 -2
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.d.ts +2 -2
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +5 -1
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
- package/dest/e2e_token_contract/token_contract_test.d.ts +4 -2
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +10 -0
- package/dest/fixtures/authwit_proxy.d.ts +15 -0
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.js +30 -0
- package/dest/fixtures/e2e_prover_test.d.ts +2 -2
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.d.ts +1 -1
- package/dest/fixtures/ha_setup.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.js +3 -1
- package/dest/fixtures/setup.d.ts +15 -15
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +20 -79
- package/dest/fixtures/setup_p2p_test.d.ts +10 -5
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +6 -3
- package/dest/shared/index.d.ts +2 -1
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/index.js +1 -0
- package/dest/shared/mock_state_view.d.ts +86 -0
- package/dest/shared/mock_state_view.d.ts.map +1 -0
- package/dest/shared/mock_state_view.js +186 -0
- package/dest/shared/submit-transactions.d.ts +2 -2
- package/dest/shared/submit-transactions.d.ts.map +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 +8 -6
- 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 -23
- package/dest/spartan/setup_test_wallets.d.ts +2 -2
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +3 -1
- package/dest/spartan/utils/bot.d.ts +1 -1
- package/dest/spartan/utils/bot.d.ts.map +1 -1
- package/dest/spartan/utils/bot.js +1 -1
- package/dest/test-wallet/test_wallet.d.ts +83 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +214 -0
- package/dest/test-wallet/utils.d.ts +41 -0
- package/dest/test-wallet/utils.d.ts.map +1 -0
- package/dest/test-wallet/utils.js +71 -0
- package/package.json +40 -39
- package/src/bench/client_flows/client_flows_benchmark.ts +8 -12
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/utils.ts +1 -1
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +11 -2
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +7 -8
- package/src/e2e_deploy_contract/deploy_test.ts +3 -3
- package/src/e2e_epochs/epochs_test.ts +13 -3
- package/src/e2e_fees/bridging_race.notest.ts +1 -1
- package/src/e2e_fees/fees_test.ts +11 -26
- package/src/e2e_nested_contract/nested_contract_test.ts +1 -1
- package/src/e2e_p2p/inactivity_slash_test.ts +4 -4
- package/src/e2e_p2p/p2p_network.ts +5 -5
- package/src/e2e_p2p/reqresp/utils.ts +4 -4
- package/src/e2e_p2p/shared.ts +3 -1
- package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
- package/src/e2e_token_contract/token_contract_test.ts +11 -2
- package/src/fixtures/authwit_proxy.ts +50 -0
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +4 -4
- package/src/fixtures/ha_setup.ts +3 -1
- package/src/fixtures/setup.ts +31 -109
- package/src/fixtures/setup_p2p_test.ts +16 -7
- package/src/guides/up_quick_start.sh +3 -3
- package/src/shared/index.ts +1 -0
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +2 -1
- package/src/shared/uniswap_l1_l2.ts +9 -11
- package/src/simulators/token_simulator.ts +1 -29
- package/src/spartan/setup_test_wallets.ts +3 -1
- package/src/spartan/utils/bot.ts +1 -1
- package/src/test-wallet/test_wallet.ts +306 -0
- package/src/test-wallet/utils.ts +112 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec/accounts/ecdsa';
|
|
2
|
+
import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
|
|
3
|
+
import { StubAccountContractArtifact, createStubAccount } from '@aztec/accounts/stub';
|
|
4
|
+
import { SignerlessAccount } from '@aztec/aztec.js/account';
|
|
5
|
+
import { SetPublicAuthwitContractInteraction, computeInnerAuthWitHashFromAction, isContractFunctionInteractionCallIntent, lookupValidity } from '@aztec/aztec.js/authorization';
|
|
6
|
+
import { AccountManager } from '@aztec/aztec.js/wallet';
|
|
7
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
9
|
+
import { getPXEConfig } from '@aztec/pxe/config';
|
|
10
|
+
import { createPXE } from '@aztec/pxe/server';
|
|
11
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
12
|
+
import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
13
|
+
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
14
|
+
import { mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
15
|
+
import { BaseWallet } from '@aztec/wallet-sdk/base-wallet';
|
|
16
|
+
import { AztecNodeProxy, ProvenTx } from './utils.js';
|
|
17
|
+
/**
|
|
18
|
+
* Wallet implementation that stores accounts in memory and provides extra debugging
|
|
19
|
+
* utilities
|
|
20
|
+
* It is intended to be used in e2e tests.
|
|
21
|
+
*/ export class TestWallet extends BaseWallet {
|
|
22
|
+
nodeRef;
|
|
23
|
+
constructor(pxe, nodeRef){
|
|
24
|
+
super(pxe, nodeRef), this.nodeRef = nodeRef, this.accounts = new Map(), this.simulatedSimulations = false;
|
|
25
|
+
}
|
|
26
|
+
static async create(node, overridePXEConfig, options = {
|
|
27
|
+
loggers: {}
|
|
28
|
+
}) {
|
|
29
|
+
const nodeRef = new AztecNodeProxy(node);
|
|
30
|
+
const pxeConfig = Object.assign(getPXEConfig(), {
|
|
31
|
+
proverEnabled: overridePXEConfig?.proverEnabled ?? false,
|
|
32
|
+
...overridePXEConfig
|
|
33
|
+
});
|
|
34
|
+
const pxe = await createPXE(nodeRef, pxeConfig, options);
|
|
35
|
+
return new TestWallet(pxe, nodeRef);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Updates the underlying node that this wallet and its PXE communicate with.
|
|
39
|
+
* @param node - The new AztecNode to forward all calls to.
|
|
40
|
+
*/ updateNode(node) {
|
|
41
|
+
this.nodeRef.updateTargetNode(node);
|
|
42
|
+
}
|
|
43
|
+
createSchnorrAccount(secret, salt, signingKey) {
|
|
44
|
+
signingKey = signingKey ?? deriveSigningKey(secret);
|
|
45
|
+
const accountData = {
|
|
46
|
+
secret,
|
|
47
|
+
salt,
|
|
48
|
+
contract: new SchnorrAccountContract(signingKey)
|
|
49
|
+
};
|
|
50
|
+
return this.createAccount(accountData);
|
|
51
|
+
}
|
|
52
|
+
createECDSARAccount(secret, salt, signingKey) {
|
|
53
|
+
const accountData = {
|
|
54
|
+
secret,
|
|
55
|
+
salt,
|
|
56
|
+
contract: new EcdsaRAccountContract(signingKey)
|
|
57
|
+
};
|
|
58
|
+
return this.createAccount(accountData);
|
|
59
|
+
}
|
|
60
|
+
createECDSAKAccount(secret, salt, signingKey) {
|
|
61
|
+
const accountData = {
|
|
62
|
+
secret,
|
|
63
|
+
salt,
|
|
64
|
+
contract: new EcdsaKAccountContract(signingKey)
|
|
65
|
+
};
|
|
66
|
+
return this.createAccount(accountData);
|
|
67
|
+
}
|
|
68
|
+
async getFakeAccountDataFor(address) {
|
|
69
|
+
const originalAccount = await this.getAccountFromAddress(address);
|
|
70
|
+
if (originalAccount instanceof SignerlessAccount) {
|
|
71
|
+
throw new Error(`Cannot create fake account data for SignerlessAccount at address: ${address}`);
|
|
72
|
+
}
|
|
73
|
+
const originalAddress = originalAccount.getCompleteAddress();
|
|
74
|
+
const contractInstance = await this.pxe.getContractInstance(originalAddress.address);
|
|
75
|
+
if (!contractInstance) {
|
|
76
|
+
throw new Error(`No contract instance found for address: ${originalAddress.address}`);
|
|
77
|
+
}
|
|
78
|
+
const stubAccount = createStubAccount(originalAddress);
|
|
79
|
+
const instance = await getContractInstanceFromInstantiationParams(StubAccountContractArtifact, {
|
|
80
|
+
salt: Fr.random()
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
account: stubAccount,
|
|
84
|
+
instance,
|
|
85
|
+
artifact: StubAccountContractArtifact
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
accounts;
|
|
89
|
+
/**
|
|
90
|
+
* Toggle for running "simulated simulations" when calling simulateTx.
|
|
91
|
+
*
|
|
92
|
+
* When this flag is true, simulateViaEntrypoint constructs a request using a fake account
|
|
93
|
+
* (and accepts contract overrides on the input) and the PXE emulates kernel effects without
|
|
94
|
+
* generating kernel witnesses. When false, simulateViaEntrypoint defers to the standard
|
|
95
|
+
* simulation path via the real account entrypoint.
|
|
96
|
+
*/ simulatedSimulations;
|
|
97
|
+
enableSimulatedSimulations() {
|
|
98
|
+
this.simulatedSimulations = true;
|
|
99
|
+
}
|
|
100
|
+
disableSimulatedSimulations() {
|
|
101
|
+
this.simulatedSimulations = false;
|
|
102
|
+
}
|
|
103
|
+
setMinFeePadding(value) {
|
|
104
|
+
this.minFeePadding = value ?? 0.5;
|
|
105
|
+
}
|
|
106
|
+
getAccountFromAddress(address) {
|
|
107
|
+
let account;
|
|
108
|
+
if (address.equals(AztecAddress.ZERO)) {
|
|
109
|
+
account = new SignerlessAccount();
|
|
110
|
+
} else {
|
|
111
|
+
account = this.accounts.get(address?.toString() ?? '');
|
|
112
|
+
}
|
|
113
|
+
if (!account) {
|
|
114
|
+
throw new Error(`Account not found in wallet for address: ${address}`);
|
|
115
|
+
}
|
|
116
|
+
return Promise.resolve(account);
|
|
117
|
+
}
|
|
118
|
+
getAccounts() {
|
|
119
|
+
return Promise.resolve(Array.from(this.accounts.values()).map((acc)=>({
|
|
120
|
+
alias: '',
|
|
121
|
+
item: acc.getAddress()
|
|
122
|
+
})));
|
|
123
|
+
}
|
|
124
|
+
async createAccount(accountData) {
|
|
125
|
+
const secret = accountData?.secret ?? Fr.random();
|
|
126
|
+
const salt = accountData?.salt ?? Fr.random();
|
|
127
|
+
const contract = accountData?.contract ?? new SchnorrAccountContract(GrumpkinScalar.random());
|
|
128
|
+
const accountManager = await AccountManager.create(this, secret, contract, salt);
|
|
129
|
+
const instance = accountManager.getInstance();
|
|
130
|
+
const artifact = await contract.getContractArtifact();
|
|
131
|
+
await this.registerContract(instance, artifact, secret);
|
|
132
|
+
this.accounts.set(accountManager.address.toString(), await accountManager.getAccount());
|
|
133
|
+
return accountManager;
|
|
134
|
+
}
|
|
135
|
+
lookupValidity(onBehalfOf, intent, witness) {
|
|
136
|
+
return lookupValidity(this, onBehalfOf, intent, witness);
|
|
137
|
+
}
|
|
138
|
+
setPublicAuthWit(from, messageHashOrIntent, authorized) {
|
|
139
|
+
return SetPublicAuthwitContractInteraction.create(this, from, messageHashOrIntent, authorized);
|
|
140
|
+
}
|
|
141
|
+
async createAuthWit(from, intent) {
|
|
142
|
+
const account = await this.getAccountFromAddress(from);
|
|
143
|
+
const chainInfo = await this.getChainInfo();
|
|
144
|
+
let intentInnerHash;
|
|
145
|
+
if ('caller' in intent) {
|
|
146
|
+
const call = isContractFunctionInteractionCallIntent(intent) ? await intent.action.getFunctionCall() : intent.call;
|
|
147
|
+
const innerHash = await computeInnerAuthWitHashFromAction(intent.caller, call);
|
|
148
|
+
intentInnerHash = {
|
|
149
|
+
innerHash,
|
|
150
|
+
consumer: call.to
|
|
151
|
+
};
|
|
152
|
+
} else {
|
|
153
|
+
intentInnerHash = intent;
|
|
154
|
+
}
|
|
155
|
+
return account.createAuthWit(intentInnerHash, chainInfo);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Override simulateViaEntrypoint to use fake accounts for kernelless simulation
|
|
159
|
+
* when simulatedSimulations is enabled. Otherwise falls through to the real entrypoint path.
|
|
160
|
+
*/ async simulateViaEntrypoint(executionPayload, from, feeOptions, scopes, skipTxValidation, skipFeeEnforcement) {
|
|
161
|
+
if (!this.simulatedSimulations) {
|
|
162
|
+
return super.simulateViaEntrypoint(executionPayload, from, feeOptions, scopes, skipTxValidation, skipFeeEnforcement);
|
|
163
|
+
}
|
|
164
|
+
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
165
|
+
const executionOptions = {
|
|
166
|
+
txNonce: Fr.random(),
|
|
167
|
+
cancellable: this.cancellableTransactions,
|
|
168
|
+
feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions
|
|
169
|
+
};
|
|
170
|
+
const finalExecutionPayload = feeExecutionPayload ? mergeExecutionPayloads([
|
|
171
|
+
feeExecutionPayload,
|
|
172
|
+
executionPayload
|
|
173
|
+
]) : executionPayload;
|
|
174
|
+
const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(from);
|
|
175
|
+
const chainInfo = await this.getChainInfo();
|
|
176
|
+
const txRequest = await fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo, executionOptions);
|
|
177
|
+
const contractOverrides = {
|
|
178
|
+
[from.toString()]: {
|
|
179
|
+
instance,
|
|
180
|
+
artifact
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
return this.pxe.simulateTx(txRequest, {
|
|
184
|
+
simulatePublic: true,
|
|
185
|
+
skipFeeEnforcement: true,
|
|
186
|
+
skipTxValidation: true,
|
|
187
|
+
overrides: {
|
|
188
|
+
contracts: contractOverrides
|
|
189
|
+
},
|
|
190
|
+
scopes
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
async proveTx(exec, opts) {
|
|
194
|
+
const fee = await this.completeFeeOptions(opts.from, exec.feePayer, opts.fee?.gasSettings);
|
|
195
|
+
const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee);
|
|
196
|
+
const txProvingResult = await this.pxe.proveTx(txRequest, this.scopesFor(opts.from));
|
|
197
|
+
return new ProvenTx(this.aztecNode, await txProvingResult.toTx(), txProvingResult.getOffchainEffects(), txProvingResult.stats);
|
|
198
|
+
}
|
|
199
|
+
getTxReceipt(txHash) {
|
|
200
|
+
return this.aztecNode.getTxReceipt(txHash);
|
|
201
|
+
}
|
|
202
|
+
getNotes(filter) {
|
|
203
|
+
return this.pxe.debug.getNotes(filter);
|
|
204
|
+
}
|
|
205
|
+
getSyncedBlockHeader() {
|
|
206
|
+
return this.pxe.getSyncedBlockHeader();
|
|
207
|
+
}
|
|
208
|
+
sync() {
|
|
209
|
+
return this.pxe.debug.sync();
|
|
210
|
+
}
|
|
211
|
+
stop() {
|
|
212
|
+
return this.pxe.stop();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ContractFunctionInteraction, DeployMethod, type DeployOptions, type NoWait, type SendInteractionOptions, type WaitOpts } from '@aztec/aztec.js/contracts';
|
|
2
|
+
import { type AztecNode } from '@aztec/aztec.js/node';
|
|
3
|
+
import { type OffchainEffect, type ProvingStats, Tx, TxHash, type TxReceipt } from '@aztec/stdlib/tx';
|
|
4
|
+
import type { TestWallet } from './test_wallet.js';
|
|
5
|
+
export type ProvenTxSendOpts = {
|
|
6
|
+
wait?: NoWait | WaitOpts;
|
|
7
|
+
};
|
|
8
|
+
export type ProvenTxSendReturn<T extends NoWait | WaitOpts | undefined> = T extends NoWait ? TxHash : TxReceipt;
|
|
9
|
+
export declare class ProvenTx extends Tx {
|
|
10
|
+
private node;
|
|
11
|
+
offchainEffects: OffchainEffect[];
|
|
12
|
+
stats?: ProvingStats | undefined;
|
|
13
|
+
constructor(node: AztecNode, tx: Tx, offchainEffects: OffchainEffect[], stats?: ProvingStats | undefined);
|
|
14
|
+
send(options?: Omit<ProvenTxSendOpts, 'wait'>): Promise<TxReceipt>;
|
|
15
|
+
send<W extends ProvenTxSendOpts['wait']>(options: ProvenTxSendOpts & {
|
|
16
|
+
wait: W;
|
|
17
|
+
}): Promise<ProvenTxSendReturn<W>>;
|
|
18
|
+
private contextualizeError;
|
|
19
|
+
}
|
|
20
|
+
export declare function proveInteraction(wallet: TestWallet, interaction: ContractFunctionInteraction | DeployMethod, options: SendInteractionOptions | DeployOptions): Promise<ProvenTx>;
|
|
21
|
+
/**
|
|
22
|
+
* Extends AztecNode via declaration merging so instances can be used wherever AztecNode is expected.
|
|
23
|
+
* The actual method forwarding is handled by a Proxy in the class constructor.
|
|
24
|
+
*/
|
|
25
|
+
export interface AztecNodeProxy extends AztecNode {
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Mutable wrapper around an AztecNode that forwards all calls to the current target.
|
|
29
|
+
* Allows swapping the underlying node at runtime via updateTargetNode, which is useful
|
|
30
|
+
* for tests that need to redirect a wallet from one node to another without recreating it.
|
|
31
|
+
*/
|
|
32
|
+
export declare class AztecNodeProxy {
|
|
33
|
+
private target;
|
|
34
|
+
constructor(target: AztecNode);
|
|
35
|
+
/**
|
|
36
|
+
* Updates the underlying node that this reference points to.
|
|
37
|
+
* @param node - The new node to forward calls to.
|
|
38
|
+
*/
|
|
39
|
+
updateTargetNode(node: AztecNode): void;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0LXdhbGxldC91dGlscy50cyJdL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
|
|
1
|
+
import { DeployMethod, NO_WAIT, toSendOptions } from '@aztec/aztec.js/contracts';
|
|
2
|
+
import { waitForTx } from '@aztec/aztec.js/node';
|
|
3
|
+
import { SimulationError } from '@aztec/stdlib/errors';
|
|
4
|
+
import { Tx } from '@aztec/stdlib/tx';
|
|
5
|
+
import { inspect } from 'util';
|
|
6
|
+
export class ProvenTx extends Tx {
|
|
7
|
+
node;
|
|
8
|
+
offchainEffects;
|
|
9
|
+
stats;
|
|
10
|
+
constructor(node, tx, offchainEffects, stats){
|
|
11
|
+
super(tx.getTxHash(), tx.data, tx.chonkProof, tx.contractClassLogFields, tx.publicFunctionCalldata), this.node = node, this.offchainEffects = offchainEffects, this.stats = stats;
|
|
12
|
+
}
|
|
13
|
+
async send(options) {
|
|
14
|
+
const txHash = this.getTxHash();
|
|
15
|
+
await this.node.sendTx(this).catch((err)=>{
|
|
16
|
+
throw this.contextualizeError(err, inspect(this));
|
|
17
|
+
});
|
|
18
|
+
if (options?.wait === NO_WAIT) {
|
|
19
|
+
return txHash;
|
|
20
|
+
}
|
|
21
|
+
const waitOpts = typeof options?.wait === 'object' ? options.wait : undefined;
|
|
22
|
+
return await waitForTx(this.node, txHash, waitOpts);
|
|
23
|
+
}
|
|
24
|
+
contextualizeError(err, ...context) {
|
|
25
|
+
let contextStr = '';
|
|
26
|
+
if (context.length > 0) {
|
|
27
|
+
contextStr = `\nContext:\n${context.join('\n')}`;
|
|
28
|
+
}
|
|
29
|
+
if (err instanceof SimulationError) {
|
|
30
|
+
err.setAztecContext(contextStr);
|
|
31
|
+
}
|
|
32
|
+
return err;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export async function proveInteraction(wallet, interaction, options) {
|
|
36
|
+
let execPayload;
|
|
37
|
+
if (interaction instanceof DeployMethod) {
|
|
38
|
+
execPayload = await interaction.request(interaction.convertDeployOptionsToRequestOptions(options));
|
|
39
|
+
} else {
|
|
40
|
+
execPayload = await interaction.request(options);
|
|
41
|
+
}
|
|
42
|
+
return wallet.proveTx(execPayload, toSendOptions(options));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Mutable wrapper around an AztecNode that forwards all calls to the current target.
|
|
46
|
+
* Allows swapping the underlying node at runtime via updateTargetNode, which is useful
|
|
47
|
+
* for tests that need to redirect a wallet from one node to another without recreating it.
|
|
48
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
|
|
49
|
+
export class AztecNodeProxy {
|
|
50
|
+
target;
|
|
51
|
+
constructor(target){
|
|
52
|
+
this.target = target;
|
|
53
|
+
return new Proxy(this, {
|
|
54
|
+
get: (obj, prop, receiver)=>{
|
|
55
|
+
// Own properties and methods (updateTargetNode, target) are served directly.
|
|
56
|
+
if (Reflect.has(obj, prop)) {
|
|
57
|
+
return Reflect.get(obj, prop, receiver);
|
|
58
|
+
}
|
|
59
|
+
// Everything else is forwarded to the current target node.
|
|
60
|
+
const val = obj.target[prop];
|
|
61
|
+
return typeof val === 'function' ? val.bind(obj.target) : val;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Updates the underlying node that this reference points to.
|
|
67
|
+
* @param node - The new node to forward calls to.
|
|
68
|
+
*/ updateTargetNode(node) {
|
|
69
|
+
this.target = node;
|
|
70
|
+
}
|
|
71
|
+
}
|
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.8f9871590",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -26,44 +26,45 @@
|
|
|
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/merkle-tree": "0.0.1-commit.
|
|
48
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
49
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
50
|
-
"@aztec/noir-noirc_abi": "0.0.1-commit.
|
|
51
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
52
|
-
"@aztec/noir-test-contracts.js": "0.0.1-commit.
|
|
53
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
54
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
55
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
56
|
-
"@aztec/prover-node": "0.0.1-commit.
|
|
57
|
-
"@aztec/pxe": "0.0.1-commit.
|
|
58
|
-
"@aztec/sequencer-client": "0.0.1-commit.
|
|
59
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
60
|
-
"@aztec/slasher": "0.0.1-commit.
|
|
61
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
62
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
63
|
-
"@aztec/
|
|
64
|
-
"@aztec/validator-
|
|
65
|
-
"@aztec/
|
|
66
|
-
"@aztec/
|
|
29
|
+
"@aztec/accounts": "0.0.1-commit.8f9871590",
|
|
30
|
+
"@aztec/archiver": "0.0.1-commit.8f9871590",
|
|
31
|
+
"@aztec/aztec": "0.0.1-commit.8f9871590",
|
|
32
|
+
"@aztec/aztec-node": "0.0.1-commit.8f9871590",
|
|
33
|
+
"@aztec/aztec.js": "0.0.1-commit.8f9871590",
|
|
34
|
+
"@aztec/bb-prover": "0.0.1-commit.8f9871590",
|
|
35
|
+
"@aztec/bb.js": "0.0.1-commit.8f9871590",
|
|
36
|
+
"@aztec/blob-client": "0.0.1-commit.8f9871590",
|
|
37
|
+
"@aztec/blob-lib": "0.0.1-commit.8f9871590",
|
|
38
|
+
"@aztec/bot": "0.0.1-commit.8f9871590",
|
|
39
|
+
"@aztec/cli": "0.0.1-commit.8f9871590",
|
|
40
|
+
"@aztec/constants": "0.0.1-commit.8f9871590",
|
|
41
|
+
"@aztec/entrypoints": "0.0.1-commit.8f9871590",
|
|
42
|
+
"@aztec/epoch-cache": "0.0.1-commit.8f9871590",
|
|
43
|
+
"@aztec/ethereum": "0.0.1-commit.8f9871590",
|
|
44
|
+
"@aztec/foundation": "0.0.1-commit.8f9871590",
|
|
45
|
+
"@aztec/kv-store": "0.0.1-commit.8f9871590",
|
|
46
|
+
"@aztec/l1-artifacts": "0.0.1-commit.8f9871590",
|
|
47
|
+
"@aztec/merkle-tree": "0.0.1-commit.8f9871590",
|
|
48
|
+
"@aztec/node-keystore": "0.0.1-commit.8f9871590",
|
|
49
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.8f9871590",
|
|
50
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.8f9871590",
|
|
51
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.8f9871590",
|
|
52
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.8f9871590",
|
|
53
|
+
"@aztec/p2p": "0.0.1-commit.8f9871590",
|
|
54
|
+
"@aztec/protocol-contracts": "0.0.1-commit.8f9871590",
|
|
55
|
+
"@aztec/prover-client": "0.0.1-commit.8f9871590",
|
|
56
|
+
"@aztec/prover-node": "0.0.1-commit.8f9871590",
|
|
57
|
+
"@aztec/pxe": "0.0.1-commit.8f9871590",
|
|
58
|
+
"@aztec/sequencer-client": "0.0.1-commit.8f9871590",
|
|
59
|
+
"@aztec/simulator": "0.0.1-commit.8f9871590",
|
|
60
|
+
"@aztec/slasher": "0.0.1-commit.8f9871590",
|
|
61
|
+
"@aztec/stdlib": "0.0.1-commit.8f9871590",
|
|
62
|
+
"@aztec/telemetry-client": "0.0.1-commit.8f9871590",
|
|
63
|
+
"@aztec/validator-client": "0.0.1-commit.8f9871590",
|
|
64
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.8f9871590",
|
|
65
|
+
"@aztec/wallet-sdk": "0.0.1-commit.8f9871590",
|
|
66
|
+
"@aztec/wallets": "0.0.1-commit.8f9871590",
|
|
67
|
+
"@aztec/world-state": "0.0.1-commit.8f9871590",
|
|
67
68
|
"@iarna/toml": "^2.2.5",
|
|
68
69
|
"@jest/globals": "^30.0.0",
|
|
69
70
|
"@noble/curves": "=1.0.0",
|
|
@@ -26,7 +26,6 @@ import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
|
|
|
26
26
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
27
27
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
28
28
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
29
|
-
import { TestWallet } from '@aztec/test-wallet/server';
|
|
30
29
|
|
|
31
30
|
import { MNEMONIC } from '../../fixtures/fixtures.js';
|
|
32
31
|
import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
|
|
@@ -37,6 +36,7 @@ import {
|
|
|
37
36
|
FeeJuicePortalTestingHarnessFactory,
|
|
38
37
|
type GasBridgingTestHarness,
|
|
39
38
|
} from '../../shared/gas_portal_test_harness.js';
|
|
39
|
+
import { TestWallet } from '../../test-wallet/test_wallet.js';
|
|
40
40
|
import { ProxyLogger } from './benchmark.js';
|
|
41
41
|
import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
|
|
42
42
|
|
|
@@ -138,10 +138,10 @@ export class ClientFlowsBenchmark {
|
|
|
138
138
|
});
|
|
139
139
|
await this.applyBaseSetup();
|
|
140
140
|
|
|
141
|
-
await this.context.aztecNodeService
|
|
141
|
+
await this.context.aztecNodeService.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
|
|
142
142
|
|
|
143
143
|
const rollupContract = RollupContract.getFromConfig(this.context.config);
|
|
144
|
-
this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider
|
|
144
|
+
this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider, this.logger, 200).start();
|
|
145
145
|
|
|
146
146
|
return this;
|
|
147
147
|
}
|
|
@@ -161,15 +161,11 @@ export class ClientFlowsBenchmark {
|
|
|
161
161
|
|
|
162
162
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */
|
|
163
163
|
async mintPrivateBananas(amount: bigint, address: AztecAddress) {
|
|
164
|
-
const balanceBefore = await this.bananaCoin.methods
|
|
165
|
-
.balance_of_private(address)
|
|
166
|
-
.simulate({ from: this.adminAddress });
|
|
164
|
+
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
|
|
167
165
|
|
|
168
166
|
await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
|
|
169
167
|
|
|
170
|
-
const balanceAfter = await this.bananaCoin.methods
|
|
171
|
-
.balance_of_private(address)
|
|
172
|
-
.simulate({ from: this.adminAddress });
|
|
168
|
+
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
|
|
173
169
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
174
170
|
}
|
|
175
171
|
|
|
@@ -207,7 +203,7 @@ export class ClientFlowsBenchmark {
|
|
|
207
203
|
const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
|
|
208
204
|
|
|
209
205
|
this.adminWallet = this.context.wallet;
|
|
210
|
-
this.aztecNode = this.context.aztecNodeService
|
|
206
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
211
207
|
this.cheatCodes = this.context.cheatCodes;
|
|
212
208
|
|
|
213
209
|
this.adminAddress = adminAddress;
|
|
@@ -235,8 +231,8 @@ export class ClientFlowsBenchmark {
|
|
|
235
231
|
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
|
|
236
232
|
|
|
237
233
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
238
|
-
aztecNode: this.context.aztecNodeService
|
|
239
|
-
aztecNodeAdmin: this.context.aztecNodeService
|
|
234
|
+
aztecNode: this.context.aztecNodeService,
|
|
235
|
+
aztecNodeAdmin: this.context.aztecNodeService,
|
|
240
236
|
l1Client: this.context.deployL1ContractsValues.l1Client,
|
|
241
237
|
wallet: this.adminWallet,
|
|
242
238
|
logger: this.logger,
|
|
@@ -6,7 +6,7 @@ export type ClientFlowConfig = {
|
|
|
6
6
|
recursions?: number[];
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
type ClientFlows = 'accountDeployments' | 'deployments' | 'transfers' | 'bridging' | 'amm';
|
|
9
|
+
type ClientFlows = 'accountDeployments' | 'deployments' | 'transfers' | 'bridging' | 'amm' | 'storageProof';
|
|
10
10
|
|
|
11
11
|
export type ClientFlowsConfig = {
|
|
12
12
|
[key in ClientFlows]: ClientFlowConfig;
|
|
@@ -34,6 +34,10 @@ export const KEY_FLOWS_CONFIG: ClientFlowsConfig = {
|
|
|
34
34
|
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
35
35
|
recursions: [0, 1],
|
|
36
36
|
},
|
|
37
|
+
storageProof: {
|
|
38
|
+
accounts: ['ecdsar1'],
|
|
39
|
+
feePaymentMethods: ['sponsored_fpc'],
|
|
40
|
+
},
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
export const FULL_FLOWS_CONFIG: ClientFlowsConfig = {
|
|
@@ -58,4 +62,8 @@ export const FULL_FLOWS_CONFIG: ClientFlowsConfig = {
|
|
|
58
62
|
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
59
63
|
recursions: [0, 1, 2],
|
|
60
64
|
},
|
|
65
|
+
storageProof: {
|
|
66
|
+
accounts: ['ecdsar1', 'schnorr'],
|
|
67
|
+
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
68
|
+
},
|
|
61
69
|
};
|
package/src/bench/utils.ts
CHANGED
|
@@ -28,7 +28,7 @@ export async function benchmarkSetup(
|
|
|
28
28
|
const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
|
|
29
29
|
context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
|
|
30
30
|
const sequencer = (context.aztecNode as AztecNodeService).getSequencer()!;
|
|
31
|
-
const telemetry = context.telemetryClient
|
|
31
|
+
const telemetry = context.telemetryClient as BenchmarkTelemetryClient;
|
|
32
32
|
context.logger.warn(`Cleared benchmark data points from setup`);
|
|
33
33
|
telemetry.clear();
|
|
34
34
|
const origTeardown = context.teardown.bind(context);
|
|
@@ -7,14 +7,15 @@ import type { TxHash } from '@aztec/aztec.js/tx';
|
|
|
7
7
|
import type { CheatCodes } from '@aztec/aztec/testing';
|
|
8
8
|
import type { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
9
9
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
10
|
+
import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
|
|
10
11
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
11
12
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
12
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
13
13
|
|
|
14
14
|
import { jest } from '@jest/globals';
|
|
15
15
|
|
|
16
16
|
import { type EndToEndContext, deployAccounts, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
|
|
17
17
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
18
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
18
19
|
|
|
19
20
|
export class Role {
|
|
20
21
|
private isAdmin = false;
|
|
@@ -53,6 +54,7 @@ export class BlacklistTokenContractTest {
|
|
|
53
54
|
asset!: TokenBlacklistContract;
|
|
54
55
|
tokenSim!: TokenSimulator;
|
|
55
56
|
badAccount!: InvalidAccountContract;
|
|
57
|
+
authwitProxy!: GenericProxyContract;
|
|
56
58
|
cheatCodes!: CheatCodes;
|
|
57
59
|
sequencer!: SequencerClient;
|
|
58
60
|
aztecNode!: AztecNode;
|
|
@@ -92,7 +94,7 @@ export class BlacklistTokenContractTest {
|
|
|
92
94
|
});
|
|
93
95
|
|
|
94
96
|
this.cheatCodes = this.context.cheatCodes;
|
|
95
|
-
this.aztecNode = this.context.aztecNodeService
|
|
97
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
96
98
|
this.sequencer = this.context.sequencer!;
|
|
97
99
|
this.wallet = this.context.wallet;
|
|
98
100
|
this.adminAddress = deployedAccounts[0].address;
|
|
@@ -114,6 +116,13 @@ export class BlacklistTokenContractTest {
|
|
|
114
116
|
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress });
|
|
115
117
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
116
118
|
|
|
119
|
+
// Deploy a proxy contract for "on behalf of other" tests. The note owner must be the tx sender
|
|
120
|
+
// (so their notes are in scope), but msg_sender in the target must differ from the note owner
|
|
121
|
+
// to trigger authwit validation. The proxy forwards calls so that msg_sender != tx sender.
|
|
122
|
+
this.logger.verbose(`Deploying generic proxy...`);
|
|
123
|
+
this.authwitProxy = await GenericProxyContract.deploy(this.wallet).send({ from: this.adminAddress });
|
|
124
|
+
this.logger.verbose(`Deployed to ${this.authwitProxy.address}.`);
|
|
125
|
+
|
|
117
126
|
await this.crossTimestampOfChange();
|
|
118
127
|
|
|
119
128
|
this.tokenSim = new TokenSimulator(
|
|
@@ -13,13 +13,12 @@ import type {
|
|
|
13
13
|
} from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
14
14
|
import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
|
|
15
15
|
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
16
|
-
import {
|
|
16
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
17
17
|
import { sleep } from '@aztec/foundation/sleep';
|
|
18
18
|
import { TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
|
|
19
19
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
20
20
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
21
21
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
22
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
23
22
|
|
|
24
23
|
import { MNEMONIC } from '../fixtures/fixtures.js';
|
|
25
24
|
import {
|
|
@@ -31,6 +30,7 @@ import {
|
|
|
31
30
|
teardown,
|
|
32
31
|
} from '../fixtures/setup.js';
|
|
33
32
|
import { CrossChainTestHarness } from '../shared/cross_chain_test_harness.js';
|
|
33
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
34
34
|
|
|
35
35
|
export class CrossChainMessagingTest {
|
|
36
36
|
private requireEpochProven: boolean;
|
|
@@ -86,9 +86,8 @@ export class CrossChainMessagingTest {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
async advanceToEpochProven(l2TxReceipt: TxReceipt): Promise<EpochNumber> {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
);
|
|
89
|
+
const block = await this.aztecNode.getBlock(l2TxReceipt.blockNumber!);
|
|
90
|
+
const epoch = await this.rollup.getEpochNumberForCheckpoint(block!.checkpointNumber);
|
|
92
91
|
// Warp to the next epoch.
|
|
93
92
|
await this.cheatCodes.rollup.advanceToEpoch(EpochNumber(epoch + 1));
|
|
94
93
|
// Wait for the tx to be proven.
|
|
@@ -110,16 +109,16 @@ export class CrossChainMessagingTest {
|
|
|
110
109
|
|
|
111
110
|
async applyBaseSetup() {
|
|
112
111
|
// Set up base context fields
|
|
113
|
-
this.aztecNode = this.context.aztecNodeService
|
|
112
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
114
113
|
this.wallet = this.context.wallet;
|
|
115
114
|
this.aztecNodeConfig = this.context.config;
|
|
116
115
|
this.cheatCodes = this.context.cheatCodes;
|
|
117
116
|
this.deployL1ContractsValues = this.context.deployL1ContractsValues;
|
|
118
|
-
this.aztecNodeAdmin = this.context.aztecNodeService
|
|
117
|
+
this.aztecNodeAdmin = this.context.aztecNodeService;
|
|
119
118
|
|
|
120
119
|
if (this.requireEpochProven) {
|
|
121
120
|
// Turn off the watcher to prevent it from keep marking blocks as proven.
|
|
122
|
-
this.context.watcher
|
|
121
|
+
this.context.watcher.setIsMarkingAsProven(false);
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
// Deploy 3 accounts
|
|
@@ -8,9 +8,9 @@ import type { AztecNode } from '@aztec/aztec.js/node';
|
|
|
8
8
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
9
9
|
import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/StatefulTest';
|
|
10
10
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
11
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
12
11
|
|
|
13
12
|
import { type EndToEndContext, deployAccounts, setup, teardown } from '../fixtures/setup.js';
|
|
13
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
14
14
|
|
|
15
15
|
export class DeployTest {
|
|
16
16
|
public context!: EndToEndContext;
|
|
@@ -30,9 +30,9 @@ export class DeployTest {
|
|
|
30
30
|
fundSponsoredFPC: true,
|
|
31
31
|
skipAccountDeployment: true,
|
|
32
32
|
});
|
|
33
|
-
this.aztecNode = this.context.aztecNodeService
|
|
33
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
34
34
|
this.wallet = this.context.wallet;
|
|
35
|
-
this.aztecNodeAdmin = this.context.aztecNodeService
|
|
35
|
+
this.aztecNodeAdmin = this.context.aztecNodeService;
|
|
36
36
|
await this.applyInitialAccount();
|
|
37
37
|
return this;
|
|
38
38
|
}
|