@aztec/txe 0.0.1-commit.3fd054f6 → 0.0.1-commit.42ee6df9b
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/oracle/txe_oracle_top_level_context.d.ts +1 -1
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +8 -7
- package/dest/rpc_translator.d.ts +21 -21
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +47 -36
- package/dest/state_machine/archiver.d.ts +1 -1
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/archiver.js +2 -1
- 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 +3 -3
- package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
- package/dest/state_machine/global_variable_builder.js +1 -1
- package/dest/txe_session.d.ts +1 -1
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +8 -8
- package/package.json +15 -15
- package/src/oracle/txe_oracle_top_level_context.ts +13 -9
- package/src/rpc_translator.ts +58 -32
- package/src/state_machine/archiver.ts +1 -0
- package/src/state_machine/dummy_p2p_client.ts +6 -2
- package/src/state_machine/global_variable_builder.ts +7 -1
- package/src/txe_session.ts +9 -9
|
@@ -29,8 +29,11 @@ export class DummyP2P {
|
|
|
29
29
|
registerBlockProposalHandler(_handler) {
|
|
30
30
|
throw new Error('DummyP2P does not implement "registerBlockProposalHandler"');
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
throw new Error('DummyP2P does not implement "
|
|
32
|
+
registerValidatorCheckpointProposalHandler(_handler) {
|
|
33
|
+
throw new Error('DummyP2P does not implement "registerValidatorCheckpointProposalHandler"');
|
|
34
|
+
}
|
|
35
|
+
registerAllNodesCheckpointProposalHandler(_handler) {
|
|
36
|
+
throw new Error('DummyP2P does not implement "registerAllNodesCheckpointProposalHandler"');
|
|
34
37
|
}
|
|
35
38
|
requestTxs(_txHashes) {
|
|
36
39
|
throw new Error('DummyP2P does not implement "requestTxs"');
|
|
@@ -2,10 +2,10 @@ import { BlockNumber, type SlotNumber } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { GasFees } from '@aztec/stdlib/gas';
|
|
5
|
-
import { type CheckpointGlobalVariables, type GlobalVariableBuilder, GlobalVariables } from '@aztec/stdlib/tx';
|
|
5
|
+
import { type BuildCheckpointGlobalVariablesOpts, type CheckpointGlobalVariables, type GlobalVariableBuilder, GlobalVariables } from '@aztec/stdlib/tx';
|
|
6
6
|
export declare class TXEGlobalVariablesBuilder implements GlobalVariableBuilder {
|
|
7
7
|
getCurrentMinFees(): Promise<GasFees>;
|
|
8
8
|
buildGlobalVariables(_blockNumber: BlockNumber, _coinbase: EthAddress, _feeRecipient: AztecAddress, _slotNumber?: SlotNumber): Promise<GlobalVariables>;
|
|
9
|
-
buildCheckpointGlobalVariables(_coinbase: EthAddress, _feeRecipient: AztecAddress, _slotNumber: SlotNumber): Promise<CheckpointGlobalVariables>;
|
|
9
|
+
buildCheckpointGlobalVariables(_coinbase: EthAddress, _feeRecipient: AztecAddress, _slotNumber: SlotNumber, _opts?: BuildCheckpointGlobalVariablesOpts): Promise<CheckpointGlobalVariables>;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2xvYmFsX3ZhcmlhYmxlX2J1aWxkZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdGF0ZV9tYWNoaW5lL2dsb2JhbF92YXJpYWJsZV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AK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,
|
|
1
|
+
{"version":3,"file":"global_variable_builder.d.ts","sourceRoot":"","sources":["../../src/state_machine/global_variable_builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,yBAA0B,YAAW,qBAAqB;IAC9D,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,CAE3C;IAEM,oBAAoB,CACzB,YAAY,EAAE,WAAW,EACzB,SAAS,EAAE,UAAU,EACrB,aAAa,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,UAAU,GACvB,OAAO,CAAC,eAAe,CAAC,CAE1B;IAEM,8BAA8B,CACnC,SAAS,EAAE,UAAU,EACrB,aAAa,EAAE,YAAY,EAC3B,WAAW,EAAE,UAAU,EACvB,KAAK,CAAC,EAAE,kCAAkC,GACzC,OAAO,CAAC,yBAAyB,CAAC,CAWpC;CACF"}
|
|
@@ -7,7 +7,7 @@ export class TXEGlobalVariablesBuilder {
|
|
|
7
7
|
buildGlobalVariables(_blockNumber, _coinbase, _feeRecipient, _slotNumber) {
|
|
8
8
|
return Promise.resolve(makeGlobalVariables());
|
|
9
9
|
}
|
|
10
|
-
buildCheckpointGlobalVariables(_coinbase, _feeRecipient, _slotNumber) {
|
|
10
|
+
buildCheckpointGlobalVariables(_coinbase, _feeRecipient, _slotNumber, _opts) {
|
|
11
11
|
const vars = makeGlobalVariables();
|
|
12
12
|
return Promise.resolve({
|
|
13
13
|
chainId: vars.chainId,
|
package/dest/txe_session.d.ts
CHANGED
|
@@ -76,4 +76,4 @@ export declare class TXESession implements TXESessionStateHandler {
|
|
|
76
76
|
private utilityExecutorForContractSync;
|
|
77
77
|
}
|
|
78
78
|
export {};
|
|
79
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
79
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX3Nlc3Npb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy90eGVfc2Vzc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDOUQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUNsRSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFNUMsT0FBTyxFQUNMLFlBQVksRUFHWixZQUFZLEVBQ1osYUFBYSxFQUNiLG1CQUFtQixFQUNuQixjQUFjLEVBRWQsU0FBUyxFQUNULGlCQUFpQixFQUNqQixxQkFBcUIsRUFDckIsc0JBQXNCLEVBQ3RCLGtCQUFrQixFQUNuQixNQUFNLG1CQUFtQixDQUFDO0FBQzNCLE9BQU8sRUFJTCxLQUFLLHVCQUF1QixFQUM1QixLQUFLLHVCQUF1QixFQUk3QixNQUFNLHNCQUFzQixDQUFDO0FBVzlCLE9BQU8sRUFBRSxZQUF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sQ0FBQyxDQStEL0I7SUFFSyxnQkFBZ0IsQ0FBQyxlQUFlLENBQUMsRUFBRSxZQUFZLGlCQXNCcEQ7SUFFSyxpQkFBaUIsQ0FBQyxlQUFlLEdBQUUsWUFBOEIsaUJBdUN0RTtJQUVELE9BQU8sQ0FBQyxpQkFBaUI7WUFpQlgsZ0JBQWdCO1lBNkJoQixlQUFlO0lBUzdCLE9BQU8sQ0FBQyxrQkFBa0I7SUFNMUIsT0FBTyxDQUFDLDhCQUE4QjtDQThDdkMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"txe_session.d.ts","sourceRoot":"","sources":["../src/txe_session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"txe_session.d.ts","sourceRoot":"","sources":["../src/txe_session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EACL,YAAY,EAGZ,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,cAAc,EAEd,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAIL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAI7B,MAAM,sBAAsB,CAAC;AAW9B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,C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OAAO,CAAC,iBAAiB,CAAC,CAuBxG;IAED,aAAa,IAAI,MAAM,CAEtB;IAED,4EAA4E;IACtE,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAIhC;IAEK,kBAAkB,kBA8CvB;IAEK,iBAAiB,CACrB,eAAe,GAAE,YAA8B,EAC/C,iBAAiB,CAAC,EAAE,WAAW,GAC9B,OAAO,CAAC,oBAAoB,CAAC,CA+D/B;IAEK,gBAAgB,CAAC,eAAe,CAAC,EAAE,YAAY,iBAsBpD;IAEK,iBAAiB,CAAC,eAAe,GAAE,YAA8B,iBAuCtE;IAED,OAAO,CAAC,iBAAiB;YAiBX,gBAAgB;YA6BhB,eAAe;IAS7B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,8BAA8B;CA8CvC"}
|
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, ContractSyncService, JobCoordinator, NoteService, NoteStore, PrivateEventStore, RecipientTaggingStore, SenderAddressBookStore, SenderTaggingStore } from '@aztec/pxe/server';
|
|
6
|
+
import { AddressStore, AnchorBlockStore, CapsuleService, CapsuleStore, ContractSyncService, 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';
|
|
@@ -174,7 +174,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
174
174
|
// build the proof), and the *next* block, i.e. the one we'll create once the execution ends, and which will contain
|
|
175
175
|
// a single transaction with the effects of what was done in the test.
|
|
176
176
|
const anchorBlock = await this.stateMachine.node.getBlockHeader(anchorBlockNumber ?? 'latest');
|
|
177
|
-
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlock, this.currentJobId).syncNoteNullifiers(contractAddress,
|
|
177
|
+
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlock, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
178
178
|
const latestBlock = await this.stateMachine.node.getBlockHeader('latest');
|
|
179
179
|
const nextBlockGlobalVariables = makeGlobalVariables(undefined, {
|
|
180
180
|
blockNumber: BlockNumber(latestBlock.globalVariables.blockNumber + 1),
|
|
@@ -206,11 +206,11 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
206
206
|
senderTaggingStore: this.senderTaggingStore,
|
|
207
207
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
208
208
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
209
|
-
|
|
209
|
+
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
210
210
|
privateEventStore: this.privateEventStore,
|
|
211
211
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
212
212
|
jobId: this.currentJobId,
|
|
213
|
-
scopes:
|
|
213
|
+
scopes: await this.keyStore.getAccounts(),
|
|
214
214
|
messageContextService: this.stateMachine.messageContextService
|
|
215
215
|
});
|
|
216
216
|
// We store the note and tagging index caches fed into the PrivateExecutionOracle (along with some other auxiliary
|
|
@@ -252,7 +252,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
252
252
|
// we perform this. We therefore search for known nullifiers now, as otherwise notes that were nullified would not
|
|
253
253
|
// be removed from the database.
|
|
254
254
|
// TODO(#12553): make the synchronizer sync here instead and remove this
|
|
255
|
-
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlockHeader, this.currentJobId).syncNoteNullifiers(contractAddress,
|
|
255
|
+
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlockHeader, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
256
256
|
this.oracleHandler = new UtilityExecutionOracle({
|
|
257
257
|
contractAddress,
|
|
258
258
|
authWitnesses: [],
|
|
@@ -265,12 +265,12 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
265
265
|
aztecNode: this.stateMachine.node,
|
|
266
266
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
267
267
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
268
|
-
|
|
268
|
+
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
269
269
|
privateEventStore: this.privateEventStore,
|
|
270
270
|
messageContextService: this.stateMachine.messageContextService,
|
|
271
271
|
contractSyncService: this.contractSyncService,
|
|
272
272
|
jobId: this.currentJobId,
|
|
273
|
-
scopes:
|
|
273
|
+
scopes: await this.keyStore.getAccounts()
|
|
274
274
|
});
|
|
275
275
|
this.state = {
|
|
276
276
|
name: 'UTILITY'
|
|
@@ -346,7 +346,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
346
346
|
aztecNode: this.stateMachine.node,
|
|
347
347
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
348
348
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
349
|
-
|
|
349
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
350
350
|
privateEventStore: this.privateEventStore,
|
|
351
351
|
messageContextService: this.stateMachine.messageContextService,
|
|
352
352
|
contractSyncService: this.contractSyncService,
|
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.42ee6df9b",
|
|
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.42ee6df9b",
|
|
65
|
+
"@aztec/archiver": "0.0.1-commit.42ee6df9b",
|
|
66
|
+
"@aztec/aztec-node": "0.0.1-commit.42ee6df9b",
|
|
67
|
+
"@aztec/aztec.js": "0.0.1-commit.42ee6df9b",
|
|
68
|
+
"@aztec/bb-prover": "0.0.1-commit.42ee6df9b",
|
|
69
|
+
"@aztec/constants": "0.0.1-commit.42ee6df9b",
|
|
70
|
+
"@aztec/foundation": "0.0.1-commit.42ee6df9b",
|
|
71
|
+
"@aztec/key-store": "0.0.1-commit.42ee6df9b",
|
|
72
|
+
"@aztec/kv-store": "0.0.1-commit.42ee6df9b",
|
|
73
|
+
"@aztec/protocol-contracts": "0.0.1-commit.42ee6df9b",
|
|
74
|
+
"@aztec/pxe": "0.0.1-commit.42ee6df9b",
|
|
75
|
+
"@aztec/simulator": "0.0.1-commit.42ee6df9b",
|
|
76
|
+
"@aztec/stdlib": "0.0.1-commit.42ee6df9b",
|
|
77
|
+
"@aztec/world-state": "0.0.1-commit.42ee6df9b",
|
|
78
78
|
"zod": "^3.23.8"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
@@ -12,9 +12,9 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
12
12
|
import { LogLevels, type Logger, applyStringFormatting, createLogger } from '@aztec/foundation/log';
|
|
13
13
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
14
14
|
import type { KeyStore } from '@aztec/key-store';
|
|
15
|
-
import type { AccessScopes } from '@aztec/pxe/client/lazy';
|
|
16
15
|
import {
|
|
17
16
|
AddressStore,
|
|
17
|
+
CapsuleService,
|
|
18
18
|
CapsuleStore,
|
|
19
19
|
type ContractStore,
|
|
20
20
|
type ContractSyncService,
|
|
@@ -120,8 +120,12 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
120
120
|
|
|
121
121
|
assertCompatibleOracleVersion(version: number): void {
|
|
122
122
|
if (version !== ORACLE_VERSION) {
|
|
123
|
+
const hint =
|
|
124
|
+
version > ORACLE_VERSION
|
|
125
|
+
? 'The contract was compiled with a newer version of Aztec.nr than this aztec cli version supports. Upgrade your aztec cli version to a compatible version.'
|
|
126
|
+
: 'The contract was compiled with an older version of Aztec.nr than this aztec cli version supports. Recompile the contract with a compatible version of Aztec.nr.';
|
|
123
127
|
throw new Error(
|
|
124
|
-
`Incompatible
|
|
128
|
+
`Incompatible aztec cli version: ${hint} See https://docs.aztec.network/errors/8 (expected oracle version ${ORACLE_VERSION}, got ${version})`,
|
|
125
129
|
);
|
|
126
130
|
}
|
|
127
131
|
}
|
|
@@ -324,7 +328,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
324
328
|
const effectiveScopes = from.isZero() ? [] : [from];
|
|
325
329
|
|
|
326
330
|
// Sync notes before executing private function to discover notes from previous transactions
|
|
327
|
-
const utilityExecutor = async (call: FunctionCall, execScopes:
|
|
331
|
+
const utilityExecutor = async (call: FunctionCall, execScopes: AztecAddress[]) => {
|
|
328
332
|
await this.executeUtilityCall(call, execScopes, jobId);
|
|
329
333
|
};
|
|
330
334
|
|
|
@@ -378,7 +382,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
378
382
|
senderTaggingStore: this.senderTaggingStore,
|
|
379
383
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
380
384
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
381
|
-
|
|
385
|
+
capsuleService: new CapsuleService(this.capsuleStore, effectiveScopes),
|
|
382
386
|
privateEventStore: this.privateEventStore,
|
|
383
387
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
384
388
|
jobId,
|
|
@@ -412,7 +416,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
412
416
|
);
|
|
413
417
|
const publicFunctionsCalldata = await Promise.all(
|
|
414
418
|
publicCallRequests.map(async r => {
|
|
415
|
-
const calldata = await privateExecutionOracle.
|
|
419
|
+
const calldata = await privateExecutionOracle.getHashPreimage(r.calldataHash);
|
|
416
420
|
return new HashedValues(calldata, r.calldataHash);
|
|
417
421
|
}),
|
|
418
422
|
);
|
|
@@ -702,7 +706,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
702
706
|
},
|
|
703
707
|
blockHeader,
|
|
704
708
|
jobId,
|
|
705
|
-
|
|
709
|
+
await this.keyStore.getAccounts(),
|
|
706
710
|
);
|
|
707
711
|
|
|
708
712
|
const call = FunctionCall.from({
|
|
@@ -716,10 +720,10 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
716
720
|
returnTypes: [],
|
|
717
721
|
});
|
|
718
722
|
|
|
719
|
-
return this.executeUtilityCall(call,
|
|
723
|
+
return this.executeUtilityCall(call, await this.keyStore.getAccounts(), jobId);
|
|
720
724
|
}
|
|
721
725
|
|
|
722
|
-
private async executeUtilityCall(call: FunctionCall, scopes:
|
|
726
|
+
private async executeUtilityCall(call: FunctionCall, scopes: AztecAddress[], jobId: string): Promise<Fr[]> {
|
|
723
727
|
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
|
|
724
728
|
if (entryPointArtifact.functionType !== FunctionType.UTILITY) {
|
|
725
729
|
throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`);
|
|
@@ -744,7 +748,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
744
748
|
aztecNode: this.stateMachine.node,
|
|
745
749
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
746
750
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
747
|
-
|
|
751
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
748
752
|
privateEventStore: this.privateEventStore,
|
|
749
753
|
messageContextService: this.stateMachine.messageContextService,
|
|
750
754
|
contractSyncService: this.contractSyncService,
|
package/src/rpc_translator.ts
CHANGED
|
@@ -339,20 +339,20 @@ export class RPCTranslator {
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
// eslint-disable-next-line camelcase
|
|
342
|
-
|
|
342
|
+
aztec_prv_setHashPreimage(foreignValues: ForeignCallArray, foreignHash: ForeignCallSingle) {
|
|
343
343
|
const values = fromArray(foreignValues);
|
|
344
344
|
const hash = fromSingle(foreignHash);
|
|
345
345
|
|
|
346
|
-
this.handlerAsPrivate().
|
|
346
|
+
this.handlerAsPrivate().setHashPreimage(values, hash);
|
|
347
347
|
|
|
348
348
|
return toForeignCallResult([]);
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
// eslint-disable-next-line camelcase
|
|
352
|
-
async
|
|
352
|
+
async aztec_prv_getHashPreimage(foreignHash: ForeignCallSingle) {
|
|
353
353
|
const hash = fromSingle(foreignHash);
|
|
354
354
|
|
|
355
|
-
const returns = await this.handlerAsPrivate().
|
|
355
|
+
const returns = await this.handlerAsPrivate().getHashPreimage(hash);
|
|
356
356
|
|
|
357
357
|
return toForeignCallResult([toArray(returns)]);
|
|
358
358
|
}
|
|
@@ -378,7 +378,7 @@ export class RPCTranslator {
|
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
// eslint-disable-next-line camelcase
|
|
381
|
-
async
|
|
381
|
+
async aztec_utl_getFromPublicStorage(
|
|
382
382
|
foreignBlockHash: ForeignCallSingle,
|
|
383
383
|
foreignContractAddress: ForeignCallSingle,
|
|
384
384
|
foreignStartStorageSlot: ForeignCallSingle,
|
|
@@ -389,7 +389,7 @@ export class RPCTranslator {
|
|
|
389
389
|
const startStorageSlot = fromSingle(foreignStartStorageSlot);
|
|
390
390
|
const numberOfElements = fromSingle(foreignNumberOfElements).toNumber();
|
|
391
391
|
|
|
392
|
-
const values = await this.handlerAsUtility().
|
|
392
|
+
const values = await this.handlerAsUtility().getFromPublicStorage(
|
|
393
393
|
blockHash,
|
|
394
394
|
contractAddress,
|
|
395
395
|
startStorageSlot,
|
|
@@ -556,10 +556,10 @@ export class RPCTranslator {
|
|
|
556
556
|
}
|
|
557
557
|
|
|
558
558
|
// eslint-disable-next-line camelcase
|
|
559
|
-
async
|
|
559
|
+
async aztec_utl_doesNullifierExist(foreignInnerNullifier: ForeignCallSingle) {
|
|
560
560
|
const innerNullifier = fromSingle(foreignInnerNullifier);
|
|
561
561
|
|
|
562
|
-
const exists = await this.handlerAsUtility().
|
|
562
|
+
const exists = await this.handlerAsUtility().doesNullifierExist(innerNullifier);
|
|
563
563
|
|
|
564
564
|
return toForeignCallResult([toSingle(new Fr(exists))]);
|
|
565
565
|
}
|
|
@@ -582,10 +582,10 @@ export class RPCTranslator {
|
|
|
582
582
|
}
|
|
583
583
|
|
|
584
584
|
// eslint-disable-next-line camelcase
|
|
585
|
-
async
|
|
585
|
+
async aztec_utl_getPublicKeysAndPartialAddress(foreignAddress: ForeignCallSingle) {
|
|
586
586
|
const address = addressFromSingle(foreignAddress);
|
|
587
587
|
|
|
588
|
-
const result = await this.handlerAsUtility().
|
|
588
|
+
const result = await this.handlerAsUtility().getPublicKeysAndPartialAddress(address);
|
|
589
589
|
|
|
590
590
|
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
591
591
|
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
@@ -652,7 +652,7 @@ export class RPCTranslator {
|
|
|
652
652
|
}
|
|
653
653
|
|
|
654
654
|
// eslint-disable-next-line camelcase
|
|
655
|
-
public
|
|
655
|
+
public aztec_prv_assertValidPublicCalldata(_foreignCalldataHash: ForeignCallSingle) {
|
|
656
656
|
throw new Error('Enqueueing public calls is not supported in TestEnvironment::private_context');
|
|
657
657
|
}
|
|
658
658
|
|
|
@@ -662,9 +662,9 @@ export class RPCTranslator {
|
|
|
662
662
|
}
|
|
663
663
|
|
|
664
664
|
// eslint-disable-next-line camelcase
|
|
665
|
-
public async
|
|
665
|
+
public async aztec_prv_isExecutionInRevertiblePhase(foreignSideEffectCounter: ForeignCallSingle) {
|
|
666
666
|
const sideEffectCounter = fromSingle(foreignSideEffectCounter).toNumber();
|
|
667
|
-
const isRevertible = await this.handlerAsPrivate().
|
|
667
|
+
const isRevertible = await this.handlerAsPrivate().isExecutionInRevertiblePhase(sideEffectCounter);
|
|
668
668
|
return toForeignCallResult([toSingle(new Fr(isRevertible))]);
|
|
669
669
|
}
|
|
670
670
|
|
|
@@ -738,10 +738,14 @@ export class RPCTranslator {
|
|
|
738
738
|
}
|
|
739
739
|
|
|
740
740
|
// eslint-disable-next-line camelcase
|
|
741
|
-
async
|
|
741
|
+
async aztec_utl_getPendingTaggedLogs(
|
|
742
|
+
foreignPendingTaggedLogArrayBaseSlot: ForeignCallSingle,
|
|
743
|
+
foreignScope: ForeignCallSingle,
|
|
744
|
+
) {
|
|
742
745
|
const pendingTaggedLogArrayBaseSlot = fromSingle(foreignPendingTaggedLogArrayBaseSlot);
|
|
746
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
743
747
|
|
|
744
|
-
await this.handlerAsUtility().
|
|
748
|
+
await this.handlerAsUtility().getPendingTaggedLogs(pendingTaggedLogArrayBaseSlot, scope);
|
|
745
749
|
|
|
746
750
|
return toForeignCallResult([]);
|
|
747
751
|
}
|
|
@@ -753,12 +757,14 @@ export class RPCTranslator {
|
|
|
753
757
|
foreignEventValidationRequestsArrayBaseSlot: ForeignCallSingle,
|
|
754
758
|
foreignMaxNotePackedLen: ForeignCallSingle,
|
|
755
759
|
foreignMaxEventSerializedLen: ForeignCallSingle,
|
|
760
|
+
foreignScope: ForeignCallSingle,
|
|
756
761
|
) {
|
|
757
762
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
758
763
|
const noteValidationRequestsArrayBaseSlot = fromSingle(foreignNoteValidationRequestsArrayBaseSlot);
|
|
759
764
|
const eventValidationRequestsArrayBaseSlot = fromSingle(foreignEventValidationRequestsArrayBaseSlot);
|
|
760
765
|
const maxNotePackedLen = fromSingle(foreignMaxNotePackedLen).toNumber();
|
|
761
766
|
const maxEventSerializedLen = fromSingle(foreignMaxEventSerializedLen).toNumber();
|
|
767
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
762
768
|
|
|
763
769
|
await this.handlerAsUtility().validateAndStoreEnqueuedNotesAndEvents(
|
|
764
770
|
contractAddress,
|
|
@@ -766,75 +772,86 @@ export class RPCTranslator {
|
|
|
766
772
|
eventValidationRequestsArrayBaseSlot,
|
|
767
773
|
maxNotePackedLen,
|
|
768
774
|
maxEventSerializedLen,
|
|
775
|
+
scope,
|
|
769
776
|
);
|
|
770
777
|
|
|
771
778
|
return toForeignCallResult([]);
|
|
772
779
|
}
|
|
773
780
|
|
|
774
781
|
// eslint-disable-next-line camelcase
|
|
775
|
-
public async
|
|
782
|
+
public async aztec_utl_getLogsByTag(
|
|
776
783
|
foreignContractAddress: ForeignCallSingle,
|
|
777
784
|
foreignLogRetrievalRequestsArrayBaseSlot: ForeignCallSingle,
|
|
778
785
|
foreignLogRetrievalResponsesArrayBaseSlot: ForeignCallSingle,
|
|
786
|
+
foreignScope: ForeignCallSingle,
|
|
779
787
|
) {
|
|
780
788
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
781
789
|
const logRetrievalRequestsArrayBaseSlot = fromSingle(foreignLogRetrievalRequestsArrayBaseSlot);
|
|
782
790
|
const logRetrievalResponsesArrayBaseSlot = fromSingle(foreignLogRetrievalResponsesArrayBaseSlot);
|
|
791
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
783
792
|
|
|
784
|
-
await this.handlerAsUtility().
|
|
793
|
+
await this.handlerAsUtility().getLogsByTag(
|
|
785
794
|
contractAddress,
|
|
786
795
|
logRetrievalRequestsArrayBaseSlot,
|
|
787
796
|
logRetrievalResponsesArrayBaseSlot,
|
|
797
|
+
scope,
|
|
788
798
|
);
|
|
789
799
|
|
|
790
800
|
return toForeignCallResult([]);
|
|
791
801
|
}
|
|
792
802
|
|
|
793
803
|
// eslint-disable-next-line camelcase
|
|
794
|
-
public async
|
|
804
|
+
public async aztec_utl_getMessageContextsByTxHash(
|
|
795
805
|
foreignContractAddress: ForeignCallSingle,
|
|
796
806
|
foreignMessageContextRequestsArrayBaseSlot: ForeignCallSingle,
|
|
797
807
|
foreignMessageContextResponsesArrayBaseSlot: ForeignCallSingle,
|
|
808
|
+
foreignScope: ForeignCallSingle,
|
|
798
809
|
) {
|
|
799
810
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
800
811
|
const messageContextRequestsArrayBaseSlot = fromSingle(foreignMessageContextRequestsArrayBaseSlot);
|
|
801
812
|
const messageContextResponsesArrayBaseSlot = fromSingle(foreignMessageContextResponsesArrayBaseSlot);
|
|
813
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
802
814
|
|
|
803
|
-
await this.handlerAsUtility().
|
|
815
|
+
await this.handlerAsUtility().getMessageContextsByTxHash(
|
|
804
816
|
contractAddress,
|
|
805
817
|
messageContextRequestsArrayBaseSlot,
|
|
806
818
|
messageContextResponsesArrayBaseSlot,
|
|
819
|
+
scope,
|
|
807
820
|
);
|
|
808
821
|
|
|
809
822
|
return toForeignCallResult([]);
|
|
810
823
|
}
|
|
811
824
|
|
|
812
825
|
// eslint-disable-next-line camelcase
|
|
813
|
-
|
|
826
|
+
aztec_utl_setCapsule(
|
|
814
827
|
foreignContractAddress: ForeignCallSingle,
|
|
815
828
|
foreignSlot: ForeignCallSingle,
|
|
816
829
|
foreignCapsule: ForeignCallArray,
|
|
830
|
+
foreignScope: ForeignCallSingle,
|
|
817
831
|
) {
|
|
818
832
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
819
833
|
const slot = fromSingle(foreignSlot);
|
|
820
834
|
const capsule = fromArray(foreignCapsule);
|
|
835
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
821
836
|
|
|
822
|
-
|
|
837
|
+
this.handlerAsUtility().setCapsule(contractAddress, slot, capsule, scope);
|
|
823
838
|
|
|
824
839
|
return toForeignCallResult([]);
|
|
825
840
|
}
|
|
826
841
|
|
|
827
842
|
// eslint-disable-next-line camelcase
|
|
828
|
-
async
|
|
843
|
+
async aztec_utl_getCapsule(
|
|
829
844
|
foreignContractAddress: ForeignCallSingle,
|
|
830
845
|
foreignSlot: ForeignCallSingle,
|
|
831
846
|
foreignTSize: ForeignCallSingle,
|
|
847
|
+
foreignScope: ForeignCallSingle,
|
|
832
848
|
) {
|
|
833
849
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
834
850
|
const slot = fromSingle(foreignSlot);
|
|
835
851
|
const tSize = fromSingle(foreignTSize).toNumber();
|
|
852
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
836
853
|
|
|
837
|
-
const values = await this.handlerAsUtility().
|
|
854
|
+
const values = await this.handlerAsUtility().getCapsule(contractAddress, slot, scope);
|
|
838
855
|
|
|
839
856
|
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
840
857
|
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
@@ -848,11 +865,16 @@ export class RPCTranslator {
|
|
|
848
865
|
}
|
|
849
866
|
|
|
850
867
|
// eslint-disable-next-line camelcase
|
|
851
|
-
|
|
868
|
+
aztec_utl_deleteCapsule(
|
|
869
|
+
foreignContractAddress: ForeignCallSingle,
|
|
870
|
+
foreignSlot: ForeignCallSingle,
|
|
871
|
+
foreignScope: ForeignCallSingle,
|
|
872
|
+
) {
|
|
852
873
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
853
874
|
const slot = fromSingle(foreignSlot);
|
|
875
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
854
876
|
|
|
855
|
-
|
|
877
|
+
this.handlerAsUtility().deleteCapsule(contractAddress, slot, scope);
|
|
856
878
|
|
|
857
879
|
return toForeignCallResult([]);
|
|
858
880
|
}
|
|
@@ -863,13 +885,15 @@ export class RPCTranslator {
|
|
|
863
885
|
foreignSrcSlot: ForeignCallSingle,
|
|
864
886
|
foreignDstSlot: ForeignCallSingle,
|
|
865
887
|
foreignNumEntries: ForeignCallSingle,
|
|
888
|
+
foreignScope: ForeignCallSingle,
|
|
866
889
|
) {
|
|
867
890
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
868
891
|
const srcSlot = fromSingle(foreignSrcSlot);
|
|
869
892
|
const dstSlot = fromSingle(foreignDstSlot);
|
|
870
893
|
const numEntries = fromSingle(foreignNumEntries).toNumber();
|
|
894
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
871
895
|
|
|
872
|
-
await this.handlerAsUtility().copyCapsule(contractAddress, srcSlot, dstSlot, numEntries);
|
|
896
|
+
await this.handlerAsUtility().copyCapsule(contractAddress, srcSlot, dstSlot, numEntries, scope);
|
|
873
897
|
|
|
874
898
|
return toForeignCallResult([]);
|
|
875
899
|
}
|
|
@@ -879,7 +903,7 @@ export class RPCTranslator {
|
|
|
879
903
|
// to implement this function here. Isn't there a way to programmatically identify that this is missing, given the
|
|
880
904
|
// existence of a txe_oracle method?
|
|
881
905
|
// eslint-disable-next-line camelcase
|
|
882
|
-
async
|
|
906
|
+
async aztec_utl_decryptAes128(
|
|
883
907
|
foreignCiphertextBVecStorage: ForeignCallArray,
|
|
884
908
|
foreignCiphertextLength: ForeignCallSingle,
|
|
885
909
|
foreignIv: ForeignCallArray,
|
|
@@ -891,7 +915,7 @@ export class RPCTranslator {
|
|
|
891
915
|
|
|
892
916
|
// Noir Option<BoundedVec> is encoded as [is_some: Field, storage: Field[], length: Field].
|
|
893
917
|
try {
|
|
894
|
-
const plaintextBuffer = await this.handlerAsUtility().
|
|
918
|
+
const plaintextBuffer = await this.handlerAsUtility().decryptAes128(ciphertext, iv, symKey);
|
|
895
919
|
const [storage, length] = arrayToBoundedVec(
|
|
896
920
|
bufferToU8Array(plaintextBuffer),
|
|
897
921
|
foreignCiphertextBVecStorage.length,
|
|
@@ -909,6 +933,7 @@ export class RPCTranslator {
|
|
|
909
933
|
foreignEphPKField0: ForeignCallSingle,
|
|
910
934
|
foreignEphPKField1: ForeignCallSingle,
|
|
911
935
|
foreignEphPKField2: ForeignCallSingle,
|
|
936
|
+
foreignContractAddress: ForeignCallSingle,
|
|
912
937
|
) {
|
|
913
938
|
const address = AztecAddress.fromField(fromSingle(foreignAddress));
|
|
914
939
|
const ephPK = Point.fromFields([
|
|
@@ -916,14 +941,15 @@ export class RPCTranslator {
|
|
|
916
941
|
fromSingle(foreignEphPKField1),
|
|
917
942
|
fromSingle(foreignEphPKField2),
|
|
918
943
|
]);
|
|
944
|
+
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
919
945
|
|
|
920
|
-
const secret = await this.handlerAsUtility().getSharedSecret(address, ephPK);
|
|
946
|
+
const secret = await this.handlerAsUtility().getSharedSecret(address, ephPK, contractAddress);
|
|
921
947
|
|
|
922
|
-
return toForeignCallResult(secret
|
|
948
|
+
return toForeignCallResult([toSingle(secret)]);
|
|
923
949
|
}
|
|
924
950
|
|
|
925
951
|
// eslint-disable-next-line camelcase
|
|
926
|
-
|
|
952
|
+
aztec_utl_setContractSyncCacheInvalid(
|
|
927
953
|
foreignContractAddress: ForeignCallSingle,
|
|
928
954
|
foreignScopes: ForeignCallArray,
|
|
929
955
|
foreignScopeCount: ForeignCallSingle,
|
|
@@ -934,7 +960,7 @@ export class RPCTranslator {
|
|
|
934
960
|
.slice(0, count)
|
|
935
961
|
.map(f => new AztecAddress(f));
|
|
936
962
|
|
|
937
|
-
this.handlerAsUtility().
|
|
963
|
+
this.handlerAsUtility().setContractSyncCacheInvalid(contractAddress, scopes);
|
|
938
964
|
|
|
939
965
|
return Promise.resolve(toForeignCallResult([]));
|
|
940
966
|
}
|
|
@@ -61,8 +61,12 @@ export class DummyP2P implements P2P {
|
|
|
61
61
|
throw new Error('DummyP2P does not implement "registerBlockProposalHandler"');
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
public
|
|
65
|
-
throw new Error('DummyP2P does not implement "
|
|
64
|
+
public registerValidatorCheckpointProposalHandler(_handler: P2PCheckpointReceivedCallback): void {
|
|
65
|
+
throw new Error('DummyP2P does not implement "registerValidatorCheckpointProposalHandler"');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public registerAllNodesCheckpointProposalHandler(_handler: P2PCheckpointReceivedCallback): void {
|
|
69
|
+
throw new Error('DummyP2P does not implement "registerAllNodesCheckpointProposalHandler"');
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
public requestTxs(_txHashes: TxHash[]): Promise<(Tx | undefined)[]> {
|
|
@@ -3,7 +3,12 @@ import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
3
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { GasFees } from '@aztec/stdlib/gas';
|
|
5
5
|
import { makeGlobalVariables } from '@aztec/stdlib/testing';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
type BuildCheckpointGlobalVariablesOpts,
|
|
8
|
+
type CheckpointGlobalVariables,
|
|
9
|
+
type GlobalVariableBuilder,
|
|
10
|
+
GlobalVariables,
|
|
11
|
+
} from '@aztec/stdlib/tx';
|
|
7
12
|
|
|
8
13
|
export class TXEGlobalVariablesBuilder implements GlobalVariableBuilder {
|
|
9
14
|
public getCurrentMinFees(): Promise<GasFees> {
|
|
@@ -23,6 +28,7 @@ export class TXEGlobalVariablesBuilder implements GlobalVariableBuilder {
|
|
|
23
28
|
_coinbase: EthAddress,
|
|
24
29
|
_feeRecipient: AztecAddress,
|
|
25
30
|
_slotNumber: SlotNumber,
|
|
31
|
+
_opts?: BuildCheckpointGlobalVariablesOpts,
|
|
26
32
|
): Promise<CheckpointGlobalVariables> {
|
|
27
33
|
const vars = makeGlobalVariables();
|
|
28
34
|
return Promise.resolve({
|