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 
43 class AcceptedLedgerTx : public CountedObject<AcceptedLedgerTx>
44 {
45 public:
47  std::shared_ptr<ReadView const> const& ledger,
50 
52  getTxn() const
53  {
54  return mTxn;
55  }
56  TxMeta const&
57  getMeta() const
58  {
59  return mMeta;
60  }
61 
62  boost::container::flat_set<AccountID> const&
63  getAffected() const
64  {
65  return mAffected;
66  }
67 
68  TxID
70  {
71  return mTxn->getTransactionID();
72  }
73  TxType
74  getTxnType() const
75  {
76  return mTxn->getTxnType();
77  }
78  TER
79  getResult() const
80  {
81  return mMeta.getResultTER();
82  }
84  getTxnSeq() const
85  {
86  return mMeta.getIndex();
87  }
89  getEscMeta() const;
90 
91  Json::Value const&
92  getJson() const
93  {
94  return mJson;
95  }
96 
97 private:
100  boost::container::flat_set<AccountID> mAffected;
103 };
104 
105 } // namespace ripple
106 
107 #endif
ripple::AcceptedLedgerTx::mMeta
TxMeta mMeta
Definition: AcceptedLedgerTx.h:99
ripple::AcceptedLedgerTx::getJson
Json::Value const & getJson() const
Definition: AcceptedLedgerTx.h:92
ripple::CountedObject
Tracks the number of instances of an object.
Definition: CountedObject.h:124
std::string
STL class.
std::shared_ptr
STL class.
ripple::AcceptedLedgerTx::getTxn
std::shared_ptr< STTx const > const & getTxn() const
Definition: AcceptedLedgerTx.h:52
ripple::AcceptedLedgerTx::getTransactionID
TxID getTransactionID() const
Definition: AcceptedLedgerTx.h:69
ripple::AcceptedLedgerTx::mJson
Json::Value mJson
Definition: AcceptedLedgerTx.h:102
std::vector< unsigned char >
ripple::TxType
TxType
Transaction type identifiers.
Definition: TxFormats.h:56
ripple::TxMeta
Definition: TxMeta.h:32
ripple::AcceptedLedgerTx::getTxnType
TxType getTxnType() const
Definition: AcceptedLedgerTx.h:74
ripple::base_uint< 256 >
ripple::TxMeta::getResultTER
TER getResultTER() const
Definition: TxMeta.h:68
ripple::TERSubset< CanCvtToTER >
ripple::AcceptedLedgerTx
A transaction that is in a closed ledger.
Definition: AcceptedLedgerTx.h:43
ripple::AcceptedLedgerTx::getAffected
boost::container::flat_set< AccountID > const & getAffected() const
Definition: AcceptedLedgerTx.h:63
std::uint32_t
ripple::AcceptedLedgerTx::getResult
TER getResult() const
Definition: AcceptedLedgerTx.h:79
ripple::AcceptedLedgerTx::mRawMeta
Blob mRawMeta
Definition: AcceptedLedgerTx.h:101
ripple::AcceptedLedgerTx::getEscMeta
std::string getEscMeta() const
Definition: AcceptedLedgerTx.cpp:77
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:84
ripple::AcceptedLedgerTx::mTxn
std::shared_ptr< STTx const > mTxn
Definition: AcceptedLedgerTx.h:98
ripple::AcceptedLedgerTx::getMeta
TxMeta const & getMeta() const
Definition: AcceptedLedgerTx.h:57
ripple::AcceptedLedgerTx::AcceptedLedgerTx
AcceptedLedgerTx(std::shared_ptr< ReadView const > const &ledger, std::shared_ptr< STTx const > const &, std::shared_ptr< STObject const > const &)
Definition: AcceptedLedgerTx.cpp:28
ripple::AcceptedLedgerTx::mAffected
boost::container::flat_set< AccountID > mAffected
Definition: AcceptedLedgerTx.h:100
ripple::TxMeta::getIndex
std::uint32_t getIndex() const
Definition: TxMeta.h:73
Json::Value
Represents a JSON value.
Definition: json_value.h:145