Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions yarn-project/aztec/src/cli/aztec_start_action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
let config: ChainConfig | undefined = undefined;

if (options.localNetwork) {
const localNetwork = extractNamespacedOptions(options, 'local-network');
localNetwork.testAccounts = true;
const localNetwork = extractNamespacedOptions(options, 'localNetwork');
userLog(`${splash}\n${github}\n\n`);
userLog(`Setting up Aztec local network ${packageVersion ?? 'unknown'}, please stand by...`);

Expand Down
15 changes: 15 additions & 0 deletions yarn-project/aztec/src/cli/aztec_start_options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ describe('aztec_start_options commander integration', () => {
expect(typeof opts.port).toBe('number');
});

it('respects TEST_ACCOUNTS env var for local network', () => {
process.env.TEST_ACCOUNTS = 'false';
const cmd = buildCommandWith(['LOCAL_NETWORK']);
cmd.parse(['node', 'cli']);
const opts = cmd.opts();
expect(opts['localNetwork.testAccounts']).toBe(false);
});

it('defaults testAccounts to true for local network', () => {
const cmd = buildCommandWith(['LOCAL_NETWORK']);
cmd.parse(['node', 'cli']);
const opts = cmd.opts();
expect(opts['localNetwork.testAccounts']).toBe(true);
});

it('parses optional boolean flag values', () => {
const cmd = buildCommandWith(['P2P SUBSYSTEM']);

Expand Down
6 changes: 6 additions & 0 deletions yarn-project/aztec/src/cli/aztec_start_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
defaultValue: DefaultMnemonic,
env: 'MNEMONIC',
},
{
flag: '--local-network.testAccounts',
description: 'Deploy test accounts on local network start',
env: 'TEST_ACCOUNTS',
...booleanConfigHelper(true),
},
],
API: [
{
Expand Down
Loading