@neo-one/smart-contract-test-common-esnext-esm
Version:
NEO•ONE TypeScript smart contract test harness common code.
32 lines (31 loc) • 1.52 kB
TypeScript
import { UserAccountID } from '@neo-one/client-common-esnext-esm';
import { DeveloperClient, LocalKeyStore, NEOONEDataProvider, NEOONEProvider } from '@neo-one/client-core-esnext-esm';
import { Client, LocalUserAccountProvider } from '@neo-one/client-full-core-esnext-esm';
import { CompilerHost } from '@neo-one/smart-contract-compiler-esnext-esm';
export interface Contract {
readonly filePath: string;
readonly name: string;
}
export interface WithContractsOptions {
readonly ignoreWarnings?: boolean;
readonly deploy?: boolean;
readonly autoConsensus?: boolean;
readonly autoSystemFee?: boolean;
readonly logging?: boolean;
}
export interface TestOptions {
readonly networkName: string;
readonly client: Client<{
readonly memory: LocalUserAccountProvider<LocalKeyStore, NEOONEProvider>;
}>;
readonly developerClient: DeveloperClient;
readonly masterAccountID: UserAccountID;
readonly masterPrivateKey: string;
readonly accountIDs: ReadonlyArray<UserAccountID>;
}
export interface DataProviderOptions {
readonly dataProvider: NEOONEDataProvider;
readonly cleanup: () => Promise<void>;
readonly privateKey: string;
}
export declare const withContracts: <T>(contracts: readonly Contract[], test: (contracts: T & TestOptions) => Promise<void>, createCompilerHost: () => CompilerHost, getDataProvider: () => Promise<DataProviderOptions>, { ignoreWarnings, deploy, autoConsensus, autoSystemFee, logging, }?: WithContractsOptions) => Promise<void>;