Skip to content

Commit

Permalink
Removal of unnecessary condition for ethAccount
Browse files Browse the repository at this point in the history
The `ethAccount` is no longer necessary for deposit flow.
  • Loading branch information
kkosiorowska committed May 29, 2024
1 parent 34d8350 commit a40ba08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const TOAST_ID = TOAST_IDS.DEPOSIT_TRANSACTION_ERROR
const TOAST = TOASTS[TOAST_ID]

export default function DepositBTCModal() {
const { ethAccount } = useWalletContext()
const tokenAmount = useActionFlowTokenAmount()
const { btcAddress, depositReceipt, stake } = useStakeFlowContext()
const depositTelemetry = useDepositTelemetry()
Expand Down Expand Up @@ -68,14 +67,9 @@ export default function DepositBTCModal() {
)

const handledDepositBTC = useCallback(async () => {
if (!tokenAmount?.amount || !btcAddress || !depositReceipt || !ethAccount)
return
if (!tokenAmount?.amount || !btcAddress || !depositReceipt) return

const response = await depositTelemetry(
depositReceipt,
btcAddress,
ethAccount,
)
const response = await depositTelemetry(depositReceipt, btcAddress)

if (response.verificationStatus === "valid") {
logPromiseFailure(sendBitcoinTransaction(tokenAmount?.amount, btcAddress))
Expand All @@ -86,7 +80,6 @@ export default function DepositBTCModal() {
btcAddress,
depositReceipt,
depositTelemetry,
ethAccount,
sendBitcoinTransaction,
showError,
tokenAmount?.amount,
Expand Down
7 changes: 1 addition & 6 deletions dapp/src/hooks/useDepositTelemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ export function useDepositTelemetry() {
const captureMessage = useCaptureMessage()

return useCallback(
async (
deposit: DepositReceipt,
depositAddress: string,
ethAddress: string,
) => {
async (deposit: DepositReceipt, depositAddress: string) => {
const { status, response } = await verifyDepositAddress(
deposit,
depositAddress,
Expand Down Expand Up @@ -43,7 +39,6 @@ export function useDepositTelemetry() {
verificationResponse: response,
},
{
ethAddress,
...verificationStatus,
},
)
Expand Down

0 comments on commit a40ba08

Please sign in to comment.