Skip to content

Commit

Permalink
Merge branch 'ns/feat/test-node-launcher' of github.com:FuelLabs/fuel…
Browse files Browse the repository at this point in the history
…s-ts into ns/feat/test-node-launcher
  • Loading branch information
nedsalk committed May 15, 2024
2 parents aa58458 + 492503d commit 8a04be8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/account/src/test-utils/wallet-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export class WalletConfig {
private initialState: SnapshotConfigs['stateConfig'];
private options: WalletConfigOptions;
public wallets: WalletUnlocked[];

private generateWallets: () => WalletUnlocked[] = () => {
const generatedWallets: WalletUnlocked[] = [];
for (let index = 1; index <= this.options.count; index++) {
Expand All @@ -60,6 +61,7 @@ export class WalletConfig {
this.options = config;

const { assets, coinsPerAsset, amountPerCoin, messages } = this.options;

this.wallets = this.generateWallets();
this.initialState = {
messages: WalletConfig.createMessages(this.wallets, messages),
Expand Down
3 changes: 3 additions & 0 deletions packages/contract/src/test-utils/launch-test-node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ const pathToContractRootDir = join(__dirname, '../../test/fixtures/simple-contra

async function generateChainConfigFile(chainName: string): Promise<[string, () => void]> {
const configsFolder = join(__dirname, '../../../../', '.fuel-core', 'configs');

const chainMetadata = JSON.parse(
readFileSync(join(configsFolder, 'metadata.json'), 'utf-8')
) as SnapshotConfigs['metadata'];

const chainConfig = JSON.parse(
readFileSync(join(configsFolder, chainMetadata.chain_config), 'utf-8')
) as SnapshotConfigs['chainConfig'];

chainConfig.chain_name = chainName;

const tempSnapshotDirPath = join(os.tmpdir(), '.fuels-ts', randomUUID());
Expand Down

0 comments on commit 8a04be8

Please sign in to comment.