Skip to content

Commit

Permalink
Revert "Hotfix - remove post validation"
Browse files Browse the repository at this point in the history
  • Loading branch information
timjrobinson authored Jun 30, 2023
1 parent ae1e176 commit 74042b5
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/components/_global/BalActionSteps/BalActionSteps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,9 @@ function handleSignAction(state: TransactionActionState) {
async function handleTransaction(
tx: TransactionResponse,
state: TransactionActionState,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
actionInfo: TransactionActionInfo
): Promise<void> {
// const { postActionValidation, actionInvalidReason } = actionInfo;
const { postActionValidation, actionInvalidReason } = actionInfo;
await txListener(tx, {
onTxConfirmed: async (receipt: TransactionReceipt) => {
Expand All @@ -230,21 +229,21 @@ async function handleTransaction(
state.confirming = false;
// const isValid = await postActionValidation?.();
// if (isValid || !postActionValidation) {
const confirmedAt = await getTxConfirmedAt(receipt);
state.confirmedAt = dateTimeLabelFor(confirmedAt);
state.confirmed = true;
if (currentActionIndex.value >= actions.value.length - 1) {
emit('success', { receipt, confirmedAt: state.confirmedAt });
const isValid = await postActionValidation?.();
if (isValid || !postActionValidation) {
const confirmedAt = await getTxConfirmedAt(receipt);
state.confirmedAt = dateTimeLabelFor(confirmedAt);
state.confirmed = true;
if (currentActionIndex.value >= actions.value.length - 1) {
emit('success', { receipt, confirmedAt: state.confirmedAt });
} else {
currentActionIndex.value += 1;
}
} else {
currentActionIndex.value += 1;
// post action validation failed, display reason.
if (actionInvalidReason) state.error = actionInvalidReason;
state.init = false;
}
// } else {
// // post action validation failed, display reason.
// if (actionInvalidReason) state.error = actionInvalidReason;
// state.init = false;
// }
},
onTxFailed: () => {
state.confirming = false;
Expand Down

0 comments on commit 74042b5

Please sign in to comment.