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
22namespace ripple {
23namespace test {
24namespace jtx {
25
26void
28{
29 auto& jv = jt.jv;
30 auto& ma = jv["Memos"];
31 auto& mi = ma[ma.size()];
32 auto& m = mi["Memo"];
33 m["MemoData"] = strHex(data_);
34 m["MemoFormat"] = strHex(format_);
35 m["MemoType"] = strHex(type_);
36}
37
38void
40{
41 auto& jv = jt.jv;
42 auto& ma = jv["Memos"];
43 auto& mi = ma[ma.size()];
44 auto& m = mi["Memo"];
45 m["MemoData"] = strHex(s_);
46}
47
48void
50{
51 auto& jv = jt.jv;
52 auto& ma = jv["Memos"];
53 auto& mi = ma[ma.size()];
54 auto& m = mi["Memo"];
55 m["MemoFormat"] = strHex(s_);
56}
57
58void
60{
61 auto& jv = jt.jv;
62 auto& ma = jv["Memos"];
63 auto& mi = ma[ma.size()];
64 auto& m = mi["Memo"];
65 m["MemoType"] = strHex(s_);
66}
67
68void
70{
71 auto& jv = jt.jv;
72 auto& ma = jv["Memos"];
73 auto& mi = ma[ma.size()];
74 auto& m = mi["Memo"];
75 m["MemoFormat"] = strHex(format_);
76 m["MemoType"] = strHex(type_);
77}
78
79void
81{
82 auto& jv = jt.jv;
83 auto& ma = jv["Memos"];
84 auto& mi = ma[ma.size()];
85 auto& m = mi["Memo"];
86 m["MemoData"] = strHex(data_);
87 m["MemoType"] = strHex(type_);
88}
89
90void
92{
93 auto& jv = jt.jv;
94 auto& ma = jv["Memos"];
95 auto& mi = ma[ma.size()];
96 auto& m = mi["Memo"];
97 m["MemoData"] = strHex(data_);
98 m["MemoFormat"] = strHex(format_);
99}
100
101} // namespace jtx
102} // namespace test
103} // namespace ripple
A transaction testing environment.
Definition: Env.h:118
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:27
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:39
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:49
std::string format_
Definition: memo.h:99
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:69
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:80
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:91
void operator()(Env &, JTx &jt) const
Definition: memo.cpp:59
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