rippled
ripple
app
tx
impl
SignerEntries.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_IMPL_SIGNER_ENTRIES_H_INCLUDED
21
#define RIPPLE_TX_IMPL_SIGNER_ENTRIES_H_INCLUDED
22
23
#include <ripple/app/tx/impl/Transactor.h>
// NotTEC
24
#include <ripple/basics/Expected.h>
//
25
#include <ripple/beast/utility/Journal.h>
// beast::Journal
26
#include <ripple/protocol/STTx.h>
// STTx::maxMultiSigners
27
#include <ripple/protocol/TER.h>
// temMALFORMED
28
#include <ripple/protocol/UintTypes.h>
// AccountID
29
30
namespace
ripple
{
31
32
// Forward declarations
33
class
STObject;
34
35
// Support for SignerEntries that is needed by a few Transactors
36
class
SignerEntries
37
{
38
public
:
39
explicit
SignerEntries
() =
default
;
40
41
struct
SignerEntry
42
{
43
AccountID
account
;
44
std::uint16_t
weight
;
45
46
SignerEntry
(
AccountID
const
& inAccount,
std::uint16_t
inWeight)
47
:
account
(inAccount),
weight
(inWeight)
48
{
49
}
50
51
// For sorting to look for duplicate accounts
52
friend
bool
53
operator<
(
SignerEntry
const
& lhs,
SignerEntry
const
& rhs)
54
{
55
return
lhs.
account
< rhs.
account
;
56
}
57
58
friend
bool
59
operator==
(
SignerEntry
const
& lhs,
SignerEntry
const
& rhs)
60
{
61
return
lhs.
account
== rhs.
account
;
62
}
63
};
64
65
// Deserialize a SignerEntries array from the network or from the ledger.
66
static
Expected<std::vector<SignerEntry>
,
NotTEC
>
67
deserialize
(
68
STObject
const
& obj,
69
beast::Journal
journal,
70
std::string
const
& annotation);
71
};
72
73
}
// namespace ripple
74
75
#endif // RIPPLE_TX_IMPL_SIGNER_ENTRIES_H_INCLUDED
std::string
STL class.
ripple::SignerEntries::deserialize
static Expected< std::vector< SignerEntry >, NotTEC > deserialize(STObject const &obj, beast::Journal journal, std::string const &annotation)
Definition:
SignerEntries.cpp:29
ripple::SignerEntries
Definition:
SignerEntries.h:36
ripple::SignerEntries::SignerEntry
Definition:
SignerEntries.h:41
ripple::SignerEntries::SignerEntry::account
AccountID account
Definition:
SignerEntries.h:43
ripple::base_uint< 160, detail::AccountIDTag >
ripple::Expected
Definition:
Expected.h:129
ripple::SignerEntries::SignerEntry::weight
std::uint16_t weight
Definition:
SignerEntries.h:44
ripple::SignerEntries::SignerEntry::operator==
friend bool operator==(SignerEntry const &lhs, SignerEntry const &rhs)
Definition:
SignerEntries.h:59
ripple::TERSubset
Definition:
TER.h:327
beast::Journal
A generic endpoint for log messages.
Definition:
Journal.h:58
std::uint16_t
ripple::SignerEntries::SignerEntry::operator<
friend bool operator<(SignerEntry const &lhs, SignerEntry const &rhs)
Definition:
SignerEntries.h:53
ripple::STObject
Definition:
STObject.h:51
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition:
RCLCensorshipDetector.h:29
ripple::SignerEntries::SignerEntry::SignerEntry
SignerEntry(AccountID const &inAccount, std::uint16_t inWeight)
Definition:
SignerEntries.h:46
ripple::SignerEntries::SignerEntries
SignerEntries()=default
Generated by
1.8.17