@aztec/end-to-end 0.81.0 → 0.82.1-alpha-testnet.1
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/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 +7 -7
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -1
- 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 -18
- package/dest/e2e_deploy_contract/deploy_test.d.ts +2 -0
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +2 -0
- package/dest/e2e_epochs/epochs_test.d.ts +1 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +7 -6
- package/dest/e2e_fees/fees_test.d.ts +4 -0
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +41 -33
- package/dest/e2e_prover/e2e_prover_test.d.ts +2 -0
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
- package/dest/e2e_prover/e2e_prover_test.js +10 -10
- package/dest/e2e_token_contract/token_contract_test.d.ts +2 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +3 -1
- package/dest/fixtures/snapshot_manager.d.ts +4 -2
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +24 -18
- package/dest/fixtures/utils.d.ts +17 -6
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +50 -11
- package/dest/shared/capture_private_execution_steps.d.ts +7 -0
- package/dest/shared/capture_private_execution_steps.d.ts.map +1 -0
- package/dest/shared/capture_private_execution_steps.js +40 -0
- package/dest/shared/cross_chain_test_harness.d.ts +2 -2
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +16 -4
- package/dest/shared/gas_portal_test_harness.d.ts +11 -1
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +27 -12
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +24 -16
- package/dest/simulators/lending_simulator.d.ts +3 -5
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +5 -13
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +6 -4
- package/dest/spartan/utils.d.ts +18 -5
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +8 -5
- package/package.json +33 -31
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +9 -5
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +3 -19
- package/src/e2e_deploy_contract/deploy_test.ts +3 -0
- package/src/e2e_epochs/epochs_test.ts +6 -5
- package/src/e2e_fees/fees_test.ts +53 -36
- package/src/e2e_prover/e2e_prover_test.ts +13 -9
- package/src/e2e_token_contract/token_contract_test.ts +4 -2
- package/src/fixtures/snapshot_manager.ts +37 -12
- package/src/fixtures/utils.ts +69 -12
- package/src/guides/up_quick_start.sh +2 -3
- package/src/shared/capture_private_execution_steps.ts +43 -0
- package/src/shared/cross_chain_test_harness.ts +14 -3
- package/src/shared/gas_portal_test_harness.ts +29 -9
- package/src/shared/uniswap_l1_l2.ts +16 -16
- package/src/simulators/lending_simulator.ts +7 -12
- package/src/spartan/setup_test_wallets.ts +7 -7
- package/src/spartan/utils.ts +8 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AccountWallet, type CompleteAddress, Fr, type Logger, type TxHash } from '@aztec/aztec.js';
|
|
1
|
+
import { type AccountWallet, AztecAddress, type CompleteAddress, Fr, type Logger, type PXE, type TxHash } from '@aztec/aztec.js';
|
|
2
2
|
import { DocsExampleContract } from '@aztec/noir-contracts.js/DocsExample';
|
|
3
3
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
4
4
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
@@ -22,6 +22,7 @@ export declare class BlacklistTokenContractTest {
|
|
|
22
22
|
private snapshotManager;
|
|
23
23
|
logger: Logger;
|
|
24
24
|
wallets: AccountWallet[];
|
|
25
|
+
pxe: PXE;
|
|
25
26
|
accounts: CompleteAddress[];
|
|
26
27
|
asset: TokenBlacklistContract;
|
|
27
28
|
tokenSim: TokenSimulator;
|
|
@@ -40,7 +41,7 @@ export declare class BlacklistTokenContractTest {
|
|
|
40
41
|
setup(): Promise<void>;
|
|
41
42
|
snapshot: <T>(name: string, apply: (context: SubsystemsContext) => Promise<T>, restore?: (snapshotData: T, context: SubsystemsContext) => Promise<void>) => Promise<void>;
|
|
42
43
|
teardown(): Promise<void>;
|
|
43
|
-
addPendingShieldNoteToPXE(contract: TokenBlacklistContract,
|
|
44
|
+
addPendingShieldNoteToPXE(contract: TokenBlacklistContract, recipient: AztecAddress, amount: bigint, secretHash: Fr, txHash: TxHash): Promise<void>;
|
|
44
45
|
applyMintSnapshot(): Promise<void>;
|
|
45
46
|
}
|
|
46
47
|
//# sourceMappingURL=blacklist_token_contract_test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blacklist_token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAIjF,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIlE,qBAAa,IAAI;IACf,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAE9B,SAAS;IAKT,UAAU;IAKV,eAAe;IAKf,YAAY;;;;;CAKb;AAED,qBAAa,0BAA0B;;IAGrC,MAAM,CAAC,KAAK,SAAK;IAEjB,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,aAAa,EAAE,CAAM;IAC9B,QAAQ,EAAE,eAAe,EAAE,CAAM;IACjC,KAAK,EAAG,sBAAsB,CAAC;IAC/B,QAAQ,EAAG,cAAc,CAAC;IAC1B,UAAU,EAAG,mBAAmB,CAAC;IAEjC,KAAK,EAAG,aAAa,CAAC;IACtB,KAAK,EAAG,aAAa,CAAC;IACtB,WAAW,EAAG,aAAa,CAAC;gBAEhB,QAAQ,EAAE,MAAM;IAKtB,UAAU,CAAC,MAAM,GAAE,MAAyC;IAMlE;;;;OAIG;IACG,kBAAkB;
|
|
1
|
+
{"version":3,"file":"blacklist_token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,eAAe,EACpB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC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
40
|
snapshotManager;
|
|
41
41
|
logger;
|
|
42
42
|
wallets = [];
|
|
43
|
+
pxe;
|
|
43
44
|
accounts = [];
|
|
44
45
|
asset;
|
|
45
46
|
tokenSim;
|
|
@@ -64,6 +65,7 @@ export class BlacklistTokenContractTest {
|
|
|
64
65
|
// Adding a timeout of 2 minutes in here such that it is propagated to the underlying tests
|
|
65
66
|
jest.setTimeout(120_000);
|
|
66
67
|
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger), async ({ deployedAccounts }, { pxe })=>{
|
|
68
|
+
this.pxe = pxe;
|
|
67
69
|
this.wallets = await Promise.all(deployedAccounts.map((a)=>getSchnorrWallet(pxe, a.address, a.signingKey)));
|
|
68
70
|
this.admin = this.wallets[0];
|
|
69
71
|
this.other = this.wallets[1];
|
|
@@ -109,9 +111,9 @@ export class BlacklistTokenContractTest {
|
|
|
109
111
|
storage: arr.concat(new Array(maxLen - arr.length).fill(new Fr(0)))
|
|
110
112
|
};
|
|
111
113
|
}
|
|
112
|
-
async addPendingShieldNoteToPXE(contract,
|
|
113
|
-
const txEffects = await
|
|
114
|
-
await contract.methods.deliver_transparent_note(contract.address, amount, secretHash, txHash.hash, this.#toBoundedVec(txEffects.data.noteHashes, MAX_NOTE_HASHES_PER_TX), txEffects.data.nullifiers[0],
|
|
114
|
+
async addPendingShieldNoteToPXE(contract, recipient, amount, secretHash, txHash) {
|
|
115
|
+
const txEffects = await this.pxe.getTxEffect(txHash);
|
|
116
|
+
await contract.methods.deliver_transparent_note(contract.address, amount, secretHash, txHash.hash, this.#toBoundedVec(txEffects.data.noteHashes, MAX_NOTE_HASHES_PER_TX), txEffects.data.nullifiers[0], recipient).simulate();
|
|
115
117
|
}
|
|
116
118
|
async applyMintSnapshot() {
|
|
117
119
|
await this.snapshotManager.snapshot('mint', async ()=>{
|
|
@@ -129,11 +131,9 @@ export class BlacklistTokenContractTest {
|
|
|
129
131
|
const secret = Fr.random();
|
|
130
132
|
const secretHash = await computeSecretHash(secret);
|
|
131
133
|
const receipt = await asset.methods.mint_private(amount, secretHash).send().wait();
|
|
132
|
-
await this.addPendingShieldNoteToPXE(asset, wallets[0], amount, secretHash, receipt.txHash);
|
|
134
|
+
await this.addPendingShieldNoteToPXE(asset, wallets[0].getAddress(), amount, secretHash, receipt.txHash);
|
|
133
135
|
const txClaim = asset.methods.redeem_shield(accounts[0].address, amount, secret).send();
|
|
134
|
-
await txClaim.wait(
|
|
135
|
-
debug: true
|
|
136
|
-
});
|
|
136
|
+
await txClaim.wait();
|
|
137
137
|
this.logger.verbose(`Minting complete.`);
|
|
138
138
|
return {
|
|
139
139
|
amount
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross_chain_messaging_test.d.ts","sourceRoot":"","sources":["../../src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EAET,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,gBAAgB,EAAqC,MAAM,iBAAiB,CAAC;AAE3F,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAK3E,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAI9E,qBAAa,uBAAuB;IAClC,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,aAAa,EAAE,CAAM;IAC9B,QAAQ,EAAE,eAAe,EAAE,CAAM;IACjC,SAAS,EAAG,SAAS,CAAC;IACtB,GAAG,EAAG,GAAG,CAAC;IACV,eAAe,EAAG,eAAe,CAAC;IAElC,YAAY,EAAG,gBAAgB,GAAG,SAAS,CAAC;IAE5C,WAAW,EAAG,aAAa,CAAC;IAC5B,WAAW,EAAG,aAAa,CAAC;IAC5B,qBAAqB,EAAG,qBAAqB,CAAC;IAC9C,UAAU,EAAG,UAAU,CAAC;IACxB,YAAY,EAAG,YAAY,CAAC;IAC5B,OAAO,EAAG,aAAa,CAAC;IACxB,QAAQ,EAAG,mBAAmB,CAAC;IAE/B,
|
|
1
|
+
{"version":3,"file":"cross_chain_messaging_test.d.ts","sourceRoot":"","sources":["../../src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EAET,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,gBAAgB,EAAqC,MAAM,iBAAiB,CAAC;AAE3F,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAK3E,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAI9E,qBAAa,uBAAuB;IAClC,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,aAAa,EAAE,CAAM;IAC9B,QAAQ,EAAE,eAAe,EAAE,CAAM;IACjC,SAAS,EAAG,SAAS,CAAC;IACtB,GAAG,EAAG,GAAG,CAAC;IACV,eAAe,EAAG,eAAe,CAAC;IAElC,YAAY,EAAG,gBAAgB,GAAG,SAAS,CAAC;IAE5C,WAAW,EAAG,aAAa,CAAC;IAC5B,WAAW,EAAG,aAAa,CAAC;IAC5B,qBAAqB,EAAG,qBAAqB,CAAC;IAC9C,UAAU,EAAG,UAAU,CAAC;IACxB,YAAY,EAAG,YAAY,CAAC;IAC5B,OAAO,EAAG,aAAa,CAAC;IACxB,QAAQ,EAAG,mBAAmB,CAAC;IAE/B,KAAK,EAAG,GAAG,CAAC;IACZ,MAAM,EAAG,GAAG,CAAC;IACb,UAAU,EAAG,UAAU,CAAC;gBAEZ,QAAQ,EAAE,MAAM;IAKtB,YAAY;IAIZ,KAAK;IAQX,QAAQ,YACA,MAAM,SACL,CAAC,OAAO,EAAE,iBAAiB,KAAK,QAAQ,CAAC,CAAC,YACxC,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,QAAQ,IAAI,CAAC,KACtE,QAAQ,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAIR,kBAAkB;IAkGxB,mBAAmB,IAAI,iBAAiB;CAYzC;AAED,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,YAAY,CAAC;IACvB,WAAW,EAAE,UAAU,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
|
2
2
|
import { AztecAddress, EthAddress, createLogger } from '@aztec/aztec.js';
|
|
3
3
|
import { CheatCodes } from '@aztec/aztec.js/testing';
|
|
4
4
|
import { createL1Clients, deployL1Contract } from '@aztec/ethereum';
|
|
5
|
-
import { InboxAbi, OutboxAbi,
|
|
5
|
+
import { InboxAbi, OutboxAbi, TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
|
|
6
6
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
7
7
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
8
8
|
import { getContract } from 'viem';
|
|
@@ -26,7 +26,6 @@ export class CrossChainMessagingTest {
|
|
|
26
26
|
ownerAddress;
|
|
27
27
|
l2Token;
|
|
28
28
|
l2Bridge;
|
|
29
|
-
rollup;
|
|
30
29
|
inbox;
|
|
31
30
|
outbox;
|
|
32
31
|
cheatcodes;
|
|
@@ -35,7 +34,7 @@ export class CrossChainMessagingTest {
|
|
|
35
34
|
this.snapshotManager = createSnapshotManager(`e2e_cross_chain_messaging/${testName}`, dataPath);
|
|
36
35
|
}
|
|
37
36
|
async assumeProven() {
|
|
38
|
-
await this.cheatcodes.rollup.markAsProven(
|
|
37
|
+
await this.cheatcodes.rollup.markAsProven();
|
|
39
38
|
}
|
|
40
39
|
async setup() {
|
|
41
40
|
const { aztecNode, pxe, aztecNodeConfig } = await this.snapshotManager.setup();
|
|
@@ -51,15 +50,10 @@ export class CrossChainMessagingTest {
|
|
|
51
50
|
async applyBaseSnapshots() {
|
|
52
51
|
// Note that we are using the same `pxe`, `aztecNodeConfig` and `aztecNode` across all snapshots.
|
|
53
52
|
// This is to not have issues with different networks.
|
|
54
|
-
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger), async ({ deployedAccounts }, { pxe, aztecNodeConfig, aztecNode
|
|
53
|
+
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger), async ({ deployedAccounts }, { pxe, aztecNodeConfig, aztecNode })=>{
|
|
55
54
|
this.wallets = await Promise.all(deployedAccounts.map((a)=>getSchnorrWallet(pxe, a.address, a.signingKey)));
|
|
56
55
|
this.accounts = this.wallets.map((w)=>w.getCompleteAddress());
|
|
57
56
|
this.wallets.forEach((w, i)=>this.logger.verbose(`Wallet ${i} address: ${w.getAddress()}`));
|
|
58
|
-
this.rollup = getContract({
|
|
59
|
-
address: deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(),
|
|
60
|
-
abi: RollupAbi,
|
|
61
|
-
client: deployL1ContractsValues.walletClient
|
|
62
|
-
});
|
|
63
57
|
this.user1Wallet = this.wallets[0];
|
|
64
58
|
this.user2Wallet = this.wallets[1];
|
|
65
59
|
this.pxe = pxe;
|
|
@@ -77,15 +71,6 @@ export class CrossChainMessagingTest {
|
|
|
77
71
|
'UND',
|
|
78
72
|
walletClient.account.address
|
|
79
73
|
]).then(({ address })=>address);
|
|
80
|
-
const underlyingERC20 = getContract({
|
|
81
|
-
address: underlyingERC20Address.toString(),
|
|
82
|
-
abi: TestERC20Abi,
|
|
83
|
-
client: walletClient
|
|
84
|
-
});
|
|
85
|
-
// allow anyone to mint
|
|
86
|
-
await underlyingERC20.write.setFreeForAll([
|
|
87
|
-
true
|
|
88
|
-
], {});
|
|
89
74
|
this.logger.verbose(`Setting up cross chain harness...`);
|
|
90
75
|
this.crossChainTestHarness = await CrossChainTestHarness.new(this.aztecNode, this.pxe, publicClient, walletClient, this.wallets[0], this.logger, underlyingERC20Address);
|
|
91
76
|
this.logger.verbose(`L2 token deployed to: ${this.crossChainTestHarness.l2Token.address}`);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AccountWallet, type AztecAddress, type AztecNode, type ContractArtifact, type ContractBase, Fr, type Logger, type PXE, type PublicKeys, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import type { StatefulTestContract } from '@aztec/noir-contracts.js/StatefulTest';
|
|
3
|
+
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
3
4
|
export declare class DeployTest {
|
|
4
5
|
private snapshotManager;
|
|
5
6
|
private wallets;
|
|
@@ -7,6 +8,7 @@ export declare class DeployTest {
|
|
|
7
8
|
pxe: PXE;
|
|
8
9
|
wallet: AccountWallet;
|
|
9
10
|
aztecNode: AztecNode;
|
|
11
|
+
aztecNodeAdmin: AztecNodeAdmin;
|
|
10
12
|
constructor(testName: string);
|
|
11
13
|
setup(): Promise<this>;
|
|
12
14
|
teardown(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_test.d.ts","sourceRoot":"","sources":["../../src/e2e_deploy_contract/deploy_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,UAAU,EACf,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy_test.d.ts","sourceRoot":"","sources":["../../src/e2e_deploy_contract/deploy_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,UAAU,EACf,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAMtE,qBAAa,UAAU;IACrB,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,OAAO,CAAuB;IAE/B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAG,GAAG,CAAC;IACV,MAAM,EAAG,aAAa,CAAC;IACvB,SAAS,EAAG,SAAS,CAAC;IACtB,cAAc,EAAG,cAAc,CAAC;gBAE3B,QAAQ,EAAE,MAAM;IAKtB,KAAK;IAQL,QAAQ;YAIA,2BAA2B;IAYnC,gBAAgB,CAAC,CAAC,SAAS,YAAY,EAC3C,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAC1C,IAAI,GAAE;QACJ,IAAI,CAAC,EAAE,EAAE,CAAC;QACV,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,YAAY,CAAC;KACpB,GACL,OAAO,CAAC,CAAC,CAAC;IAaP,qBAAqB,IAAI,OAAO,CAAC,YAAY,CAAC;CAIrD;AAED,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AAElG,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,YAAY,IAAI;IAC1D,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACtD,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC"}
|
|
@@ -9,6 +9,7 @@ export class DeployTest {
|
|
|
9
9
|
pxe;
|
|
10
10
|
wallet;
|
|
11
11
|
aztecNode;
|
|
12
|
+
aztecNodeAdmin;
|
|
12
13
|
constructor(testName){
|
|
13
14
|
this.logger = createLogger(`e2e:e2e_deploy_contract:${testName}`);
|
|
14
15
|
this.snapshotManager = createSnapshotManager(`e2e_deploy_contract/${testName}`, dataPath);
|
|
@@ -17,6 +18,7 @@ export class DeployTest {
|
|
|
17
18
|
await this.applyInitialAccountSnapshot();
|
|
18
19
|
const context = await this.snapshotManager.setup();
|
|
19
20
|
({ pxe: this.pxe, aztecNode: this.aztecNode } = context);
|
|
21
|
+
this.aztecNodeAdmin = context.aztecNode;
|
|
20
22
|
return this;
|
|
21
23
|
}
|
|
22
24
|
async teardown() {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { type Logger } from '@aztec/aztec.js';
|
|
3
3
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
4
|
-
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
5
|
-
import { type Delayer } from '@aztec/ethereum/test';
|
|
4
|
+
import { ChainMonitor, type Delayer } from '@aztec/ethereum/test';
|
|
6
5
|
import { ProverNode } from '@aztec/prover-node';
|
|
7
6
|
import type { L2BlockNumber } from '@aztec/stdlib/block';
|
|
8
7
|
import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAM,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAM,KAAK,MAAM,EAA8D,MAAM,iBAAiB,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAkB,KAAK,OAAO,EAAwB,MAAM,sBAAsB,CAAC;AAGxG,OAAO,EAAE,UAAU,EAAuB,MAAM,oBAAoB,CAAC;AAIrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,KAAK,EAAO,YAAY,EAAE,MAAM,MAAM,CAAC;AAE9C,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EAIlB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,kBAAkB,QAAsE,CAAC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'@aztec/aztec-node';
|
|
2
|
-
import { Fr, getTimestampRangeForEpoch, retryUntil, sleep } from '@aztec/aztec.js';
|
|
2
|
+
import { Fr, MerkleTreeId, getTimestampRangeForEpoch, retryUntil, sleep } from '@aztec/aztec.js';
|
|
3
3
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
4
|
-
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
5
|
-
import { waitUntilL1Timestamp } from '@aztec/ethereum/test';
|
|
4
|
+
import { ChainMonitor, waitUntilL1Timestamp } from '@aztec/ethereum/test';
|
|
6
5
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
7
6
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
8
|
-
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
9
7
|
import { join } from 'path';
|
|
10
8
|
import { createAndSyncProverNode, getPrivateKeyFromIndex, setup } from '../fixtures/utils.js';
|
|
11
9
|
// This can be lowered to as much as 2s in non-CI
|
|
@@ -147,8 +145,11 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
147
145
|
}
|
|
148
146
|
}
|
|
149
147
|
/** Verifies whether the given block number is found on the aztec node. */ async verifyHistoricBlock(blockNumber, expectedSuccess) {
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
// We use `findLeavesIndexes` here, but could use any function that queries the world-state
|
|
149
|
+
// at a particular block, so we know whether that historic block is available or has been
|
|
150
|
+
// pruned. Note that `getBlock` would not work here, since it only hits the archiver.
|
|
151
|
+
const result = await this.context.aztecNode.findLeavesIndexes(blockNumber, MerkleTreeId.NULLIFIER_TREE, [
|
|
152
|
+
Fr.ZERO
|
|
152
153
|
]).then((_)=>true).catch((_)=>false);
|
|
153
154
|
expect(result).toBe(expectedSuccess);
|
|
154
155
|
}
|
|
@@ -7,6 +7,7 @@ import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscriptio
|
|
|
7
7
|
import { CounterContract } from '@aztec/noir-contracts.js/Counter';
|
|
8
8
|
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
9
9
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
10
|
+
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
10
11
|
import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
|
|
11
12
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
12
13
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
@@ -18,6 +19,7 @@ import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.j
|
|
|
18
19
|
* PublicDeployAccounts: Deploys the accounts publicly.
|
|
19
20
|
* DeployFeeJuice: Deploys the Fee Juice contract.
|
|
20
21
|
* FPCSetup: Deploys BananaCoin and FPC contracts, and bridges gas from L1.
|
|
22
|
+
* SponsoredFPCSetup: Deploys Sponsored FPC contract, and bridges gas from L1.
|
|
21
23
|
* FundAlice: Mints private and public bananas to Alice.
|
|
22
24
|
* SetupSubscription: Deploys a counter contract and a subscription contract, and mints Fee Juice to the subscription contract.
|
|
23
25
|
*/
|
|
@@ -40,6 +42,7 @@ export declare class FeesTest {
|
|
|
40
42
|
feeJuiceContract: FeeJuiceContract;
|
|
41
43
|
bananaCoin: BananaCoin;
|
|
42
44
|
bananaFPC: FPCContract;
|
|
45
|
+
sponsoredFPC: SponsoredFPCContract;
|
|
43
46
|
counterContract: CounterContract;
|
|
44
47
|
subscriptionContract: AppSubscriptionContract;
|
|
45
48
|
feeJuiceBridgeTestHarness: GasBridgingTestHarness;
|
|
@@ -68,6 +71,7 @@ export declare class FeesTest {
|
|
|
68
71
|
applySetupFeeJuiceSnapshot(): Promise<void>;
|
|
69
72
|
applyDeployBananaTokenSnapshot(): Promise<void>;
|
|
70
73
|
applyFPCSetupSnapshot(): Promise<void>;
|
|
74
|
+
applySponsoredFPCSetupSnapshot(): Promise<void>;
|
|
71
75
|
applyFundAliceWithBananas(): Promise<void>;
|
|
72
76
|
applyFundAliceWithPrivateBananas(): Promise<void>;
|
|
73
77
|
applySetupSubscription(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fees_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,KAAK,qBAAqB,
|
|
1
|
+
{"version":3,"file":"fees_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,KAAK,qBAAqB,EAAoD,MAAM,iBAAiB,CAAC;AAC/G,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAG7E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhD,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,iCAAiC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C;IAE/D,SAAgB,qBAAqB,SAAgB;IACrD,SAAgB,mBAAmB,SAAgB;IACnD,SAAgB,0BAA0B,SAAgB;gBAGxD,QAAQ,EAAE,MAAM,EACR,gBAAgB,SAAI,EAC5B,YAAY,GAAE,OAAO,CAAC,YAAY,GAAG,qBAAqB,CAAM;IAc5D,KAAK;IAUL,QAAQ;IAKd,oBAAoB,CAAC,CAAC,EAAE,OAAO;IAIzB,kBAAkB;IAOlB,qBAAqB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM;IAMjE,sFAAsF;IAChF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IASjD,kBAAkB;IAOzB,4BAA4B;IAmC5B,iCAAiC;IAMjC,0BAA0B;IA0B1B,8BAA8B;IAuBvB,qBAAqB;IA+DrB,8BAA8B;IAqB9B,yBAAyB;IAWzB,gCAAgC;IAUhC,sBAAsB;CAgCpC"}
|
|
@@ -2,24 +2,24 @@ import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
|
2
2
|
import { createLogger, sleep } from '@aztec/aztec.js';
|
|
3
3
|
import { CheatCodes } from '@aztec/aztec.js/testing';
|
|
4
4
|
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
5
|
-
import { RollupContract, createL1Clients } from '@aztec/ethereum';
|
|
5
|
+
import { RollupContract, createL1Clients, getPublicClient } from '@aztec/ethereum';
|
|
6
6
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
7
7
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
8
|
-
import {
|
|
8
|
+
import { TestERC20Abi } from '@aztec/l1-artifacts';
|
|
9
9
|
import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscription';
|
|
10
10
|
import { CounterContract } from '@aztec/noir-contracts.js/Counter';
|
|
11
11
|
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
12
12
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
13
|
+
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
13
14
|
import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
|
|
14
15
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
15
16
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
16
|
-
import { computePartialAddress } from '@aztec/stdlib/contract';
|
|
17
17
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
18
18
|
import { getContract } from 'viem';
|
|
19
19
|
import { MNEMONIC } from '../fixtures/fixtures.js';
|
|
20
20
|
import { createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
|
|
21
21
|
import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
22
|
-
import { ensureAccountsPubliclyDeployed, getBalancesFn, setupCanonicalFeeJuice } from '../fixtures/utils.js';
|
|
22
|
+
import { ensureAccountsPubliclyDeployed, getBalancesFn, setupCanonicalFeeJuice, setupSponsoredFPC } from '../fixtures/utils.js';
|
|
23
23
|
import { FeeJuicePortalTestingHarnessFactory } from '../shared/gas_portal_test_harness.js';
|
|
24
24
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
25
25
|
/**
|
|
@@ -28,6 +28,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
28
28
|
* PublicDeployAccounts: Deploys the accounts publicly.
|
|
29
29
|
* DeployFeeJuice: Deploys the Fee Juice contract.
|
|
30
30
|
* FPCSetup: Deploys BananaCoin and FPC contracts, and bridges gas from L1.
|
|
31
|
+
* SponsoredFPCSetup: Deploys Sponsored FPC contract, and bridges gas from L1.
|
|
31
32
|
* FundAlice: Mints private and public bananas to Alice.
|
|
32
33
|
* SetupSubscription: Deploys a counter contract and a subscription contract, and mints Fee Juice to the subscription contract.
|
|
33
34
|
*/ export class FeesTest {
|
|
@@ -49,6 +50,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
49
50
|
feeJuiceContract;
|
|
50
51
|
bananaCoin;
|
|
51
52
|
bananaFPC;
|
|
53
|
+
sponsoredFPC;
|
|
52
54
|
counterContract;
|
|
53
55
|
subscriptionContract;
|
|
54
56
|
feeJuiceBridgeTestHarness;
|
|
@@ -121,7 +123,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
121
123
|
await this.applyDeployBananaTokenSnapshot();
|
|
122
124
|
}
|
|
123
125
|
async applyInitialAccountsSnapshot() {
|
|
124
|
-
await this.snapshotManager.snapshot('initial_accounts', deployAccounts(this.numberOfAccounts, this.logger), async ({ deployedAccounts }, { pxe, aztecNode, aztecNodeConfig })=>{
|
|
126
|
+
await this.snapshotManager.snapshot('initial_accounts', deployAccounts(this.numberOfAccounts, this.logger), async ({ deployedAccounts }, { pxe, aztecNode, aztecNodeConfig, deployL1ContractsValues })=>{
|
|
125
127
|
this.pxe = pxe;
|
|
126
128
|
this.aztecNode = aztecNode;
|
|
127
129
|
this.gasSettings = GasSettings.default({
|
|
@@ -136,17 +138,13 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
136
138
|
this.fpcAdmin = this.aliceAddress;
|
|
137
139
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
138
140
|
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.aliceWallet);
|
|
139
|
-
if (this.numberOfAccounts > 1) {
|
|
140
|
-
const bobInstance = (await this.bobWallet.getContractMetadata(this.bobAddress)).contractInstance;
|
|
141
|
-
await this.aliceWallet.registerAccount(deployedAccounts[1].secret, await computePartialAddress(bobInstance));
|
|
142
|
-
}
|
|
143
141
|
this.coinbase = EthAddress.random();
|
|
144
|
-
const { publicClient, walletClient } = createL1Clients(aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
145
142
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
146
|
-
aztecNode
|
|
143
|
+
aztecNode,
|
|
144
|
+
aztecNodeAdmin: aztecNode,
|
|
147
145
|
pxeService: pxe,
|
|
148
|
-
publicClient: publicClient,
|
|
149
|
-
walletClient: walletClient,
|
|
146
|
+
publicClient: deployL1ContractsValues.publicClient,
|
|
147
|
+
walletClient: deployL1ContractsValues.walletClient,
|
|
150
148
|
wallet: this.aliceWallet,
|
|
151
149
|
logger: this.logger
|
|
152
150
|
});
|
|
@@ -162,12 +160,12 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
162
160
|
this.context = context;
|
|
163
161
|
this.feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.aliceWallet);
|
|
164
162
|
this.getGasBalanceFn = getBalancesFn('⛽', this.feeJuiceContract.methods.balance_of_public, this.logger);
|
|
165
|
-
const { publicClient, walletClient } = createL1Clients(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
166
163
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
167
164
|
aztecNode: context.aztecNode,
|
|
165
|
+
aztecNodeAdmin: context.aztecNode,
|
|
168
166
|
pxeService: context.pxe,
|
|
169
|
-
publicClient: publicClient,
|
|
170
|
-
walletClient: walletClient,
|
|
167
|
+
publicClient: context.deployL1ContractsValues.publicClient,
|
|
168
|
+
walletClient: context.deployL1ContractsValues.walletClient,
|
|
171
169
|
wallet: this.aliceWallet,
|
|
172
170
|
logger: this.logger
|
|
173
171
|
});
|
|
@@ -182,6 +180,9 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
182
180
|
};
|
|
183
181
|
}, async ({ bananaCoinAddress })=>{
|
|
184
182
|
this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.aliceWallet);
|
|
183
|
+
const logger = this.logger;
|
|
184
|
+
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, logger);
|
|
185
|
+
this.getBananaPrivateBalanceFn = getBalancesFn('🍌.private', this.bananaCoin.methods.balance_of_private, logger);
|
|
185
186
|
});
|
|
186
187
|
}
|
|
187
188
|
async applyFPCSetupSnapshot() {
|
|
@@ -201,9 +202,6 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
201
202
|
}, async (data, context)=>{
|
|
202
203
|
const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.aliceWallet);
|
|
203
204
|
this.bananaFPC = bananaFPC;
|
|
204
|
-
const logger = this.logger;
|
|
205
|
-
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, logger);
|
|
206
|
-
this.getBananaPrivateBalanceFn = getBalancesFn('🍌.private', this.bananaCoin.methods.balance_of_private, logger);
|
|
207
205
|
this.getCoinbaseBalance = async ()=>{
|
|
208
206
|
const { walletClient } = createL1Clients(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
209
207
|
const gasL1 = getContract({
|
|
@@ -216,30 +214,40 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
216
214
|
]);
|
|
217
215
|
};
|
|
218
216
|
this.getCoinbaseSequencerRewards = async ()=>{
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
abi: RollupAbi,
|
|
223
|
-
client: walletClient
|
|
217
|
+
const publicClient = getPublicClient({
|
|
218
|
+
l1RpcUrls: context.aztecNodeConfig.l1RpcUrls,
|
|
219
|
+
l1ChainId: context.aztecNodeConfig.l1ChainId
|
|
224
220
|
});
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
]);
|
|
221
|
+
const rollup = new RollupContract(publicClient, data.rollupAddress);
|
|
222
|
+
return await rollup.getSequencerRewards(this.coinbase);
|
|
228
223
|
};
|
|
229
224
|
this.getProverFee = async (blockNumber)=>{
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
abi: RollupAbi,
|
|
234
|
-
client: walletClient
|
|
225
|
+
const publicClient = getPublicClient({
|
|
226
|
+
l1RpcUrls: context.aztecNodeConfig.l1RpcUrls,
|
|
227
|
+
l1ChainId: context.aztecNodeConfig.l1ChainId
|
|
235
228
|
});
|
|
236
|
-
const
|
|
229
|
+
const rollup = new RollupContract(publicClient, data.rollupAddress);
|
|
230
|
+
const provingCostPerMana = await rollup.getProvingCostPerManaInFeeAsset();
|
|
237
231
|
const block = await this.pxe.getBlock(blockNumber);
|
|
238
232
|
const mana = block.header.totalManaUsed.toBigInt();
|
|
239
233
|
return mana * provingCostPerMana;
|
|
240
234
|
};
|
|
241
235
|
});
|
|
242
236
|
}
|
|
237
|
+
async applySponsoredFPCSetupSnapshot() {
|
|
238
|
+
await this.snapshotManager.snapshot('sponsored_fpc_setup', async (context)=>{
|
|
239
|
+
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
240
|
+
expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPubliclyDeployed).toBe(true);
|
|
241
|
+
this.sponsoredFPC = await setupSponsoredFPC(context.pxe);
|
|
242
|
+
this.logger.info(`SponsoredFPC deployed at ${this.sponsoredFPC.address}`);
|
|
243
|
+
return {
|
|
244
|
+
sponsoredFPCAddress: this.sponsoredFPC.address
|
|
245
|
+
};
|
|
246
|
+
}, async (data)=>{
|
|
247
|
+
const sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.aliceWallet);
|
|
248
|
+
this.sponsoredFPC = sponsoredFPC;
|
|
249
|
+
});
|
|
250
|
+
}
|
|
243
251
|
async applyFundAliceWithBananas() {
|
|
244
252
|
await this.snapshotManager.snapshot('fund_alice', async ()=>{
|
|
245
253
|
await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
|
|
@@ -6,6 +6,7 @@ import type { BlobSinkServer } from '@aztec/blob-sink/server';
|
|
|
6
6
|
import { type DeployL1ContractsReturnType } from '@aztec/ethereum';
|
|
7
7
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
8
8
|
import type { PXEService } from '@aztec/pxe/server';
|
|
9
|
+
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
9
10
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
10
11
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
11
12
|
/**
|
|
@@ -28,6 +29,7 @@ export declare class FullProverTest {
|
|
|
28
29
|
fakeProofsAsset: TokenContract;
|
|
29
30
|
tokenSim: TokenSimulator;
|
|
30
31
|
aztecNode: AztecNode;
|
|
32
|
+
aztecNodeAdmin: AztecNodeAdmin;
|
|
31
33
|
pxe: PXEService;
|
|
32
34
|
cheatCodes: CheatCodes;
|
|
33
35
|
blobSink: BlobSinkServer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/e2e_prover/e2e_prover_test.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAqB,KAAK,6BAA6B,EAAuB,MAAM,kBAAkB,CAAC;AAE9G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,KAAK,2BAA2B,EAAoB,MAAM,iBAAiB,CAAC;AAGrF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/e2e_prover/e2e_prover_test.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,SAAS,EACd,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;IAC9C,OAAO,CAAC,iBAAiB,CAAC,CAAsB;IAChD,oBAAoB,CAAC,EAAE,6BAA6B,CAAC;IACrD,YAAY,EAAE,aAAa,EAAE,CAAM;IACnC,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,mBAAmB,CAAc;IAClC,WAAW,EAAG,2BAA2B,CAAC;IAC1C,aAAa,EAAG,UAAU,CAAC;gBAGhC,QAAQ,EAAE,MAAM,EACR,sBAAsB,EAAE,MAAM,EACtC,QAAQ,EAAE,UAAU,EACZ,UAAU,UAAO;IAW3B;;;;OAIG;IACG,kBAAkB;IAqDlB,KAAK;YA8JG,WAAW;IAQzB,QAAQ,YACA,MAAM,SACL,CAAC,OAAO,EAAE,iBAAiB,KAAK,QAAQ,CAAC,CAAC,YACxC,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,QAAQ,IAAI,CAAC,KACtE,QAAQ,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAeR,iBAAiB;IA+CjB,cAAc;CA4BrB"}
|
|
@@ -14,7 +14,7 @@ import { privateKeyToAddress } from 'viem/accounts';
|
|
|
14
14
|
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
15
15
|
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
16
16
|
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
|
|
17
|
-
import { getPrivateKeyFromIndex, setupPXEService } from '../fixtures/utils.js';
|
|
17
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEService } from '../fixtures/utils.js';
|
|
18
18
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
19
19
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
20
20
|
/**
|
|
@@ -36,6 +36,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
36
36
|
fakeProofsAsset;
|
|
37
37
|
tokenSim;
|
|
38
38
|
aztecNode;
|
|
39
|
+
aztecNodeAdmin;
|
|
39
40
|
pxe;
|
|
40
41
|
cheatCodes;
|
|
41
42
|
blobSink;
|
|
@@ -80,7 +81,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
80
81
|
// Create the token contract state.
|
|
81
82
|
// Move this account thing to addAccounts above?
|
|
82
83
|
this.logger.verbose(`Public deploy accounts...`);
|
|
83
|
-
await publicDeployAccounts(this.wallets[0], this.accounts.slice(0, 2)
|
|
84
|
+
await publicDeployAccounts(this.wallets[0], this.accounts.slice(0, 2));
|
|
84
85
|
this.logger.verbose(`Deploying TokenContract...`);
|
|
85
86
|
const asset = await TokenContract.deploy(this.wallets[0], this.accounts[0], FullProverTest.TOKEN_NAME, FullProverTest.TOKEN_SYMBOL, FullProverTest.TOKEN_DECIMALS).send().deployed();
|
|
86
87
|
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
@@ -101,6 +102,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
101
102
|
this.context.watcher.setIsMarkingAsProven(false);
|
|
102
103
|
this.simulatedProverNode = this.context.proverNode;
|
|
103
104
|
({ pxe: this.pxe, aztecNode: this.aztecNode, deployL1ContractsValues: this.l1Contracts, cheatCodes: this.cheatCodes, blobSink: this.blobSink } = this.context);
|
|
105
|
+
this.aztecNodeAdmin = this.context.aztecNode;
|
|
104
106
|
const blobSinkClient = createBlobSinkClient({
|
|
105
107
|
blobSinkUrl: `http://localhost:${this.blobSink.port}`
|
|
106
108
|
});
|
|
@@ -122,14 +124,14 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
122
124
|
}
|
|
123
125
|
this.circuitProofVerifier = await BBCircuitVerifier.new(bbConfig);
|
|
124
126
|
this.logger.debug(`Configuring the node for real proofs...`);
|
|
125
|
-
await this.
|
|
127
|
+
await this.aztecNodeAdmin.setConfig({
|
|
126
128
|
realProofs: true,
|
|
127
129
|
minTxsPerBlock: this.minNumberOfTxsPerBlock
|
|
128
130
|
});
|
|
129
131
|
} else {
|
|
130
132
|
this.logger.debug(`Configuring the node min txs per block ${this.minNumberOfTxsPerBlock}...`);
|
|
131
133
|
this.circuitProofVerifier = new TestCircuitVerifier();
|
|
132
|
-
await this.
|
|
134
|
+
await this.aztecNodeAdmin.setConfig({
|
|
133
135
|
minTxsPerBlock: this.minNumberOfTxsPerBlock
|
|
134
136
|
});
|
|
135
137
|
}
|
|
@@ -197,7 +199,8 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
197
199
|
txGatheringIntervalMs: 1000,
|
|
198
200
|
txGatheringMaxParallelRequests: 100
|
|
199
201
|
};
|
|
200
|
-
const
|
|
202
|
+
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
203
|
+
const { prefilledPublicData } = await getGenesisValues(this.context.initialFundedAccounts.map((a)=>a.address).concat(sponsoredFPCAddress));
|
|
201
204
|
this.proverNode = await createProverNode(proverConfig, {
|
|
202
205
|
aztecNodeTxProvider: this.aztecNode,
|
|
203
206
|
archiver: archiver,
|
|
@@ -242,13 +245,10 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
242
245
|
const { fakeProofsAsset: asset, accounts } = this;
|
|
243
246
|
const privateAmount = 10000n;
|
|
244
247
|
const publicAmount = 10000n;
|
|
245
|
-
const waitOpts = {
|
|
246
|
-
proven: false
|
|
247
|
-
};
|
|
248
248
|
this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
|
|
249
|
-
await asset.methods.mint_to_public(accounts[0].address, privateAmount + publicAmount).send().wait(
|
|
249
|
+
await asset.methods.mint_to_public(accounts[0].address, privateAmount + publicAmount).send().wait();
|
|
250
250
|
this.logger.verbose(`Transferring ${privateAmount} to private...`);
|
|
251
|
-
await asset.methods.transfer_to_private(accounts[0].address, privateAmount).send().wait(
|
|
251
|
+
await asset.methods.transfer_to_private(accounts[0].address, privateAmount).send().wait();
|
|
252
252
|
this.logger.verbose(`Minting complete.`);
|
|
253
253
|
return {
|
|
254
254
|
amount: publicAmount
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AccountWallet, type CompleteAddress, type Logger } from '@aztec/aztec.js';
|
|
1
|
+
import { type AccountWallet, type AztecNode, type CompleteAddress, type Logger } from '@aztec/aztec.js';
|
|
2
2
|
import { DocsExampleContract } from '@aztec/noir-contracts.js/DocsExample';
|
|
3
3
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
4
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
@@ -14,6 +14,7 @@ export declare class TokenContractTest {
|
|
|
14
14
|
asset: TokenContract;
|
|
15
15
|
tokenSim: TokenSimulator;
|
|
16
16
|
badAccount: DocsExampleContract;
|
|
17
|
+
node: AztecNode;
|
|
17
18
|
constructor(testName: string);
|
|
18
19
|
/**
|
|
19
20
|
* Adds two state shifts to snapshot manager.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AACtH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIlE,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,UAAU,SAAU;IAC3B,MAAM,CAAC,YAAY,SAAS;IAC5B,MAAM,CAAC,cAAc,SAAO;IAC5B,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,aAAa,EAAE,CAAM;IAC9B,QAAQ,EAAE,eAAe,EAAE,CAAM;IACjC,KAAK,EAAG,aAAa,CAAC;IACtB,QAAQ,EAAG,cAAc,CAAC;IAC1B,UAAU,EAAG,mBAAmB,CAAC;IACjC,IAAI,EAAG,SAAS,CAAC;gBAEL,QAAQ,EAAE,MAAM;IAO5B;;;;OAIG;IACG,kBAAkB;IAiElB,KAAK;IAIX,QAAQ,YACA,MAAM,SACL,CAAC,OAAO,EAAE,iBAAiB,KAAK,QAAQ,CAAC,CAAC,YACxC,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,QAAQ,IAAI,CAAC,KACtE,QAAQ,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAIR,iBAAiB;CAyCxB"}
|
|
@@ -18,6 +18,7 @@ export class TokenContractTest {
|
|
|
18
18
|
asset;
|
|
19
19
|
tokenSim;
|
|
20
20
|
badAccount;
|
|
21
|
+
node;
|
|
21
22
|
constructor(testName){
|
|
22
23
|
this.logger = createLogger(`e2e:e2e_token_contract:${testName}`);
|
|
23
24
|
this.snapshotManager = createSnapshotManager(`e2e_token_contract/${testName}`, dataPath, {
|
|
@@ -31,7 +32,8 @@ export class TokenContractTest {
|
|
|
31
32
|
*/ async applyBaseSnapshots() {
|
|
32
33
|
// Adding a timeout of 2 minutes in here such that it is propagated to the underlying tests
|
|
33
34
|
jest.setTimeout(120_000);
|
|
34
|
-
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger), async ({ deployedAccounts }, { pxe })=>{
|
|
35
|
+
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger), async ({ deployedAccounts }, { pxe, aztecNode })=>{
|
|
36
|
+
this.node = aztecNode;
|
|
35
37
|
this.wallets = await Promise.all(deployedAccounts.map((a)=>getSchnorrWallet(pxe, a.address, a.signingKey)));
|
|
36
38
|
this.accounts = this.wallets.map((w)=>w.getCompleteAddress());
|
|
37
39
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import { type AztecAddress, type CompleteAddress, type Logger, type PXE, type Wallet } from '@aztec/aztec.js';
|
|
3
|
+
import { type AztecAddress, type AztecNode, type CompleteAddress, type Logger, type PXE, type Wallet } from '@aztec/aztec.js';
|
|
4
4
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
5
5
|
import { type BlobSinkServer } from '@aztec/blob-sink/server';
|
|
6
6
|
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType } from '@aztec/ethereum';
|
|
@@ -82,7 +82,9 @@ export declare const deployAccounts: (numberOfAccounts: number, logger: Logger,
|
|
|
82
82
|
* Use this when you need to make a public call to an account contract, such as for requesting a public authwit.
|
|
83
83
|
* @param sender - Wallet to send the deployment tx.
|
|
84
84
|
* @param accountsToDeploy - Which accounts to publicly deploy.
|
|
85
|
+
* @param waitUntilProven - Whether to wait for the tx to be proven.
|
|
86
|
+
* @param pxeOrNode - PXE or AztecNode to wait for proven.
|
|
85
87
|
*/
|
|
86
|
-
export declare function publicDeployAccounts(sender: Wallet, accountsToDeploy: (CompleteAddress | AztecAddress)[], waitUntilProven?: boolean): Promise<void>;
|
|
88
|
+
export declare function publicDeployAccounts(sender: Wallet, accountsToDeploy: (CompleteAddress | AztecAddress)[], waitUntilProven?: boolean, pxeOrNode?: PXE | AztecNode): Promise<void>;
|
|
87
89
|
export {};
|
|
88
90
|
//# sourceMappingURL=snapshot_manager.d.ts.map
|