@aztec/aztec 3.0.0-nightly.20251111 → 3.0.0-nightly.20251112
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 +1 -1
- package/dest/cli/aztec_start_action.js +9 -9
- package/dest/cli/aztec_start_options.js +6 -6
- package/dest/cli/cmds/start_node.js +1 -1
- package/dest/examples/token.js +1 -1
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/local-network/banana_fpc.d.ts.map +1 -0
- package/dest/{sandbox → local-network}/index.d.ts +1 -1
- package/dest/local-network/index.d.ts.map +1 -0
- package/dest/{sandbox → local-network}/index.js +1 -1
- package/dest/{sandbox/sandbox.d.ts → local-network/local-network.d.ts} +7 -7
- package/dest/local-network/local-network.d.ts.map +1 -0
- package/dest/{sandbox/sandbox.js → local-network/local-network.js} +8 -8
- package/dest/local-network/sponsored_fpc.d.ts.map +1 -0
- package/dest/testing/anvil_test_watcher.d.ts +2 -2
- package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
- package/dest/testing/anvil_test_watcher.js +8 -8
- package/package.json +33 -33
- package/src/cli/aztec_start_action.ts +9 -9
- package/src/cli/aztec_start_options.ts +6 -6
- package/src/cli/cmds/start_node.ts +1 -1
- package/src/examples/token.ts +1 -1
- package/src/index.ts +2 -2
- package/src/{sandbox → local-network}/index.ts +1 -1
- package/src/{sandbox/sandbox.ts → local-network/local-network.ts} +13 -13
- package/src/testing/anvil_test_watcher.ts +7 -7
- package/dest/sandbox/banana_fpc.d.ts.map +0 -1
- package/dest/sandbox/index.d.ts.map +0 -1
- package/dest/sandbox/sandbox.d.ts.map +0 -1
- package/dest/sandbox/sponsored_fpc.d.ts.map +0 -1
- /package/dest/{sandbox → local-network}/banana_fpc.d.ts +0 -0
- /package/dest/{sandbox → local-network}/banana_fpc.js +0 -0
- /package/dest/{sandbox → local-network}/sponsored_fpc.d.ts +0 -0
- /package/dest/{sandbox → local-network}/sponsored_fpc.js +0 -0
- /package/src/{sandbox → local-network}/banana_fpc.ts +0 -0
- /package/src/{sandbox → local-network}/sponsored_fpc.ts +0 -0
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Aztec is a package that allows for a simple development environment on Aztec sta
|
|
|
8
8
|
|
|
9
9
|
The easiest way to run is by using `docker compose up`. This will create two containers:
|
|
10
10
|
|
|
11
|
-
1. The
|
|
11
|
+
1. The local network listening on port `8080`
|
|
12
12
|
2. An anvil instance listening on port `8545`
|
|
13
13
|
|
|
14
14
|
### Node Server
|
|
@@ -2,7 +2,7 @@ import { createNamespacedSafeJsonRpcServer, startHttpRpcServer } from '@aztec/fo
|
|
|
2
2
|
import { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
3
3
|
import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
|
|
4
4
|
import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
5
|
-
import {
|
|
5
|
+
import { createLocalNetwork } from '../local-network/index.js';
|
|
6
6
|
import { github, splash } from '../splash.js';
|
|
7
7
|
import { getCliVersion } from './release_version.js';
|
|
8
8
|
import { extractNamespacedOptions, installSignalHandlers } from './util.js';
|
|
@@ -13,17 +13,17 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
13
13
|
const services = {};
|
|
14
14
|
const adminServices = {};
|
|
15
15
|
let config = undefined;
|
|
16
|
-
if (options.
|
|
16
|
+
if (options.localNetwork) {
|
|
17
17
|
const cliVersion = getCliVersion();
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const localNetwork = extractNamespacedOptions(options, 'local-network');
|
|
19
|
+
localNetwork.testAccounts = true;
|
|
20
20
|
userLog(`${splash}\n${github}\n\n`);
|
|
21
|
-
userLog(`Setting up Aztec
|
|
22
|
-
const { node, stop } = await
|
|
23
|
-
l1Mnemonic:
|
|
21
|
+
userLog(`Setting up Aztec local network ${cliVersion}, please stand by...`);
|
|
22
|
+
const { node, stop } = await createLocalNetwork({
|
|
23
|
+
l1Mnemonic: localNetwork.l1Mnemonic,
|
|
24
24
|
l1RpcUrls: options.l1RpcUrls,
|
|
25
|
-
deployAztecContractsSalt:
|
|
26
|
-
testAccounts:
|
|
25
|
+
deployAztecContractsSalt: localNetwork.deployAztecContractsSalt,
|
|
26
|
+
testAccounts: localNetwork.testAccounts,
|
|
27
27
|
realProofs: false
|
|
28
28
|
}, userLog);
|
|
29
29
|
// Start Node and PXE JSON-RPC server
|
|
@@ -78,22 +78,22 @@ export const aztecStartOptions = {
|
|
|
78
78
|
configToFlag('--sync-mode', sharedNodeConfigMappings.syncMode),
|
|
79
79
|
configToFlag('--snapshots-urls', sharedNodeConfigMappings.snapshotsUrls)
|
|
80
80
|
],
|
|
81
|
-
|
|
81
|
+
LOCAL_NETWORK: [
|
|
82
82
|
{
|
|
83
|
-
flag: '--
|
|
84
|
-
description: 'Starts Aztec
|
|
83
|
+
flag: '--local-network',
|
|
84
|
+
description: 'Starts Aztec Local Network',
|
|
85
85
|
defaultValue: undefined,
|
|
86
86
|
env: undefined
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
flag: '--
|
|
89
|
+
flag: '--local-network.l1Mnemonic <value>',
|
|
90
90
|
description: 'Mnemonic for L1 accounts. Will be used ',
|
|
91
91
|
defaultValue: DefaultMnemonic,
|
|
92
92
|
env: 'MNEMONIC'
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
flag: '--
|
|
96
|
-
description: 'Numeric salt for deploying L1 Aztec contracts before starting the
|
|
95
|
+
flag: '--local-network.deployAztecContractsSalt <value>',
|
|
96
|
+
description: 'Numeric salt for deploying L1 Aztec contracts before starting the local network. Needs mnemonic or private key to be set.',
|
|
97
97
|
env: 'DEPLOY_AZTEC_CONTRACTS_SALT',
|
|
98
98
|
defaultValue: undefined,
|
|
99
99
|
parseVal: (val)=>val ? parseInt(val) : undefined
|
|
@@ -11,7 +11,7 @@ import { P2PApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
|
11
11
|
import { initTelemetryClient, telemetryClientConfigMappings } from '@aztec/telemetry-client';
|
|
12
12
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
13
13
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
14
|
-
import { createAztecNode } from '../../
|
|
14
|
+
import { createAztecNode } from '../../local-network/index.js';
|
|
15
15
|
import { extractNamespacedOptions, extractRelevantOptions, preloadCrsDataForVerifying, setupUpdateMonitor } from '../util.js';
|
|
16
16
|
export async function startNode(options, signalHandlers, services, adminServices, userLog) {
|
|
17
17
|
// All options set from environment variables
|
package/dest/examples/token.js
CHANGED
|
@@ -13,7 +13,7 @@ const TRANSFER_AMOUNT = 33n;
|
|
|
13
13
|
*/ async function main() {
|
|
14
14
|
logger.info('Running token contract test on HTTP interface.');
|
|
15
15
|
const wallet = await TestWallet.create(node);
|
|
16
|
-
// During
|
|
16
|
+
// During local network setup we deploy a few accounts. Below we add them to our wallet.
|
|
17
17
|
const [aliceInitialAccountData, bobInitialAccountData] = await getInitialTestAccountsData();
|
|
18
18
|
await wallet.createSchnorrAccount(aliceInitialAccountData.secret, aliceInitialAccountData.salt);
|
|
19
19
|
await wallet.createSchnorrAccount(bobInitialAccountData.secret, bobInitialAccountData.salt);
|
package/dest/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { createLocalNetwork, registerDeployedBananaCoinInWalletAndGetAddress, registerDeployedBananaFPCInWalletAndGetAddress, registerDeployedSponsoredFPCInWalletAndGetAddress, } from './local-network/index.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dest/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,+CAA+C,EAC/C,8CAA8C,EAC9C,iDAAiD,GAClD,MAAM,0BAA0B,CAAC"}
|
package/dest/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { createLocalNetwork, registerDeployedBananaCoinInWalletAndGetAddress, registerDeployedBananaFPCInWalletAndGetAddress, registerDeployedSponsoredFPCInWalletAndGetAddress } from './local-network/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banana_fpc.d.ts","sourceRoot":"","sources":["../../src/local-network/banana_fpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA8B,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAwB3D,wBAAsB,oBAAoB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE/E;AAWD,wBAAsB,mBAAmB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE9E;AAED,wBAAsB,cAAc,CAAC,eAAe,EAAE,kBAAkB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAcrG;AAED,wBAAsB,+CAA+C,CAAC,MAAM,EAAE,MAAM,yBAMnF;AAED,wBAAsB,8CAA8C,CAAC,MAAM,EAAE,MAAM,yBAMlF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './local-network.js';
|
|
2
2
|
export { registerDeployedBananaCoinInWalletAndGetAddress, registerDeployedBananaFPCInWalletAndGetAddress, } from './banana_fpc.js';
|
|
3
3
|
export { registerDeployedSponsoredFPCInWalletAndGetAddress } from './sponsored_fpc.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/local-network/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EACL,+CAA+C,EAC/C,8CAA8C,GAC/C,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iDAAiD,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './local-network.js';
|
|
2
2
|
export { registerDeployedBananaCoinInWalletAndGetAddress, registerDeployedBananaFPCInWalletAndGetAddress } from './banana_fpc.js';
|
|
3
3
|
export { registerDeployedSponsoredFPCInWalletAndGetAddress } from './sponsored_fpc.js';
|
|
@@ -9,7 +9,7 @@ import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
|
9
9
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
10
10
|
import { type HDAccount, type PrivateKeyAccount } from 'viem';
|
|
11
11
|
/**
|
|
12
|
-
* Function to deploy our L1 contracts to the
|
|
12
|
+
* Function to deploy our L1 contracts to the local network L1
|
|
13
13
|
* @param aztecNodeConfig - The Aztec Node Config
|
|
14
14
|
* @param hdAccount - Account for publishing L1 contracts
|
|
15
15
|
*/
|
|
@@ -42,21 +42,21 @@ export declare function deployContractsToL1(aztecNodeConfig: AztecNodeConfig, hd
|
|
|
42
42
|
} & {
|
|
43
43
|
rollupAddress: EthAddress;
|
|
44
44
|
}>;
|
|
45
|
-
/**
|
|
46
|
-
export type
|
|
45
|
+
/** Local network settings. */
|
|
46
|
+
export type LocalNetworkConfig = AztecNodeConfig & {
|
|
47
47
|
/** Mnemonic used to derive the L1 deployer private key.*/
|
|
48
48
|
l1Mnemonic: string;
|
|
49
49
|
/** Salt used to deploy L1 contracts.*/
|
|
50
50
|
deployAztecContractsSalt: string;
|
|
51
|
-
/** Whether to deploy test accounts on
|
|
51
|
+
/** Whether to deploy test accounts on local network start.*/
|
|
52
52
|
testAccounts: boolean;
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
55
|
* Create and start a new Aztec Node and PXE. Deploys L1 contracts.
|
|
56
56
|
* Does not start any HTTP services nor populate any initial accounts.
|
|
57
|
-
* @param config - Optional
|
|
57
|
+
* @param config - Optional local network settings.
|
|
58
58
|
*/
|
|
59
|
-
export declare function
|
|
59
|
+
export declare function createLocalNetwork(config: Partial<LocalNetworkConfig> | undefined, userLog: LogFn): Promise<{
|
|
60
60
|
node: AztecNodeService;
|
|
61
61
|
stop: () => Promise<void>;
|
|
62
62
|
}>;
|
|
@@ -71,4 +71,4 @@ export declare function createAztecNode(config?: Partial<AztecNodeConfig>, deps?
|
|
|
71
71
|
}, options?: {
|
|
72
72
|
prefilledPublicData?: PublicDataTreeLeaf[];
|
|
73
73
|
}): Promise<AztecNodeService>;
|
|
74
|
-
//# sourceMappingURL=
|
|
74
|
+
//# sourceMappingURL=local-network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-network.d.ts","sourceRoot":"","sources":["../../src/local-network/local-network.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAY7F,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAoB,MAAM,yBAAyB,CAAC;AAGzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAA2D,MAAM,MAAM,CAAC;AAcvH;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GAAG,iBAAiB,EACxC,oBAAoB,yCAAS,EAC7B,IAAI,GAAE;IACJ,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,EAAE,CAAC;IACxB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CAClC;;;;;;;;;;;;;;;;;;;;;;;GAkCP;AAED,8BAA8B;AAC9B,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IACjD,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,wBAAwB,EAAE,MAAM,CAAC;IACjC,6DAA6D;IAC7D,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,YAAK,EAAE,OAAO,EAAE,KAAK;;;GAgHhG;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,EACrC,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,eAAe,CAAC;IAAC,cAAc,CAAC,EAAE,uBAAuB,CAAC;IAAC,YAAY,CAAC,EAAE,YAAY,CAAA;CAAO,EACjH,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAAO,6BAW7D"}
|
|
@@ -23,10 +23,10 @@ import { DefaultMnemonic } from '../mnemonic.js';
|
|
|
23
23
|
import { AnvilTestWatcher } from '../testing/anvil_test_watcher.js';
|
|
24
24
|
import { getBananaFPCAddress, setupBananaFPC } from './banana_fpc.js';
|
|
25
25
|
import { getSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
26
|
-
const logger = createLogger('
|
|
26
|
+
const logger = createLogger('local-network');
|
|
27
27
|
const localAnvil = foundry;
|
|
28
28
|
/**
|
|
29
|
-
* Function to deploy our L1 contracts to the
|
|
29
|
+
* Function to deploy our L1 contracts to the local network L1
|
|
30
30
|
* @param aztecNodeConfig - The Aztec Node Config
|
|
31
31
|
* @param hdAccount - Account for publishing L1 contracts
|
|
32
32
|
*/ export async function deployContractsToL1(aztecNodeConfig, hdAccount, contractDeployLogger = logger, opts = {}) {
|
|
@@ -54,15 +54,15 @@ const localAnvil = foundry;
|
|
|
54
54
|
/**
|
|
55
55
|
* Create and start a new Aztec Node and PXE. Deploys L1 contracts.
|
|
56
56
|
* Does not start any HTTP services nor populate any initial accounts.
|
|
57
|
-
* @param config - Optional
|
|
58
|
-
*/ export async function
|
|
59
|
-
//
|
|
57
|
+
* @param config - Optional local network settings.
|
|
58
|
+
*/ export async function createLocalNetwork(config = {}, userLog) {
|
|
59
|
+
// local network is meant for test envs. We should only need one l1RpcUrl
|
|
60
60
|
const l1RpcUrl = config.l1RpcUrls?.[0];
|
|
61
61
|
if (!l1RpcUrl) {
|
|
62
62
|
throw new Error('An L1 RPC URL is required');
|
|
63
63
|
}
|
|
64
64
|
if ((config.l1RpcUrls?.length || 0) > 1) {
|
|
65
|
-
logger.warn(`Multiple L1 RPC URLs provided.
|
|
65
|
+
logger.warn(`Multiple L1 RPC URLs provided. Local networks will only use the first one: ${l1RpcUrl}`);
|
|
66
66
|
}
|
|
67
67
|
const aztecNodeConfig = {
|
|
68
68
|
...getConfigEnvVars(),
|
|
@@ -124,11 +124,11 @@ const localAnvil = foundry;
|
|
|
124
124
|
watcher = new AnvilTestWatcher(new EthCheatCodes([
|
|
125
125
|
l1RpcUrl
|
|
126
126
|
], dateProvider), l1ContractAddresses.rollupAddress, publicClient, dateProvider);
|
|
127
|
-
watcher.
|
|
127
|
+
watcher.setisLocalNetwork(true);
|
|
128
128
|
await watcher.start();
|
|
129
129
|
}
|
|
130
130
|
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
131
|
-
// Create a local blob sink client inside the
|
|
131
|
+
// Create a local blob sink client inside the local network, no http connectivity
|
|
132
132
|
const blobSinkClient = createBlobSinkClient();
|
|
133
133
|
const node = await createAztecNode(aztecNodeConfig, {
|
|
134
134
|
telemetry,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sponsored_fpc.d.ts","sourceRoot":"","sources":["../../src/local-network/sponsored_fpc.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAUrD,wBAAsB,sBAAsB,8DAE3C;AAED,wBAAsB,iDAAiD,CAAC,MAAM,EAAE,MAAM,6DAKrF"}
|
|
@@ -12,7 +12,7 @@ import type { TestDateProvider } from '@aztec/foundation/timer';
|
|
|
12
12
|
export declare class AnvilTestWatcher {
|
|
13
13
|
private cheatcodes;
|
|
14
14
|
private dateProvider?;
|
|
15
|
-
private
|
|
15
|
+
private isLocalNetwork;
|
|
16
16
|
private rollup;
|
|
17
17
|
private rollupCheatCodes;
|
|
18
18
|
private l2SlotDuration;
|
|
@@ -23,7 +23,7 @@ export declare class AnvilTestWatcher {
|
|
|
23
23
|
private isMarkingAsProven;
|
|
24
24
|
constructor(cheatcodes: EthCheatCodes, rollupAddress: EthAddress, l1Client: ViemClient, dateProvider?: TestDateProvider | undefined);
|
|
25
25
|
setIsMarkingAsProven(isMarkingAsProven: boolean): void;
|
|
26
|
-
|
|
26
|
+
setisLocalNetwork(isLocalNetwork: boolean): void;
|
|
27
27
|
start(): Promise<void>;
|
|
28
28
|
stop(): Promise<void>;
|
|
29
29
|
trigger(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anvil_test_watcher.d.ts","sourceRoot":"","sources":["../../src/testing/anvil_test_watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAKhE;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAgBzB,OAAO,CAAC,UAAU;IAGlB,OAAO,CAAC,YAAY,CAAC;IAlBvB,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"anvil_test_watcher.d.ts","sourceRoot":"","sources":["../../src/testing/anvil_test_watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAKhE;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAgBzB,OAAO,CAAC,UAAU;IAGlB,OAAO,CAAC,YAAY,CAAC;IAlBvB,OAAO,CAAC,cAAc,CAAkB;IAExC,OAAO,CAAC,MAAM,CAAsD;IACpE,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,cAAc,CAAU;IAEhC,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAC9C,OAAO,CAAC,uBAAuB,CAAC,CAAiB;IACjD,OAAO,CAAC,6BAA6B,CAAC,CAAiB;IAEvD,OAAO,CAAC,MAAM,CAAiD;IAE/D,OAAO,CAAC,iBAAiB,CAAQ;gBAGvB,UAAU,EAAE,aAAa,EACjC,aAAa,EAAE,UAAU,EACzB,QAAQ,EAAE,UAAU,EACZ,YAAY,CAAC,EAAE,gBAAgB,YAAA;IAezC,oBAAoB,CAAC,iBAAiB,EAAE,OAAO;IAK/C,iBAAiB,CAAC,cAAc,EAAE,OAAO;IAInC,KAAK;IA2BL,IAAI;IAMJ,OAAO;IAMP,YAAY;IAOZ,4BAA4B;IAiB5B,gBAAgB;CAwCvB"}
|
|
@@ -12,7 +12,7 @@ import { getAddress, getContract } from 'viem';
|
|
|
12
12
|
*/ export class AnvilTestWatcher {
|
|
13
13
|
cheatcodes;
|
|
14
14
|
dateProvider;
|
|
15
|
-
|
|
15
|
+
isLocalNetwork;
|
|
16
16
|
rollup;
|
|
17
17
|
rollupCheatCodes;
|
|
18
18
|
l2SlotDuration;
|
|
@@ -24,7 +24,7 @@ import { getAddress, getContract } from 'viem';
|
|
|
24
24
|
constructor(cheatcodes, rollupAddress, l1Client, dateProvider){
|
|
25
25
|
this.cheatcodes = cheatcodes;
|
|
26
26
|
this.dateProvider = dateProvider;
|
|
27
|
-
this.
|
|
27
|
+
this.isLocalNetwork = false;
|
|
28
28
|
this.logger = createLogger(`aztecjs:utils:watcher`);
|
|
29
29
|
this.isMarkingAsProven = true;
|
|
30
30
|
this.rollup = getContract({
|
|
@@ -41,8 +41,8 @@ import { getAddress, getContract } from 'viem';
|
|
|
41
41
|
this.logger.warn(`Watcher is now ${isMarkingAsProven ? 'marking' : 'not marking'} blocks as proven`);
|
|
42
42
|
this.isMarkingAsProven = isMarkingAsProven;
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
this.
|
|
44
|
+
setisLocalNetwork(isLocalNetwork) {
|
|
45
|
+
this.isLocalNetwork = isLocalNetwork;
|
|
46
46
|
}
|
|
47
47
|
async start() {
|
|
48
48
|
if (this.filledRunningPromise) {
|
|
@@ -52,7 +52,7 @@ import { getAddress, getContract } from 'viem';
|
|
|
52
52
|
this.l2SlotDuration = config.slotDuration;
|
|
53
53
|
// If auto mining is not supported (e.g., we are on a real network), then we
|
|
54
54
|
// will simple do nothing. But if on an anvil or the like, this make sure that
|
|
55
|
-
// the
|
|
55
|
+
// the local network and tests don't break because time is frozen and we never get to
|
|
56
56
|
// the next slot.
|
|
57
57
|
const isAutoMining = await this.cheatcodes.isAutoMining();
|
|
58
58
|
if (isAutoMining) {
|
|
@@ -84,7 +84,7 @@ import { getAddress, getContract } from 'viem';
|
|
|
84
84
|
await this.rollupCheatCodes.markAsProven();
|
|
85
85
|
}
|
|
86
86
|
async syncDateProviderToL1IfBehind() {
|
|
87
|
-
// this doesn't apply to the
|
|
87
|
+
// this doesn't apply to the local network, because we don't have a date provider in the local network
|
|
88
88
|
if (!this.dateProvider) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
@@ -120,8 +120,8 @@ import { getAddress, getContract } from 'viem';
|
|
|
120
120
|
this.logger.info(`Slot ${currentSlot} was filled, jumped to next slot`);
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
// If we are not in
|
|
124
|
-
if (!this.
|
|
123
|
+
// If we are not in local network, we don't need to warp time
|
|
124
|
+
if (!this.isLocalNetwork) {
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
127
|
const currentTimestamp = this.dateProvider?.now() ?? Date.now();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"build": "yarn clean && tsc -b",
|
|
19
19
|
"start": "node --no-warnings ./dest/bin",
|
|
20
20
|
"start:debug": "node --inspect=0.0.0.0:9221 --no-warnings ./dest/bin",
|
|
21
|
-
"start:
|
|
21
|
+
"start:local-network": "ETHEREUM_HOSTS=http://0.0.0.0:8545/ && yarn start start --local-network",
|
|
22
22
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
23
23
|
"build:dev": "tsc -b --watch",
|
|
24
24
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}",
|
|
@@ -28,37 +28,37 @@
|
|
|
28
28
|
"../package.common.json"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
32
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
33
|
-
"@aztec/aztec-faucet": "3.0.0-nightly.
|
|
34
|
-
"@aztec/aztec-node": "3.0.0-nightly.
|
|
35
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
36
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
37
|
-
"@aztec/bb.js": "3.0.0-nightly.
|
|
38
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
39
|
-
"@aztec/bot": "3.0.0-nightly.
|
|
40
|
-
"@aztec/builder": "3.0.0-nightly.
|
|
41
|
-
"@aztec/cli": "3.0.0-nightly.
|
|
42
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
43
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
44
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
45
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
46
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
47
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
48
|
-
"@aztec/node-lib": "3.0.0-nightly.
|
|
49
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
50
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
51
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
52
|
-
"@aztec/p2p-bootstrap": "3.0.0-nightly.
|
|
53
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
54
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
55
|
-
"@aztec/prover-node": "3.0.0-nightly.
|
|
56
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
57
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
58
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
59
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
60
|
-
"@aztec/txe": "3.0.0-nightly.
|
|
61
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
31
|
+
"@aztec/accounts": "3.0.0-nightly.20251112",
|
|
32
|
+
"@aztec/archiver": "3.0.0-nightly.20251112",
|
|
33
|
+
"@aztec/aztec-faucet": "3.0.0-nightly.20251112",
|
|
34
|
+
"@aztec/aztec-node": "3.0.0-nightly.20251112",
|
|
35
|
+
"@aztec/aztec.js": "3.0.0-nightly.20251112",
|
|
36
|
+
"@aztec/bb-prover": "3.0.0-nightly.20251112",
|
|
37
|
+
"@aztec/bb.js": "3.0.0-nightly.20251112",
|
|
38
|
+
"@aztec/blob-sink": "3.0.0-nightly.20251112",
|
|
39
|
+
"@aztec/bot": "3.0.0-nightly.20251112",
|
|
40
|
+
"@aztec/builder": "3.0.0-nightly.20251112",
|
|
41
|
+
"@aztec/cli": "3.0.0-nightly.20251112",
|
|
42
|
+
"@aztec/constants": "3.0.0-nightly.20251112",
|
|
43
|
+
"@aztec/entrypoints": "3.0.0-nightly.20251112",
|
|
44
|
+
"@aztec/ethereum": "3.0.0-nightly.20251112",
|
|
45
|
+
"@aztec/foundation": "3.0.0-nightly.20251112",
|
|
46
|
+
"@aztec/kv-store": "3.0.0-nightly.20251112",
|
|
47
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20251112",
|
|
48
|
+
"@aztec/node-lib": "3.0.0-nightly.20251112",
|
|
49
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20251112",
|
|
50
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251112",
|
|
51
|
+
"@aztec/p2p": "3.0.0-nightly.20251112",
|
|
52
|
+
"@aztec/p2p-bootstrap": "3.0.0-nightly.20251112",
|
|
53
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251112",
|
|
54
|
+
"@aztec/prover-client": "3.0.0-nightly.20251112",
|
|
55
|
+
"@aztec/prover-node": "3.0.0-nightly.20251112",
|
|
56
|
+
"@aztec/pxe": "3.0.0-nightly.20251112",
|
|
57
|
+
"@aztec/stdlib": "3.0.0-nightly.20251112",
|
|
58
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20251112",
|
|
59
|
+
"@aztec/test-wallet": "3.0.0-nightly.20251112",
|
|
60
|
+
"@aztec/txe": "3.0.0-nightly.20251112",
|
|
61
|
+
"@aztec/world-state": "3.0.0-nightly.20251112",
|
|
62
62
|
"@types/chalk": "^2.2.0",
|
|
63
63
|
"abitype": "^0.8.11",
|
|
64
64
|
"chalk": "^5.3.0",
|
|
@@ -9,7 +9,7 @@ import { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
|
9
9
|
import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
|
|
10
10
|
import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { createLocalNetwork } from '../local-network/index.js';
|
|
13
13
|
import { github, splash } from '../splash.js';
|
|
14
14
|
import { getCliVersion } from './release_version.js';
|
|
15
15
|
import { extractNamespacedOptions, installSignalHandlers } from './util.js';
|
|
@@ -22,19 +22,19 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
22
22
|
const adminServices: NamespacedApiHandlers = {};
|
|
23
23
|
let config: ChainConfig | undefined = undefined;
|
|
24
24
|
|
|
25
|
-
if (options.
|
|
25
|
+
if (options.localNetwork) {
|
|
26
26
|
const cliVersion = getCliVersion();
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const localNetwork = extractNamespacedOptions(options, 'local-network');
|
|
28
|
+
localNetwork.testAccounts = true;
|
|
29
29
|
userLog(`${splash}\n${github}\n\n`);
|
|
30
|
-
userLog(`Setting up Aztec
|
|
30
|
+
userLog(`Setting up Aztec local network ${cliVersion}, please stand by...`);
|
|
31
31
|
|
|
32
|
-
const { node, stop } = await
|
|
32
|
+
const { node, stop } = await createLocalNetwork(
|
|
33
33
|
{
|
|
34
|
-
l1Mnemonic:
|
|
34
|
+
l1Mnemonic: localNetwork.l1Mnemonic,
|
|
35
35
|
l1RpcUrls: options.l1RpcUrls,
|
|
36
|
-
deployAztecContractsSalt:
|
|
37
|
-
testAccounts:
|
|
36
|
+
deployAztecContractsSalt: localNetwork.deployAztecContractsSalt,
|
|
37
|
+
testAccounts: localNetwork.testAccounts,
|
|
38
38
|
realProofs: false,
|
|
39
39
|
},
|
|
40
40
|
userLog,
|
|
@@ -108,23 +108,23 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
108
108
|
configToFlag('--sync-mode', sharedNodeConfigMappings.syncMode),
|
|
109
109
|
configToFlag('--snapshots-urls', sharedNodeConfigMappings.snapshotsUrls),
|
|
110
110
|
],
|
|
111
|
-
|
|
111
|
+
LOCAL_NETWORK: [
|
|
112
112
|
{
|
|
113
|
-
flag: '--
|
|
114
|
-
description: 'Starts Aztec
|
|
113
|
+
flag: '--local-network',
|
|
114
|
+
description: 'Starts Aztec Local Network',
|
|
115
115
|
defaultValue: undefined,
|
|
116
116
|
env: undefined,
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
flag: '--
|
|
119
|
+
flag: '--local-network.l1Mnemonic <value>',
|
|
120
120
|
description: 'Mnemonic for L1 accounts. Will be used ',
|
|
121
121
|
defaultValue: DefaultMnemonic,
|
|
122
122
|
env: 'MNEMONIC',
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
|
-
flag: '--
|
|
125
|
+
flag: '--local-network.deployAztecContractsSalt <value>',
|
|
126
126
|
description:
|
|
127
|
-
'Numeric salt for deploying L1 Aztec contracts before starting the
|
|
127
|
+
'Numeric salt for deploying L1 Aztec contracts before starting the local network. Needs mnemonic or private key to be set.',
|
|
128
128
|
env: 'DEPLOY_AZTEC_CONTRACTS_SALT',
|
|
129
129
|
defaultValue: undefined,
|
|
130
130
|
parseVal: (val: string) => (val ? parseInt(val) : undefined),
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
19
19
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
20
20
|
|
|
21
|
-
import { createAztecNode } from '../../
|
|
21
|
+
import { createAztecNode } from '../../local-network/index.js';
|
|
22
22
|
import {
|
|
23
23
|
extractNamespacedOptions,
|
|
24
24
|
extractRelevantOptions,
|
package/src/examples/token.ts
CHANGED
|
@@ -21,7 +21,7 @@ async function main() {
|
|
|
21
21
|
|
|
22
22
|
const wallet = await TestWallet.create(node);
|
|
23
23
|
|
|
24
|
-
// During
|
|
24
|
+
// During local network setup we deploy a few accounts. Below we add them to our wallet.
|
|
25
25
|
const [aliceInitialAccountData, bobInitialAccountData] = await getInitialTestAccountsData();
|
|
26
26
|
await wallet.createSchnorrAccount(aliceInitialAccountData.secret, aliceInitialAccountData.salt);
|
|
27
27
|
await wallet.createSchnorrAccount(bobInitialAccountData.secret, bobInitialAccountData.salt);
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export {
|
|
2
|
-
|
|
2
|
+
createLocalNetwork,
|
|
3
3
|
registerDeployedBananaCoinInWalletAndGetAddress,
|
|
4
4
|
registerDeployedBananaFPCInWalletAndGetAddress,
|
|
5
5
|
registerDeployedSponsoredFPCInWalletAndGetAddress,
|
|
6
|
-
} from './
|
|
6
|
+
} from './local-network/index.js';
|
|
@@ -38,12 +38,12 @@ import { AnvilTestWatcher } from '../testing/anvil_test_watcher.js';
|
|
|
38
38
|
import { getBananaFPCAddress, setupBananaFPC } from './banana_fpc.js';
|
|
39
39
|
import { getSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
40
40
|
|
|
41
|
-
const logger = createLogger('
|
|
41
|
+
const logger = createLogger('local-network');
|
|
42
42
|
|
|
43
43
|
const localAnvil = foundry;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* Function to deploy our L1 contracts to the
|
|
46
|
+
* Function to deploy our L1 contracts to the local network L1
|
|
47
47
|
* @param aztecNodeConfig - The Aztec Node Config
|
|
48
48
|
* @param hdAccount - Account for publishing L1 contracts
|
|
49
49
|
*/
|
|
@@ -78,8 +78,8 @@ export async function deployContractsToL1(
|
|
|
78
78
|
genesisArchiveRoot: opts.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
|
|
79
79
|
salt: opts.salt,
|
|
80
80
|
feeJuicePortalInitialBalance: opts.feeJuicePortalInitialBalance,
|
|
81
|
-
aztecTargetCommitteeSize: 0, // no committee in
|
|
82
|
-
slasherFlavor: 'none', // no slashing in
|
|
81
|
+
aztecTargetCommitteeSize: 0, // no committee in local network
|
|
82
|
+
slasherFlavor: 'none', // no slashing in local network
|
|
83
83
|
realVerifier: false,
|
|
84
84
|
},
|
|
85
85
|
);
|
|
@@ -92,29 +92,29 @@ export async function deployContractsToL1(
|
|
|
92
92
|
return aztecNodeConfig.l1Contracts;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
/**
|
|
96
|
-
export type
|
|
95
|
+
/** Local network settings. */
|
|
96
|
+
export type LocalNetworkConfig = AztecNodeConfig & {
|
|
97
97
|
/** Mnemonic used to derive the L1 deployer private key.*/
|
|
98
98
|
l1Mnemonic: string;
|
|
99
99
|
/** Salt used to deploy L1 contracts.*/
|
|
100
100
|
deployAztecContractsSalt: string;
|
|
101
|
-
/** Whether to deploy test accounts on
|
|
101
|
+
/** Whether to deploy test accounts on local network start.*/
|
|
102
102
|
testAccounts: boolean;
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* Create and start a new Aztec Node and PXE. Deploys L1 contracts.
|
|
107
107
|
* Does not start any HTTP services nor populate any initial accounts.
|
|
108
|
-
* @param config - Optional
|
|
108
|
+
* @param config - Optional local network settings.
|
|
109
109
|
*/
|
|
110
|
-
export async function
|
|
111
|
-
//
|
|
110
|
+
export async function createLocalNetwork(config: Partial<LocalNetworkConfig> = {}, userLog: LogFn) {
|
|
111
|
+
// local network is meant for test envs. We should only need one l1RpcUrl
|
|
112
112
|
const l1RpcUrl = config.l1RpcUrls?.[0];
|
|
113
113
|
if (!l1RpcUrl) {
|
|
114
114
|
throw new Error('An L1 RPC URL is required');
|
|
115
115
|
}
|
|
116
116
|
if ((config.l1RpcUrls?.length || 0) > 1) {
|
|
117
|
-
logger.warn(`Multiple L1 RPC URLs provided.
|
|
117
|
+
logger.warn(`Multiple L1 RPC URLs provided. Local networks will only use the first one: ${l1RpcUrl}`);
|
|
118
118
|
}
|
|
119
119
|
const aztecNodeConfig: AztecNodeConfig = { ...getConfigEnvVars(), ...config };
|
|
120
120
|
const hdAccount = mnemonicToAccount(config.l1Mnemonic || DefaultMnemonic);
|
|
@@ -179,12 +179,12 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
|
|
|
179
179
|
publicClient,
|
|
180
180
|
dateProvider,
|
|
181
181
|
);
|
|
182
|
-
watcher.
|
|
182
|
+
watcher.setisLocalNetwork(true);
|
|
183
183
|
await watcher.start();
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
187
|
-
// Create a local blob sink client inside the
|
|
187
|
+
// Create a local blob sink client inside the local network, no http connectivity
|
|
188
188
|
const blobSinkClient = createBlobSinkClient();
|
|
189
189
|
const node = await createAztecNode(
|
|
190
190
|
aztecNodeConfig,
|
|
@@ -16,7 +16,7 @@ import { type GetContractReturnType, getAddress, getContract } from 'viem';
|
|
|
16
16
|
* block within the slot. And if so, it will time travel into the next slot.
|
|
17
17
|
*/
|
|
18
18
|
export class AnvilTestWatcher {
|
|
19
|
-
private
|
|
19
|
+
private isLocalNetwork: boolean = false;
|
|
20
20
|
|
|
21
21
|
private rollup: GetContractReturnType<typeof RollupAbi, ViemClient>;
|
|
22
22
|
private rollupCheatCodes: RollupCheatCodes;
|
|
@@ -54,8 +54,8 @@ export class AnvilTestWatcher {
|
|
|
54
54
|
this.isMarkingAsProven = isMarkingAsProven;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
this.
|
|
57
|
+
setisLocalNetwork(isLocalNetwork: boolean) {
|
|
58
|
+
this.isLocalNetwork = isLocalNetwork;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
async start() {
|
|
@@ -68,7 +68,7 @@ export class AnvilTestWatcher {
|
|
|
68
68
|
|
|
69
69
|
// If auto mining is not supported (e.g., we are on a real network), then we
|
|
70
70
|
// will simple do nothing. But if on an anvil or the like, this make sure that
|
|
71
|
-
// the
|
|
71
|
+
// the local network and tests don't break because time is frozen and we never get to
|
|
72
72
|
// the next slot.
|
|
73
73
|
const isAutoMining = await this.cheatcodes.isAutoMining();
|
|
74
74
|
|
|
@@ -105,7 +105,7 @@ export class AnvilTestWatcher {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
async syncDateProviderToL1IfBehind() {
|
|
108
|
-
// this doesn't apply to the
|
|
108
|
+
// this doesn't apply to the local network, because we don't have a date provider in the local network
|
|
109
109
|
if (!this.dateProvider) {
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
@@ -142,8 +142,8 @@ export class AnvilTestWatcher {
|
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
// If we are not in
|
|
146
|
-
if (!this.
|
|
145
|
+
// If we are not in local network, we don't need to warp time
|
|
146
|
+
if (!this.isLocalNetwork) {
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"banana_fpc.d.ts","sourceRoot":"","sources":["../../src/sandbox/banana_fpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA8B,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAwB3D,wBAAsB,oBAAoB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE/E;AAWD,wBAAsB,mBAAmB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE9E;AAED,wBAAsB,cAAc,CAAC,eAAe,EAAE,kBAAkB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAcrG;AAED,wBAAsB,+CAA+C,CAAC,MAAM,EAAE,MAAM,yBAMnF;AAED,wBAAsB,8CAA8C,CAAC,MAAM,EAAE,MAAM,yBAMlF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,+CAA+C,EAC/C,8CAA8C,GAC/C,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iDAAiD,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAY7F,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAoB,MAAM,yBAAyB,CAAC;AAGzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAA2D,MAAM,MAAM,CAAC;AAcvH;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GAAG,iBAAiB,EACxC,oBAAoB,yCAAS,EAC7B,IAAI,GAAE;IACJ,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,EAAE,CAAC;IACxB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CAClC;;;;;;;;;;;;;;;;;;;;;;;GAkCP;AAED,wBAAwB;AACxB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,wBAAwB,EAAE,MAAM,CAAC;IACjC,uDAAuD;IACvD,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,YAAK,EAAE,OAAO,EAAE,KAAK;;;GAgHtF;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,EACrC,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,eAAe,CAAC;IAAC,cAAc,CAAC,EAAE,uBAAuB,CAAC;IAAC,YAAY,CAAC,EAAE,YAAY,CAAA;CAAO,EACjH,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAAO,6BAW7D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sponsored_fpc.d.ts","sourceRoot":"","sources":["../../src/sandbox/sponsored_fpc.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAUrD,wBAAsB,sBAAsB,8DAE3C;AAED,wBAAsB,iDAAiD,CAAC,MAAM,EAAE,MAAM,6DAKrF"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|