Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickDinh committed Jan 29, 2025
1 parent 916ec5a commit b90c354
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/filterFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { algorandFixture } from '@algorandfoundation/algokit-utils/testing'
import { AlgorandFixture, AlgorandFixtureConfig } from '@algorandfoundation/algokit-utils/types/testing'
import { SendAtomicTransactionComposerResults, SendTransactionResult } from '@algorandfoundation/algokit-utils/types/transaction'
import type { Account, Transaction } from 'algosdk'
import algosdk from 'algosdk'
import algosdk, { TransactionType } from 'algosdk'
import { expect, vitest } from 'vitest'
import { Arc28EventGroup, TransactionFilter, TransactionSubscriptionResult } from '../src/types'
import { GetSubscribedTransactions, SendXTransactions } from './transactions'
Expand Down Expand Up @@ -106,8 +106,20 @@ export function filterFixture(fixtureConfig?: AlgorandFixtureConfig): {

expect(algod.subscribedTransactions.length).toBe(results.length)
expect(algod.subscribedTransactions.map((s) => s.id)).toEqual(results.map((r) => r.transaction.txID()))
expect(indexer.subscribedTransactions.length).toBe(results.length)
expect(indexer.subscribedTransactions.map((s) => s.id)).toEqual(results.map((r) => r.transaction.txID()))

// Filter out the proposal payout transaction from the indexer
const subscribedTransactions = indexer.subscribedTransactions.filter(
(t) =>
!(
t.fee === 0n &&
t.confirmedRound === t.firstValid &&
t.confirmedRound === t.lastValid &&
t.txType === TransactionType.pay &&
t.parentTransactionId === undefined
),
)
expect(subscribedTransactions.length).toBe(results.length)
expect(subscribedTransactions.map((s) => s.id)).toEqual(results.map((r) => r.transaction.txID()))

return { algod, indexer }
}
Expand Down
1 change: 1 addition & 0 deletions tests/scenarios/transform-complex-txn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ describe('Complex transaction with many nested inner transactions', () => {
"applicationId": 1390675395n,
"approvalProgram": "",
"clearStateProgram": "",
"extraProgramPages": 0,
"foreignApps": [],
"foreignAssets": [
1390638935n,
Expand Down

0 comments on commit b90c354

Please sign in to comment.