MCPcopy
hub / github.com/subquery/subql / filterExistingMethods

Function filterExistingMethods

packages/cli/src/controller/generate-controller.ts:320–333  ·  view source on GitHub ↗
(
  eventFragments: Record<string, EventFragment>,
  functionFragments: Record<string, FunctionFragment>,
  dataSources: T,
  address: string | undefined,
  extractor: ManifestExtractor<T>
)

Source from the content-addressed store, hash-verified

318};
319
320export function filterExistingMethods<T>(
321 eventFragments: Record<string, EventFragment>,
322 functionFragments: Record<string, FunctionFragment>,
323 dataSources: T,
324 address: string | undefined,
325 extractor: ManifestExtractor<T>
326): [Record<string, EventFragment>, Record<string, FunctionFragment>] {
327 const {existingEvents, existingFunctions} = extractor(dataSources, address && address.toLowerCase());
328
329 return [
330 filterExistingFragments<EventFragment>(eventFragments, existingEvents),
331 filterExistingFragments<FunctionFragment>(functionFragments, existingFunctions),
332 ];
333}
334
335export const yamlExtractor: ManifestExtractor<EthereumDs[]> = (dataSources, casedInputAddress) => {
336 const existingEvents: string[] = [];

Callers 3

prepareUserInputFunction · 0.85

Calls 1

filterExistingFragmentsFunction · 0.85

Tested by

no test coverage detected