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  AccountIDCache const&);
51 
53  getTxn() const
54  {
55  return mTxn;
56  }
57  TxMeta const&
58  getMeta() const
59  {
60  return mMeta;
61  }
62 
63  boost::container::flat_set<AccountID> const&
64  getAffected() const
65  {
66  return mAffected;
67  }
68 
69  TxID
71  {
72  return mTxn->getTransactionID();
73  }
74  TxType
75  getTxnType() const
76  {
77  return mTxn->getTxnType();
78  }
79  TER
80  getResult() const
81  {
82  return mMeta.getResultTER();
83  }
85  getTxnSeq() const
86  {
87  return mMeta.getIndex();
88  }
90  getEscMeta() const;
91 
92  Json::Value const&
93  getJson() const
94  {
95  return mJson;
96  }
97 
98 private:
101  boost::container::flat_set<AccountID> mAffected;
104 };
105 
106 } // namespace ripple
107 
108 #endif
ripple::AcceptedLedgerTx::mMeta
TxMeta mMeta
Definition: AcceptedLedgerTx.h:100
ripple::AcceptedLedgerTx::getJson
Json::Value const & getJson() const
Definition: AcceptedLedgerTx.h:93
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:53
ripple::AcceptedLedgerTx::getTransactionID
TxID getTransactionID() const
Definition: AcceptedLedgerTx.h:70
ripple::AcceptedLedgerTx::mJson
Json::Value mJson
Definition: AcceptedLedgerTx.h:103
std::vector< unsigned char >
ripple::TxType
TxType
Transaction type identifiers.
Definition: TxFormats.h:56
ripple::AccountIDCache
Caches the base58 representations of AccountIDs.
Definition: AccountID.h:118
ripple::TxMeta
Definition: TxMeta.h:32
ripple::AcceptedLedgerTx::getTxnType
TxType getTxnType() const
Definition: AcceptedLedgerTx.h:75
ripple::base_uint
Integers of any length that is a multiple of 32-bits.
Definition: base_uint.h:75
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:64
std::uint32_t
ripple::AcceptedLedgerTx::getResult
TER getResult() const
Definition: AcceptedLedgerTx.h:80
ripple::AcceptedLedgerTx::mRawMeta
Blob mRawMeta
Definition: AcceptedLedgerTx.h:102
ripple::AcceptedLedgerTx::getEscMeta
std::string getEscMeta() const
Definition: AcceptedLedgerTx.cpp:78
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:85
ripple::AcceptedLedgerTx::mTxn
std::shared_ptr< STTx const > mTxn
Definition: AcceptedLedgerTx.h:99
ripple::AcceptedLedgerTx::getMeta
TxMeta const & getMeta() const
Definition: AcceptedLedgerTx.h:58
ripple::AcceptedLedgerTx::mAffected
boost::container::flat_set< AccountID > mAffected
Definition: AcceptedLedgerTx.h:101
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 &)
Definition: AcceptedLedgerTx.cpp:28
ripple::TxMeta::getIndex
std::uint32_t getIndex() const
Definition: TxMeta.h:73
Json::Value
Represents a JSON value.
Definition: json_value.h:145