js otxn_type

This commit is contained in:
Richard Holland
2024-05-09 11:15:18 +10:00
committed by RichardAH
parent f9137000e3
commit ec7d603bf9
3 changed files with 31 additions and 1 deletions

View File

@@ -2528,6 +2528,21 @@ DEFINE_WASM_FUNCNARG(int64_t, otxn_type)
WASM_HOOK_TEARDOWN();
}
DEFINE_JS_FUNCNARG(
JSValue,
otxn_type)
{
JS_HOOK_SETUP();
if (hookCtx.emitFailure)
returnJS(safe_cast<TxType>(
hookCtx.emitFailure->getFieldU16(sfTransactionType)));
returnJS(applyCtx.tx.getTxnType());
JS_HOOK_TEARDOWN();
}
DEFINE_WASM_FUNCTION(int64_t, otxn_slot, uint32_t slot_into)
{
WASM_HOOK_SETUP(); // populates memory_ctx, memory, memory_length, applyCtx,