@aztec/test-wallet 3.0.0-nightly.20251112 → 3.0.0-nightly.20251114
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/utils.js
CHANGED
|
@@ -3,13 +3,13 @@ import { type Account, type AccountContract } from '@aztec/aztec.js/account';
|
|
|
3
3
|
import { type CallIntent, type ContractFunctionInteractionCallIntent, type IntentInnerHash, SetPublicAuthwitContractInteraction } from '@aztec/aztec.js/authorization';
|
|
4
4
|
import { BaseWallet, type SendOptions, type SimulateOptions } from '@aztec/aztec.js/wallet';
|
|
5
5
|
import { AccountManager } from '@aztec/aztec.js/wallet';
|
|
6
|
-
import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
7
6
|
import { Fq, Fr } from '@aztec/foundation/fields';
|
|
8
7
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
9
8
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
9
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
11
10
|
import type { NotesFilter, UniqueNote } from '@aztec/stdlib/note';
|
|
12
11
|
import type { TxSimulationResult } from '@aztec/stdlib/tx';
|
|
12
|
+
import { ExecutionPayload } from '@aztec/stdlib/tx';
|
|
13
13
|
import { ProvenTx } from '../utils.js';
|
|
14
14
|
/**
|
|
15
15
|
* Data for generating an account.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test_wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/test_wallet.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,yBAAyB,CAAC;AAChG,OAAO,EACL,KAAK,UAAU,EACf,KAAK,qCAAqC,EAC1C,KAAK,eAAe,EACpB,mCAAmC,EAGpC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,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AU,GAAG,qCAAqC,EAC9F,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,mCAAmC,CAAC;IAI/C;;;;;;OAMG;IACmB,aAAa,CACjC,IAAI,EAAE,YAAY,EAClB,mBAAmB,EAAE,EAAE,GAAG,eAAe,GAAG,UAAU,GAAG,qCAAqC,GAC7F,OAAO,CAAC,WAAW,CAAC;IAOvB,QAAQ,CAAC,qBAAqB,CAC5B,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,2BAA2B,CAAC;QAAC,QAAQ,EAAE,gBAAgB,CAAA;KAAE,CAAC;IAEpF,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA6BjH;;;;;;;;OAQG;IACG,OAAO,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAY3E;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAIpD;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAGtB"}
|
|
@@ -3,9 +3,9 @@ import { SignerlessAccount } from '@aztec/aztec.js/account';
|
|
|
3
3
|
import { SetPublicAuthwitContractInteraction, getMessageHashFromIntent, lookupValidity } from '@aztec/aztec.js/authorization';
|
|
4
4
|
import { BaseWallet } from '@aztec/aztec.js/wallet';
|
|
5
5
|
import { AccountManager } from '@aztec/aztec.js/wallet';
|
|
6
|
-
import { mergeExecutionPayloads } from '@aztec/entrypoints/payload';
|
|
7
6
|
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
|
|
8
7
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
+
import { mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
9
9
|
import { ProvenTx } from '../utils.js';
|
|
10
10
|
/**
|
|
11
11
|
* Wallet implementation that stores accounts in memory and allows allows their creation
|
|
@@ -113,7 +113,7 @@ import { ProvenTx } from '../utils.js';
|
|
|
113
113
|
if (!this.simulatedSimulations) {
|
|
114
114
|
return super.simulateTx(executionPayload, opts);
|
|
115
115
|
} else {
|
|
116
|
-
const feeOptions = opts.fee?.estimateGas ? await this.
|
|
116
|
+
const feeOptions = opts.fee?.estimateGas ? await this.completeFeeOptionsForEstimation(opts.from, executionPayload.feePayer, opts.fee?.gasSettings) : await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
|
|
117
117
|
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
118
118
|
const executionOptions = {
|
|
119
119
|
txNonce: Fr.random(),
|
|
@@ -146,7 +146,7 @@ import { ProvenTx } from '../utils.js';
|
|
|
146
146
|
* @param opts - The options to configure the interaction
|
|
147
147
|
* @returns - A proven tx ready to be sent to the network
|
|
148
148
|
*/ async proveTx(exec, opts) {
|
|
149
|
-
const fee = await this.
|
|
149
|
+
const fee = await this.completeFeeOptions(opts.from, exec.feePayer, opts.fee?.gasSettings);
|
|
150
150
|
const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee);
|
|
151
151
|
const txProvingResult = await this.pxe.proveTx(txRequest);
|
|
152
152
|
return new ProvenTx(this.aztecNode, await txProvingResult.toTx(), txProvingResult.getOffchainEffects(), txProvingResult.stats);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/test-wallet",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/test-wallet",
|
|
4
|
-
"version": "3.0.0-nightly.
|
|
4
|
+
"version": "3.0.0-nightly.20251114",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./client/bundle": "./dest/bundle.js",
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
66
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
67
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
68
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
69
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
70
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
71
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
65
|
+
"@aztec/accounts": "3.0.0-nightly.20251114",
|
|
66
|
+
"@aztec/aztec.js": "3.0.0-nightly.20251114",
|
|
67
|
+
"@aztec/entrypoints": "3.0.0-nightly.20251114",
|
|
68
|
+
"@aztec/foundation": "3.0.0-nightly.20251114",
|
|
69
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20251114",
|
|
70
|
+
"@aztec/pxe": "3.0.0-nightly.20251114",
|
|
71
|
+
"@aztec/stdlib": "3.0.0-nightly.20251114"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@jest/globals": "^30.0.0",
|
package/src/utils.ts
CHANGED
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
import { BaseWallet, type SendOptions, type SimulateOptions } from '@aztec/aztec.js/wallet';
|
|
13
13
|
import { AccountManager } from '@aztec/aztec.js/wallet';
|
|
14
14
|
import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
15
|
-
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/entrypoints/payload';
|
|
16
15
|
import { Fq, Fr, GrumpkinScalar } from '@aztec/foundation/fields';
|
|
17
16
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
18
17
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
19
18
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
20
19
|
import type { NotesFilter, UniqueNote } from '@aztec/stdlib/note';
|
|
21
20
|
import type { TxSimulationResult } from '@aztec/stdlib/tx';
|
|
21
|
+
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
22
22
|
|
|
23
23
|
import { ProvenTx } from '../utils.js';
|
|
24
24
|
|
|
@@ -194,8 +194,8 @@ export abstract class BaseTestWallet extends BaseWallet {
|
|
|
194
194
|
return super.simulateTx(executionPayload, opts);
|
|
195
195
|
} else {
|
|
196
196
|
const feeOptions = opts.fee?.estimateGas
|
|
197
|
-
? await this.
|
|
198
|
-
: await this.
|
|
197
|
+
? await this.completeFeeOptionsForEstimation(opts.from, executionPayload.feePayer, opts.fee?.gasSettings)
|
|
198
|
+
: await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
|
|
199
199
|
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
200
200
|
const executionOptions: DefaultAccountEntrypointOptions = {
|
|
201
201
|
txNonce: Fr.random(),
|
|
@@ -228,7 +228,7 @@ export abstract class BaseTestWallet extends BaseWallet {
|
|
|
228
228
|
* @returns - A proven tx ready to be sent to the network
|
|
229
229
|
*/
|
|
230
230
|
async proveTx(exec: ExecutionPayload, opts: SendOptions): Promise<ProvenTx> {
|
|
231
|
-
const fee = await this.
|
|
231
|
+
const fee = await this.completeFeeOptions(opts.from, exec.feePayer, opts.fee?.gasSettings);
|
|
232
232
|
const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee);
|
|
233
233
|
const txProvingResult = await this.pxe.proveTx(txRequest);
|
|
234
234
|
return new ProvenTx(
|