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

Function extractInputIndexFromScenario

packages/cashscript/src/debugging.ts:196–200  ·  view source on GitHub ↗
(scenarioId: string)

Source from the content-addressed store, hash-verified

194
195// Note: this relies on the naming convention that the scenario ID is of the form <name>_input<index>_evaluate
196const extractInputIndexFromScenario = (scenarioId: string): number => {
197 const match = scenarioId.match(/_input(\d+)_/);
198 if (!match) throw new Error(`Invalid scenario ID: ${scenarioId}`);
199 return parseInt(match[1]);
200};
201
202type Program = AuthenticationProgramCommon;
203type CreateProgramResult = { vm: VM, program: Program };

Callers 1

debugSingleScenarioFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected