Skip to content

Commit

Permalink
fix: withdrawal finalization improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 committed May 10, 2024
1 parent dbde7d6 commit 1d461dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion store/zksync/withdrawals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const useZkSyncWithdrawalsStore = defineStore("zkSyncWithdrawals", () =>
providerStore.requestProvider().getTransactionDetails(withdrawal.transactionHash!)
);

const withdrawalFinalizationAvailable = transactionDetails.status === "verified";
const withdrawalFinalizationAvailable = !!transactionDetails.ethExecuteTxHash;
const isFinalized = withdrawalFinalizationAvailable
? await useZkSyncWalletStore()
.getL1VoidSigner(true)
Expand Down
12 changes: 10 additions & 2 deletions views/transactions/WithdrawalSubmitted.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
>
<p>You can claim your withdrawal now.</p>
</CommonAlert>
<CommonAlert v-else-if="isCustomBridgeToken" variant="warning" :icon="ExclamationTriangleIcon" class="mb-4">
<p>This withdrawal was made through a third-party bridge. Please use that bridge to claim your withdrawal.</p>
</CommonAlert>
<CommonAlert v-else variant="warning" :icon="ExclamationTriangleIcon" class="mb-4">
<p>
You will have to claim your withdrawal once it's processed. Claiming will require paying the fee on the
Expand All @@ -51,7 +54,7 @@
:failed="transaction.info.failed"
:animation-state="withdrawalFinalizationAvailable ? 'stopped-in-the-end' : undefined"
:expected-complete-timestamp="
withdrawalFinalizationAvailable ? undefined : transaction.info.expectedCompleteTimestamp
withdrawalFinalizationAvailable || isCustomBridgeToken ? undefined : transaction.info.expectedCompleteTimestamp
"
>
<template v-if="withdrawalFinalizationAvailable" #to-button>
Expand Down Expand Up @@ -167,6 +170,7 @@ const { eraNetwork, blockExplorerUrl } = storeToRefs(useZkSyncProviderStore());
const { l1BlockExplorerUrl } = storeToRefs(useNetworkStore());
const { connectorName, isCorrectNetworkSet } = storeToRefs(onboardStore);
const isCustomBridgeToken = computed(() => !props.transaction.token.l1Address);
const withdrawalManualFinalizationRequired = computed(() => {
return (
!props.transaction.info.completed &&
Expand All @@ -175,7 +179,11 @@ const withdrawalManualFinalizationRequired = computed(() => {
);
});
const withdrawalFinalizationAvailable = computed(() => {
return withdrawalManualFinalizationRequired.value && props.transaction.info.withdrawalFinalizationAvailable;
return (
!isCustomBridgeToken.value &&
withdrawalManualFinalizationRequired.value &&
props.transaction.info.withdrawalFinalizationAvailable
);
});
const {
Expand Down

0 comments on commit 1d461dc

Please sign in to comment.