@aztec/txe 0.0.1-commit.d3ec352c → 0.0.1-commit.d58ff9d0
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/AuthRegistry-QVGDDH5X.js +3 -0
- package/dest/AuthRegistry-QVGDDH5X.js.map +7 -0
- package/dest/ContractClassRegistry-VWR3F42P.js +3 -0
- package/dest/ContractClassRegistry-VWR3F42P.js.map +7 -0
- package/dest/ContractInstanceRegistry-FHIWE33X.js +3 -0
- package/dest/ContractInstanceRegistry-FHIWE33X.js.map +7 -0
- package/dest/FeeJuice-SAOWVGG7.js +3 -0
- package/dest/FeeJuice-SAOWVGG7.js.map +7 -0
- package/dest/HandshakeRegistry-GY5CPEPS.js +3 -0
- package/dest/HandshakeRegistry-GY5CPEPS.js.map +7 -0
- package/dest/MultiCallEntrypoint-QG5H33ZZ.js +3 -0
- package/dest/MultiCallEntrypoint-QG5H33ZZ.js.map +7 -0
- package/dest/SchnorrAccount-NME3E45O.js +3 -0
- package/dest/SchnorrAccount-NME3E45O.js.map +7 -0
- package/dest/SchnorrInitializerlessAccount-WTGXU6SW.js +3 -0
- package/dest/SchnorrInitializerlessAccount-WTGXU6SW.js.map +7 -0
- package/dest/bin/check_txe_oracle_version.d.ts +2 -0
- package/dest/bin/check_txe_oracle_version.d.ts.map +1 -0
- package/dest/bin/check_txe_oracle_version.js +53 -0
- package/dest/bin/index.js +3 -30
- package/dest/bin/index.js.map +7 -0
- package/dest/bin/oracle_test_server.d.ts +3 -0
- package/dest/bin/oracle_test_server.d.ts.map +1 -0
- package/dest/bin/oracle_test_server.js +41 -0
- package/dest/chunk-32UHX7YY.js +3 -0
- package/dest/chunk-32UHX7YY.js.map +7 -0
- package/dest/chunk-GSUKUCKV.js +260 -0
- package/dest/chunk-GSUKUCKV.js.map +7 -0
- package/dest/chunk-UP4KKUVA.js +304 -0
- package/dest/chunk-UP4KKUVA.js.map +7 -0
- package/dest/constants.d.ts +7 -0
- package/dest/constants.d.ts.map +1 -0
- package/dest/constants.js +10 -0
- package/dest/dispatcher_pool.d.ts +67 -0
- package/dest/dispatcher_pool.d.ts.map +1 -0
- package/dest/dispatcher_pool.js +286 -0
- package/dest/index.d.ts +51 -7
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +75 -158
- package/dest/metafile.json +38759 -0
- package/dest/msgpackr_fr_extension.d.ts +2 -0
- package/dest/msgpackr_fr_extension.d.ts.map +1 -0
- package/dest/msgpackr_fr_extension.js +21 -0
- package/dest/oracle/interfaces.d.ts +71 -30
- package/dest/oracle/interfaces.d.ts.map +1 -1
- package/dest/oracle/tagging_secret_strategy.d.ts +12 -0
- package/dest/oracle/tagging_secret_strategy.d.ts.map +1 -0
- package/dest/oracle/tagging_secret_strategy.js +12 -0
- package/dest/oracle/test-resolver/default_fixtures.d.ts +16 -0
- package/dest/oracle/test-resolver/default_fixtures.d.ts.map +1 -0
- package/dest/oracle/test-resolver/default_fixtures.js +200 -0
- package/dest/oracle/test-resolver/index.d.ts +9 -0
- package/dest/oracle/test-resolver/index.d.ts.map +1 -0
- package/dest/oracle/test-resolver/index.js +32 -0
- package/dest/oracle/test-resolver/resolver.d.ts +48 -0
- package/dest/oracle/test-resolver/resolver.d.ts.map +1 -0
- package/dest/oracle/test-resolver/resolver.js +181 -0
- package/dest/oracle/txe_oracle_public_context.d.ts +40 -16
- package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.js +69 -23
- package/dest/oracle/txe_oracle_registry.d.ts +172 -0
- package/dest/oracle/txe_oracle_registry.d.ts.map +1 -0
- package/dest/oracle/txe_oracle_registry.js +767 -0
- package/dest/oracle/txe_oracle_top_level_context.d.ts +79 -30
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +653 -285
- package/dest/oracle/txe_oracle_version.d.ts +17 -0
- package/dest/oracle/txe_oracle_version.d.ts.map +1 -0
- package/dest/oracle/txe_oracle_version.js +14 -0
- package/dest/oracle/txe_private_execution_oracle.d.ts +17 -0
- package/dest/oracle/txe_private_execution_oracle.d.ts.map +1 -0
- package/dest/oracle/txe_private_execution_oracle.js +15 -0
- package/dest/rpc_server.d.ts +14 -0
- package/dest/rpc_server.d.ts.map +1 -0
- package/dest/rpc_server.js +78 -0
- package/dest/rpc_translator.d.ts +115 -216
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +901 -560
- package/dest/server.bundle.js +3 -0
- package/dest/server.bundle.js.map +7 -0
- package/dest/state_machine/archiver.d.ts +23 -58
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/archiver.js +76 -112
- package/dest/state_machine/dummy_p2p_client.d.ts +31 -17
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +63 -25
- package/dest/state_machine/global_variable_builder.d.ts +10 -5
- package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
- package/dest/state_machine/global_variable_builder.js +20 -5
- package/dest/state_machine/index.d.ts +14 -8
- package/dest/state_machine/index.d.ts.map +1 -1
- package/dest/state_machine/index.js +84 -27
- package/dest/state_machine/mock_epoch_cache.d.ts +24 -8
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +43 -9
- package/dest/state_machine/synchronizer.d.ts +14 -6
- package/dest/state_machine/synchronizer.d.ts.map +1 -1
- package/dest/state_machine/synchronizer.js +23 -10
- package/dest/txe_session.d.ts +102 -20
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +442 -75
- package/dest/utils/block_creation.d.ts +20 -6
- package/dest/utils/block_creation.d.ts.map +1 -1
- package/dest/utils/block_creation.js +40 -6
- package/dest/utils/encoding.d.ts +192 -0
- package/dest/utils/encoding.d.ts.map +1 -0
- package/dest/{util → utils}/encoding.js +8 -3
- package/dest/{util → utils}/expected_failure_error.d.ts +1 -1
- package/dest/utils/expected_failure_error.d.ts.map +1 -0
- package/dest/utils/tx_effect_creation.d.ts +2 -3
- package/dest/utils/tx_effect_creation.d.ts.map +1 -1
- package/dest/utils/tx_effect_creation.js +3 -7
- package/dest/utils/txe_account_store.d.ts +10 -0
- package/dest/utils/txe_account_store.d.ts.map +1 -0
- package/dest/{util/txe_account_data_provider.js → utils/txe_account_store.js} +1 -1
- package/dest/utils/txe_artifact_resolver.d.ts +37 -0
- package/dest/utils/txe_artifact_resolver.d.ts.map +1 -0
- package/dest/utils/txe_artifact_resolver.js +161 -0
- package/dest/utils/txe_public_contract_data_source.d.ts +20 -0
- package/dest/utils/txe_public_contract_data_source.d.ts.map +1 -0
- package/dest/utils/txe_public_contract_data_source.js +51 -0
- package/dest/worker.bundle.js +3 -0
- package/dest/worker.bundle.js.map +7 -0
- package/dest/worker.d.ts +2 -0
- package/dest/worker.d.ts.map +1 -0
- package/dest/worker.js +92 -0
- package/package.json +39 -22
- package/src/bin/check_txe_oracle_version.ts +67 -0
- package/src/bin/index.ts +11 -2
- package/src/bin/oracle_test_server.ts +51 -0
- package/src/constants.ts +13 -0
- package/src/dispatcher_pool.ts +317 -0
- package/src/index.ts +113 -201
- package/src/msgpackr_fr_extension.ts +23 -0
- package/src/oracle/interfaces.ts +77 -35
- package/src/oracle/tagging_secret_strategy.ts +25 -0
- package/src/oracle/test-resolver/default_fixtures.ts +271 -0
- package/src/oracle/test-resolver/index.ts +44 -0
- package/src/oracle/test-resolver/resolver.ts +245 -0
- package/src/oracle/txe_oracle_public_context.ts +82 -27
- package/src/oracle/txe_oracle_registry.ts +556 -0
- package/src/oracle/txe_oracle_top_level_context.ts +555 -189
- package/src/oracle/txe_oracle_version.ts +17 -0
- package/src/oracle/txe_private_execution_oracle.ts +30 -0
- package/src/rpc_server.ts +87 -0
- package/src/rpc_translator.ts +1115 -923
- package/src/state_machine/archiver.ts +81 -132
- package/src/state_machine/dummy_p2p_client.ts +96 -38
- package/src/state_machine/global_variable_builder.ts +28 -10
- package/src/state_machine/index.ts +118 -44
- package/src/state_machine/mock_epoch_cache.ts +53 -14
- package/src/state_machine/synchronizer.ts +32 -12
- package/src/txe_session.ts +727 -123
- package/src/utils/block_creation.ts +50 -16
- package/src/{util → utils}/encoding.ts +9 -3
- package/src/utils/tx_effect_creation.ts +3 -13
- package/src/{util/txe_account_data_provider.ts → utils/txe_account_store.ts} +1 -1
- package/src/utils/txe_artifact_resolver.ts +217 -0
- package/src/utils/txe_public_contract_data_source.ts +60 -0
- package/src/worker.ts +98 -0
- package/dest/util/encoding.d.ts +0 -121
- package/dest/util/encoding.d.ts.map +0 -1
- package/dest/util/expected_failure_error.d.ts.map +0 -1
- package/dest/util/txe_account_data_provider.d.ts +0 -10
- package/dest/util/txe_account_data_provider.d.ts.map +0 -1
- package/dest/util/txe_contract_data_provider.d.ts +0 -12
- package/dest/util/txe_contract_data_provider.d.ts.map +0 -1
- package/dest/util/txe_contract_data_provider.js +0 -22
- package/dest/util/txe_public_contract_data_source.d.ts +0 -21
- package/dest/util/txe_public_contract_data_source.d.ts.map +0 -1
- package/dest/util/txe_public_contract_data_source.js +0 -67
- package/src/util/txe_contract_data_provider.ts +0 -36
- package/src/util/txe_public_contract_data_source.ts +0 -86
- /package/dest/{util → utils}/expected_failure_error.js +0 -0
- /package/src/{util → utils}/expected_failure_error.ts +0 -0
package/dest/util/encoding.d.ts
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import { type ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
export type ForeignCallSingle = string;
|
|
8
|
-
export type ForeignCallArray = string[];
|
|
9
|
-
export type ForeignCallArgs = (ForeignCallSingle | ForeignCallArray | ContractArtifact | ContractInstanceWithAddress)[];
|
|
10
|
-
export type ForeignCallResult = {
|
|
11
|
-
values: (ForeignCallSingle | ForeignCallArray)[];
|
|
12
|
-
};
|
|
13
|
-
export declare function fromSingle(obj: ForeignCallSingle): Fr;
|
|
14
|
-
export declare function addressFromSingle(obj: ForeignCallSingle): AztecAddress;
|
|
15
|
-
export declare function fromArray(obj: ForeignCallArray): Fr[];
|
|
16
|
-
/**
|
|
17
|
-
* Converts an array of Noir unsigned integers to a single tightly-packed buffer.
|
|
18
|
-
* @param uintBitSize If it's an array of Noir u8's, put `8`, etc.
|
|
19
|
-
* @returns A buffer where each byte is correctly represented as a single byte in the buffer.
|
|
20
|
-
*/
|
|
21
|
-
export declare function fromUintArray(obj: ForeignCallArray, uintBitSize: number): Buffer;
|
|
22
|
-
/**
|
|
23
|
-
* Converts a Noir BoundedVec of unsigned integers into a Buffer. Note that BoundedVecs are structs, and therefore
|
|
24
|
-
* translated as two separate ForeignCallArray and ForeignCallSingle values (an array and a single field).
|
|
25
|
-
*
|
|
26
|
-
* @param storage The array with the BoundedVec's storage (i.e. BoundedVec::storage())
|
|
27
|
-
* @param length The length of the BoundedVec (i.e. BoundedVec::len())
|
|
28
|
-
* @param uintBitSize If it's an array of Noir u8's, put `8`, etc.
|
|
29
|
-
* @returns A buffer containing the unsigned integers tightly packed
|
|
30
|
-
*/
|
|
31
|
-
export declare function fromUintBoundedVec(storage: ForeignCallArray, length: ForeignCallSingle, uintBitSize: number): Buffer;
|
|
32
|
-
export declare function toSingle(value: AztecAddress | EthAddress | Fr | Buffer | boolean | number | bigint): ForeignCallSingle;
|
|
33
|
-
export declare function toArray(objs: Fr[]): ForeignCallArray;
|
|
34
|
-
export declare function toSingleOrArray(value: Fr | Fr[]): string | string[];
|
|
35
|
-
export declare function bufferToU8Array(buffer: Buffer): ForeignCallArray;
|
|
36
|
-
/**
|
|
37
|
-
* Converts a ForeignCallArray into a tuple which represents a nr BoundedVec.
|
|
38
|
-
* If the input array is shorter than the maxLen, it pads the result with zeros,
|
|
39
|
-
* so that nr can correctly coerce this result into a BoundedVec.
|
|
40
|
-
* @param bVecStorage - The array underlying the BoundedVec.
|
|
41
|
-
* @param maxLen - the max length of the BoundedVec.
|
|
42
|
-
* @returns a tuple representing a BoundedVec.
|
|
43
|
-
*/
|
|
44
|
-
export declare function arrayToBoundedVec(bVecStorage: ForeignCallArray, maxLen: number): [ForeignCallArray, ForeignCallSingle];
|
|
45
|
-
/**
|
|
46
|
-
* Converts an array of arrays representing Noir BoundedVec of nested arrays into its Noir serialized form.
|
|
47
|
-
* @param bVecStorage - The array underlying the BoundedVec.
|
|
48
|
-
* @param maxLen - The max length of the BoundedVec (max num of the nested arrays in the BoundedVec).
|
|
49
|
-
* @param nestedArrayLength - The length of the nested arrays (each nested array has to have the same length).
|
|
50
|
-
* @returns Serialized BoundedVec following Noir intrinsic serialization.
|
|
51
|
-
*/
|
|
52
|
-
export declare function arrayOfArraysToBoundedVecOfArrays(bVecStorage: ForeignCallArray[], maxLen: number, nestedArrayLength: number): [ForeignCallArray, ForeignCallSingle];
|
|
53
|
-
export declare function toForeignCallResult(obj: (ForeignCallSingle | ForeignCallArray)[]): {
|
|
54
|
-
values: (string | ForeignCallArray)[];
|
|
55
|
-
};
|
|
56
|
-
export declare const ForeignCallSingleSchema: z.ZodString;
|
|
57
|
-
export declare const ForeignCallArraySchema: z.ZodArray<z.ZodString, "many">;
|
|
58
|
-
export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, import("../../../foundation/dest/schemas/types.js").ZodFor<ContractArtifact>, z.ZodIntersection<z.ZodObject<{
|
|
59
|
-
version: z.ZodLiteral<1>;
|
|
60
|
-
salt: import("../../../foundation/dest/schemas/types.js").ZodFor<Fr>;
|
|
61
|
-
deployer: import("../../../foundation/dest/schemas/types.js").ZodFor<AztecAddress>;
|
|
62
|
-
currentContractClassId: import("../../../foundation/dest/schemas/types.js").ZodFor<Fr>;
|
|
63
|
-
originalContractClassId: import("../../../foundation/dest/schemas/types.js").ZodFor<Fr>;
|
|
64
|
-
initializationHash: import("../../../foundation/dest/schemas/types.js").ZodFor<Fr>;
|
|
65
|
-
publicKeys: z.ZodEffects<z.ZodObject<{
|
|
66
|
-
masterNullifierPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
|
|
67
|
-
masterIncomingViewingPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
|
|
68
|
-
masterOutgoingViewingPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
|
|
69
|
-
masterTaggingPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
|
|
70
|
-
}, "strip", z.ZodTypeAny, {
|
|
71
|
-
masterNullifierPublicKey: import("@aztec/foundation/fields").Point;
|
|
72
|
-
masterIncomingViewingPublicKey: import("@aztec/foundation/fields").Point;
|
|
73
|
-
masterOutgoingViewingPublicKey: import("@aztec/foundation/fields").Point;
|
|
74
|
-
masterTaggingPublicKey: import("@aztec/foundation/fields").Point;
|
|
75
|
-
}, {
|
|
76
|
-
masterNullifierPublicKey: string;
|
|
77
|
-
masterIncomingViewingPublicKey: string;
|
|
78
|
-
masterOutgoingViewingPublicKey: string;
|
|
79
|
-
masterTaggingPublicKey: string;
|
|
80
|
-
}>, import("../../../stdlib/dest/keys/public_keys.js").PublicKeys, {
|
|
81
|
-
masterNullifierPublicKey: string;
|
|
82
|
-
masterIncomingViewingPublicKey: string;
|
|
83
|
-
masterOutgoingViewingPublicKey: string;
|
|
84
|
-
masterTaggingPublicKey: string;
|
|
85
|
-
}>;
|
|
86
|
-
}, "strip", z.ZodTypeAny, {
|
|
87
|
-
version: 1;
|
|
88
|
-
salt: Fr;
|
|
89
|
-
deployer: AztecAddress;
|
|
90
|
-
currentContractClassId: Fr;
|
|
91
|
-
originalContractClassId: Fr;
|
|
92
|
-
initializationHash: Fr;
|
|
93
|
-
publicKeys: import("../../../stdlib/dest/keys/public_keys.js").PublicKeys;
|
|
94
|
-
}, {
|
|
95
|
-
version: 1;
|
|
96
|
-
salt?: any;
|
|
97
|
-
deployer?: any;
|
|
98
|
-
currentContractClassId?: any;
|
|
99
|
-
originalContractClassId?: any;
|
|
100
|
-
initializationHash?: any;
|
|
101
|
-
publicKeys: {
|
|
102
|
-
masterNullifierPublicKey: string;
|
|
103
|
-
masterIncomingViewingPublicKey: string;
|
|
104
|
-
masterOutgoingViewingPublicKey: string;
|
|
105
|
-
masterTaggingPublicKey: string;
|
|
106
|
-
};
|
|
107
|
-
}>, z.ZodObject<{
|
|
108
|
-
address: import("../../../foundation/dest/schemas/types.js").ZodFor<AztecAddress>;
|
|
109
|
-
}, "strip", z.ZodTypeAny, {
|
|
110
|
-
address: AztecAddress;
|
|
111
|
-
}, {
|
|
112
|
-
address?: any;
|
|
113
|
-
}>>]>, "many">;
|
|
114
|
-
export declare const ForeignCallResultSchema: z.ZodObject<{
|
|
115
|
-
values: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, "many">;
|
|
116
|
-
}, "strip", z.ZodTypeAny, {
|
|
117
|
-
values: (string | string[])[];
|
|
118
|
-
}, {
|
|
119
|
-
values: (string | string[])[];
|
|
120
|
-
}>;
|
|
121
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2RpbmcuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2VuY29kaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ2hFLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUU5QyxPQUFPLEVBQUUsS0FBSyxnQkFBZ0IsRUFBMEIsTUFBTSxtQkFBbUIsQ0FBQztBQUNsRixPQ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,GAAG,EAAE,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GACzE,iBAAiB,CAYnB;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,gBAAgB,CAEpD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,qBAE/C;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAEhE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,gBAAgB,EAC7B,MAAM,EAAE,MAAM,GACb,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAYvC;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,WAAW,EAAE,gBAAgB,EAAE,EAC/B,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,MAAM,GACxB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAqBvC;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,EAAE;;EAEhF;AAED,eAAO,MAAM,uBAAuB,aAAa,CAAC;AAElD,eAAO,MAAM,sBAAsB,iCAAsB,CAAC;AAE1D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expected_failure_error.d.ts","sourceRoot":"","sources":["../../src/util/expected_failure_error.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAO,EAAE,MAAM,EAE1B;CACF"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
2
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
-
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
4
|
-
export declare class TXEAccountDataProvider {
|
|
5
|
-
#private;
|
|
6
|
-
constructor(store: AztecAsyncKVStore);
|
|
7
|
-
getAccount(key: AztecAddress): Promise<CompleteAddress>;
|
|
8
|
-
setAccount(key: AztecAddress, value: CompleteAddress): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX2FjY291bnRfZGF0YV9wcm92aWRlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWwvdHhlX2FjY291bnRfZGF0YV9wcm92aWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBaUIsTUFBTSxpQkFBaUIsQ0FBQztBQUN4RSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFekQscUJBQWEsc0JBQXNCOztJQUdqQyxZQUFZLEtBQUssRUFBRSxpQkFBaUIsRUFFbkM7SUFFSyxVQUFVLENBQUMsR0FBRyxFQUFFLFlBQVksNEJBTWpDO0lBRUssVUFBVSxDQUFDLEdBQUcsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLGVBQWUsaUJBRXpEO0NBQ0YifQ==
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"txe_account_data_provider.d.ts","sourceRoot":"","sources":["../../src/util/txe_account_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qBAAa,sBAAsB;;IAGjC,YAAY,KAAK,EAAE,iBAAiB,EAEnC;IAEK,UAAU,CAAC,GAAG,EAAE,YAAY,4BAMjC;IAEK,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,iBAEzD;CACF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ContractArtifact } from '@aztec/aztec.js/abi';
|
|
2
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
|
-
import { ContractDataProvider } from '@aztec/pxe/server';
|
|
4
|
-
export type ContractArtifactWithHash = ContractArtifact & {
|
|
5
|
-
artifactHash: Fr;
|
|
6
|
-
};
|
|
7
|
-
export declare class TXEContractDataProvider extends ContractDataProvider {
|
|
8
|
-
#private;
|
|
9
|
-
addContractArtifact(id: Fr, artifact: ContractArtifact | ContractArtifactWithHash): Promise<void>;
|
|
10
|
-
getContractArtifact(contractClassId: Fr): Promise<ContractArtifact | ContractArtifactWithHash | undefined>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX2NvbnRyYWN0X2RhdGFfcHJvdmlkZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3R4ZV9jb250cmFjdF9kYXRhX3Byb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDNUQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQzVDLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBRXpELE1BQU0sTUFBTSx3QkFBd0IsR0FBRyxnQkFBZ0IsR0FBRztJQUFFLFlBQVksRUFBRSxFQUFFLENBQUE7Q0FBRSxDQUFDO0FBTy9FLHFCQUFhLHVCQUF3QixTQUFRLG9CQUFvQjs7SUFHekMsbUJBQW1CLENBQ3ZDLEVBQUUsRUFBRSxFQUFFLEVBQ04sUUFBUSxFQUFFLGdCQUFnQixHQUFHLHdCQUF3QixHQUNwRCxPQUFPLENBQUMsSUFBSSxDQUFDLENBS2Y7SUFFcUIsbUJBQW1CLENBQ3ZDLGVBQWUsRUFBRSxFQUFFLEdBQ2xCLE9BQU8sQ0FBQyxnQkFBZ0IsR0FBRyx3QkFBd0IsR0FBRyxTQUFTLENBQUMsQ0FRbEU7Q0FDRiJ9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"txe_contract_data_provider.d.ts","sourceRoot":"","sources":["../../src/util/txe_contract_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG;IAAE,YAAY,EAAE,EAAE,CAAA;CAAE,CAAC;AAO/E,qBAAa,uBAAwB,SAAQ,oBAAoB;;IAGzC,mBAAmB,CACvC,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,gBAAgB,GAAG,wBAAwB,GACpD,OAAO,CAAC,IAAI,CAAC,CAKf;IAEqB,mBAAmB,CACvC,eAAe,EAAE,EAAE,GAClB,OAAO,CAAC,gBAAgB,GAAG,wBAAwB,GAAG,SAAS,CAAC,CAQlE;CACF"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
2
|
-
import { ContractDataProvider } from '@aztec/pxe/server';
|
|
3
|
-
/*
|
|
4
|
-
* A contract data provider that stores contract artifacts with their hashes. Since
|
|
5
|
-
* TXE typically deploys the same contract again and again for multiple tests, caching
|
|
6
|
-
* the *very* expensive artifact hash computation improves testing speed significantly.
|
|
7
|
-
*/ export class TXEContractDataProvider extends ContractDataProvider {
|
|
8
|
-
#artifactHashes = new Map();
|
|
9
|
-
async addContractArtifact(id, artifact) {
|
|
10
|
-
if ('artifactHash' in artifact) {
|
|
11
|
-
this.#artifactHashes.set(id.toString(), artifact.artifactHash.toBuffer());
|
|
12
|
-
}
|
|
13
|
-
await super.addContractArtifact(id, artifact);
|
|
14
|
-
}
|
|
15
|
-
async getContractArtifact(contractClassId) {
|
|
16
|
-
const artifact = await super.getContractArtifact(contractClassId);
|
|
17
|
-
if (artifact && this.#artifactHashes.has(contractClassId.toString())) {
|
|
18
|
-
artifact.artifactHash = Fr.fromBuffer(this.#artifactHashes.get(contractClassId.toString()));
|
|
19
|
-
}
|
|
20
|
-
return artifact;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import type { ContractDataProvider } from '@aztec/pxe/server';
|
|
4
|
-
import { type ContractArtifact, FunctionSelector } from '@aztec/stdlib/abi';
|
|
5
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import { type ContractClassPublic, type ContractDataSource, type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
7
|
-
export declare class TXEPublicContractDataSource implements ContractDataSource {
|
|
8
|
-
#private;
|
|
9
|
-
private blockNumber;
|
|
10
|
-
private contractDataProvider;
|
|
11
|
-
constructor(blockNumber: BlockNumber, contractDataProvider: ContractDataProvider);
|
|
12
|
-
getBlockNumber(): Promise<BlockNumber>;
|
|
13
|
-
getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
|
|
14
|
-
getBytecodeCommitment(id: Fr): Promise<Fr | undefined>;
|
|
15
|
-
getContract(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
|
|
16
|
-
getContractClassIds(): Promise<Fr[]>;
|
|
17
|
-
getContractArtifact(address: AztecAddress): Promise<ContractArtifact | undefined>;
|
|
18
|
-
getDebugFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
19
|
-
registerContractFunctionSignatures(_signatures: []): Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWwvdHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDOUQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQzlDLE9BQU8sS0FBSyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDOUQsT0FBTyxFQUFFLEtBQUssZ0JBQWdCLEVBQUUsZ0JBQWdCLEVBQWdCLE1BQU0sbUJBQW1CLENBQUM7QUFDMUYsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxFQUNMLEtBQUssbUJBQW1CLEVBQ3hCLEtBQUssa0JBQWtCLEVBQ3ZCLEtBQUssMkJBQTJCLEVBSWpDLE1BQU0sd0JBQXdCLENBQUM7QUFFaEMscUJBQWEsMkJBQTRCLFlBQVcsa0JBQWtCOztJQUdsRSxPQUFPLENBQUMsV0FBVztJQUNuQixPQUFPLENBQUMsb0JBQW9CO0lBRjlCLFlBQ1UsV0FBVyxFQUFFLFdBQVcsRUFDeEIsb0JBQW9CLEVBQUUsb0JBQW9CLEVBQ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gB,MAAM,mBAAmB,CAAC;AAC1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAIjC,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,2BAA4B,YAAW,kBAAkB;;IAGlE,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,oBAAoB;IAF9B,YACU,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,oBAAoB,EAChD;IAEJ,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAErC;IAEK,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAgCvE;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"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { FunctionType } from '@aztec/stdlib/abi';
|
|
3
|
-
import { computePrivateFunctionsRoot, computePublicBytecodeCommitment, getContractClassPrivateFunctionFromArtifact } from '@aztec/stdlib/contract';
|
|
4
|
-
export class TXEPublicContractDataSource {
|
|
5
|
-
blockNumber;
|
|
6
|
-
contractDataProvider;
|
|
7
|
-
#privateFunctionsRoot;
|
|
8
|
-
constructor(blockNumber, contractDataProvider){
|
|
9
|
-
this.blockNumber = blockNumber;
|
|
10
|
-
this.contractDataProvider = contractDataProvider;
|
|
11
|
-
this.#privateFunctionsRoot = new Map();
|
|
12
|
-
}
|
|
13
|
-
getBlockNumber() {
|
|
14
|
-
return Promise.resolve(this.blockNumber);
|
|
15
|
-
}
|
|
16
|
-
async getContractClass(id) {
|
|
17
|
-
const contractClass = await this.contractDataProvider.getContractClass(id);
|
|
18
|
-
if (!contractClass) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const artifact = await this.contractDataProvider.getContractArtifact(id);
|
|
22
|
-
if (!artifact) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
let privateFunctionsRoot;
|
|
26
|
-
if (!this.#privateFunctionsRoot.has(id.toString())) {
|
|
27
|
-
const privateFunctions = await Promise.all(artifact.functions.filter((fn)=>fn.functionType === FunctionType.PRIVATE).map((fn)=>getContractClassPrivateFunctionFromArtifact(fn)));
|
|
28
|
-
privateFunctionsRoot = await computePrivateFunctionsRoot(privateFunctions);
|
|
29
|
-
this.#privateFunctionsRoot.set(id.toString(), privateFunctionsRoot.toBuffer());
|
|
30
|
-
} else {
|
|
31
|
-
privateFunctionsRoot = Fr.fromBuffer(this.#privateFunctionsRoot.get(id.toString()));
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
id,
|
|
35
|
-
artifactHash: contractClass.artifactHash,
|
|
36
|
-
packedBytecode: contractClass.packedBytecode,
|
|
37
|
-
privateFunctionsRoot,
|
|
38
|
-
version: contractClass.version,
|
|
39
|
-
privateFunctions: [],
|
|
40
|
-
utilityFunctions: []
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
async getBytecodeCommitment(id) {
|
|
44
|
-
const contractClass = await this.contractDataProvider.getContractClass(id);
|
|
45
|
-
return contractClass && computePublicBytecodeCommitment(contractClass.packedBytecode);
|
|
46
|
-
}
|
|
47
|
-
async getContract(address) {
|
|
48
|
-
const instance = await this.contractDataProvider.getContractInstance(address);
|
|
49
|
-
return instance && {
|
|
50
|
-
...instance,
|
|
51
|
-
address
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
getContractClassIds() {
|
|
55
|
-
throw new Error('Method not implemented.');
|
|
56
|
-
}
|
|
57
|
-
async getContractArtifact(address) {
|
|
58
|
-
const instance = await this.contractDataProvider.getContractInstance(address);
|
|
59
|
-
return instance && this.contractDataProvider.getContractArtifact(instance.currentContractClassId);
|
|
60
|
-
}
|
|
61
|
-
async getDebugFunctionName(address, selector) {
|
|
62
|
-
return await this.contractDataProvider.getDebugFunctionName(address, selector);
|
|
63
|
-
}
|
|
64
|
-
registerContractFunctionSignatures(_signatures) {
|
|
65
|
-
return Promise.resolve();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ContractArtifact } from '@aztec/aztec.js/abi';
|
|
2
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
|
-
import { ContractDataProvider } from '@aztec/pxe/server';
|
|
4
|
-
|
|
5
|
-
export type ContractArtifactWithHash = ContractArtifact & { artifactHash: Fr };
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
* A contract data provider that stores contract artifacts with their hashes. Since
|
|
9
|
-
* TXE typically deploys the same contract again and again for multiple tests, caching
|
|
10
|
-
* the *very* expensive artifact hash computation improves testing speed significantly.
|
|
11
|
-
*/
|
|
12
|
-
export class TXEContractDataProvider extends ContractDataProvider {
|
|
13
|
-
#artifactHashes: Map<string, Buffer> = new Map();
|
|
14
|
-
|
|
15
|
-
public override async addContractArtifact(
|
|
16
|
-
id: Fr,
|
|
17
|
-
artifact: ContractArtifact | ContractArtifactWithHash,
|
|
18
|
-
): Promise<void> {
|
|
19
|
-
if ('artifactHash' in artifact) {
|
|
20
|
-
this.#artifactHashes.set(id.toString(), artifact.artifactHash.toBuffer());
|
|
21
|
-
}
|
|
22
|
-
await super.addContractArtifact(id, artifact);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public override async getContractArtifact(
|
|
26
|
-
contractClassId: Fr,
|
|
27
|
-
): Promise<ContractArtifact | ContractArtifactWithHash | undefined> {
|
|
28
|
-
const artifact = await super.getContractArtifact(contractClassId);
|
|
29
|
-
if (artifact && this.#artifactHashes.has(contractClassId.toString())) {
|
|
30
|
-
(artifact as ContractArtifactWithHash).artifactHash = Fr.fromBuffer(
|
|
31
|
-
this.#artifactHashes.get(contractClassId.toString())!,
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
return artifact;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import type { ContractDataProvider } from '@aztec/pxe/server';
|
|
4
|
-
import { type ContractArtifact, FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
5
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import {
|
|
7
|
-
type ContractClassPublic,
|
|
8
|
-
type ContractDataSource,
|
|
9
|
-
type ContractInstanceWithAddress,
|
|
10
|
-
computePrivateFunctionsRoot,
|
|
11
|
-
computePublicBytecodeCommitment,
|
|
12
|
-
getContractClassPrivateFunctionFromArtifact,
|
|
13
|
-
} from '@aztec/stdlib/contract';
|
|
14
|
-
|
|
15
|
-
export class TXEPublicContractDataSource implements ContractDataSource {
|
|
16
|
-
#privateFunctionsRoot: Map<string, Buffer> = new Map();
|
|
17
|
-
constructor(
|
|
18
|
-
private blockNumber: BlockNumber,
|
|
19
|
-
private contractDataProvider: ContractDataProvider,
|
|
20
|
-
) {}
|
|
21
|
-
|
|
22
|
-
getBlockNumber(): Promise<BlockNumber> {
|
|
23
|
-
return Promise.resolve(this.blockNumber);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async getContractClass(id: Fr): Promise<ContractClassPublic | undefined> {
|
|
27
|
-
const contractClass = await this.contractDataProvider.getContractClass(id);
|
|
28
|
-
if (!contractClass) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const artifact = await this.contractDataProvider.getContractArtifact(id);
|
|
32
|
-
if (!artifact) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
let privateFunctionsRoot;
|
|
37
|
-
if (!this.#privateFunctionsRoot.has(id.toString())) {
|
|
38
|
-
const privateFunctions = await Promise.all(
|
|
39
|
-
artifact.functions
|
|
40
|
-
.filter(fn => fn.functionType === FunctionType.PRIVATE)
|
|
41
|
-
.map(fn => getContractClassPrivateFunctionFromArtifact(fn)),
|
|
42
|
-
);
|
|
43
|
-
privateFunctionsRoot = await computePrivateFunctionsRoot(privateFunctions);
|
|
44
|
-
this.#privateFunctionsRoot.set(id.toString(), privateFunctionsRoot.toBuffer());
|
|
45
|
-
} else {
|
|
46
|
-
privateFunctionsRoot = Fr.fromBuffer(this.#privateFunctionsRoot.get(id.toString())!);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
id,
|
|
51
|
-
artifactHash: contractClass!.artifactHash,
|
|
52
|
-
packedBytecode: contractClass!.packedBytecode,
|
|
53
|
-
privateFunctionsRoot,
|
|
54
|
-
version: contractClass!.version,
|
|
55
|
-
privateFunctions: [],
|
|
56
|
-
utilityFunctions: [],
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
async getBytecodeCommitment(id: Fr): Promise<Fr | undefined> {
|
|
61
|
-
const contractClass = await this.contractDataProvider.getContractClass(id);
|
|
62
|
-
return contractClass && computePublicBytecodeCommitment(contractClass.packedBytecode);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
async getContract(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined> {
|
|
66
|
-
const instance = await this.contractDataProvider.getContractInstance(address);
|
|
67
|
-
return instance && { ...instance, address };
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
getContractClassIds(): Promise<Fr[]> {
|
|
71
|
-
throw new Error('Method not implemented.');
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
async getContractArtifact(address: AztecAddress): Promise<ContractArtifact | undefined> {
|
|
75
|
-
const instance = await this.contractDataProvider.getContractInstance(address);
|
|
76
|
-
return instance && this.contractDataProvider.getContractArtifact(instance.currentContractClassId);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
async getDebugFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined> {
|
|
80
|
-
return await this.contractDataProvider.getDebugFunctionName(address, selector);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
registerContractFunctionSignatures(_signatures: []): Promise<void> {
|
|
84
|
-
return Promise.resolve();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
File without changes
|
|
File without changes
|