rippled
AcceptedLedgerTx.h
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 #ifndef RIPPLE_APP_LEDGER_ACCEPTEDLEDGERTX_H_INCLUDED
21 #define RIPPLE_APP_LEDGER_ACCEPTEDLEDGERTX_H_INCLUDED
22 
23 #include <ripple/app/ledger/Ledger.h>
24 #include <ripple/protocol/AccountID.h>
25 #include <boost/container/flat_set.hpp>
26 
27 namespace ripple {
28 
29 class Logs;
30 
51 {
52 public:
54  using ref = const pointer&;
55 
56 public:
58  std::shared_ptr<ReadView const> const& ledger,
61  AccountIDCache const&,
62  Logs&);
66  TER,
67  AccountIDCache const&,
68  Logs&);
69 
71  getTxn() const
72  {
73  return mTxn;
74  }
76  getMeta() const
77  {
78  return mMeta;
79  }
80 
81  boost::container::flat_set<AccountID> const&
82  getAffected() const
83  {
84  return mAffected;
85  }
86 
87  TxID
89  {
90  return mTxn->getTransactionID();
91  }
92  TxType
93  getTxnType() const
94  {
95  return mTxn->getTxnType();
96  }
97  TER
98  getResult() const
99  {
100  return mResult;
101  }
103  getTxnSeq() const
104  {
105  return mMeta->getIndex();
106  }
107 
108  bool
109  isApplied() const
110  {
111  return bool(mMeta);
112  }
113  int
114  getIndex() const
115  {
116  return mMeta ? mMeta->getIndex() : 0;
117  }
119  getEscMeta() const;
121  getJson() const
122  {
123  return mJson;
124  }
125 
126 private:
131  boost::container::flat_set<AccountID> mAffected;
136 
137  void
138  buildJson();
139 };
140 
141 } // namespace ripple
142 
143 #endif
std::string
STL class.
std::shared_ptr
STL class.
ripple::AcceptedLedgerTx::mLedger
std::shared_ptr< ReadView const > mLedger
Definition: AcceptedLedgerTx.h:127
ripple::Logs
Manages partitions for logging.
Definition: Log.h:48
ripple::AcceptedLedgerTx::getTxn
std::shared_ptr< STTx const > const & getTxn() const
Definition: AcceptedLedgerTx.h:71
ripple::AcceptedLedgerTx::getTransactionID
TxID getTransactionID() const
Definition: AcceptedLedgerTx.h:88
ripple::AcceptedLedgerTx::mJson
Json::Value mJson
Definition: AcceptedLedgerTx.h:133
std::vector< unsigned char >
ripple::AcceptedLedgerTx::getIndex
int getIndex() const
Definition: AcceptedLedgerTx.h:114
ripple::AccountIDCache
Caches the base58 representations of AccountIDs.
Definition: AccountID.h:118
ripple::AcceptedLedgerTx::AcceptedLedgerTx
AcceptedLedgerTx(std::shared_ptr< ReadView const > const &ledger, std::shared_ptr< STTx const > const &, std::shared_ptr< STObject const > const &, AccountIDCache const &, Logs &)
Definition: AcceptedLedgerTx.cpp:29
ripple::AcceptedLedgerTx::logs_
Logs & logs_
Definition: AcceptedLedgerTx.h:135
ripple::AcceptedLedgerTx::getTxnType
TxType getTxnType() const
Definition: AcceptedLedgerTx.h:93
ripple::base_uint
Integers of any length that is a multiple of 32-bits.
Definition: base_uint.h:73
ripple::AcceptedLedgerTx::accountCache_
AccountIDCache const & accountCache_
Definition: AcceptedLedgerTx.h:134
ripple::AcceptedLedgerTx::getMeta
std::shared_ptr< TxMeta > const & getMeta() const
Definition: AcceptedLedgerTx.h:76
ripple::TERSubset< CanCvtToTER >
ripple::AcceptedLedgerTx
A transaction that is in a closed ledger.
Definition: AcceptedLedgerTx.h:50
ripple::AcceptedLedgerTx::getAffected
boost::container::flat_set< AccountID > const & getAffected() const
Definition: AcceptedLedgerTx.h:82
std::uint32_t
ripple::AcceptedLedgerTx::getResult
TER getResult() const
Definition: AcceptedLedgerTx.h:98
ripple::AcceptedLedgerTx::mRawMeta
Blob mRawMeta
Definition: AcceptedLedgerTx.h:132
ripple::AcceptedLedgerTx::getEscMeta
std::string getEscMeta() const
Definition: AcceptedLedgerTx.cpp:74
ripple::AcceptedLedgerTx::buildJson
void buildJson()
Definition: AcceptedLedgerTx.cpp:81
ripple::TxType
TxType
Transaction type identifiers.
Definition: TxFormats.h:33
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::AcceptedLedgerTx::getTxnSeq
std::uint32_t getTxnSeq() const
Definition: AcceptedLedgerTx.h:103
ripple::AcceptedLedgerTx::mTxn
std::shared_ptr< STTx const > mTxn
Definition: AcceptedLedgerTx.h:128
ripple::AcceptedLedgerTx::isApplied
bool isApplied() const
Definition: AcceptedLedgerTx.h:109
ripple::AcceptedLedgerTx::mMeta
std::shared_ptr< TxMeta > mMeta
Definition: AcceptedLedgerTx.h:129
ripple::AcceptedLedgerTx::mAffected
boost::container::flat_set< AccountID > mAffected
Definition: AcceptedLedgerTx.h:131
ripple::AcceptedLedgerTx::getJson
Json::Value getJson() const
Definition: AcceptedLedgerTx.h:121
ripple::AcceptedLedgerTx::mResult
TER mResult
Definition: AcceptedLedgerTx.h:130
Json::Value
Represents a JSON value.
Definition: json_value.h:145