@aztec/end-to-end 0.0.1-commit.d6f2b3f94 → 0.0.1-commit.e2b2873ed
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/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_deploy_contract/deploy_test.d.ts +2 -2
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- 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 +2 -1
- 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/e2e_prover_test.d.ts +2 -2
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/setup.d.ts +3 -3
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +4 -3
- 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/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/test-wallet/test_wallet.d.ts +82 -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 +3 -7
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +10 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +1 -1
- package/src/e2e_deploy_contract/deploy_test.ts +1 -1
- package/src/e2e_fees/bridging_race.notest.ts +1 -1
- package/src/e2e_fees/fees_test.ts +5 -20
- package/src/e2e_p2p/p2p_network.ts +1 -1
- package/src/e2e_p2p/shared.ts +2 -1
- package/src/e2e_token_contract/token_contract_test.ts +10 -1
- package/src/fixtures/e2e_prover_test.ts +1 -1
- package/src/fixtures/setup.ts +3 -3
- package/src/guides/up_quick_start.sh +3 -3
- package/src/shared/submit-transactions.ts +2 -1
- package/src/shared/uniswap_l1_l2.ts +1 -1
- package/src/simulators/token_simulator.ts +1 -29
- package/src/spartan/setup_test_wallets.ts +3 -1
- package/src/test-wallet/test_wallet.ts +305 -0
- package/src/test-wallet/utils.ts +112 -0
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0LXdhbGxldC91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsMkJBQTJCLEVBQzNCLFlBQVksRUFDWixLQUFLLGFBQWEsRUFFbEIsS0FBSyxNQUFNLEVBQ1gsS0FBSyxzQkFBc0IsRUFDM0IsS0FBSyxRQUFRLEVBRWQsTUFBTSwyQkFBMkIsQ0FBQztBQUNuQyxPQUFPLEVBQUUsS0FBSyxTQUFTLEVBQWEsTUFBTSxzQkFBc0IsQ0FBQztBQUVqRSxPQUFPLEVBQUUsS0FBSyxjQUFjLEVBQUUsS0FBSyxZQUFZLEVBQUUsRUFBRSxFQUFFLE1BQU0sRUFBRSxLQUFLLFNBQVMsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBSXRHLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRW5ELE1BQU0sTUFBTSxnQkFBZ0IsR0FBRztJQUM3QixJQUFJLENBQUMsRUFBRSxNQUFNLEdBQUcsUUFBUSxDQUFDO0NBQzFCLENBQUM7QUFFRixNQUFNLE1BQU0sa0JBQWtCLENBQUMsQ0FBQyxTQUFTLE1BQU0sR0FBRyxRQUFRLEdBQUcsU0FBUyxJQUFJLENBQUMsU0FBUyxNQUFNLEdBQUcsTUFBTSxHQUFHLFNBQVMsQ0FBQztBQUVoSCxxQkFBYSxRQUFTLFNBQVEsRUFBRTtJQUU1QixPQUFPLENBQUMsSUFBSTtJQUVMLGVBQWUsRUFBRSxjQUFjLEVBQUU7SUFDakMsS0FBSyxDQUFDO0lBSmYsWUFDVSxJQUFJLEVBQUUsU0FBUyxFQUN2QixFQUFFLEVBQUUsRUFBRSxFQUNDLGVBQWUsRUFBRSxjQUFjLEVBQUUsRUFDakMsS0FBSyxDQUFDLDBCQUFjLEVBRzVCO0lBRUQsSUFBSSxDQUFDLE9BQU8sQ0FBQyxFQUFFLElBQUksQ0FBQyxnQkFBZ0IsRUFBRSxNQUFNLENBQUMsR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7SUFDbkUsSUFBSSxDQUFDLENBQUMsU0FBUyxnQkFBZ0IsQ0FBQyxNQUFNLENBQUMsRUFBRSxPQUFPLEVBQUUsZ0JBQWdCLEdBQUc7UUFBRSxJQUFJLEVBQUUsQ0FBQyxDQUFBO0tBQUUsR0FBRyxPQUFPLENBQUMsa0JBQWtCLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQWVsSCxPQUFPLENBQUMsa0JBQWtCO0NBVTNCO0FBRUQsd0JBQXNCLGdCQUFnQixDQUNwQyxNQUFNLEVBQUUsVUFBVSxFQUNsQixXQUFXLEVBQUUsMkJBQTJCLEdBQUcsWUFBWSxFQUN2RCxPQUFPLEVBQUUsc0JBQXNCLEdBQUcsYUFBYSxxQkFTaEQ7QUFFRDs7O0dBR0c7QUFFSCxNQUFNLFdBQVcsY0FBZSxTQUFRLFNBQVM7Q0FBRztBQUVwRDs7OztHQUlHO0FBRUgscUJBQWEsY0FBYztJQUNiLE9BQU8sQ0FBQyxNQUFNO0lBQTFCLFlBQW9CLE1BQU0sRUFBRSxTQUFTLEVBWXBDO0lBRUQ7OztPQUdHO0lBQ0gsZ0JBQWdCLENBQUMsSUFBSSxFQUFFLFNBQVMsR0FBRyxJQUFJLENBRXRDO0NBQ0YifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/test-wallet/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,YAAY,EACZ,KAAK,aAAa,EAElB,KAAK,MAAM,EACX,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EAEd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAItG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,QAAQ,GAAG,SAAS,IAAI,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhH,qBAAa,QAAS,SAAQ,EAAE;IAE5B,OAAO,CAAC,IAAI;IAEL,eAAe,EAAE,cAAc,EAAE;IACjC,KAAK,CAAC;IAJf,YACU,IAAI,EAAE,SAAS,EACvB,EAAE,EAAE,EAAE,EACC,eAAe,EAAE,cAAc,EAAE,EACjC,KAAK,CAAC,0BAAc,EAG5B;IAED,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACnE,IAAI,CAAC,CAAC,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IAelH,OAAO,CAAC,kBAAkB;CAU3B;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,2BAA2B,GAAG,YAAY,EACvD,OAAO,EAAE,sBAAsB,GAAG,aAAa,qBAShD;AAED;;;GAGG;AAEH,MAAM,WAAW,cAAe,SAAQ,SAAS;CAAG;AAEpD;;;;GAIG;AAEH,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;IAA1B,YAAoB,MAAM,EAAE,SAAS,EAYpC;IAED;;;OAGG;IACH,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAEtC;CACF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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.e2b2873ed",
|
|
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.e2b2873ed",
|
|
30
|
+
"@aztec/archiver": "0.0.1-commit.e2b2873ed",
|
|
31
|
+
"@aztec/aztec": "0.0.1-commit.e2b2873ed",
|
|
32
|
+
"@aztec/aztec-node": "0.0.1-commit.e2b2873ed",
|
|
33
|
+
"@aztec/aztec.js": "0.0.1-commit.e2b2873ed",
|
|
34
|
+
"@aztec/bb-prover": "0.0.1-commit.e2b2873ed",
|
|
35
|
+
"@aztec/bb.js": "0.0.1-commit.e2b2873ed",
|
|
36
|
+
"@aztec/blob-client": "0.0.1-commit.e2b2873ed",
|
|
37
|
+
"@aztec/blob-lib": "0.0.1-commit.e2b2873ed",
|
|
38
|
+
"@aztec/bot": "0.0.1-commit.e2b2873ed",
|
|
39
|
+
"@aztec/cli": "0.0.1-commit.e2b2873ed",
|
|
40
|
+
"@aztec/constants": "0.0.1-commit.e2b2873ed",
|
|
41
|
+
"@aztec/entrypoints": "0.0.1-commit.e2b2873ed",
|
|
42
|
+
"@aztec/epoch-cache": "0.0.1-commit.e2b2873ed",
|
|
43
|
+
"@aztec/ethereum": "0.0.1-commit.e2b2873ed",
|
|
44
|
+
"@aztec/foundation": "0.0.1-commit.e2b2873ed",
|
|
45
|
+
"@aztec/kv-store": "0.0.1-commit.e2b2873ed",
|
|
46
|
+
"@aztec/l1-artifacts": "0.0.1-commit.e2b2873ed",
|
|
47
|
+
"@aztec/merkle-tree": "0.0.1-commit.e2b2873ed",
|
|
48
|
+
"@aztec/node-keystore": "0.0.1-commit.e2b2873ed",
|
|
49
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.e2b2873ed",
|
|
50
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.e2b2873ed",
|
|
51
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.e2b2873ed",
|
|
52
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.e2b2873ed",
|
|
53
|
+
"@aztec/p2p": "0.0.1-commit.e2b2873ed",
|
|
54
|
+
"@aztec/protocol-contracts": "0.0.1-commit.e2b2873ed",
|
|
55
|
+
"@aztec/prover-client": "0.0.1-commit.e2b2873ed",
|
|
56
|
+
"@aztec/prover-node": "0.0.1-commit.e2b2873ed",
|
|
57
|
+
"@aztec/pxe": "0.0.1-commit.e2b2873ed",
|
|
58
|
+
"@aztec/sequencer-client": "0.0.1-commit.e2b2873ed",
|
|
59
|
+
"@aztec/simulator": "0.0.1-commit.e2b2873ed",
|
|
60
|
+
"@aztec/slasher": "0.0.1-commit.e2b2873ed",
|
|
61
|
+
"@aztec/stdlib": "0.0.1-commit.e2b2873ed",
|
|
62
|
+
"@aztec/telemetry-client": "0.0.1-commit.e2b2873ed",
|
|
63
|
+
"@aztec/validator-client": "0.0.1-commit.e2b2873ed",
|
|
64
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.e2b2873ed",
|
|
65
|
+
"@aztec/wallet-sdk": "0.0.1-commit.e2b2873ed",
|
|
66
|
+
"@aztec/wallets": "0.0.1-commit.e2b2873ed",
|
|
67
|
+
"@aztec/world-state": "0.0.1-commit.e2b2873ed",
|
|
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
|
|
|
@@ -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
|
|
|
@@ -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
|
+
proxy!: GenericProxyContract;
|
|
56
58
|
cheatCodes!: CheatCodes;
|
|
57
59
|
sequencer!: SequencerClient;
|
|
58
60
|
aztecNode!: AztecNode;
|
|
@@ -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.proxy = await GenericProxyContract.deploy(this.wallet).send({ from: this.adminAddress });
|
|
124
|
+
this.logger.verbose(`Deployed to ${this.proxy.address}.`);
|
|
125
|
+
|
|
117
126
|
await this.crossTimestampOfChange();
|
|
118
127
|
|
|
119
128
|
this.tokenSim = new TokenSimulator(
|
|
@@ -19,7 +19,6 @@ 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;
|
|
@@ -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;
|
|
@@ -4,11 +4,11 @@ import type { Logger } from '@aztec/aztec.js/log';
|
|
|
4
4
|
import { Fq } from '@aztec/foundation/curves/bn254';
|
|
5
5
|
import { sleep } from '@aztec/foundation/sleep';
|
|
6
6
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
8
7
|
|
|
9
8
|
import { jest } from '@jest/globals';
|
|
10
9
|
import type { Hex } from 'viem';
|
|
11
10
|
|
|
11
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
12
12
|
import { FeesTest } from './fees_test.js';
|
|
13
13
|
|
|
14
14
|
jest.setTimeout(300_000);
|
|
@@ -20,7 +20,6 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
|
20
20
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
21
21
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
22
22
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
23
|
-
import { TestWallet } from '@aztec/test-wallet/server';
|
|
24
23
|
|
|
25
24
|
import { getContract } from 'viem';
|
|
26
25
|
|
|
@@ -36,6 +35,7 @@ import {
|
|
|
36
35
|
import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
37
36
|
import { type BalancesFn, getBalancesFn, setupSponsoredFPC } from '../fixtures/utils.js';
|
|
38
37
|
import { FeeJuicePortalTestingHarnessFactory, type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.js';
|
|
38
|
+
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Test fixture for testing fees. Provides the following setup steps:
|
|
@@ -157,15 +157,11 @@ export class FeesTest {
|
|
|
157
157
|
|
|
158
158
|
/** Alice mints bananaCoin tokens privately to the target address and redeems them. */
|
|
159
159
|
async mintPrivateBananas(amount: bigint, address: AztecAddress) {
|
|
160
|
-
const balanceBefore = await this.bananaCoin.methods
|
|
161
|
-
.balance_of_private(address)
|
|
162
|
-
.simulate({ from: this.aliceAddress });
|
|
160
|
+
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
|
|
163
161
|
|
|
164
162
|
await mintTokensToPrivate(this.bananaCoin, this.aliceAddress, address, amount);
|
|
165
163
|
|
|
166
|
-
const balanceAfter = await this.bananaCoin.methods
|
|
167
|
-
.balance_of_private(address)
|
|
168
|
-
.simulate({ from: this.aliceAddress });
|
|
164
|
+
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
|
|
169
165
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
170
166
|
}
|
|
171
167
|
|
|
@@ -213,12 +209,7 @@ export class FeesTest {
|
|
|
213
209
|
|
|
214
210
|
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.wallet);
|
|
215
211
|
|
|
216
|
-
this.getGasBalanceFn = getBalancesFn(
|
|
217
|
-
'⛽',
|
|
218
|
-
this.feeJuiceContract.methods.balance_of_public,
|
|
219
|
-
this.aliceAddress,
|
|
220
|
-
this.logger,
|
|
221
|
-
);
|
|
212
|
+
this.getGasBalanceFn = getBalancesFn('⛽', this.feeJuiceContract.methods.balance_of_public, this.logger);
|
|
222
213
|
|
|
223
214
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
224
215
|
aztecNode: this.context.aztecNodeService,
|
|
@@ -238,16 +229,10 @@ export class FeesTest {
|
|
|
238
229
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
239
230
|
|
|
240
231
|
this.bananaCoin = bananaCoin;
|
|
241
|
-
this.getBananaPublicBalanceFn = getBalancesFn(
|
|
242
|
-
'🍌.public',
|
|
243
|
-
this.bananaCoin.methods.balance_of_public,
|
|
244
|
-
this.aliceAddress,
|
|
245
|
-
this.logger,
|
|
246
|
-
);
|
|
232
|
+
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, this.logger);
|
|
247
233
|
this.getBananaPrivateBalanceFn = getBalancesFn(
|
|
248
234
|
'🍌.private',
|
|
249
235
|
this.bananaCoin.methods.balance_of_private,
|
|
250
|
-
this.aliceAddress,
|
|
251
236
|
this.logger,
|
|
252
237
|
);
|
|
253
238
|
}
|
|
@@ -27,7 +27,6 @@ import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
|
27
27
|
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
28
28
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
29
29
|
import { ZkPassportProofParams } from '@aztec/stdlib/zkpassport';
|
|
30
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
31
30
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
32
31
|
|
|
33
32
|
import getPort from 'get-port';
|
|
@@ -49,6 +48,7 @@ import {
|
|
|
49
48
|
generatePrivateKeys,
|
|
50
49
|
} from '../fixtures/setup_p2p_test.js';
|
|
51
50
|
import { getEndToEndTestTelemetryClient } from '../fixtures/with_telemetry_utils.js';
|
|
51
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
52
52
|
|
|
53
53
|
// Use a fixed bootstrap node private key so that we can re-use the same snapshot and the nodes can find each other
|
|
54
54
|
const BOOTSTRAP_NODE_PRIVATE_KEY = '080212208f988fc0899e4a73a5aee4d271a5f20670603a756ad8d84f2c94263a6427c591';
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -22,9 +22,10 @@ import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
|
22
22
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
23
23
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
24
24
|
import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
25
|
-
import { type ProvenTx, TestWallet, proveInteraction } from '@aztec/test-wallet/server';
|
|
26
25
|
|
|
27
26
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
27
|
+
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
28
|
+
import { type ProvenTx, proveInteraction } from '../test-wallet/utils.js';
|
|
28
29
|
|
|
29
30
|
// submits a set of transactions to the provided Private eXecution Environment (PXE)
|
|
30
31
|
export const submitComplexTxsTo = async (
|
|
@@ -2,14 +2,15 @@ import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
|
2
2
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
3
3
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
4
4
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
5
|
+
import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
|
|
5
6
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
6
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
7
7
|
|
|
8
8
|
import { jest } from '@jest/globals';
|
|
9
9
|
|
|
10
10
|
import { type EndToEndContext, deployAccounts, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
|
|
11
11
|
import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
12
12
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
13
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
13
14
|
|
|
14
15
|
const { METRICS_PORT: metricsPort } = process.env;
|
|
15
16
|
|
|
@@ -25,6 +26,7 @@ export class TokenContractTest {
|
|
|
25
26
|
node!: AztecNode;
|
|
26
27
|
|
|
27
28
|
badAccount!: InvalidAccountContract;
|
|
29
|
+
proxy!: GenericProxyContract;
|
|
28
30
|
wallet!: TestWallet;
|
|
29
31
|
adminAddress!: AztecAddress;
|
|
30
32
|
account1Address!: AztecAddress;
|
|
@@ -92,6 +94,13 @@ export class TokenContractTest {
|
|
|
92
94
|
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress });
|
|
93
95
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
94
96
|
|
|
97
|
+
// Deploy a proxy contract for "on behalf of other" tests. The note owner must be the tx sender
|
|
98
|
+
// (so their notes are in scope), but msg_sender in the target must differ from the note owner
|
|
99
|
+
// to trigger authwit validation. The proxy forwards calls so that msg_sender != tx sender.
|
|
100
|
+
this.logger.verbose(`Deploying generic proxy...`);
|
|
101
|
+
this.proxy = await GenericProxyContract.deploy(this.wallet).send({ from: this.adminAddress });
|
|
102
|
+
this.logger.verbose(`Deployed to ${this.proxy.address}.`);
|
|
103
|
+
|
|
95
104
|
this.tokenSim = new TokenSimulator(this.asset, this.wallet, this.adminAddress, this.logger, [
|
|
96
105
|
this.adminAddress,
|
|
97
106
|
this.account1Address,
|
|
@@ -20,13 +20,13 @@ import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
|
20
20
|
import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
|
|
21
21
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
22
22
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
23
|
-
import { TestWallet } from '@aztec/test-wallet/server';
|
|
24
23
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
25
24
|
|
|
26
25
|
import { type Hex, getContract } from 'viem';
|
|
27
26
|
import { privateKeyToAddress } from 'viem/accounts';
|
|
28
27
|
|
|
29
28
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
29
|
+
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
30
30
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
31
31
|
import { getBBConfig } from './get_bb_config.js';
|
|
32
32
|
import {
|
package/src/fixtures/setup.ts
CHANGED
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
initTelemetryClient,
|
|
68
68
|
} from '@aztec/telemetry-client';
|
|
69
69
|
import { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
70
|
-
import {
|
|
70
|
+
import { deployFundedSchnorrAccounts } from '@aztec/wallets/testing';
|
|
71
71
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
72
72
|
|
|
73
73
|
import type { Anvil } from '@viem/anvil';
|
|
@@ -84,6 +84,7 @@ import {
|
|
|
84
84
|
} from 'viem/accounts';
|
|
85
85
|
import { type Chain, foundry } from 'viem/chains';
|
|
86
86
|
|
|
87
|
+
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
87
88
|
import { MNEMONIC, TEST_MAX_PENDING_TX_POOL_COUNT, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
88
89
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
89
90
|
import { getBBConfig } from './get_bb_config.js';
|
|
@@ -785,12 +786,11 @@ export type BalancesFn = ReturnType<typeof getBalancesFn>;
|
|
|
785
786
|
export function getBalancesFn(
|
|
786
787
|
symbol: string,
|
|
787
788
|
method: ContractMethod,
|
|
788
|
-
from: AztecAddress,
|
|
789
789
|
logger: any,
|
|
790
790
|
): (...addresses: (AztecAddress | { address: AztecAddress })[]) => Promise<bigint[]> {
|
|
791
791
|
const balances = async (...addressLikes: (AztecAddress | { address: AztecAddress })[]) => {
|
|
792
792
|
const addresses = addressLikes.map(addressLike => ('address' in addressLike ? addressLike.address : addressLike));
|
|
793
|
-
const b = await Promise.all(addresses.map(address => method(address).simulate({ from })));
|
|
793
|
+
const b = await Promise.all(addresses.map(address => method(address).simulate({ from: address })));
|
|
794
794
|
const debugString = `${symbol} balances: ${addresses.map((address, i) => `${address}: ${b[i]}`).join(', ')}`;
|
|
795
795
|
logger.verbose(debugString);
|
|
796
796
|
return b;
|
|
@@ -23,6 +23,8 @@ aztec-wallet create-account -a alice -f test0
|
|
|
23
23
|
aztec-wallet create-account -a bob -f test0
|
|
24
24
|
# docs:end:declare-accounts
|
|
25
25
|
|
|
26
|
+
aztec-wallet bridge-fee-juice 1000000000000000000000 accounts:alice --mint --no-wait
|
|
27
|
+
|
|
26
28
|
DEPLOY_OUTPUT=$(aztec-wallet deploy ../noir-contracts.js/artifacts/token_contract-Token.json --args accounts:test0 Test TST 18 -f test0)
|
|
27
29
|
TOKEN_ADDRESS=$(echo "$DEPLOY_OUTPUT" | grep -oE 'Contract deployed at 0x[0-9a-fA-F]+' | cut -d ' ' -f4)
|
|
28
30
|
echo "Deployed contract at $TOKEN_ADDRESS"
|
|
@@ -38,9 +40,7 @@ fi
|
|
|
38
40
|
|
|
39
41
|
TRANSFER_AMOUNT=42
|
|
40
42
|
|
|
41
|
-
aztec-wallet
|
|
42
|
-
|
|
43
|
-
aztec-wallet send transfer_in_private -ca last --args accounts:alice accounts:bob $TRANSFER_AMOUNT 1 -aw authwits:last -f test0
|
|
43
|
+
aztec-wallet send transfer_in_private -ca last --args accounts:alice accounts:bob $TRANSFER_AMOUNT 0 -f alice --payment method=fee_juice,claim
|
|
44
44
|
|
|
45
45
|
# Test end result
|
|
46
46
|
ALICE_BALANCE=$(aztec-wallet simulate balance_of_private -ca last --args accounts:alice -f alice)
|
|
@@ -4,7 +4,8 @@ import { Fr, GrumpkinScalar } from '@aztec/aztec.js/fields';
|
|
|
4
4
|
import type { Logger } from '@aztec/aztec.js/log';
|
|
5
5
|
import { TxHash, type TxReceipt, TxStatus } from '@aztec/aztec.js/tx';
|
|
6
6
|
import { times } from '@aztec/foundation/collection';
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
8
9
|
|
|
9
10
|
// submits a set of transactions to the provided Wallet
|
|
10
11
|
export const submitTxsTo = async (
|
|
@@ -17,12 +17,12 @@ import { InboxAbi, UniswapPortalAbi, UniswapPortalBytecode } from '@aztec/l1-art
|
|
|
17
17
|
import { UniswapContract } from '@aztec/noir-contracts.js/Uniswap';
|
|
18
18
|
import { computeL2ToL1MessageHash } from '@aztec/stdlib/hash';
|
|
19
19
|
import { computeL2ToL1MembershipWitness } from '@aztec/stdlib/messaging';
|
|
20
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
21
20
|
|
|
22
21
|
import { jest } from '@jest/globals';
|
|
23
22
|
import { type GetContractReturnType, getContract, parseEther, toFunctionSelector } from 'viem';
|
|
24
23
|
|
|
25
24
|
import { type EndToEndContext, ensureAccountContractsPublished } from '../fixtures/utils.js';
|
|
25
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
26
26
|
import { CrossChainTestHarness } from './cross_chain_test_harness.js';
|
|
27
27
|
|
|
28
28
|
// PSA: This tests works on forked mainnet. There is a dump of the data in `dumpedState` such that we
|
|
@@ -119,39 +119,11 @@ export class TokenSimulator {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
async checkPrivate() {
|
|
122
|
-
// Private calls
|
|
123
|
-
const defaultLookups = [];
|
|
124
|
-
const nonDefaultLookups = [];
|
|
125
|
-
|
|
126
122
|
for (const address of this.accounts) {
|
|
127
|
-
if (this.lookupProvider.has(address.toString())) {
|
|
128
|
-
nonDefaultLookups.push(address);
|
|
129
|
-
} else {
|
|
130
|
-
defaultLookups.push(address);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const defaultCalls = defaultLookups.map(address => this.token.methods.balance_of_private(address));
|
|
135
|
-
const results = (
|
|
136
|
-
await Promise.all(
|
|
137
|
-
chunk(defaultCalls, 4).map(batch =>
|
|
138
|
-
new BatchCall(this.defaultWallet, batch).simulate({ from: this.defaultAddress }),
|
|
139
|
-
),
|
|
140
|
-
)
|
|
141
|
-
).flat();
|
|
142
|
-
for (let i = 0; i < defaultLookups.length; i++) {
|
|
143
|
-
expect(results[i]).toEqual(this.balanceOfPrivate(defaultLookups[i]));
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// We are just running individual calls for the non-default lookups
|
|
147
|
-
// @todo We should also batch these
|
|
148
|
-
for (const address of nonDefaultLookups) {
|
|
149
123
|
const wallet = this.lookupProvider.get(address.toString());
|
|
150
124
|
const asset = wallet ? this.token.withWallet(wallet) : this.token;
|
|
151
125
|
|
|
152
|
-
const actualPrivateBalance = await asset.methods
|
|
153
|
-
.balance_of_private({ address })
|
|
154
|
-
.simulate({ from: this.defaultAddress });
|
|
126
|
+
const actualPrivateBalance = await asset.methods.balance_of_private(address).simulate({ from: address });
|
|
155
127
|
expect(actualPrivateBalance).toEqual(this.balanceOfPrivate(address));
|
|
156
128
|
}
|
|
157
129
|
}
|
|
@@ -13,11 +13,13 @@ import type { Logger } from '@aztec/foundation/log';
|
|
|
13
13
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
14
14
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
15
15
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
16
|
-
import {
|
|
16
|
+
import { registerInitialLocalNetworkAccountsInWallet } from '@aztec/wallets/testing';
|
|
17
17
|
|
|
18
18
|
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
19
19
|
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
20
20
|
import { getSponsoredFPCAddress, registerSponsoredFPC } from '../fixtures/utils.js';
|
|
21
|
+
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
22
|
+
import { proveInteraction } from '../test-wallet/utils.js';
|
|
21
23
|
|
|
22
24
|
export interface TestAccounts {
|
|
23
25
|
aztecNode: AztecNode;
|