20 #include <ripple/protocol/STIssue.h>
22 #include <ripple/basics/contract.h>
32 issue_.currency = sit.get160();
33 if (!
isXRP(issue_.currency))
34 issue_.account = sit.get160();
38 if (
isXRP(issue_.currency) !=
isXRP(issue_.account))
39 Throw<std::runtime_error>(
40 "invalid issue: currency and account native mismatch");
44 :
STBase{name}, issue_{issue}
46 if (
isXRP(issue_.currency) !=
isXRP(issue_.account))
47 Throw<std::runtime_error>(
48 "invalid issue: currency and account native mismatch");
80 return v && (*v == *
this);
92 return std::make_unique<STIssue>(sit, name);
104 return emplace(n, buf, std::move(*
this));
void add(Serializer &s) const override
A currency issued by an account.
STBase * copy(std::size_t n, void *buf) const override
SerializedTypeID getSType() const override
Json::Value getJson(JsonOptions) const override
static STBase * emplace(std::size_t n, void *buf, T &&val)
bool isEquivalent(const STBase &t) const override
std::string getText() const
AccountID const & xrpAccount()
Compute AccountID from public key.
bool isXRP(AccountID const &c)
Issue issueFromJson(Json::Value const &v)
static std::unique_ptr< STIssue > construct(SerialIter &, SField const &name)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
int addBitString(base_uint< Bits, Tag > const &v)
Json::Value to_json(Issue const &is)
A type which can be exported to a well known binary format.
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
std::string getText() const override
bool isDefault() const override
STBase * move(std::size_t n, void *buf) override