mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-23 15:20:54 +00:00
feat: Hook up le_arr_len host function
This commit is contained in:
@@ -313,6 +313,23 @@ HostContext::getCurrentLedgerObjArrayLen(std::int32_t field) const noexcept
|
||||
});
|
||||
}
|
||||
|
||||
std::int32_t
|
||||
HostContext::getLedgerObjArrayLen(std::int32_t cacheIdx, std::int32_t field) const noexcept
|
||||
{
|
||||
return guarded(hostFunctions_.getJournal(), kHostInternal, [&] {
|
||||
auto const& knownSFields = SField::getKnownCodeToField();
|
||||
auto const it = knownSFields.find(field);
|
||||
if (it == knownSFields.end())
|
||||
return hfErrorToInt(HostFunctionError::InvalidField);
|
||||
|
||||
auto const len = hostFunctions_.getLedgerObjArrayLen(cacheIdx, *it->second);
|
||||
if (!len)
|
||||
return hfErrorToInt(len.error());
|
||||
|
||||
return *len;
|
||||
});
|
||||
}
|
||||
|
||||
std::int32_t
|
||||
HostContext::sha512Half(rust::Slice<std::uint8_t const> data, rust::Slice<std::uint8_t> out)
|
||||
const noexcept
|
||||
|
||||
Reference in New Issue
Block a user