Skip to content

Commit

Permalink
feat: support tenure_change in tx type filter queries (#1808)
Browse files Browse the repository at this point in the history
  • Loading branch information
zone117x committed Jan 9, 2024
1 parent c9a4df8 commit 0831393
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/controllers/db-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`);
Expand All @@ -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}`);
}
Expand Down Expand Up @@ -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}`);
}
Expand Down

0 comments on commit 0831393

Please sign in to comment.