Skip to content

Commit

Permalink
feat: allow fallback transactions to all users
Browse files Browse the repository at this point in the history
  • Loading branch information
N3TC4T committed Oct 24, 2024
1 parent df03043 commit 8a12b12
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/common/libs/payload/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { Endpoints } from '@common/constants/endpoints';
import ApiService, { ApiError } from '@services/ApiService';
import LoggerService from '@services/LoggerService';

import CoreRepository from '@store/repositories/core';

import { TransactionFactory } from '@common/libs/ledger/factory';

import Localize from '@locale';
Expand Down Expand Up @@ -328,20 +326,13 @@ export class Payload {
}

// check if normal transaction and supported by the app
// NOTE: only in case of developer mode enabled we allow transaction fallback
if (
request_json.TransactionType &&
!Object.values(TransactionTypes).includes(request_json.TransactionType as TransactionTypes)
) {
if (CoreRepository.isDeveloperModeEnabled()) {
logger.warn(
`Requested transaction type "${request_json.TransactionType}" not found, revert to fallback transaction.`,
);
} else {
throw new Error(
`Requested transaction type "${request_json.TransactionType} is not supported at the moment.`,
);
}
logger.warn(
`Requested transaction type "${request_json.TransactionType}" not found, revert to fallback transaction.`,
);
}

let craftedTransaction;
Expand Down

0 comments on commit 8a12b12

Please sign in to comment.