remove otxn_field_txt api (old api that should have been removed earlier)

This commit is contained in:
Richard Holland
2022-12-06 11:19:28 +00:00
parent 7f71535773
commit 7ca435d8f7
4 changed files with 21 additions and 67 deletions

View File

@@ -278,7 +278,6 @@ namespace hook_api
"ledger_keylet",
"otxn_burden",
"otxn_field",
"otxn_field_txt",
"otxn_slot",
"otxn_generation",
"otxn_id",

View File

@@ -193,7 +193,6 @@ namespace hook_api
DECLARE_HOOK_FUNCNARG(int64_t, otxn_burden );
DECLARE_HOOK_FUNCTION(int64_t, otxn_field, uint32_t write_ptr, uint32_t write_len, uint32_t field_id );
DECLARE_HOOK_FUNCTION(int64_t, otxn_field_txt, uint32_t write_ptr, uint32_t write_len, uint32_t field_id );
DECLARE_HOOK_FUNCNARG(int64_t, otxn_generation );
DECLARE_HOOK_FUNCTION(int64_t, otxn_id, uint32_t write_ptr, uint32_t write_len, uint32_t flags );
DECLARE_HOOK_FUNCNARG(int64_t, otxn_type );
@@ -575,7 +574,6 @@ namespace hook
ADD_HOOK_FUNCTION(otxn_burden, ctx);
ADD_HOOK_FUNCTION(otxn_generation, ctx);
ADD_HOOK_FUNCTION(otxn_field_txt, ctx);
ADD_HOOK_FUNCTION(otxn_field, ctx);
ADD_HOOK_FUNCTION(otxn_id, ctx);
ADD_HOOK_FUNCTION(otxn_type, ctx);

View File

@@ -1932,43 +1932,6 @@ DEFINE_HOOK_FUNCNARG(
).count();
}
// Dump a field in 'full text' form into the hook's memory
DEFINE_HOOK_FUNCTION(
int64_t,
otxn_field_txt,
uint32_t write_ptr, uint32_t write_len,
uint32_t field_id )
{
HOOK_SETUP(); // populates memory_ctx, memory, memory_length, applyCtx, hookCtx on current stack
if (NOT_IN_BOUNDS(write_ptr, write_len, memory_length))
return OUT_OF_BOUNDS;
SField const& fieldType = ripple::SField::getField( field_id );
if (fieldType == sfInvalid)
return INVALID_FIELD;
if (!applyCtx.tx.isFieldPresent(fieldType))
return DOESNT_EXIST;
auto const& field =
hookCtx.emitFailure
? hookCtx.emitFailure->getField(fieldType)
: const_cast<ripple::STTx&>(applyCtx.tx).getField(fieldType);
std::string out = field.getText();
if (out.size() > write_len)
return TOO_SMALL;
WRITE_WASM_MEMORY_AND_RETURN(
write_ptr, write_len,
out.data(), out.size(),
memory, memory_length);
}
// Dump a field from the originating transaction into the hook's memory
DEFINE_HOOK_FUNCTION(
int64_t,

View File

@@ -4031,11 +4031,6 @@ public:
{
}
void
test_otxn_field_txt()
{
}
void
test_otxn_generation()
{
@@ -7400,11 +7395,11 @@ public:
test_float_sign(); //
test_float_sto();
test_float_sto_set();
test_float_sum(); //
test_float_sum(); //
test_hook_account(); //
test_hook_account(); //
test_hook_again();
test_hook_hash(); //
test_hook_hash(); //
test_hook_param();
test_hook_param_set();
test_hook_pos();
@@ -7420,32 +7415,31 @@ public:
test_otxn_burden();
test_otxn_field();
test_otxn_field_txt();
test_otxn_generation();
test_otxn_id();
test_otxn_slot();
test_otxn_type();
test_slot(); //
test_slot_clear(); //
test_slot_count(); //
test_slot(); //
test_slot_clear(); //
test_slot_count(); //
test_slot_float();
test_slot_set(); //
test_slot_size(); //
test_slot_subarray(); //
test_slot_subfield();
test_slot_type();
test_slot_set(); //
test_slot_size(); //
test_slot_subarray(); //
test_slot_subfield(); //
test_slot_type(); //
test_state();
test_state_foreign();
test_state_foreign_set();
test_state_set();
test_sto_emplace(); //
test_sto_erase(); //
test_sto_subarray(); //
test_sto_subfield(); //
test_sto_validate(); //
test_sto_emplace(); //
test_sto_erase(); //
test_sto_subarray(); //
test_sto_subfield(); //
test_sto_validate(); //
test_str_compare();
test_str_concat();
@@ -7456,11 +7450,11 @@ public:
test_trace_float();
test_trace_num();
test_util_accid(); //
test_util_keylet(); //
test_util_raddr(); //
test_util_sha512h(); //
test_util_verify(); //
test_util_accid(); //
test_util_keylet(); //
test_util_raddr(); //
test_util_sha512h(); //
test_util_verify(); //
}
private: