( selectedEvents: Record<string, EventFragment>, selectedFunctions: Record<string, FunctionFragment>, existingDs: T, address: string | undefined, startBlock: number, abiFileName: string, extractor: ManifestExtractor<T> )
| 102 | } |
| 103 | |
| 104 | export function prepareUserInput<T>( |
| 105 | selectedEvents: Record<string, EventFragment>, |
| 106 | selectedFunctions: Record<string, FunctionFragment>, |
| 107 | existingDs: T, |
| 108 | address: string | undefined, |
| 109 | startBlock: number, |
| 110 | abiFileName: string, |
| 111 | extractor: ManifestExtractor<T> |
| 112 | ): UserInput { |
| 113 | const [cleanEvents, cleanFunctions] = filterExistingMethods( |
| 114 | selectedEvents, |
| 115 | selectedFunctions, |
| 116 | existingDs, |
| 117 | address, |
| 118 | extractor |
| 119 | ); |
| 120 | |
| 121 | const constructedEvents = constructMethod<EventFragment>(cleanEvents); |
| 122 | const constructedFunctions = constructMethod<FunctionFragment>(cleanFunctions); |
| 123 | |
| 124 | return { |
| 125 | startBlock: startBlock, |
| 126 | functions: constructedFunctions, |
| 127 | events: constructedEvents, |
| 128 | abiPath: `./abis/${abiFileName}`, |
| 129 | address: address, |
| 130 | }; |
| 131 | } |
| 132 | |
| 133 | export function constructMethod<T extends ConstructorFragment | Fragment>( |
| 134 | cleanedFragment: Record<string, T> |
no test coverage detected