From 083139316350650c6cc97af377a6ae1cf6006be8 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Tue, 9 Jan 2024 15:47:06 +0100 Subject: [PATCH] feat: support tenure_change in tx type filter queries (#1808) --- src/api/controllers/db-controller.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api/controllers/db-controller.ts b/src/api/controllers/db-controller.ts index 9a8e2840..fe9399b0 100644 --- a/src/api/controllers/db-controller.ts +++ b/src/api/controllers/db-controller.ts @@ -77,6 +77,7 @@ export function parseTxTypeStrings(values: string[]): TransactionType[] { case 'token_transfer': case 'coinbase': case 'poison_microblock': + case 'tenure_change': return v; default: throw new Error(`Unexpected tx type: ${JSON.stringify(v)}`); @@ -98,6 +99,8 @@ export function getTxTypeString(typeId: DbTxTypeId): Transaction['tx_type'] { case DbTxTypeId.Coinbase: case DbTxTypeId.CoinbaseToAltRecipient: return 'coinbase'; + case DbTxTypeId.TenureChange: + return 'tenure_change'; default: throw new Error(`Unexpected DbTxTypeId: ${typeId}`); } @@ -139,6 +142,8 @@ export function getTxTypeId(typeString: Transaction['tx_type']): DbTxTypeId[] { return [DbTxTypeId.PoisonMicroblock]; case 'coinbase': return [DbTxTypeId.Coinbase, DbTxTypeId.CoinbaseToAltRecipient]; + case 'tenure_change': + return [DbTxTypeId.TenureChange]; default: throw new Error(`Unexpected tx type string: ${typeString}`); }