Skip to content

Commit

Permalink
fix: use normal stake if no vesca
Browse files Browse the repository at this point in the history
  • Loading branch information
fum-is-chum committed Mar 24, 2024
1 parent df4d118 commit 4dda1df
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/builders/borrowIncentiveBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,19 @@ const generateBorrowIncentiveQuickMethod: GenerateBorrowIncentiveQuickMethod =
);

if (!obligationLocked || unstakeObligationBeforeStake) {
try {
const { veScaKey: veScaKeyArg } = await requireVeSca(
builder,
txBlock,
veScaKey
);
const { veScaKey: veScaKeyArg } = await requireVeSca(
builder,
txBlock,
veScaKey
);
if (veScaKey) {
txBlock.stakeObligationWithVesca(
obligationArg,
obligationtKeyArg,
veScaKeyArg
);
} catch (e: any) {
if (e.message === 'No vesca found for sender') {
txBlock.stakeObligation(obligationArg, obligationtKeyArg);
}
} else {
txBlock.stakeObligation(obligationArg, obligationtKeyArg);
}
}
},
Expand Down

0 comments on commit 4dda1df

Please sign in to comment.