mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-21 22:30:57 +00:00
feat: Hook up home_le_inner host function
This commit is contained in:
@@ -234,6 +234,28 @@ HostContext::getTxNestedField(
|
||||
});
|
||||
}
|
||||
|
||||
std::int32_t
|
||||
HostContext::getCurrentLedgerObjNestedField(
|
||||
rust::Slice<std::uint8_t const> locator,
|
||||
rust::Slice<std::uint8_t> out) const noexcept
|
||||
{
|
||||
return guarded(hostFunctions_.getJournal(), kHostInternal, [&] {
|
||||
if (locator.empty() || (locator.size() & 3) != 0)
|
||||
return hfErrorToInt(HostFunctionError::LocatorMalformed);
|
||||
|
||||
std::uint32_t const steps = locator.size() / sizeof(std::int32_t);
|
||||
std::vector<std::int32_t> locBuf(steps);
|
||||
std::memcpy(locBuf.data(), locator.data(), locator.size());
|
||||
FieldLocator const fl(std::move(locBuf));
|
||||
|
||||
auto const value = hostFunctions_.getCurrentLedgerObjNestedField(fl);
|
||||
if (!value)
|
||||
return hfErrorToInt(value.error());
|
||||
|
||||
return answer(out, value->data(), value->size());
|
||||
});
|
||||
}
|
||||
|
||||
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