@@ -6,7 +6,7 @@ import { checkRoutingConditions } from '../context-helpers/context-util'
66import { lazyContext } from '../context-helpers/internal-context'
77import type { DecodedLogs , LogDecoding } from '../decode-logs'
88import { decodeLogs } from '../decode-logs'
9- import { InternalError , testInvariant } from '../errors'
9+ import { InternalError , invariant } from '../errors'
1010import type {
1111 ApplicationCallInnerTxn ,
1212 AssetConfigInnerTxn ,
@@ -265,7 +265,7 @@ export class TransactionGroup {
265265 if ( this . transactions . length === 0 ) {
266266 throw new InternalError ( 'No transactions in the group' )
267267 }
268- testInvariant ( this . activeTransaction . type === TransactionType . ApplicationCall , 'No app_id found in the active transaction' )
268+ invariant ( this . activeTransaction . type === TransactionType . ApplicationCall , 'No app_id found in the active transaction' )
269269 return ( this . activeTransaction as ApplicationCallTransaction ) . backingAppId . id
270270 }
271271
@@ -322,7 +322,7 @@ export class TransactionGroup {
322322 if ( this . constructingItxnGroup . length ) {
323323 throw new InternalError ( 'itxn begin without itxn submit' )
324324 }
325- testInvariant ( this . activeTransaction . type === TransactionType . ApplicationCall , 'No active application call transaction' )
325+ invariant ( this . activeTransaction . type === TransactionType . ApplicationCall , 'No active application call transaction' )
326326 if ( this . activeTransaction . onCompletion === OnCompleteAction . ClearState ) {
327327 throw new InternalError ( 'Cannot begin inner transaction group in a clear state call' )
328328 }
@@ -376,12 +376,12 @@ export class TransactionGroup {
376376 getItxnGroup ( index ?: StubUint64Compat ) : ItxnGroup {
377377 const i = index !== undefined ? asNumber ( index ) : undefined
378378
379- testInvariant ( this . itxnGroups . length > 0 , 'no previous inner transactions' )
379+ invariant ( this . itxnGroups . length > 0 , 'no previous inner transactions' )
380380 if ( i !== undefined && i >= this . itxnGroups . length ) {
381381 throw new InternalError ( 'Invalid group index' )
382382 }
383383 const group = i !== undefined ? this . itxnGroups [ i ] : this . itxnGroups . at ( - 1 ) !
384- testInvariant ( group . itxns . length > 0 , 'no previous inner transactions' )
384+ invariant ( group . itxns . length > 0 , 'no previous inner transactions' )
385385
386386 return group
387387 }
@@ -552,7 +552,7 @@ export class ItxnGroup {
552552 }
553553
554554 private getInnerTxnImpl ( { type, index } : { type ?: TransactionType ; index ?: StubUint64Compat } ) {
555- testInvariant ( this . itxns . length > 0 , 'no previous inner transactions' )
555+ invariant ( this . itxns . length > 0 , 'no previous inner transactions' )
556556 const i = index !== undefined ? asNumber ( index ) : undefined
557557 if ( i !== undefined && i >= this . itxns . length ) {
558558 throw new InternalError ( 'Invalid group index' )
0 commit comments