MCPcopy Create free account
hub / github.com/CashScript/cashscript / createVirtualMachine

Function createVirtualMachine

packages/cashscript/src/debugging.ts:19–33  ·  view source on GitHub ↗
(vmTarget: VmTarget)

Source from the content-addressed store, hash-verified

17/* eslint-enable @typescript-eslint/indent */
18
19const createVirtualMachine = (vmTarget: VmTarget): VM => {
20 switch (vmTarget) {
21 case 'BCH_2023_05':
22 return createVirtualMachineBch2023();
23 case 'BCH_2025_05':
24 return createVirtualMachineBch2025();
25 case 'BCH_2026_05':
26 return createVirtualMachineBch2026();
27 case 'BCH_SPEC':
28 // TODO: This typecast is shitty, but it's hard to fix
29 return createVirtualMachineBchSpec() as unknown as VM;
30 default:
31 throw new Error(`Debugging is not supported for the ${vmTarget} virtual machine.`);
32 }
33};
34
35// debugs the template, optionally logging the execution data
36export const debugTemplate = (template: WalletTemplate, artifacts: Artifact[]): DebugResults => {

Callers 1

createProgramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected