Skip to content

Commit 1793fc5

Browse files
committed
fix(cli): when sending to L2, only coerce gas params if not null
1 parent 47e5f15 commit 1793fc5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cli/commands/bridge/to-l2.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const checkAndRedeemMessage = async (l1ToL2Message: L1ToL2MessageWriter) => {
4040
logger.info(`Transfer successful: ${l2TxHash}`)
4141
}
4242

43+
const ifNotNullToBN = (val: string | null) => (val == null ? val : toBN(val))
44+
4345
export const sendToL2 = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<void> => {
4446
logger.info(`>>> Sending tokens to L2 <<<\n`)
4547

@@ -168,9 +170,9 @@ export const sendToL2Command = {
168170
description: 'Calldata to pass to the recipient. Must be allowlisted in the bridge',
169171
})
170172
.coerce({
171-
maxGas: toBN,
172-
gasPriceBid: toBN,
173-
maxSubmissionCost: toBN,
173+
maxGas: ifNotNullToBN,
174+
gasPriceBid: ifNotNullToBN,
175+
maxSubmissionCost: ifNotNullToBN,
174176
})
175177
},
176178
handler: async (argv: CLIArgs): Promise<void> => {

0 commit comments

Comments
 (0)