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

Function decodeLogDataEntry

packages/cashscript/src/debugging.ts:245–260  ·  view source on GitHub ↗
(
  dataEntry: LogData,
  reversedPriorDebugSteps: AuthenticationProgramStateCommon[],
  vm: VM,
)

Source from the content-addressed store, hash-verified

243};
244
245const decodeLogDataEntry = (
246 dataEntry: LogData,
247 reversedPriorDebugSteps: AuthenticationProgramStateCommon[],
248 vm: VM,
249): string | bigint | boolean => {
250 if (typeof dataEntry === 'string') return dataEntry;
251
252 const dataEntryDebugStep = reversedPriorDebugSteps.find((step) => step.ip === dataEntry.ip);
253
254 if (!dataEntryDebugStep) {
255 throw new Error(`Should not happen: corresponding data entry debug step not found for entry at ip ${dataEntry.ip}`);
256 }
257
258 const transformedDebugStep = applyStackItemTransformations(dataEntry, dataEntryDebugStep, vm);
259 return decodeStackItem(dataEntry, transformedDebugStep.stack);
260};
261
262const applyStackItemTransformations = (
263 element: StackItem,

Callers 1

debugSingleScenarioFunction · 0.85

Calls 2

decodeStackItemFunction · 0.85

Tested by

no test coverage detected