@aztec/txe 0.0.1-commit.934299a21 → 0.0.1-commit.949a33fd8
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/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +8 -6
- package/dest/oracle/interfaces.d.ts +31 -28
- package/dest/oracle/interfaces.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.d.ts +13 -13
- package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.js +12 -12
- package/dest/oracle/txe_oracle_top_level_context.d.ts +27 -19
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +72 -42
- package/dest/rpc_translator.d.ts +128 -82
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +458 -170
- package/dest/state_machine/archiver.d.ts +3 -3
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/archiver.js +7 -8
- package/dest/state_machine/dummy_p2p_client.d.ts +3 -2
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +5 -2
- package/dest/state_machine/global_variable_builder.d.ts +9 -4
- package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
- package/dest/state_machine/global_variable_builder.js +9 -3
- package/dest/state_machine/index.d.ts +4 -2
- package/dest/state_machine/index.d.ts.map +1 -1
- package/dest/state_machine/index.js +8 -4
- package/dest/state_machine/mock_epoch_cache.d.ts +18 -3
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +35 -2
- package/dest/state_machine/synchronizer.d.ts +5 -5
- package/dest/state_machine/synchronizer.d.ts.map +1 -1
- package/dest/state_machine/synchronizer.js +3 -3
- package/dest/txe_session.d.ts +46 -1
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +86 -17
- package/dest/util/encoding.d.ts +71 -1
- package/dest/util/encoding.d.ts.map +1 -1
- package/dest/util/encoding.js +4 -0
- package/dest/util/txe_public_contract_data_source.d.ts +1 -1
- package/dest/util/txe_public_contract_data_source.d.ts.map +1 -1
- package/dest/util/txe_public_contract_data_source.js +1 -3
- package/package.json +15 -15
- package/src/index.ts +8 -5
- package/src/oracle/interfaces.ts +28 -32
- package/src/oracle/txe_oracle_public_context.ts +12 -12
- package/src/oracle/txe_oracle_top_level_context.ts +75 -46
- package/src/rpc_translator.ts +532 -204
- package/src/state_machine/archiver.ts +6 -5
- package/src/state_machine/dummy_p2p_client.ts +6 -2
- package/src/state_machine/global_variable_builder.ts +18 -3
- package/src/state_machine/index.ts +9 -2
- package/src/state_machine/mock_epoch_cache.ts +46 -3
- package/src/state_machine/synchronizer.ts +4 -4
- package/src/txe_session.ts +148 -17
- package/src/util/encoding.ts +5 -0
- package/src/util/txe_public_contract_data_source.ts +0 -2
package/dest/txe_session.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
3
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
4
|
import { KeyStore } from '@aztec/key-store';
|
|
5
5
|
import { openTmpStore } from '@aztec/kv-store/lmdb-v2';
|
|
6
|
-
import { AddressStore, AnchorBlockStore, CapsuleStore, JobCoordinator, NoteService, NoteStore, PrivateEventStore, RecipientTaggingStore, SenderAddressBookStore, SenderTaggingStore } from '@aztec/pxe/server';
|
|
6
|
+
import { AddressStore, AnchorBlockStore, CapsuleService, CapsuleStore, JobCoordinator, NoteService, NoteStore, PrivateEventStore, RecipientTaggingStore, SenderAddressBookStore, SenderTaggingStore } from '@aztec/pxe/server';
|
|
7
7
|
import { ExecutionNoteCache, ExecutionTaggingIndexCache, HashedValuesCache, Oracle, PrivateExecutionOracle, UtilityExecutionOracle } from '@aztec/pxe/simulator';
|
|
8
8
|
import { ExecutionError, WASMSimulator, createSimulationError, extractCallStack, resolveAssertionMessageFromError, toACVMWitness } from '@aztec/simulator/client';
|
|
9
9
|
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
@@ -11,7 +11,7 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
|
11
11
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
12
12
|
import { computeProtocolNullifier } from '@aztec/stdlib/hash';
|
|
13
13
|
import { makeGlobalVariables } from '@aztec/stdlib/testing';
|
|
14
|
-
import { CallContext, TxContext } from '@aztec/stdlib/tx';
|
|
14
|
+
import { CallContext, OFFCHAIN_MESSAGE_IDENTIFIER, TxContext } from '@aztec/stdlib/tx';
|
|
15
15
|
import { z } from 'zod';
|
|
16
16
|
import { DEFAULT_ADDRESS } from './constants.js';
|
|
17
17
|
import { TXEOraclePublicContext } from './oracle/txe_oracle_public_context.js';
|
|
@@ -22,6 +22,14 @@ import { TXEStateMachine } from './state_machine/index.js';
|
|
|
22
22
|
import { TXEAccountStore } from './util/txe_account_store.js';
|
|
23
23
|
import { getSingleTxBlockRequestHash, insertTxEffectIntoWorldTrees, makeTXEBlock } from './utils/block_creation.js';
|
|
24
24
|
import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
25
|
+
function emptyLastCallState() {
|
|
26
|
+
return {
|
|
27
|
+
offchainEffects: [],
|
|
28
|
+
queried: false,
|
|
29
|
+
txHash: Fr.ZERO,
|
|
30
|
+
anchorBlockTimestamp: 0n
|
|
31
|
+
};
|
|
32
|
+
}
|
|
25
33
|
/**
|
|
26
34
|
* A `TXESession` corresponds to a Noir `#[test]` function, and handles all of its oracle calls, stores test-specific
|
|
27
35
|
* state, etc., independent of all other tests running in parallel.
|
|
@@ -46,6 +54,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
46
54
|
nextBlockTimestamp;
|
|
47
55
|
state;
|
|
48
56
|
authwits;
|
|
57
|
+
lastCallInfo;
|
|
49
58
|
constructor(logger, stateMachine, oracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobCoordinator, currentJobId, chainId, version, nextBlockTimestamp){
|
|
50
59
|
this.logger = logger;
|
|
51
60
|
this.stateMachine = stateMachine;
|
|
@@ -69,6 +78,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
69
78
|
name: 'TOP_LEVEL'
|
|
70
79
|
};
|
|
71
80
|
this.authwits = new Map();
|
|
81
|
+
this.lastCallInfo = emptyLastCallState();
|
|
72
82
|
}
|
|
73
83
|
static async init(contractStore) {
|
|
74
84
|
const store = await openTmpStore('txe-session');
|
|
@@ -97,9 +107,10 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
97
107
|
const version = new Fr(await stateMachine.node.getVersion());
|
|
98
108
|
const chainId = new Fr(await stateMachine.node.getChainId());
|
|
99
109
|
const initialJobId = jobCoordinator.beginJob();
|
|
110
|
+
const logger = createLogger('txe:session');
|
|
100
111
|
const topLevelOracleHandler = new TXEOracleTopLevelContext(stateMachine, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, nextBlockTimestamp, version, chainId, new Map());
|
|
101
|
-
await topLevelOracleHandler.
|
|
102
|
-
return new TXESession(
|
|
112
|
+
await topLevelOracleHandler.advanceBlocksBy(1);
|
|
113
|
+
return new TXESession(logger, stateMachine, topLevelOracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobCoordinator, initialJobId, version, chainId, nextBlockTimestamp);
|
|
103
114
|
}
|
|
104
115
|
/**
|
|
105
116
|
* Processes an oracle function invoked by the Noir test associated to this session.
|
|
@@ -130,6 +141,42 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
130
141
|
this.currentJobId = this.jobCoordinator.beginJob();
|
|
131
142
|
return this.currentJobId;
|
|
132
143
|
}
|
|
144
|
+
resetLastCall() {
|
|
145
|
+
const notQueriedMessageCount = this.lastCallInfo.queried ? 0 : this.lastCallInfo.offchainEffects.filter((payload)=>payload[0]?.equals(OFFCHAIN_MESSAGE_IDENTIFIER)).length;
|
|
146
|
+
if (notQueriedMessageCount > 0) {
|
|
147
|
+
this.logger.warn(`Dropping ${notQueriedMessageCount} unqueried offchain message(s) from the previous top-level call. ` + `To deliver them, call \`env.offchain_messages()\` and forward the result to the recipient contract's ` + `\`offchain_receive\` utility before issuing another top-level call. To intentionally discard, assign ` + `to \`let _ = env.offchain_messages()\` to silence this warning.`);
|
|
148
|
+
}
|
|
149
|
+
this.lastCallInfo = emptyLastCallState();
|
|
150
|
+
}
|
|
151
|
+
recordOffchainEffect(data) {
|
|
152
|
+
this.lastCallInfo.offchainEffects.push(data);
|
|
153
|
+
}
|
|
154
|
+
setLastCallContext(txHash, anchorBlockTimestamp) {
|
|
155
|
+
this.lastCallInfo.txHash = txHash;
|
|
156
|
+
this.lastCallInfo.anchorBlockTimestamp = anchorBlockTimestamp;
|
|
157
|
+
}
|
|
158
|
+
async withTopLevelCallTracking(work) {
|
|
159
|
+
this.resetLastCall();
|
|
160
|
+
// Capture the anchor *before* `work` runs: private/public executor calls mine a new block as a
|
|
161
|
+
// side effect, and that block's timestamp should not be attributed to this call's anchor.
|
|
162
|
+
const anchorBlockTimestamp = (await this.stateMachine.node.getBlockHeader('latest')).globalVariables.timestamp;
|
|
163
|
+
const { result, txHash } = await work();
|
|
164
|
+
this.setLastCallContext(txHash ?? Fr.ZERO, anchorBlockTimestamp);
|
|
165
|
+
return result;
|
|
166
|
+
}
|
|
167
|
+
getLastCallOffchainEffects() {
|
|
168
|
+
this.lastCallInfo.queried = true;
|
|
169
|
+
return {
|
|
170
|
+
effects: this.lastCallInfo.offchainEffects
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
getLastCallContext() {
|
|
174
|
+
const { txHash, anchorBlockTimestamp } = this.lastCallInfo;
|
|
175
|
+
return {
|
|
176
|
+
txHash,
|
|
177
|
+
anchorBlockTimestamp
|
|
178
|
+
};
|
|
179
|
+
}
|
|
133
180
|
async enterTopLevelState() {
|
|
134
181
|
switch(this.state.name){
|
|
135
182
|
case 'PRIVATE':
|
|
@@ -166,11 +213,12 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
166
213
|
}
|
|
167
214
|
async enterPrivateState(contractAddress = DEFAULT_ADDRESS, anchorBlockNumber) {
|
|
168
215
|
this.exitTopLevelState();
|
|
216
|
+
this.resetLastCall();
|
|
169
217
|
// Private execution has two associated block numbers: the anchor block (i.e. the historical block that is used to
|
|
170
218
|
// build the proof), and the *next* block, i.e. the one we'll create once the execution ends, and which will contain
|
|
171
219
|
// a single transaction with the effects of what was done in the test.
|
|
172
220
|
const anchorBlock = await this.stateMachine.node.getBlockHeader(anchorBlockNumber ?? 'latest');
|
|
173
|
-
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlock, this.currentJobId).syncNoteNullifiers(contractAddress,
|
|
221
|
+
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlock, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
174
222
|
const latestBlock = await this.stateMachine.node.getBlockHeader('latest');
|
|
175
223
|
const nextBlockGlobalVariables = makeGlobalVariables(undefined, {
|
|
176
224
|
blockNumber: BlockNumber(latestBlock.globalVariables.blockNumber + 1),
|
|
@@ -202,11 +250,14 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
202
250
|
senderTaggingStore: this.senderTaggingStore,
|
|
203
251
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
204
252
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
205
|
-
|
|
253
|
+
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
206
254
|
privateEventStore: this.privateEventStore,
|
|
207
255
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
256
|
+
l2TipsStore: this.stateMachine.node,
|
|
208
257
|
jobId: this.currentJobId,
|
|
209
|
-
scopes:
|
|
258
|
+
scopes: await this.keyStore.getAccounts(),
|
|
259
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
260
|
+
simulator: new WASMSimulator()
|
|
210
261
|
});
|
|
211
262
|
// We store the note and tagging index caches fed into the PrivateExecutionOracle (along with some other auxiliary
|
|
212
263
|
// data) in order to refer to it later, mimicking the way this object is used by the ContractFunctionSimulator. The
|
|
@@ -220,15 +271,19 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
220
271
|
taggingIndexCache
|
|
221
272
|
};
|
|
222
273
|
this.logger.debug(`Entered state ${this.state.name}`);
|
|
274
|
+
// Record the *resolved* anchor's timestamp — if the caller pinned the anchor to a past block
|
|
275
|
+
// via `anchorBlockNumber`, "latest" would be the wrong anchor for offchain-message semantics.
|
|
276
|
+
this.setLastCallContext(Fr.ZERO, anchorBlock.globalVariables.timestamp);
|
|
223
277
|
return this.oracleHandler.getPrivateContextInputs();
|
|
224
278
|
}
|
|
225
279
|
async enterPublicState(contractAddress) {
|
|
226
280
|
this.exitTopLevelState();
|
|
281
|
+
this.resetLastCall();
|
|
227
282
|
// The PublicContext will create a block with a single transaction in it, containing the effects of what was done in
|
|
228
283
|
// the test. The block therefore gets the *next* block number and timestamp.
|
|
229
|
-
const
|
|
284
|
+
const latestHeader = await this.stateMachine.node.getBlockHeader('latest');
|
|
230
285
|
const globalVariables = makeGlobalVariables(undefined, {
|
|
231
|
-
blockNumber: BlockNumber(
|
|
286
|
+
blockNumber: BlockNumber(latestHeader.globalVariables.blockNumber + 1),
|
|
232
287
|
timestamp: this.nextBlockTimestamp,
|
|
233
288
|
version: this.version,
|
|
234
289
|
chainId: this.chainId
|
|
@@ -238,16 +293,19 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
238
293
|
name: 'PUBLIC'
|
|
239
294
|
};
|
|
240
295
|
this.logger.debug(`Entered state ${this.state.name}`);
|
|
296
|
+
// Public state is anchored at the latest block.
|
|
297
|
+
this.setLastCallContext(Fr.ZERO, latestHeader.globalVariables.timestamp);
|
|
241
298
|
}
|
|
242
299
|
async enterUtilityState(contractAddress = DEFAULT_ADDRESS) {
|
|
243
300
|
this.exitTopLevelState();
|
|
301
|
+
this.resetLastCall();
|
|
244
302
|
const anchorBlockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
245
303
|
// There is no automatic message discovery and contract-driven syncing process in inlined private or utility
|
|
246
304
|
// contexts, which means that known nullifiers are also not searched for, since it is during the tagging sync that
|
|
247
305
|
// we perform this. We therefore search for known nullifiers now, as otherwise notes that were nullified would not
|
|
248
306
|
// be removed from the database.
|
|
249
307
|
// TODO(#12553): make the synchronizer sync here instead and remove this
|
|
250
|
-
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlockHeader, this.currentJobId).syncNoteNullifiers(contractAddress,
|
|
308
|
+
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlockHeader, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
251
309
|
this.oracleHandler = new UtilityExecutionOracle({
|
|
252
310
|
contractAddress,
|
|
253
311
|
authWitnesses: [],
|
|
@@ -260,15 +318,21 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
260
318
|
aztecNode: this.stateMachine.node,
|
|
261
319
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
262
320
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
263
|
-
|
|
321
|
+
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
264
322
|
privateEventStore: this.privateEventStore,
|
|
323
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
324
|
+
contractSyncService: this.stateMachine.contractSyncService,
|
|
325
|
+
l2TipsStore: this.stateMachine.node,
|
|
265
326
|
jobId: this.currentJobId,
|
|
266
|
-
scopes:
|
|
327
|
+
scopes: await this.keyStore.getAccounts(),
|
|
328
|
+
simulator: new WASMSimulator()
|
|
267
329
|
});
|
|
268
330
|
this.state = {
|
|
269
331
|
name: 'UTILITY'
|
|
270
332
|
};
|
|
271
333
|
this.logger.debug(`Entered state ${this.state.name}`);
|
|
334
|
+
// Utility state anchors at whatever the anchor block store is pointing to (tracked as latest).
|
|
335
|
+
this.setLastCallContext(Fr.ZERO, anchorBlockHeader.globalVariables.timestamp);
|
|
272
336
|
}
|
|
273
337
|
exitTopLevelState() {
|
|
274
338
|
if (this.state.name != 'TOP_LEVEL') {
|
|
@@ -276,8 +340,8 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
276
340
|
}
|
|
277
341
|
// Note that while all public and private contexts do is build a single block that we then process when exiting
|
|
278
342
|
// those, the top level context performs a large number of actions not captured in the following 'close' call. Among
|
|
279
|
-
// others, it will create empty blocks (via `
|
|
280
|
-
// `
|
|
343
|
+
// others, it will create empty blocks (via `advanceBlocksBy` and `deploy`), create blocks with transactions via
|
|
344
|
+
// `privateCallNewFlow` and `publicCallNewFlow`, add accounts to PXE via `addAccount`, etc. This is a
|
|
281
345
|
// slight inconsistency in the working model of this class, but is not too bad.
|
|
282
346
|
// TODO: it's quite unfortunate that we need to capture the authwits created to later pass them again when the top
|
|
283
347
|
// level context is re-created. This is because authwits create a temporary utility context that'd otherwise reset
|
|
@@ -327,6 +391,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
327
391
|
throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`);
|
|
328
392
|
}
|
|
329
393
|
try {
|
|
394
|
+
const simulator = new WASMSimulator();
|
|
330
395
|
const oracle = new UtilityExecutionOracle({
|
|
331
396
|
contractAddress: call.to,
|
|
332
397
|
authWitnesses: [],
|
|
@@ -339,12 +404,16 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
339
404
|
aztecNode: this.stateMachine.node,
|
|
340
405
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
341
406
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
342
|
-
|
|
407
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
343
408
|
privateEventStore: this.privateEventStore,
|
|
409
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
410
|
+
contractSyncService: this.stateMachine.contractSyncService,
|
|
411
|
+
l2TipsStore: this.stateMachine.node,
|
|
344
412
|
jobId: this.currentJobId,
|
|
345
|
-
scopes
|
|
413
|
+
scopes,
|
|
414
|
+
simulator
|
|
346
415
|
});
|
|
347
|
-
await
|
|
416
|
+
await simulator.executeUserCircuit(toACVMWitness(0, call.args), entryPointArtifact, new Oracle(oracle).toACIRCallback()).catch((err)=>{
|
|
348
417
|
err.message = resolveAssertionMessageFromError(err, entryPointArtifact);
|
|
349
418
|
throw new ExecutionError(err.message, {
|
|
350
419
|
contractAddress: call.to,
|
package/dest/util/encoding.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
2
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import { type ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
5
6
|
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
export type ForeignCallSingle = string;
|
|
@@ -12,6 +13,7 @@ export type ForeignCallResult = {
|
|
|
12
13
|
};
|
|
13
14
|
export declare function fromSingle(obj: ForeignCallSingle): Fr;
|
|
14
15
|
export declare function addressFromSingle(obj: ForeignCallSingle): AztecAddress;
|
|
16
|
+
export declare function blockHashFromSingle(obj: ForeignCallSingle): BlockHash;
|
|
15
17
|
export declare function fromArray(obj: ForeignCallArray): Fr[];
|
|
16
18
|
/**
|
|
17
19
|
* Converts an array of Noir unsigned integers to a single tightly-packed buffer.
|
|
@@ -261,12 +263,30 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
261
263
|
files: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
262
264
|
source: z.ZodString;
|
|
263
265
|
path: z.ZodString;
|
|
266
|
+
function_locations: z.ZodArray<z.ZodObject<{
|
|
267
|
+
start: z.ZodNumber;
|
|
268
|
+
name: z.ZodString;
|
|
269
|
+
}, "strip", z.ZodTypeAny, {
|
|
270
|
+
start: number;
|
|
271
|
+
name: string;
|
|
272
|
+
}, {
|
|
273
|
+
start: number;
|
|
274
|
+
name: string;
|
|
275
|
+
}>, "many">;
|
|
264
276
|
}, "strip", z.ZodTypeAny, {
|
|
265
277
|
source: string;
|
|
266
278
|
path: string;
|
|
279
|
+
function_locations: {
|
|
280
|
+
start: number;
|
|
281
|
+
name: string;
|
|
282
|
+
}[];
|
|
267
283
|
}, {
|
|
268
284
|
source: string;
|
|
269
285
|
path: string;
|
|
286
|
+
function_locations: {
|
|
287
|
+
start: number;
|
|
288
|
+
name: string;
|
|
289
|
+
}[];
|
|
270
290
|
}>>;
|
|
271
291
|
}, "strip", z.ZodTypeAny, {
|
|
272
292
|
debugSymbols: {
|
|
@@ -288,6 +308,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
288
308
|
files: Record<string, {
|
|
289
309
|
source: string;
|
|
290
310
|
path: string;
|
|
311
|
+
function_locations: {
|
|
312
|
+
start: number;
|
|
313
|
+
name: string;
|
|
314
|
+
}[];
|
|
291
315
|
}>;
|
|
292
316
|
}, {
|
|
293
317
|
debugSymbols: {
|
|
@@ -309,6 +333,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
309
333
|
files: Record<string, {
|
|
310
334
|
source: string;
|
|
311
335
|
path: string;
|
|
336
|
+
function_locations: {
|
|
337
|
+
start: number;
|
|
338
|
+
name: string;
|
|
339
|
+
}[];
|
|
312
340
|
}>;
|
|
313
341
|
}>>;
|
|
314
342
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -335,6 +363,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
335
363
|
files: Record<string, {
|
|
336
364
|
source: string;
|
|
337
365
|
path: string;
|
|
366
|
+
function_locations: {
|
|
367
|
+
start: number;
|
|
368
|
+
name: string;
|
|
369
|
+
}[];
|
|
338
370
|
}>;
|
|
339
371
|
} | undefined;
|
|
340
372
|
}, {
|
|
@@ -361,6 +393,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
361
393
|
files: Record<string, {
|
|
362
394
|
source: string;
|
|
363
395
|
path: string;
|
|
396
|
+
function_locations: {
|
|
397
|
+
start: number;
|
|
398
|
+
name: string;
|
|
399
|
+
}[];
|
|
364
400
|
}>;
|
|
365
401
|
} | undefined;
|
|
366
402
|
}>>, "many">;
|
|
@@ -477,12 +513,30 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
477
513
|
fileMap: z.ZodRecord<z.ZodNumber, z.ZodObject<{
|
|
478
514
|
source: z.ZodString;
|
|
479
515
|
path: z.ZodString;
|
|
516
|
+
function_locations: z.ZodArray<z.ZodObject<{
|
|
517
|
+
start: z.ZodNumber;
|
|
518
|
+
name: z.ZodString;
|
|
519
|
+
}, "strip", z.ZodTypeAny, {
|
|
520
|
+
start: number;
|
|
521
|
+
name: string;
|
|
522
|
+
}, {
|
|
523
|
+
start: number;
|
|
524
|
+
name: string;
|
|
525
|
+
}>, "many">;
|
|
480
526
|
}, "strip", z.ZodTypeAny, {
|
|
481
527
|
source: string;
|
|
482
528
|
path: string;
|
|
529
|
+
function_locations: {
|
|
530
|
+
start: number;
|
|
531
|
+
name: string;
|
|
532
|
+
}[];
|
|
483
533
|
}, {
|
|
484
534
|
source: string;
|
|
485
535
|
path: string;
|
|
536
|
+
function_locations: {
|
|
537
|
+
start: number;
|
|
538
|
+
name: string;
|
|
539
|
+
}[];
|
|
486
540
|
}>>;
|
|
487
541
|
}, "strip", z.ZodTypeAny, {
|
|
488
542
|
name: string;
|
|
@@ -532,6 +586,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
532
586
|
files: Record<string, {
|
|
533
587
|
source: string;
|
|
534
588
|
path: string;
|
|
589
|
+
function_locations: {
|
|
590
|
+
start: number;
|
|
591
|
+
name: string;
|
|
592
|
+
}[];
|
|
535
593
|
}>;
|
|
536
594
|
} | undefined;
|
|
537
595
|
})[];
|
|
@@ -568,6 +626,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
568
626
|
fileMap: Record<number, {
|
|
569
627
|
source: string;
|
|
570
628
|
path: string;
|
|
629
|
+
function_locations: {
|
|
630
|
+
start: number;
|
|
631
|
+
name: string;
|
|
632
|
+
}[];
|
|
571
633
|
}>;
|
|
572
634
|
}, {
|
|
573
635
|
name: string;
|
|
@@ -617,6 +679,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
617
679
|
files: Record<string, {
|
|
618
680
|
source: string;
|
|
619
681
|
path: string;
|
|
682
|
+
function_locations: {
|
|
683
|
+
start: number;
|
|
684
|
+
name: string;
|
|
685
|
+
}[];
|
|
620
686
|
}>;
|
|
621
687
|
} | undefined;
|
|
622
688
|
})[];
|
|
@@ -653,6 +719,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
653
719
|
fileMap: Record<number, {
|
|
654
720
|
source: string;
|
|
655
721
|
path: string;
|
|
722
|
+
function_locations: {
|
|
723
|
+
start: number;
|
|
724
|
+
name: string;
|
|
725
|
+
}[];
|
|
656
726
|
}>;
|
|
657
727
|
}>, z.ZodIntersection<z.ZodObject<{
|
|
658
728
|
version: z.ZodLiteral<1>;
|
|
@@ -717,4 +787,4 @@ export declare const ForeignCallResultSchema: z.ZodObject<{
|
|
|
717
787
|
}, {
|
|
718
788
|
values: (string | string[])[];
|
|
719
789
|
}>;
|
|
720
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
790
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2RpbmcuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2VuY29kaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUVoRSxPQUFPLEVBQUUsS0FBSyxnQkFBZ0IsRUFBMEIsTUFBTSxtQkFBbUIsQ0FBQztBQUNsRixPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDM0QsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ2hELE9BQU8sRUFBRSxLQUFLLDJCQUEyQixFQUFxQyxNQUFNLHdCQUF3QixDQUFDO0FBRTdHLE9BQU8sRUFBRSxDQUFDLEVBQUUsTUFBTSxLQUFLLENBQUM7QUFFeEIsTUFBTSxNQUFNLGlCQUFpQixHQUFHLE1BQU0sQ0FBQztBQUV2QyxNQUFNLE1BQU0sZ0JBQWdCLEdBQUcsTUFBTSxFQUFFLENBQUM7QUFFeEMsTUFBTSxNQUFNLGVBQWUsR0FBRyxDQUFDLGlCQUFpQixHQUFHLGdCQUFnQixHQUFHLGdCQUFnQixHQUFHLDJCQUEyQixDQUFDLEVBQUUsQ0FBQztBQUV4SCxNQUFNLE1BQU0saUJBQWlCLEdBQUc7SUFDOUIsTUFBTSxFQUFFLENBQUMsaUJBQWlCLEdBQUcsZ0JBQWdCLENBQUMsRUFBRSxDQUFDO0NBQ2xELENBQUM7QUFFRix3QkFBZ0Is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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC"}
|
package/dest/util/encoding.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
2
2
|
import { hexToBuffer } from '@aztec/foundation/string';
|
|
3
3
|
import { ContractArtifactSchema } from '@aztec/stdlib/abi';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
5
6
|
import { ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
export function fromSingle(obj) {
|
|
@@ -10,6 +11,9 @@ export function fromSingle(obj) {
|
|
|
10
11
|
export function addressFromSingle(obj) {
|
|
11
12
|
return new AztecAddress(fromSingle(obj));
|
|
12
13
|
}
|
|
14
|
+
export function blockHashFromSingle(obj) {
|
|
15
|
+
return new BlockHash(fromSingle(obj));
|
|
16
|
+
}
|
|
13
17
|
export function fromArray(obj) {
|
|
14
18
|
return obj.map((str)=>Fr.fromBuffer(hexToBuffer(str)));
|
|
15
19
|
}
|
|
@@ -17,4 +17,4 @@ export declare class TXEPublicContractDataSource implements ContractDataSource {
|
|
|
17
17
|
getDebugFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
18
18
|
registerContractFunctionSignatures(_signatures: []): Promise<void>;
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWwvdHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDOUQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQ3ZELE9BQU8sRUFBRSxLQUFLLGdCQUFnQixFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDNUUsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsbUJBQ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ources":["../../src/util/txe_public_contract_data_source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAEnH,qBAAa,2BAA4B,YAAW,kBAAkB;IAElE,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,aAAa;IAFvB,YACU,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAClC;IAEJ,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAErC;IAEK,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"txe_public_contract_data_source.d.ts","sourceRoot":"","sources":["../../src/util/txe_public_contract_data_source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAEnH,qBAAa,2BAA4B,YAAW,kBAAkB;IAElE,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,aAAa;IAFvB,YACU,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAClC;IAEJ,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAErC;IAEK,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAYvE;IAEK,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,CAG3D;IAEK,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAGzF;IAED,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAEnC;IAEK,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAGtF;IAEK,oBAAoB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEzG;IAED,kCAAkC,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;CACF"}
|
|
@@ -18,9 +18,7 @@ export class TXEPublicContractDataSource {
|
|
|
18
18
|
artifactHash: contractClass.artifactHash,
|
|
19
19
|
packedBytecode: contractClass.packedBytecode,
|
|
20
20
|
privateFunctionsRoot: contractClass.privateFunctionsRoot,
|
|
21
|
-
version: contractClass.version
|
|
22
|
-
privateFunctions: [],
|
|
23
|
-
utilityFunctions: []
|
|
21
|
+
version: contractClass.version
|
|
24
22
|
};
|
|
25
23
|
}
|
|
26
24
|
async getBytecodeCommitment(id) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/txe",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.949a33fd8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"bin": "./dest/bin/index.js",
|
|
@@ -61,20 +61,20 @@
|
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
65
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
66
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
67
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
68
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
69
|
-
"@aztec/constants": "0.0.1-commit.
|
|
70
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
71
|
-
"@aztec/key-store": "0.0.1-commit.
|
|
72
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
73
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
74
|
-
"@aztec/pxe": "0.0.1-commit.
|
|
75
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
76
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
77
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
64
|
+
"@aztec/accounts": "0.0.1-commit.949a33fd8",
|
|
65
|
+
"@aztec/archiver": "0.0.1-commit.949a33fd8",
|
|
66
|
+
"@aztec/aztec-node": "0.0.1-commit.949a33fd8",
|
|
67
|
+
"@aztec/aztec.js": "0.0.1-commit.949a33fd8",
|
|
68
|
+
"@aztec/bb-prover": "0.0.1-commit.949a33fd8",
|
|
69
|
+
"@aztec/constants": "0.0.1-commit.949a33fd8",
|
|
70
|
+
"@aztec/foundation": "0.0.1-commit.949a33fd8",
|
|
71
|
+
"@aztec/key-store": "0.0.1-commit.949a33fd8",
|
|
72
|
+
"@aztec/kv-store": "0.0.1-commit.949a33fd8",
|
|
73
|
+
"@aztec/protocol-contracts": "0.0.1-commit.949a33fd8",
|
|
74
|
+
"@aztec/pxe": "0.0.1-commit.949a33fd8",
|
|
75
|
+
"@aztec/simulator": "0.0.1-commit.949a33fd8",
|
|
76
|
+
"@aztec/stdlib": "0.0.1-commit.949a33fd8",
|
|
77
|
+
"@aztec/world-state": "0.0.1-commit.949a33fd8",
|
|
78
78
|
"zod": "^3.23.8"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
type ForeignCallResult,
|
|
33
33
|
ForeignCallResultSchema,
|
|
34
34
|
type ForeignCallSingle,
|
|
35
|
+
addressFromSingle,
|
|
35
36
|
fromArray,
|
|
36
37
|
fromSingle,
|
|
37
38
|
toSingle,
|
|
@@ -105,6 +106,8 @@ class TXEDispatcher {
|
|
|
105
106
|
|
|
106
107
|
const decodedArgs = fromArray(inputs[3] as ForeignCallArray);
|
|
107
108
|
const secret = fromSingle(inputs[4] as ForeignCallSingle);
|
|
109
|
+
const salt = fromSingle(inputs[5] as ForeignCallSingle);
|
|
110
|
+
const deployer = addressFromSingle(inputs[6] as ForeignCallSingle);
|
|
108
111
|
const publicKeys = secret.equals(Fr.ZERO) ? PublicKeys.default() : (await deriveKeys(secret)).publicKeys;
|
|
109
112
|
const publicKeysHash = await publicKeys.hash();
|
|
110
113
|
|
|
@@ -135,7 +138,7 @@ class TXEDispatcher {
|
|
|
135
138
|
|
|
136
139
|
const cacheKey = `${contractDirectory ?? ''}-${contractFilename}-${initializer}-${decodedArgs
|
|
137
140
|
.map(arg => arg.toString())
|
|
138
|
-
.join('-')}-${publicKeysHash}-${fileHash}`;
|
|
141
|
+
.join('-')}-${publicKeysHash}-${salt}-${deployer}-${fileHash}`;
|
|
139
142
|
|
|
140
143
|
let instance;
|
|
141
144
|
let artifact: ContractArtifactWithHash;
|
|
@@ -161,10 +164,10 @@ class TXEDispatcher {
|
|
|
161
164
|
const computedInstance = await getContractInstanceFromInstantiationParams(computedArtifact, {
|
|
162
165
|
constructorArgs: decodedArgs,
|
|
163
166
|
skipArgsDecoding: true,
|
|
164
|
-
salt
|
|
167
|
+
salt,
|
|
165
168
|
publicKeys,
|
|
166
169
|
constructorArtifact: initializer ? initializer : undefined,
|
|
167
|
-
deployer
|
|
170
|
+
deployer,
|
|
168
171
|
});
|
|
169
172
|
const result = { artifact: computedArtifact, instance: computedInstance };
|
|
170
173
|
TXEArtifactsCache.set(cacheKey, result);
|
|
@@ -247,11 +250,11 @@ class TXEDispatcher {
|
|
|
247
250
|
}
|
|
248
251
|
|
|
249
252
|
switch (functionName) {
|
|
250
|
-
case '
|
|
253
|
+
case 'aztec_txe_deploy': {
|
|
251
254
|
await this.#processDeployInputs(callData);
|
|
252
255
|
break;
|
|
253
256
|
}
|
|
254
|
-
case '
|
|
257
|
+
case 'aztec_txe_addAccount': {
|
|
255
258
|
await this.#processAddAccountInputs(callData);
|
|
256
259
|
break;
|
|
257
260
|
}
|