@aztec/protocol-contracts 0.0.0-test.0 → 0.0.1-commit.24de95ac
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/README.md +2 -2
- package/artifacts/AuthRegistry.json +1979 -1183
- package/artifacts/ContractClassRegistry.json +8205 -0
- package/artifacts/ContractInstanceRegistry.json +3587 -0
- package/artifacts/FeeJuice.json +2499 -1930
- package/artifacts/MultiCallEntrypoint.json +1527 -841
- package/artifacts/Router.json +709 -3531
- package/dest/auth-registry/index.d.ts +2 -1
- package/dest/auth-registry/index.d.ts.map +1 -1
- package/dest/auth-registry/index.js +1 -1
- package/dest/auth-registry/lazy.js +4 -4
- package/dest/{class-registerer/contract_class_registered_event.d.ts → class-registry/contract_class_published_event.d.ts} +5 -7
- package/dest/class-registry/contract_class_published_event.d.ts.map +1 -0
- package/dest/{class-registerer/contract_class_registered_event.js → class-registry/contract_class_published_event.js} +12 -20
- package/dest/class-registry/index.d.ts +8 -0
- package/dest/class-registry/index.d.ts.map +1 -0
- package/dest/class-registry/index.js +17 -0
- package/dest/class-registry/lazy.d.ts +9 -0
- package/dest/class-registry/lazy.d.ts.map +1 -0
- package/dest/class-registry/lazy.js +26 -0
- package/dest/{class-registerer → class-registry}/private_function_broadcasted_event.d.ts +3 -5
- package/dest/class-registry/private_function_broadcasted_event.d.ts.map +1 -0
- package/dest/{class-registerer → class-registry}/private_function_broadcasted_event.js +11 -11
- package/dest/{class-registerer/unconstrained_function_broadcasted_event.d.ts → class-registry/utility_function_broadcasted_event.d.ts} +12 -14
- package/dest/class-registry/utility_function_broadcasted_event.d.ts.map +1 -0
- package/dest/{class-registerer/unconstrained_function_broadcasted_event.js → class-registry/utility_function_broadcasted_event.js} +19 -19
- package/dest/fee-juice/index.js +1 -1
- package/dest/fee-juice/lazy.js +4 -4
- package/dest/index.d.ts +0 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +0 -1
- package/dest/{instance-deployer/contract_instance_deployed_event.d.ts → instance-registry/contract_instance_published_event.d.ts} +5 -5
- package/dest/instance-registry/contract_instance_published_event.d.ts.map +1 -0
- package/dest/{instance-deployer/contract_instance_deployed_event.js → instance-registry/contract_instance_published_event.js} +5 -5
- package/dest/{instance-deployer → instance-registry}/contract_instance_updated_event.d.ts +4 -3
- package/dest/instance-registry/contract_instance_updated_event.d.ts.map +1 -0
- package/dest/instance-registry/contract_instance_updated_event.js +35 -0
- package/dest/{instance-deployer → instance-registry}/index.d.ts +3 -3
- package/dest/instance-registry/index.d.ts.map +1 -0
- package/dest/{instance-deployer → instance-registry}/index.js +5 -5
- package/dest/{instance-deployer → instance-registry}/lazy.d.ts +3 -3
- package/dest/{instance-deployer → instance-registry}/lazy.d.ts.map +1 -1
- package/dest/instance-registry/lazy.js +25 -0
- package/dest/make_protocol_contract.js +2 -2
- package/dest/multi-call-entrypoint/index.js +1 -1
- package/dest/multi-call-entrypoint/lazy.js +4 -4
- package/dest/protocol_contract_data.d.ts +12 -14
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +29 -19
- package/dest/provider/bundle.js +4 -4
- package/dest/provider/lazy.js +6 -6
- package/dest/router/index.js +1 -1
- package/dest/router/lazy.js +4 -4
- package/dest/scripts/cleanup_artifacts.js +2 -2
- package/dest/scripts/generate_data.js +38 -45
- package/dest/tests/fixtures.d.ts +3 -5
- package/dest/tests/fixtures.d.ts.map +1 -1
- package/dest/tests/fixtures.js +6 -6
- package/package.json +18 -16
- package/src/auth-registry/index.ts +3 -3
- package/src/auth-registry/lazy.ts +4 -4
- package/src/class-registry/__snapshots__/README.md +9 -0
- package/src/{class-registerer/contract_class_registered_event.ts → class-registry/contract_class_published_event.ts} +16 -22
- package/src/{class-registerer → class-registry}/index.ts +7 -9
- package/src/class-registry/lazy.ts +33 -0
- package/src/{class-registerer → class-registry}/private_function_broadcasted_event.ts +12 -8
- package/src/{class-registerer/unconstrained_function_broadcasted_event.ts → class-registry/utility_function_broadcasted_event.ts} +25 -21
- package/src/fee-juice/index.ts +1 -1
- package/src/fee-juice/lazy.ts +4 -4
- package/src/index.ts +0 -1
- package/src/instance-registry/__snapshots__/README.md +9 -0
- package/src/{instance-deployer/contract_instance_deployed_event.ts → instance-registry/contract_instance_published_event.ts} +6 -6
- package/src/{instance-deployer → instance-registry}/contract_instance_updated_event.ts +14 -14
- package/src/{instance-deployer → instance-registry}/index.ts +6 -6
- package/src/{instance-deployer → instance-registry}/lazy.ts +11 -11
- package/src/make_protocol_contract.ts +2 -2
- package/src/multi-call-entrypoint/index.ts +1 -1
- package/src/multi-call-entrypoint/lazy.ts +4 -4
- package/src/protocol_contract_data.ts +30 -19
- package/src/provider/bundle.ts +4 -4
- package/src/provider/lazy.ts +6 -6
- package/src/router/index.ts +1 -1
- package/src/router/lazy.ts +4 -4
- package/src/tests/fixtures.ts +6 -6
- package/artifacts/ContractClassRegisterer.json +0 -7219
- package/artifacts/ContractInstanceDeployer.json +0 -2984
- package/dest/build_protocol_contract_tree.d.ts +0 -10
- package/dest/build_protocol_contract_tree.d.ts.map +0 -1
- package/dest/build_protocol_contract_tree.js +0 -20
- package/dest/class-registerer/contract_class_registered_event.d.ts.map +0 -1
- package/dest/class-registerer/index.d.ts +0 -8
- package/dest/class-registerer/index.d.ts.map +0 -1
- package/dest/class-registerer/index.js +0 -17
- package/dest/class-registerer/lazy.d.ts +0 -9
- package/dest/class-registerer/lazy.d.ts.map +0 -1
- package/dest/class-registerer/lazy.js +0 -26
- package/dest/class-registerer/private_function_broadcasted_event.d.ts.map +0 -1
- package/dest/class-registerer/unconstrained_function_broadcasted_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_deployed_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_updated_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_updated_event.js +0 -36
- package/dest/instance-deployer/index.d.ts.map +0 -1
- package/dest/instance-deployer/lazy.js +0 -25
- package/dest/protocol_contract_tree.d.ts +0 -7
- package/dest/protocol_contract_tree.d.ts.map +0 -1
- package/dest/protocol_contract_tree.js +0 -34
- package/src/build_protocol_contract_tree.ts +0 -29
- package/src/class-registerer/lazy.ts +0 -33
- package/src/protocol_contract_tree.ts +0 -44
- /package/artifacts/{ContractClassRegisterer.d.json.ts → ContractClassRegistry.d.json.ts} +0 -0
- /package/artifacts/{ContractInstanceDeployer.d.json.ts → ContractInstanceRegistry.d.json.ts} +0 -0
|
@@ -3,30 +3,30 @@ import { type ContractArtifact, loadContractArtifact } from '@aztec/stdlib/abi';
|
|
|
3
3
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
4
4
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
5
5
|
|
|
6
|
-
export * from './
|
|
6
|
+
export * from './contract_instance_published_event.js';
|
|
7
7
|
export * from './contract_instance_updated_event.js';
|
|
8
8
|
|
|
9
9
|
let protocolContract: ProtocolContract;
|
|
10
10
|
let protocolContractArtifact: ContractArtifact;
|
|
11
11
|
|
|
12
|
-
export async function
|
|
12
|
+
export async function getContractInstanceRegistryArtifact(): Promise<ContractArtifact> {
|
|
13
13
|
if (!protocolContractArtifact) {
|
|
14
|
-
// Cannot assert this import as it's incompatible with
|
|
15
|
-
// https://
|
|
16
|
-
//
|
|
17
|
-
//
|
|
14
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
15
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
16
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
17
|
+
// "text/javascript"
|
|
18
18
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
19
|
-
const { default:
|
|
20
|
-
protocolContractArtifact = loadContractArtifact(
|
|
19
|
+
const { default: contractInstanceRegistryJson } = await import('../../artifacts/ContractInstanceRegistry.json');
|
|
20
|
+
protocolContractArtifact = loadContractArtifact(contractInstanceRegistryJson);
|
|
21
21
|
}
|
|
22
22
|
return protocolContractArtifact;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/** Returns the canonical deployment of the auth registry. */
|
|
26
|
-
export async function
|
|
26
|
+
export async function getCanonicalInstanceRegistry(): Promise<ProtocolContract> {
|
|
27
27
|
if (!protocolContract) {
|
|
28
|
-
const
|
|
29
|
-
protocolContract = await makeProtocolContract('
|
|
28
|
+
const contractInstanceRegistryArtifact = await getContractInstanceRegistryArtifact();
|
|
29
|
+
protocolContract = await makeProtocolContract('ContractInstanceRegistry', contractInstanceRegistryArtifact);
|
|
30
30
|
}
|
|
31
31
|
return protocolContract;
|
|
32
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
-
import { getContractClassFromArtifact,
|
|
2
|
+
import { getContractClassFromArtifact, getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
3
3
|
|
|
4
4
|
import type { ProtocolContract } from './protocol_contract.js';
|
|
5
5
|
import { ProtocolContractAddress, type ProtocolContractName, ProtocolContractSalt } from './protocol_contract_data.js';
|
|
@@ -16,7 +16,7 @@ export async function makeProtocolContract(
|
|
|
16
16
|
const salt = ProtocolContractSalt[name];
|
|
17
17
|
// TODO(@spalladino): This computes the contract class from the artifact twice.
|
|
18
18
|
const contractClass = await getContractClassFromArtifact(artifact);
|
|
19
|
-
const instance = await
|
|
19
|
+
const instance = await getContractInstanceFromInstantiationParams(artifact, { salt });
|
|
20
20
|
return {
|
|
21
21
|
instance: { ...instance, address },
|
|
22
22
|
contractClass,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
3
3
|
|
|
4
|
-
import MultiCallEntrypointJson from '../../artifacts/MultiCallEntrypoint.json'
|
|
4
|
+
import MultiCallEntrypointJson from '../../artifacts/MultiCallEntrypoint.json' with { type: 'json' };
|
|
5
5
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
6
6
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
7
|
|
|
@@ -8,10 +8,10 @@ let protocolContractArtifact: ContractArtifact;
|
|
|
8
8
|
|
|
9
9
|
export async function getMultiCallEntrypointArtifact(): Promise<ContractArtifact> {
|
|
10
10
|
if (!protocolContractArtifact) {
|
|
11
|
-
// Cannot assert this import as it's incompatible with
|
|
12
|
-
// https://
|
|
13
|
-
//
|
|
14
|
-
//
|
|
11
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
12
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
13
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
14
|
+
// "text/javascript"
|
|
15
15
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
16
16
|
const { default: multiCallEntrypointJson } = await import('../../artifacts/MultiCallEntrypoint.json');
|
|
17
17
|
protocolContractArtifact = loadContractArtifact(multiCallEntrypointJson);
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
// GENERATED FILE - DO NOT EDIT. RUN `yarn generate` or `yarn generate:data`
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
export const protocolContractNames = [
|
|
8
9
|
'AuthRegistry',
|
|
9
|
-
'
|
|
10
|
-
'
|
|
10
|
+
'ContractInstanceRegistry',
|
|
11
|
+
'ContractClassRegistry',
|
|
11
12
|
'MultiCallEntrypoint',
|
|
12
13
|
'FeeJuice',
|
|
13
14
|
'Router'
|
|
@@ -19,8 +20,8 @@
|
|
|
19
20
|
|
|
20
21
|
export const ProtocolContractSalt: Record<ProtocolContractName, Fr> = {
|
|
21
22
|
AuthRegistry: new Fr(1),
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
ContractInstanceRegistry: new Fr(1),
|
|
24
|
+
ContractClassRegistry: new Fr(1),
|
|
24
25
|
MultiCallEntrypoint: new Fr(1),
|
|
25
26
|
FeeJuice: new Fr(1),
|
|
26
27
|
Router: new Fr(1)
|
|
@@ -30,8 +31,8 @@ Router: new Fr(1)
|
|
|
30
31
|
|
|
31
32
|
export const ProtocolContractAddress: Record<ProtocolContractName, AztecAddress> = {
|
|
32
33
|
AuthRegistry: AztecAddress.fromBigInt(1n),
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
ContractInstanceRegistry: AztecAddress.fromBigInt(2n),
|
|
35
|
+
ContractClassRegistry: AztecAddress.fromBigInt(3n),
|
|
35
36
|
MultiCallEntrypoint: AztecAddress.fromBigInt(4n),
|
|
36
37
|
FeeJuice: AztecAddress.fromBigInt(5n),
|
|
37
38
|
Router: AztecAddress.fromBigInt(6n)
|
|
@@ -39,25 +40,35 @@ Router: AztecAddress.fromBigInt(6n)
|
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
export const
|
|
43
|
-
AuthRegistry:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
MultiCallEntrypoint:
|
|
47
|
-
FeeJuice:
|
|
48
|
-
Router:
|
|
43
|
+
export const ProtocolContractDerivedAddress = {
|
|
44
|
+
AuthRegistry: AztecAddress.fromString('0x2e35b6e1a89ac2f901f3513f505249b9a485513ac7dd57f29f1183c0862473f2'),
|
|
45
|
+
ContractInstanceRegistry: AztecAddress.fromString('0x136eade704b136bae7c5282cf8f4e1ccc51835db840123034cfefbad76215c91'),
|
|
46
|
+
ContractClassRegistry: AztecAddress.fromString('0x2b9543f587c4d7976627ed8dfe0345f9e2efa846f618dea97372c1be7240994b'),
|
|
47
|
+
MultiCallEntrypoint: AztecAddress.fromString('0x191a929597d30fafe8d5708533b89bd4022c8d3194c8fcf37d04ac51a2f804eb'),
|
|
48
|
+
FeeJuice: AztecAddress.fromString('0x2f3ffae9d3b40e8f162fc2dabbd8dba5deaf112191dfa7be263a55073e16d082'),
|
|
49
|
+
Router: AztecAddress.fromString('0x00943dfa60dc08d7fb79f30220fdab942c0ba3364e45b69777015613983bab58')
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
|
|
52
53
|
|
|
53
|
-
export const
|
|
54
|
+
export const ProtocolContractsList = new ProtocolContracts([
|
|
55
|
+
AztecAddress.fromString('0x2e35b6e1a89ac2f901f3513f505249b9a485513ac7dd57f29f1183c0862473f2'),
|
|
56
|
+
AztecAddress.fromString('0x136eade704b136bae7c5282cf8f4e1ccc51835db840123034cfefbad76215c91'),
|
|
57
|
+
AztecAddress.fromString('0x2b9543f587c4d7976627ed8dfe0345f9e2efa846f618dea97372c1be7240994b'),
|
|
58
|
+
AztecAddress.fromString('0x191a929597d30fafe8d5708533b89bd4022c8d3194c8fcf37d04ac51a2f804eb'),
|
|
59
|
+
AztecAddress.fromString('0x2f3ffae9d3b40e8f162fc2dabbd8dba5deaf112191dfa7be263a55073e16d082'),
|
|
60
|
+
AztecAddress.fromString('0x00943dfa60dc08d7fb79f30220fdab942c0ba3364e45b69777015613983bab58'),
|
|
61
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
62
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
63
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
64
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
65
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
66
|
+
]);
|
|
67
|
+
|
|
68
|
+
export const protocolContractsHash = Fr.fromString('0x1114ed602f51159e3e07a19f1b0ad7acbd7dee60fbf342ea0e46d9013f744679');
|
|
54
69
|
|
|
55
70
|
|
|
56
71
|
|
|
57
|
-
export const
|
|
58
|
-
export const REGISTERER_PRIVATE_FUNCTION_BROADCASTED_TAG = Fr.fromHexString('0x0abf338154e355442d9916d630da0491036d5a7b23c42b477c1395ba3bf9b42d');
|
|
59
|
-
export const REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_TAG = Fr.fromHexString('0x27774539896271d6dbe0c1de45ddc44709d1e8d9a9fb686ca3c105d87c417bb8');
|
|
60
|
-
export const DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_TAG = Fr.fromHexString('0x2ec28b91a5f838506d6042915005ff55cf7a0a5f889a83b11faed33a31b486f2');
|
|
61
|
-
export const DEPLOYER_CONTRACT_INSTANCE_UPDATED_TAG = new Fr(1534834688047131268740281708431107902615560100979874281215533519862n);
|
|
72
|
+
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('0x28da3fc471387d4e20b646b77abc8cdfc02a339a7507285a73d84f9b97b13486');
|
|
62
73
|
|
|
63
74
|
|
package/src/provider/bundle.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
|
|
3
3
|
import { AuthRegistryArtifact } from '../auth-registry/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ContractClassRegistryArtifact } from '../class-registry/index.js';
|
|
5
5
|
import { FeeJuiceArtifact } from '../fee-juice/index.js';
|
|
6
|
-
import {
|
|
6
|
+
import { ContractInstanceRegistryArtifact } from '../instance-registry/index.js';
|
|
7
7
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
8
8
|
import { MultiCallEntrypointArtifact } from '../multi-call-entrypoint/index.js';
|
|
9
9
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
@@ -13,8 +13,8 @@ import type { ProtocolContractsProvider } from './protocol_contracts_provider.js
|
|
|
13
13
|
|
|
14
14
|
export const ProtocolContractArtifact: Record<ProtocolContractName, ContractArtifact> = {
|
|
15
15
|
AuthRegistry: AuthRegistryArtifact,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
ContractInstanceRegistry: ContractInstanceRegistryArtifact,
|
|
17
|
+
ContractClassRegistry: ContractClassRegistryArtifact,
|
|
18
18
|
MultiCallEntrypoint: MultiCallEntrypointArtifact,
|
|
19
19
|
FeeJuice: FeeJuiceArtifact,
|
|
20
20
|
Router: RouterArtifact,
|
package/src/provider/lazy.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCanonicalAuthRegistry } from '../auth-registry/lazy.js';
|
|
2
|
-
import {
|
|
2
|
+
import { getCanonicalClassRegistry } from '../class-registry/lazy.js';
|
|
3
3
|
import { getCanonicalFeeJuice } from '../fee-juice/lazy.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getCanonicalInstanceRegistry } from '../instance-registry/lazy.js';
|
|
5
5
|
import { getCanonicalMultiCallEntrypoint } from '../multi-call-entrypoint/lazy.js';
|
|
6
6
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
7
|
import type { ProtocolContractName } from '../protocol_contract_data.js';
|
|
@@ -13,10 +13,10 @@ export class LazyProtocolContractsProvider implements ProtocolContractsProvider
|
|
|
13
13
|
switch (name) {
|
|
14
14
|
case 'AuthRegistry':
|
|
15
15
|
return getCanonicalAuthRegistry();
|
|
16
|
-
case '
|
|
17
|
-
return
|
|
18
|
-
case '
|
|
19
|
-
return
|
|
16
|
+
case 'ContractInstanceRegistry':
|
|
17
|
+
return getCanonicalInstanceRegistry();
|
|
18
|
+
case 'ContractClassRegistry':
|
|
19
|
+
return getCanonicalClassRegistry();
|
|
20
20
|
case 'MultiCallEntrypoint':
|
|
21
21
|
return getCanonicalMultiCallEntrypoint();
|
|
22
22
|
case 'FeeJuice':
|
package/src/router/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
3
3
|
|
|
4
|
-
import RouterJson from '../../artifacts/Router.json'
|
|
4
|
+
import RouterJson from '../../artifacts/Router.json' with { type: 'json' };
|
|
5
5
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
6
6
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
7
|
|
package/src/router/lazy.ts
CHANGED
|
@@ -8,10 +8,10 @@ let protocolContractArtifact: ContractArtifact;
|
|
|
8
8
|
|
|
9
9
|
export async function getRouterArtifact(): Promise<ContractArtifact> {
|
|
10
10
|
if (!protocolContractArtifact) {
|
|
11
|
-
// Cannot assert this import as it's incompatible with
|
|
12
|
-
// https://
|
|
13
|
-
//
|
|
14
|
-
//
|
|
11
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
12
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
13
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
14
|
+
// "text/javascript"
|
|
15
15
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
16
16
|
const { default: routerJson } = await import('../../artifacts/Router.json');
|
|
17
17
|
protocolContractArtifact = loadContractArtifact(routerJson);
|
package/src/tests/fixtures.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { dirname, resolve } from 'path';
|
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
|
|
5
5
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
6
|
-
export function
|
|
7
|
-
const path = getPathToFixture('
|
|
6
|
+
export function getSampleContractClassPublishedEventPayload(): Buffer {
|
|
7
|
+
const path = getPathToFixture('ContractClassPublishedEventData.hex');
|
|
8
8
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -15,14 +15,14 @@ export function getSamplePrivateFunctionBroadcastedEventPayload(): Buffer {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
18
|
-
export function
|
|
19
|
-
const path = getPathToFixture('
|
|
18
|
+
export function getSampleUtilityFunctionBroadcastedEventPayload(): Buffer {
|
|
19
|
+
const path = getPathToFixture('UtilityFunctionBroadcastedEventData.hex');
|
|
20
20
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
24
|
-
export function
|
|
25
|
-
const path = getPathToFixture('
|
|
24
|
+
export function getSampleContractInstancePublishedEventPayload(): Buffer {
|
|
25
|
+
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|
|
26
26
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
27
27
|
}
|
|
28
28
|
|