Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed Jul 31, 2020
1 parent 0c49c10 commit b99ed6c
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions test/utils.ts
Expand Up @@ -123,9 +123,21 @@ export function setupExecPath(): void {
}
}

export function getShelleyConfigDir(networkName: string): string {
const base = process.env.CARDANO_NODE_CONFIGS;
if (!base) {
const msg =
'CARDANO_NODE_CONFIGS environment variable is not set. The tests will not work.';
console.error(msg);
throw new Error(msg);
}

return path.resolve(base, networkName);
}

/**
* Set up a temporary directory containing configuration files for
* Byron mainnet.
* Shelley mainnet.
*
* This is needed because files in the cardano-node configuration file
* are resolved relative to the current working directory, rather than
Expand Down Expand Up @@ -156,8 +168,14 @@ export async function withMainnetConfigDir<T>(
}
);

await fs.promises.copyFile(configs.genesisByron.src, configs.genesisByron.dst);
await fs.promises.copyFile(configs.genesisShelley.src, configs.genesisShelley.dst);
await fs.promises.copyFile(
configs.genesisByron.src,
configs.genesisByron.dst
);
await fs.promises.copyFile(
configs.genesisShelley.src,
configs.genesisShelley.dst
);
await fs.promises.copyFile(configs.topology.src, configs.topology.dst);

const config = await fs.promises.readFile(
Expand All @@ -176,15 +194,3 @@ export async function withMainnetConfigDir<T>(
}
);
}

export function getShelleyConfigDir(networkName: string): string {
const base = process.env.CARDANO_NODE_CONFIGS;
if (!base) {
const msg =
'CARDANO_NODE_CONFIGS environment variable is not set. The tests will not work.';
console.error(msg);
throw new Error(msg);
}

return path.resolve(base, networkName);
}

0 comments on commit b99ed6c

Please sign in to comment.