Skip to content

Commit

Permalink
refactor(internal): remove explicit never from unions
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Jun 4, 2024
1 parent 6dbc88a commit 9d217b4
Show file tree
Hide file tree
Showing 31 changed files with 121 additions and 121 deletions.
8 changes: 4 additions & 4 deletions src/accounts/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ export type HDOptions =
addressIndex?: number | undefined
/** The change index to use in the path (`"m/44'/60'/0'/${changeIndex}/0"`). */
changeIndex?: number | undefined
path?: never | undefined
path?: undefined
}
| {
accountIndex?: never | undefined
addressIndex?: never | undefined
changeIndex?: never | undefined
accountIndex?: undefined
addressIndex?: undefined
changeIndex?: undefined
/** The HD path. */
path: `m/44'/60'/${string}`
}
Expand Down
4 changes: 2 additions & 2 deletions src/actions/public/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ export type CallParameters<
| {
/** The balance of the account at a block number. */
blockNumber?: bigint | undefined
blockTag?: never | undefined
blockTag?: undefined
}
| {
blockNumber?: never | undefined
blockNumber?: undefined
/**
* The balance of the account at a block tag.
* @default 'latest'
Expand Down
4 changes: 2 additions & 2 deletions src/actions/public/createContractEventFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export type CreateContractEventFilterParameters<
toBlock?: toBlock | BlockNumber | BlockTag | undefined
} & (undefined extends eventName
? {
args?: never | undefined
args?: undefined
}
: MaybeExtractEventArgsFromAbi<abi, eventName> extends infer TEventFilterArgs
? {
Expand All @@ -55,7 +55,7 @@ export type CreateContractEventFilterParameters<
| undefined
}
: {
args?: never | undefined
args?: undefined
})

export type CreateContractEventFilterReturnType<
Expand Down
26 changes: 13 additions & 13 deletions src/actions/public/createEventFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,26 @@ export type CreateEventFilterParameters<
| TEventFilterArgs
| (_Args extends TEventFilterArgs ? _Args : never)
event: TAbiEvent
events?: never | undefined
events?: undefined
/**
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
* @default false
*/
strict?: TStrict | undefined
}
| {
args?: never | undefined
args?: undefined
event?: TAbiEvent | undefined
events?: never | undefined
events?: undefined
/**
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
* @default false
*/
strict?: TStrict | undefined
}
| {
args?: never | undefined
event?: never | undefined
args?: undefined
event?: undefined
events: TAbiEvents | undefined
/**
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
Expand All @@ -79,16 +79,16 @@ export type CreateEventFilterParameters<
strict?: TStrict | undefined
}
| {
args?: never | undefined
event?: never | undefined
events?: never | undefined
strict?: never | undefined
args?: undefined
event?: undefined
events?: undefined
strict?: undefined
}
: {
args?: never | undefined
event?: never | undefined
events?: never | undefined
strict?: never | undefined
args?: undefined
event?: undefined
events?: undefined
strict?: undefined
})

export type CreateEventFilterReturnType<
Expand Down
4 changes: 2 additions & 2 deletions src/actions/public/estimateGas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ export type EstimateGasParameters<
| {
/** The balance of the account at a block number. */
blockNumber?: bigint | undefined
blockTag?: never | undefined
blockTag?: undefined
}
| {
blockNumber?: never | undefined
blockNumber?: undefined
/**
* The balance of the account at a block tag.
* @default 'latest'
Expand Down
4 changes: 2 additions & 2 deletions src/actions/public/getBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export type GetBalanceParameters = {
| {
/** The balance of the account at a block number. */
blockNumber?: bigint | undefined
blockTag?: never | undefined
blockTag?: undefined
}
| {
blockNumber?: never | undefined
blockNumber?: undefined
/** The balance of the account at a block tag. */
blockTag?: BlockTag | undefined
}
Expand Down
12 changes: 6 additions & 6 deletions src/actions/public/getBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ export type GetBlockParameters<
| {
/** Hash of the block. */
blockHash?: Hash | undefined
blockNumber?: never | undefined
blockTag?: never | undefined
blockNumber?: undefined
blockTag?: undefined
}
| {
blockHash?: never | undefined
blockHash?: undefined
/** The block number. */
blockNumber?: bigint | undefined
blockTag?: never | undefined
blockTag?: undefined
}
| {
blockHash?: never | undefined
blockNumber?: never | undefined
blockHash?: undefined
blockNumber?: undefined
/**
* The block tag.
* @default 'latest'
Expand Down
12 changes: 6 additions & 6 deletions src/actions/public/getBlockTransactionCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ export type GetBlockTransactionCountParameters =
| {
/** Hash of the block. */
blockHash?: Hash | undefined
blockNumber?: never | undefined
blockTag?: never | undefined
blockNumber?: undefined
blockTag?: undefined
}
| {
blockHash?: never | undefined
blockHash?: undefined
/** The block number. */
blockNumber?: bigint | undefined
blockTag?: never | undefined
blockTag?: undefined
}
| {
blockHash?: never | undefined
blockNumber?: never | undefined
blockHash?: undefined
blockNumber?: undefined
/** The block tag. Defaults to 'latest'. */
blockTag?: BlockTag | undefined
}
Expand Down
4 changes: 2 additions & 2 deletions src/actions/public/getBytecode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export type GetBytecodeParameters = {
address: Address
} & (
| {
blockNumber?: never | undefined
blockNumber?: undefined
blockTag?: BlockTag | undefined
}
| {
blockNumber?: bigint | undefined
blockTag?: never | undefined
blockTag?: undefined
}
)

