( transaction: TransactionSerializableLegacy, )
| 142 | | ErrorType |
| 143 | |
| 144 | export function assertTransactionLegacy( |
| 145 | transaction: TransactionSerializableLegacy, |
| 146 | ) { |
| 147 | const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = |
| 148 | transaction |
| 149 | if (to && !isAddress(to)) throw new InvalidAddressError({ address: to }) |
| 150 | if (typeof chainId !== 'undefined' && chainId <= 0) |
| 151 | throw new InvalidChainIdError({ chainId }) |
| 152 | if (maxPriorityFeePerGas || maxFeePerGas) |
| 153 | throw new BaseError( |
| 154 | '`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.', |
| 155 | ) |
| 156 | if (gasPrice && gasPrice > maxUint256) |
| 157 | throw new FeeCapTooHighError({ maxFeePerGas: gasPrice }) |
| 158 | } |
no test coverage detected