Skip to content

Commit

Permalink
fix: mb test confirmations
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Dec 20, 2024
1 parent d423943 commit a273130
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions tests/api/token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@ describe('/extended/v1/tokens tests', () => {
parent_index_block_hash: '0x03',
parent_microblock_hash: '0x11',
})
.addTx({ tx_id: '0x5555' })
.addTx({ tx_id: '0x5499' })
.addTxNftEvent({
asset_identifier: assetId2,
asset_event_type_id: DbAssetEventTypeId.Transfer,
sender: addr2,
recipient: addr3,
})
.build();
await db.update(block4);

Expand Down Expand Up @@ -228,7 +234,13 @@ describe('/extended/v1/tokens tests', () => {
index_block_hash: '0x06',
parent_index_block_hash: '0x05',
})
.addTx({ tx_id: '0xf7f8' })
.addTx({ tx_id: '0xf7f7', microblock_canonical: false })
.addTxNftEvent({
asset_identifier: assetId2,
asset_event_type_id: DbAssetEventTypeId.Transfer,
sender: addr3,
recipient: addr2,
})
.build();
await db.update(block6);

Expand Down Expand Up @@ -269,7 +281,23 @@ describe('/extended/v1/tokens tests', () => {
index_block_hash: '0x07',
parent_index_block_hash: '0x06',
})
.addTx({ tx_id: '0x100b' })
.addTx({ tx_id: '0x1009' })
.addTxStxEvent({ event_index: 0 })
.addTxNftEvent({
asset_identifier: assetId2,
asset_event_type_id: DbAssetEventTypeId.Transfer,
sender: addr3,
recipient: addr2,
event_index: 1, // Higher event index
})
.addTx({ tx_id: '0x100a' })
.addTxNftEvent({
asset_identifier: assetId2,
asset_event_type_id: DbAssetEventTypeId.Transfer,
sender: addr2,
recipient: addr3,
event_index: 0, // Lower event index but higher microblock index
})
.build();
await db.update(block7);

Expand Down

0 comments on commit a273130

Please sign in to comment.