rippled
Loading...
Searching...
No Matches
balance.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_TEST_JTX_BALANCE_H_INCLUDED
21#define RIPPLE_TEST_JTX_BALANCE_H_INCLUDED
22
23#include <test/jtx/Env.h>
24#include <test/jtx/tags.h>
25
26namespace ripple {
27namespace test {
28namespace jtx {
29
39{
40private:
41 bool const none_;
44
45public:
46 balance(Account const& account, none_t)
47 : none_(true), account_(account), value_(XRP)
48 {
49 }
50
51 balance(Account const& account, None const& value)
52 : none_(true), account_(account), value_(value.asset)
53 {
54 }
55
56 balance(Account const& account, STAmount const& value)
57 : none_(false), account_(account), value_(value)
58 {
59 }
60
61 void
62 operator()(Env&) const;
63};
64
65} // namespace jtx
66} // namespace test
67} // namespace ripple
68
69#endif
Immutable cryptographic account descriptor.
Definition Account.h:39
A transaction testing environment.
Definition Env.h:121
A balance matches.
Definition balance.h:39
balance(Account const &account, STAmount const &value)
Definition balance.h:56
void operator()(Env &) const
Definition balance.cpp:85
Account const account_
Definition balance.h:42
STAmount const value_
Definition balance.h:43
balance(Account const &account, none_t)
Definition balance.h:46
balance(Account const &account, None const &value)
Definition balance.h:51
XRP_t const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:111
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25