diff --git a/packages/core/src/types/virtual.test-d.ts b/packages/core/src/types/virtual.test-d.ts index 065edb784..bfa28130a 100644 --- a/packages/core/src/types/virtual.test-d.ts +++ b/packages/core/src/types/virtual.test-d.ts @@ -94,7 +94,7 @@ const account = onchainTable("account", (p) => ({ const schema = { account }; -test("FormatEventNames without filter", () => { +test("FormatEventNames", () => { type a = Virtual.FormatEventNames< // ^? { @@ -114,42 +114,6 @@ test("FormatEventNames without filter", () => { assertType({} as any as a); }); -test("FormatEvent names with filter", () => { - type a = Virtual.FormatEventNames< - // ^? - { - contract: { abi: abi; network: ""; filter: { event: "Event1()" } }; - }, - {}, - {} - >; - - type eventNames = "contract:setup" | "contract:Event1()"; - - assertType({} as any as eventNames); - assertType({} as any as a); -}); - -test("FormatEvent names with filter array", () => { - type a = Virtual.FormatEventNames< - // ^? - { - contract: { - abi: abi; - network: ""; - filter: { event: readonly ["Event1()"] }; - }; - }, - {}, - {} - >; - - type eventNames = "contract:setup" | "contract:Event1()"; - - assertType({} as any as eventNames); - assertType({} as any as a); -}); - test("FormatEventNames with semi-weak abi", () => { type a = Virtual.FormatEventNames< // ^? diff --git a/packages/core/src/types/virtual.ts b/packages/core/src/types/virtual.ts index a80cffc57..4646c3024 100644 --- a/packages/core/src/types/virtual.ts +++ b/packages/core/src/types/virtual.ts @@ -26,17 +26,7 @@ export namespace Virtual { contract extends Config["contracts"][string], /// safeEventNames = SafeEventNames, - > = string extends safeEventNames - ? never - : contract extends { - filter: { event: infer event extends string | readonly string[] }; - } - ? event extends safeEventNames - ? event - : event[number] extends safeEventNames - ? event[number] - : safeEventNames - : safeEventNames; + > = string extends safeEventNames ? never : safeEventNames; type _FormatFunctionNames< contract extends Config["contracts"][string],