#include #include #include #include #include #include #include #include namespace xrpl { // ========================================================= // SECTION: LEDGER HEADER FUNCTIONS // ========================================================= Expected WasmHostFunctionsImpl::getLedgerSqn() const { return ctx_.view().seq(); } Expected WasmHostFunctionsImpl::getParentLedgerTime() const { return ctx_.view().parentCloseTime().time_since_epoch().count(); } Expected WasmHostFunctionsImpl::getParentLedgerHash() const { return ctx_.view().header().parentHash; } Expected WasmHostFunctionsImpl::getBaseFee() const { return ctx_.view().fees().base.drops(); } Expected WasmHostFunctionsImpl::isAmendmentEnabled(uint256 const& amendmentId) const { return ctx_.view().rules().enabled(amendmentId); } Expected WasmHostFunctionsImpl::isAmendmentEnabled(std::string_view const& amendmentName) const { auto const& table = ctx_.registry.get().getAmendmentTable(); auto const amendment = table.find(std::string(amendmentName)); return ctx_.view().rules().enabled(amendment); } } // namespace xrpl