Expand Down
4 changes: 2 additions & 2 deletions src/actions/public/getFeeHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type GetFeeHistoryParameters = {
rewardPercentiles: number[]
} & (
| {
blockNumber?: never | undefined
blockNumber?: undefined
/**
* Highest number block of the requested range.
* @default 'latest'
Expand All @@ -34,7 +34,7 @@ export type GetFeeHistoryParameters = {
| {
/** Highest number block of the requested range. */
blockNumber?: bigint | undefined
blockTag?: never | undefined
blockTag?: undefined
}
)
export type GetFeeHistoryReturnType = FeeHistory
Expand Down
20 changes: 10 additions & 10 deletions src/actions/public/getLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export type GetLogsParameters<
} & (
| {
event: TAbiEvent
events?: never | undefined
events?: undefined
args?: MaybeExtractEventArgsFromAbi<TAbiEvents, _EventName> | undefined
/**
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
Expand All @@ -54,20 +54,20 @@ export type GetLogsParameters<
strict?: TStrict | undefined
}
| {
event?: never | undefined
event?: undefined
events: TAbiEvents
args?: never | undefined
args?: undefined
/**
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
* @default false
*/
strict?: TStrict | undefined
}
| {
event?: never | undefined
events?: never | undefined
args?: never | undefined
strict?: never | undefined
event?: undefined
events?: undefined
args?: undefined
strict?: undefined
}
) &
(
Expand All @@ -76,11 +76,11 @@ export type GetLogsParameters<
fromBlock?: TFromBlock | BlockNumber | BlockTag | undefined
/** Block number or tag before which to include logs */
toBlock?: TToBlock | BlockNumber | BlockTag | undefined
blockHash?: never | undefined
blockHash?: undefined
}
| {
fromBlock?: never | undefined
toBlock?: never | undefined
fromBlock?: undefined
toBlock?: undefined
/** Hash of block to include logs from */
blockHash?: Hash | undefined
}
Expand Down
4 changes: 2 additions & 2 deletions src/actions/public/getProof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export type GetProofParameters = {
| {
/** The block number. */
blockNumber?: bigint | undefined
blockTag?: never | undefined
blockTag?: undefined
}
| {
blockNumber?: never | undefined
blockNumber?: undefined
/**
* The block tag.
* @default 'latest'
Expand Down
4 changes: 2 additions & 2 deletions src/actions/public/getStorageAt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export type GetStorageAtParameters = {
slot: Hex
} & (
| {
blockNumber?: never | undefined
blockNumber?: undefined
blockTag?: BlockTag | undefined
}
| {
blockNumber?: bigint | undefined
blockTag?: never | undefined
blockTag?: undefined
}
)

Expand Down
24 changes: 12 additions & 12 deletions src/actions/public/getTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,34 @@ export type GetTransactionParameters<TBlockTag extends BlockTag = 'latest'> =
| {
/** The block hash */
blockHash: Hash
blockNumber?: never | undefined
blockTag?: never | undefined
hash?: never | undefined
blockNumber?: undefined
blockTag?: undefined
hash?: undefined
/** The index of the transaction on the block. */
index: number
}
| {
blockHash?: never | undefined
blockHash?: undefined
/** The block number */
blockNumber: bigint
blockTag?: never | undefined
hash?: never | undefined
blockTag?: undefined
hash?: undefined
/** The index of the transaction on the block. */
index: number
}
| {
blockHash?: never | undefined
blockNumber?: never | undefined
blockHash?: undefined
blockNumber?: undefined
/** The block tag. */
blockTag: TBlockTag | BlockTag
hash?: never | undefined
hash?: undefined
/** The index of the transaction on the block. */
index: number
}
| {
blockHash?: never | undefined
blockNumber?: never | undefined
blockTag?: never | undefined
blockHash?: undefined
blockNumber?: undefined
blockTag?: undefined
/** The hash of the transaction. */
hash: Hash
index?: number | undefined
Expand Down
4 changes: 2 additions & 2 deletions src/actions/public/getTransactionConfirmations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export type GetTransactionConfirmationsParameters<
| {
/** The transaction hash. */
hash: Hash
transactionReceipt?: never | undefined
transactionReceipt?: undefined
}
| {
hash?: never | undefined
hash?: undefined
/** The transaction receipt. */
transactionReceipt: FormattedTransactionReceipt<TChain>
}
Expand Down
4 changes: 2 additions & 2 deletions src/actions/public/getTransactionCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export type GetTransactionCountParameters = {
| {
/** The block number. */
blockNumber?: bigint | undefined
blockTag?: never | undefined
blockTag?: undefined
}
| {
blockNumber?: never | undefined
blockNumber?: undefined
/** The block tag. Defaults to 'latest'. */
blockTag?: BlockTag | undefined
}
Expand Down
Loading

0 comments on commit 9d217b4

Please sign in to comment.