Skip to content

Commit

Permalink
refactor: remove fallback values
Browse files Browse the repository at this point in the history
  • Loading branch information
dohaki committed Nov 1, 2023
1 parent 95cb1ba commit 84e229e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/views/DepositStatus/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function convertForDepositQuery(
const { sendDepositArgs, quote } = fromBridgePagePayload;

return {
depositId: Number(data.parsedDepositLog.args.depositId || 0),
depositId: Number(data.parsedDepositLog.args.depositId),
depositTime: data.depositTimestamp || Math.floor(Date.now() / 1000),
status: "pending" as const,
filled: "0",
Expand All @@ -22,7 +22,7 @@ export function convertForDepositQuery(
recipientAddr: sendDepositArgs.toAddress,
message: sendDepositArgs.message || "0x",
amount: BigNumber.from(sendDepositArgs.amount).toString(),
depositTxHash: data.depositTxReceipt.transactionHash || "0x",
depositTxHash: data.depositTxReceipt.transactionHash,
fillTxs: [],
speedUps: [],
depositRelayerFeePct: BigNumber.from(
Expand Down Expand Up @@ -54,9 +54,7 @@ export function convertForFillQuery(
const { sendDepositArgs, quote } = fromBridgePagePayload;

return {
depositId: Number(
data.depositByTxHash.parsedDepositLog.args.depositId || 0
),
depositId: Number(data.depositByTxHash.parsedDepositLog.args.depositId),
depositTime:
data.depositByTxHash.depositTimestamp || Math.floor(Date.now() / 1000),
status: "filled" as const,
Expand All @@ -68,8 +66,7 @@ export function convertForFillQuery(
recipientAddr: sendDepositArgs.toAddress,
message: sendDepositArgs.message || "0x",
amount: BigNumber.from(sendDepositArgs.amount).toString(),
depositTxHash:
data.depositByTxHash.depositTxReceipt.transactionHash || "0x",
depositTxHash: data.depositByTxHash.depositTxReceipt.transactionHash,
fillTxs: data.fillTxHashes || [],
speedUps: [],
depositRelayerFeePct: BigNumber.from(
Expand Down

0 comments on commit 84e229e

Please sign in to comment.