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

Function failedFinalVerify

packages/cashscript/src/debugging.ts:307–319  ·  view source on GitHub ↗
(evaluationResult: string | true)

Source from the content-addressed store, hash-verified

305};
306
307const failedFinalVerify = (evaluationResult: string | true): evaluationResult is string => {
308 // true indicates a successful evaluation (so no failed final verify)
309 if (evaluationResult === true) return false;
310
311 // If any of the following errors occurred, then the final verify failed - any other messages
312 // indicate other kinds of failures
313 return toRegExp([
314 // TODO: Ask Jason to put these back into an enum and replace with the enum value
315 'The CashAssembly internal evaluation completed with an unexpected number of items on the stack (must be exactly 1).', // AuthenticationErrorCommon.requiresCleanStack,
316 'The CashAssembly internal evaluation completed with a non-empty control stack.', // AuthenticationErrorCommon.nonEmptyControlStack,
317 AuthenticationErrorCommon.unsuccessfulEvaluation,
318 ]).test(evaluationResult);
319};
320
321const calculateCleanupSize = (instructions: Array<AuthenticationInstruction | undefined>): number => {
322 // OP_NIP (or OP_DROP/OP_2DROP in optimised bytecode) is used for cleanup at the end of a function,

Callers 1

debugSingleScenarioFunction · 0.85

Calls 1

toRegExpFunction · 0.85

Tested by

no test coverage detected