Skip to content

Commit 9e23935

Browse files
authored
Add typing to extracted methods (#143)
1 parent 8cc8d79 commit 9e23935

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/eth-handlers/eth_getTransactionByBlockHashAndIndex.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@ import { JSONRPCCallbackTypePlain, RequestParamsLike } from 'jayson'
22
import crypto from 'crypto'
33
import { completeReadableReceipt } from '../external/Collector'
44
import axios, { AxiosError } from 'axios'
5+
import NestedCounters from '../utils/nestedCounters'
56

67
interface BuildGetTransactionByBlockHashAndIndex {
7-
nestedCountersInstance: any
8-
ensureArrayArgs: any
9-
countFailedResponse: any
8+
nestedCountersInstance: NestedCounters
9+
ensureArrayArgs: (args: RequestParamsLike, callback: JSONRPCCallbackTypePlain) => boolean
10+
countFailedResponse: (api: string, reason: string) => void
1011
logEventEmitter: any
11-
firstLineLogs: any
12+
firstLineLogs: boolean
1213
collectorAPI: any
1314
extractTransactionObject: any
1415
countSuccessResponse: any
1516
config: any
16-
verbose: any
17-
errorBusy: any
17+
verbose: boolean
18+
errorBusy: { code: number; message: string }
1819
}
1920

2021
export const buildGetTransactionByBlockHashAndIndex = ({

src/eth-handlers/eth_getTransactionByBlockNumberAndIndex.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@ import crypto from 'crypto'
44
import { completeReadableReceipt } from '../external/Collector'
55
import { JSONRPCCallbackTypePlain } from 'jayson'
66
import axios from 'axios'
7+
import NestedCounters from '../utils/nestedCounters'
78

89
interface BuildGetTransactionByBlockNumberAndIndex {
9-
nestedCountersInstance: any
10-
ensureArrayArgs: any
11-
countFailedResponse: any
10+
nestedCountersInstance: NestedCounters
11+
ensureArrayArgs: (args: RequestParamsLike, callback: JSONRPCCallbackTypePlain) => boolean
12+
countFailedResponse: (api: string, reason: string) => void
1213
logEventEmitter: any
13-
firstLineLogs: any
14+
firstLineLogs: boolean
1415
collectorAPI: any
1516
extractTransactionObject: any
1617
countSuccessResponse: any
1718
config: any
18-
verbose: any
19-
errorBusy: any
19+
verbose: boolean
20+
errorBusy: { code: number; message: string }
2021
}
2122

2223
export const buildGetTransactionByBlockNumberAndIndex = ({

0 commit comments

Comments
 (0)