1- import { Account , Application , Asset , bytes , internal , uint64 } from '@algorandfoundation/algorand-typescript'
1+ import { Account , Application , Asset , Bytes , bytes , internal , uint64 } from '@algorandfoundation/algorand-typescript'
22import { captureMethodConfig } from './abi-metadata'
33import { DecodedLogs , LogDecoding } from './decode-logs'
44import * as ops from './impl'
@@ -27,6 +27,7 @@ export class TestExecutionContext implements internal.ExecutionContext {
2727 #txnContext: TransactionContext
2828 #valueGenerator: ValueGenerator
2929 #defaultSender: Account
30+ #activeLogicSigArgs: bytes [ ]
3031
3132 constructor ( defaultSenderAddress ?: bytes ) {
3233 internal . ctxMgr . instance = this
@@ -35,6 +36,7 @@ export class TestExecutionContext implements internal.ExecutionContext {
3536 this . #txnContext = new TransactionContext ( )
3637 this . #valueGenerator = new ValueGenerator ( )
3738 this . #defaultSender = Account ( defaultSenderAddress ?? getRandomBytes ( 32 ) . asAlgoTs ( ) )
39+ this . #activeLogicSigArgs = [ ]
3840 }
3941
4042 account ( address ?: bytes ) : Account {
@@ -120,6 +122,19 @@ export class TestExecutionContext implements internal.ExecutionContext {
120122 }
121123 }
122124
125+ get activeLogicSigArgs ( ) : bytes [ ] {
126+ return this . #activeLogicSigArgs
127+ }
128+
129+ executeLogicSig ( logicSig : LogicSig , ...args : bytes [ ] ) : boolean | uint64 {
130+ this . #activeLogicSigArgs = args
131+ try {
132+ return logicSig . program ( )
133+ } finally {
134+ this . #activeLogicSigArgs = [ ]
135+ }
136+ }
137+
123138 reset ( ) {
124139 this . #contractContext = new ContractContext ( )
125140 this . #ledgerContext = new LedgerContext ( )
0 commit comments