Skip to content

Commit

Permalink
chore: redundant if statement removed
Browse files Browse the repository at this point in the history
  • Loading branch information
benceharomi committed Jun 5, 2024
1 parent 0068f45 commit 039bd1e
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions composables/zksync/useWithdrawalFinalization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export default (transactionInfo: ComputedRef<TransactionInfo>) => {
const feeToken = computed(() => {
return tokens.value?.[ETH_TOKEN.address];
});
const usingMainContract = computed(() => transactionInfo.value.token.address === ETH_TOKEN.address);

const getFinalizationParams = async () => {
const provider = providerStore.requestProvider();
Expand All @@ -69,23 +68,13 @@ export default (transactionInfo: ComputedRef<TransactionInfo>) => {

const getTransactionParams = async () => {
finalizeWithdrawalParams.value = await getFinalizationParams();
if (usingMainContract.value) {
return {
address: (await retrieveBridgeAddresses()).sharedL1 as Hash,
abi: IL1SharedBridge,
account: onboardStore.account.address!,
functionName: "finalizeWithdrawal",
args: Object.values(finalizeWithdrawalParams.value!),
};
} else {
return {
address: (await retrieveBridgeAddresses()).sharedL1 as Hash,
abi: IL1SharedBridge,
account: onboardStore.account.address!,
functionName: "finalizeWithdrawal",
args: Object.values(finalizeWithdrawalParams.value!),
};
}
return {
address: (await retrieveBridgeAddresses()).sharedL1 as Hash,
abi: IL1SharedBridge,
account: onboardStore.account.address!,
functionName: "finalizeWithdrawal",
args: Object.values(finalizeWithdrawalParams.value!),
};
};

const {
Expand Down

0 comments on commit 039bd1e

Please sign in to comment.