rippled
Loading...
Searching...
No Matches
memo.cpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#include <test/jtx/memo.h>
21#include <xrpl/basics/StringUtilities.h>
22#include <xrpl/protocol/jss.h>
23
24namespace ripple {
25namespace test {
26namespace jtx {
27
28void
30{
31 auto& jv = jt.jv;
32 auto& ma = jv["Memos"];
33 auto& mi = ma[ma.size()];
34 auto& m = mi["Memo"];
35 m["MemoData"] = strHex(data_);
36 m["MemoFormat"] = strHex(format_);
37 m["MemoType"] = strHex(type_);
38}
39
40void
42{
43 auto& jv = jt.jv;
44 auto& ma = jv["Memos"];
45 auto& mi = ma[ma.size()];
46 auto& m = mi["Memo"];
47 m["MemoData"] = strHex(s_);
48}
49
50void
52{
53 auto& jv = jt.jv;
54 auto& ma = jv["Memos"];
55 auto& mi = ma[ma.size()];
56 auto& m = mi["Memo"];
57 m["MemoFormat"] = strHex(s_);
58}
59
60void
62{
63 auto& jv = jt.jv;
64 auto& ma = jv["Memos"];
65 auto& mi = ma[ma.size()];
66 auto& m = mi["Memo"];
67 m["MemoType"] = strHex(s_);
68}
69
70void
72{
73 auto& jv = jt.jv;
74 auto& ma = jv["Memos"];
75 auto& mi = ma[ma.size()];
76 auto& m = mi["Memo"];
77 m["MemoFormat"] = strHex(format_);
78 m["MemoType"] = strHex(type_);
79}
80
81void
83{
84 auto& jv = jt.jv;
85 auto& ma = jv["Memos"];
86 auto& mi = ma[ma.size()];
87 auto& m = mi["Memo"];
88 m["MemoData"] = strHex(data_);
89 m["MemoType"] = strHex(type_);
90}
91
92void
94{
95 auto& jv = jt.jv;
96 auto& ma = jv["Memos"];
97 auto& mi = ma[ma.size()];
98 auto& m = mi["Memo"];
99 m["MemoData"] = strHex(data_);
100 m["MemoFormat"] = strHex(format_);
101}
102
103} // namespace jtx
104} // namespace test
105} // namespace ripple
A transaction testing environment.
Definition: Env.h:117
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:29
std::string data_
Definition: memo.h:37
std::string format_
Definition: memo.h:38
std::string type_
Definition: memo.h:39
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:41
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:51
std::string format_
Definition: memo.h:99
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:71
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:82
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:93
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:61
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
Execution context for applying a JSON transaction.
Definition: JTx.h:44
Json::Value jv
Definition: JTx.h:45