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  {
72  return mTxn;
73  }
75  {
76  return mMeta;
77  }
78 
79  boost::container::flat_set<AccountID> const&
80  getAffected() const
81  {
82  return mAffected;
83  }
84 
86  {
87  return mTxn->getTransactionID ();
88  }
89  TxType getTxnType () const
90  {
91  return mTxn->getTxnType ();
92  }
93  TER getResult () const
94  {
95  return mResult;
96  }
98  {
99  return mMeta->getIndex ();
100  }
101 
102  bool isApplied () const
103  {
104  return bool(mMeta);
105  }
106  int getIndex () const
107  {
108  return mMeta ? mMeta->getIndex () : 0;
109  }
110  std::string getEscMeta () const;
112  {
113  return mJson;
114  }
115 
116 private:
121  boost::container::flat_set<AccountID> mAffected;
126 
127  void buildJson ();
128 };
129 
130 } // ripple
131 
132 #endif
std::string
STL class.
std::shared_ptr
STL class.
ripple::AcceptedLedgerTx::mLedger
std::shared_ptr< ReadView const > mLedger
Definition: AcceptedLedgerTx.h:117
ripple::Logs
Manages partitions for logging.
Definition: Log.h:49
ripple::AcceptedLedgerTx::getTxn
std::shared_ptr< STTx const > const & getTxn() const
Definition: AcceptedLedgerTx.h:70
ripple::AcceptedLedgerTx::getTransactionID
TxID getTransactionID() const
Definition: AcceptedLedgerTx.h:85
ripple::AcceptedLedgerTx::mJson
Json::Value mJson
Definition: AcceptedLedgerTx.h:123
std::vector< unsigned char >
ripple::AcceptedLedgerTx::getIndex
int getIndex() const
Definition: AcceptedLedgerTx.h:106
ripple::AccountIDCache
Caches the base58 representations of AccountIDs.
Definition: AccountID.h:150
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:125
ripple::AcceptedLedgerTx::getTxnType
TxType getTxnType() const
Definition: AcceptedLedgerTx.h:89
ripple::base_uint< 256 >
ripple::AcceptedLedgerTx::accountCache_
AccountIDCache const & accountCache_
Definition: AcceptedLedgerTx.h:124
ripple::AcceptedLedgerTx::getMeta
std::shared_ptr< TxMeta > const & getMeta() const
Definition: AcceptedLedgerTx.h:74
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:80
std::uint32_t
ripple::AcceptedLedgerTx::getResult
TER getResult() const
Definition: AcceptedLedgerTx.h:93
ripple::AcceptedLedgerTx::mRawMeta
Blob mRawMeta
Definition: AcceptedLedgerTx.h:122
ripple::AcceptedLedgerTx::getEscMeta
std::string getEscMeta() const
Definition: AcceptedLedgerTx.cpp:71
ripple::AcceptedLedgerTx::buildJson
void buildJson()
Definition: AcceptedLedgerTx.cpp:77
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:97
ripple::AcceptedLedgerTx::mTxn
std::shared_ptr< STTx const > mTxn
Definition: AcceptedLedgerTx.h:118
ripple::AcceptedLedgerTx::isApplied
bool isApplied() const
Definition: AcceptedLedgerTx.h:102
ripple::AcceptedLedgerTx::mMeta
std::shared_ptr< TxMeta > mMeta
Definition: AcceptedLedgerTx.h:119
ripple::AcceptedLedgerTx::mAffected
boost::container::flat_set< AccountID > mAffected
Definition: AcceptedLedgerTx.h:121
ripple::AcceptedLedgerTx::getJson
Json::Value getJson() const
Definition: AcceptedLedgerTx.h:111
ripple::AcceptedLedgerTx::mResult
TER mResult
Definition: AcceptedLedgerTx.h:120
Json::Value
Represents a JSON value.
Definition: json_value.h:141