import { ChainObjectBase, ClassConstructor } from "@gala-games/chain-api"; import Logger from "fabric-shim/lib/logger"; import { Context, Contract } from "fabric-contract-api"; import { ChaincodeStub } from "fabric-shim"; import { CachedKV, FabricIterable } from "./FabricIterable"; interface GalaLoggerInstance { getLogger(name?: string): Logger; error(message: string): void; warn(message: string): void; info(message: string): void; debug(message: string): void; log(level: "debug" | "info" | "warn" | "error", msg: string | (Record & { message: string; })): void; logTimeline(timelineActionDescription: string, context: string, metaData?: unknown[], error?: Error): void; } type GalaChainStub = ChaincodeStub & { getCachedState(key: string): Promise; getCachedStateByPartialCompositeKey(objectType: string, attributes: string[]): FabricIterable; flushWrites(): Promise; }; type TestGalaChainContext = Context & { readonly stub: GalaChainStub; readonly logger: GalaLoggerInstance; set callingUserData(d: { alias: string; ethAddress: string | undefined; }); get callingUser(): string; get callingUserEthAddress(): string; get txUnixTime(): number; setChaincodeStub(stub: ChaincodeStub): void; }; type GalaContract = Contract & { beforeTransaction(ctx: Ctx): Promise; createContext(): Ctx; }; declare class Fixture> { readonly writes: Record; readonly state: Record; private readonly stub; readonly contract: T; readonly ctx: Ctx; callingUserKeyPair: { privateKey: string; publicKey: string; alias: string; }; private knownKeyPairs; constructor(contractClass: ClassConstructor, writes?: Record, state?: Record); callingUser(user: string, mspId?: string): Fixture; savedState(...objs: ChainObjectBase[]): Fixture; savedRangeState(objs: (ChainObjectBase & { simpleKey(): string; })[]): Fixture; } export declare function fixture>(contractClass: ClassConstructor): Fixture; export {};