20 #ifndef RIPPLE_TEST_JTX_ORACLE_H_INCLUDED
21 #define RIPPLE_TEST_JTX_ORACLE_H_INCLUDED
23 #include <date/date.h>
98 // Global fee if not 0
99 static inline std::uint32_t fee = 0;
102 std::uint32_t documentID_;
107 Json::Value const& jv,
108 std::optional<jtx::msig> const& msig,
109 std::optional<jtx::seq> const& seq,
110 std::optional<ter> const& err);
113 Oracle(Env& env, CreateArg const& arg, bool submit = true);
116 remove(RemoveArg const& arg);
119 set(CreateArg const& arg);
121 set(UpdateArg const& arg);
126 std::optional<std::string> const& baseAsset,
127 std::optional<std::string> const& quoteAsset,
128 std::optional<std::vector<std::pair<Account, std::uint32_t>>> const&
129 oracles = std::nullopt,
130 std::optional<std::uint8_t> const& trim = std::nullopt,
131 std::optional<std::uint8_t> const& timeTreshold = std::nullopt);
142 return exists(env_, owner_, documentID_);
145 [[nodiscard]] static bool
146 exists(Env& env, AccountID const& account, std::uint32_t documentID);
149 expectPrice(DataSeries const& pricess) const;
152 expectLastUpdateTime(std::uint32_t lastUpdateTime) const;
157 AccountID const& account,
158 std::variant<std::uint32_t, std::string> const& documentID,
159 std::optional<std::string> const& index = std::nullopt);
162 ledgerEntry(std::optional<std::string> const& index = std::nullopt) const
164 return Oracle::ledgerEntry(env_, owner_, documentID_, index);
168 setFee(std::uint32_t f)
174 operator<<(std::ostream& strm, Oracle const& oracle)
176 strm << oracle.ledgerEntry().toStyledString();
181 } // namespace oracle
184 } // namespace ripple
186 #endif // RIPPLE_TEST_JTX_ORACLE_H_INCLUDED
std::vector< std::tuple< std::string, std::string, std::optional< std::uint32_t >, std::optional< std::uint8_t > >> DataSeries
std::optional< std::string > provider
std::optional< std::uint32_t > lastUpdateTime
Keylet oracle(AccountID const &account, std::uint32_t const &documentID) noexcept
Set a multisignature on a JTx.
std::optional< AccountID > owner
std::optional< std::string > assetClass
constexpr static std::chrono::seconds epoch_offset
Clock for measuring the network time.
std::optional< AccountID > const & owner
std::optional< std::uint32_t > lastUpdateTime
constexpr static std::chrono::seconds testStartTime
std::optional< std::string > uri
Set the sequence number on a JTx.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::optional< ter > const & err
std::optional< std::uint32_t > documentID
std::optional< AccountID > owner
std::optional< std::uint32_t > documentID
std::optional< std::uint32_t > const & documentID
std::optional< std::string > uri
std::optional< std::string > provider
std::optional< std::string > assetClass