Skip to content

Commit 9259641

Browse files
committed
feat: add fallback to empty object for transaction flags
1 parent e7370ad commit 9259641

File tree

1 file changed

+3
-2
lines changed
  • src/common/libs/ledger/parser/common

1 file changed

+3
-2
lines changed

src/common/libs/ledger/parser/common/flag.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ class FlagParser {
3535
const definitions = NetworkService.getNetworkDefinitions();
3636

3737
// if the transaction flags is not present in the definitions use default flags
38-
const transactionFlags = definitions?.transactionFlags ?? binary.DEFAULT_DEFINITIONS.TRANSACTION_FLAGS;
38+
const transactionFlags =
39+
definitions?.transactionFlags ?? (binary.DEFAULT_DEFINITIONS as any).TRANSACTION_FLAGS ?? {};
3940
const indicesFlags =
40-
definitions?.transactionFlagsIndices ?? binary.DEFAULT_DEFINITIONS.TRANSACTION_FLAGS_INDICES;
41+
definitions?.transactionFlagsIndices ?? (binary.DEFAULT_DEFINITIONS as any).TRANSACTION_FLAGS_INDICES ?? {};
4142

4243
// transaction flags
4344
if (type in TransactionTypes && Object.prototype.hasOwnProperty.call(transactionFlags, type)) {

0 commit comments

Comments
 (0)