import { AuthenticationErrorCommon } from '../../vm/instruction-sets/instruction-sets'; import { AuthenticationVirtualMachine } from '../../vm/virtual-machine'; import { AuthenticationProgramStateError, AuthenticationProgramStateExecutionStack, AuthenticationProgramStateStack } from '../../vm/vm-types'; import { ResolvedScript, ScriptReductionTraceScriptNode } from './language-types'; /** * Perform the standard verification of BTL evaluation results. This ensures * that evaluations complete as expected: if an error occurs while computing an * evaluation, script compilation should fail. * * Three requirements are enforced: * - the evaluation may not produce an `error` * - the resulting stack must contain exactly 1 item * - the resulting execution stack must be empty (no missing `OP_ENDIF`s) * * This differs from the virtual machine's built-in `vm.verify` in that it is * often more lenient, for example, evaluations can succeed with an non-truthy * value on top of the stack. * * @param state - the final program state to verify */ export declare const verifyBtlEvaluationState: & AuthenticationProgramStateExecutionStack & AuthenticationProgramStateError>(state: ProgramState) => unknown; /** * Reduce a resolved script, returning the resulting bytecode and a trace of the * reduction process. * * This method will return an error if provided a `resolvedScript` with * resolution errors. To check for resolution errors, use `getResolutionErrors`. * * @param resolvedScript - the `CompiledScript` to reduce * @param vm - the `AuthenticationVirtualMachine` to use for evaluations * @param createEvaluationProgram - a method which accepts the compiled bytecode * of an evaluation and returns the authentication program used to evaluate it */ export declare const reduceScript: & AuthenticationProgramStateExecutionStack & AuthenticationProgramStateError, AuthenticationProgram>(resolvedScript: ResolvedScript, vm?: AuthenticationVirtualMachine | undefined, createEvaluationProgram?: ((instructions: Uint8Array) => AuthenticationProgram) | undefined) => ScriptReductionTraceScriptNode; //# sourceMappingURL=reduce.d.ts.map