compiling

This commit is contained in:
Richard Holland
2024-04-22 13:48:36 +10:00
committed by RichardAH
parent 9ab33d580d
commit 71a6f9c4d5
7 changed files with 83 additions and 93 deletions

View File

@@ -1236,27 +1236,34 @@ hook::apply(
switch (hookApiVersion)
{
case 0: // wasm
case hook_api::CodeType::WASM:
{
HookExecutorWasm executor{hookCtx};
executor.executeWasm(
executor.execute(
bytecode.data(), (size_t)bytecode.size(), isCallback, hookArgument, j);
break;
}
case 1: // js
case hook_api::CodeType::JS:
{
// RHUPTO: populate hookArgument, bytecode, perform execution
HookExecutorJs executor{hookCtx};
HookExecutorJS executor{hookCtx};
executor.execute(
bytecode.data(), (size_t)bytecode.size(), isCallback, hookArgument, j);
js_std_eval_binary_bare(ctx, wasm.data(), wasm.size());
break;
}
default:
{
hookCtx.result.exitType = hook_api::ExitType::LEDGER_ERROR;
return hookCtx.result;
}
}
JLOG(j.trace()) << "HookInfo[" << HC_ACC() << "]: "