1- import { AuthenticationErrorCommon , AuthenticationInstruction , AuthenticationProgramCommon , AuthenticationProgramStateBchSpec , AuthenticationProgramStateCommon , AuthenticationVirtualMachine , AuthenticationVirtualMachineIdentifier , ResolvedTransactionCommon , WalletTemplate , WalletTemplateScriptUnlocking , binToHex , createCompiler , createVirtualMachineBch2023 , createVirtualMachineBch2025 , createVirtualMachineBch2026 , createVirtualMachineBchSpec , decodeAuthenticationInstructions , encodeAuthenticationInstruction , walletTemplateToCompilerConfiguration } from '@bitauth/libauth' ;
1+ import { AuthenticationErrorCommon , AuthenticationInstruction , AuthenticationProgramCommon , AuthenticationProgramStateCommon , AuthenticationVirtualMachine , AuthenticationVirtualMachineIdentifier , ResolvedTransactionCommon , WalletTemplate , WalletTemplateScriptUnlocking , binToHex , createCompiler , createVirtualMachineBch2023 , createVirtualMachineBch2025 , createVirtualMachineBch2026 , createVirtualMachineBchSpec , decodeAuthenticationInstructions , encodeAuthenticationInstruction , walletTemplateToCompilerConfiguration } from '@bitauth/libauth' ;
22import { Artifact , LogEntry , Op , PrimitiveType , StackItem , asmToBytecode , bytecodeToAsm , decodeBool , decodeInt , decodeString } from '@cashscript/utils' ;
33import { findLastIndex , toRegExp } from './utils.js' ;
44import { FailedRequireError , FailedTransactionError , FailedTransactionEvaluationError } from './Errors.js' ;
@@ -7,7 +7,7 @@ import { getBitauthUri } from './LibauthTemplate.js';
77export type DebugResult = AuthenticationProgramStateCommon [ ] ;
88export type DebugResults = Record < string , DebugResult > ;
99
10- const createVirualMachine = ( vmTarget : AuthenticationVirtualMachineIdentifier ) => {
10+ const createVirualMachine = ( vmTarget : AuthenticationVirtualMachineIdentifier ) : VM => {
1111 switch ( vmTarget ) {
1212 case 'BCH_2023_05' :
1313 return createVirtualMachineBch2023 ( ) ;
@@ -16,11 +16,11 @@ const createVirualMachine = (vmTarget: AuthenticationVirtualMachineIdentifier) =
1616 case 'BCH_2026_05' :
1717 return createVirtualMachineBch2026 ( ) ;
1818 case 'BCH_SPEC' :
19- return createVirtualMachineBchSpec ( ) ;
19+ return createVirtualMachineBchSpec ( ) as unknown as VM ;
2020 default :
21- throw new Error ( `Debugging is not supported for the ${ vmTarget } virtual machine.` ) ; ;
21+ throw new Error ( `Debugging is not supported for the ${ vmTarget } virtual machine.` ) ;
2222 }
23- }
23+ } ;
2424
2525// debugs the template, optionally logging the execution data
2626export const debugTemplate = ( template : WalletTemplate , artifacts : Artifact [ ] ) : DebugResults => {
0 commit comments