rippled
Escrow.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_TX_ESCROW_H_INCLUDED
21 #define RIPPLE_TX_ESCROW_H_INCLUDED
22 
23 #include <ripple/app/tx/impl/Transactor.h>
24 
25 namespace ripple {
26 
27 class EscrowCreate : public Transactor
28 {
29 public:
30  explicit EscrowCreate(ApplyContext& ctx) : Transactor(ctx)
31  {
32  }
33 
34  static XRPAmount
35  calculateMaxSpend(STTx const& tx);
36 
37  static NotTEC
38  preflight(PreflightContext const& ctx);
39 
40  TER
41  doApply() override;
42 };
43 
44 //------------------------------------------------------------------------------
45 
46 class EscrowFinish : public Transactor
47 {
48 public:
49  explicit EscrowFinish(ApplyContext& ctx) : Transactor(ctx)
50  {
51  }
52 
53  static NotTEC
54  preflight(PreflightContext const& ctx);
55 
56  static FeeUnit64
57  calculateBaseFee(ReadView const& view, STTx const& tx);
58 
59  TER
60  doApply() override;
61 };
62 
63 //------------------------------------------------------------------------------
64 
65 class EscrowCancel : public Transactor
66 {
67 public:
68  explicit EscrowCancel(ApplyContext& ctx) : Transactor(ctx)
69  {
70  }
71 
72  static NotTEC
73  preflight(PreflightContext const& ctx);
74 
75  TER
76  doApply() override;
77 };
78 
79 } // namespace ripple
80 
81 #endif
ripple::EscrowFinish::calculateBaseFee
static FeeUnit64 calculateBaseFee(ReadView const &view, STTx const &tx)
Definition: Escrow.cpp:354
ripple::EscrowCancel::doApply
TER doApply() override
Definition: Escrow.cpp:528
ripple::Transactor
Definition: Transactor.h:86
ripple::EscrowCreate
Definition: Escrow.h:27
ripple::EscrowFinish::preflight
static NotTEC preflight(PreflightContext const &ctx)
Definition: Escrow.cpp:304
ripple::EscrowCreate::EscrowCreate
EscrowCreate(ApplyContext &ctx)
Definition: Escrow.h:30
ripple::EscrowCreate::calculateMaxSpend
static XRPAmount calculateMaxSpend(STTx const &tx)
Definition: Escrow.cpp:94
ripple::EscrowFinish::EscrowFinish
EscrowFinish(ApplyContext &ctx)
Definition: Escrow.h:49
ripple::TERSubset
Definition: TER.h:322
ripple::STTx
Definition: STTx.h:42
ripple::ApplyContext
State information when applying a tx.
Definition: ApplyContext.h:35
ripple::feeunit::TaggedFee
Definition: FeeUnits.h:70
ripple::EscrowCancel
Definition: Escrow.h:65
ripple::ReadView
A view into a ledger.
Definition: ReadView.h:188
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::EscrowCreate::preflight
static NotTEC preflight(PreflightContext const &ctx)
Definition: Escrow.cpp:100
ripple::EscrowFinish::doApply
TER doApply() override
Definition: Escrow.cpp:368
ripple::Transactor::view
ApplyView & view()
Definition: Transactor.h:107
ripple::EscrowCancel::preflight
static NotTEC preflight(PreflightContext const &ctx)
Definition: Escrow.cpp:515
ripple::EscrowCreate::doApply
TER doApply() override
Definition: Escrow.cpp:161
ripple::PreflightContext
State information when preflighting a tx.
Definition: Transactor.h:32
ripple::EscrowFinish
Definition: Escrow.h:46
ripple::EscrowCancel::EscrowCancel
EscrowCancel(ApplyContext &ctx)
Definition: Escrow.h:68
ripple::XRPAmount
Definition: XRPAmount.h:46