Skip to content

Commit 8a7a18e

Browse files
authored
Merge pull request #2346 from hirosystems/develop
release to master
2 parents 328fb8f + 1353554 commit 8a7a18e

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

src/api/controllers/db-controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export function getTxTypeId(typeString: Transaction['tx_type']): DbTxTypeId[] {
168168
case 'poison_microblock':
169169
return [DbTxTypeId.PoisonMicroblock];
170170
case 'coinbase':
171-
return [DbTxTypeId.Coinbase, DbTxTypeId.CoinbaseToAltRecipient];
171+
return [DbTxTypeId.Coinbase, DbTxTypeId.CoinbaseToAltRecipient, DbTxTypeId.NakamotoCoinbase];
172172
case 'tenure_change':
173173
return [DbTxTypeId.TenureChange];
174174
default:

src/datastore/pg-store-v2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ export class PgStoreV2 extends BasePgStoreModule {
966966
WHERE ps.canonical = TRUE
967967
AND ps.cycle_number = ${cycleNumber}
968968
AND ps.signing_key = ${signerKey}
969-
ORDER BY locked DESC
969+
ORDER BY locked DESC, stacker ASC
970970
LIMIT ${limit}
971971
OFFSET ${offset}
972972
`;

tests/api/tx.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,6 +2698,24 @@ describe('tx tests', () => {
26982698
.build();
26992699
await db.update(block3);
27002700

2701+
const block4 = new TestBlockBuilder({
2702+
block_height: 4,
2703+
index_block_hash: '0x04',
2704+
parent_block_hash: block3.block.block_hash,
2705+
parent_index_block_hash: block3.block.index_block_hash,
2706+
burn_block_time: 1740000000,
2707+
})
2708+
.addTx({
2709+
tx_id: '0x4234',
2710+
fee_rate: 4n,
2711+
sender_address: testSendertAddr,
2712+
nonce: 4,
2713+
type_id: DbTxTypeId.NakamotoCoinbase,
2714+
coinbase_vrf_proof: '0x01',
2715+
})
2716+
.build();
2717+
await db.update(block4);
2718+
27012719
const filterTypes: TransactionType[] = ['coinbase', 'poison_microblock', 'token_transfer'];
27022720
const txsReq1 = await supertest(api.server).get(
27032721
`/extended/v1/tx?type=${filterTypes.join(',')}`
@@ -2706,6 +2724,9 @@ describe('tx tests', () => {
27062724
expect(txsReq1.body).toEqual(
27072725
expect.objectContaining({
27082726
results: [
2727+
expect.objectContaining({
2728+
tx_id: block4.txs[0].tx.tx_id,
2729+
}),
27092730
expect.objectContaining({
27102731
tx_id: block3.txs[0].tx.tx_id,
27112732
}),

0 commit comments

Comments
 (0)