Skip to content

Commit

Permalink
fix: export launchTestNode interfaces (#2706)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedsalk authored Jul 5, 2024
1 parent 408aaf5 commit f18a570
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-donuts-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-ts/contract": patch
---

fix: export `launchTestNode` interfaces
10 changes: 5 additions & 5 deletions packages/contract/src/test-utils/launch-test-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import { mergeDeepRight } from 'ramda';

import type { DeployContractOptions } from '../contract-factory';

interface ContractDeployer {
export interface ContractDeployer {
deployContract(
bytecode: BytesLike,
wallet: Account,
options?: DeployContractOptions
): Promise<Contract>;
}

interface DeployContractConfig {
export interface DeployContractConfig {
/**
* Contract deployer object compatible with factories outputted by `pnpm fuels typegen`.
*/
Expand All @@ -41,17 +41,17 @@ interface DeployContractConfig {
walletIndex?: number;
}

interface LaunchTestNodeOptions<TContractConfigs extends DeployContractConfig[]>
export interface LaunchTestNodeOptions<TContractConfigs extends DeployContractConfig[]>
extends LaunchCustomProviderAndGetWalletsOptions {
/**
* Pass in either the path to the contract's root directory to deploy the contract or use `DeployContractConfig` for more control.
*/
contractsConfigs: TContractConfigs;
}
type TContracts<T extends DeployContractConfig[]> = {
export type TContracts<T extends DeployContractConfig[]> = {
[K in keyof T]: Awaited<ReturnType<T[K]['deployer']['deployContract']>>;
};
interface LaunchTestNodeReturn<TFactories extends DeployContractConfig[]>
export interface LaunchTestNodeReturn<TFactories extends DeployContractConfig[]>
extends SetupTestProviderAndWalletsReturn {
contracts: TContracts<TFactories>;
}
Expand Down

0 comments on commit f18a570

Please sign in to comment.