rippled
Loading...
Searching...
No Matches
SetSignerList.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2014 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_SETSIGNERLIST_H_INCLUDED
21#define RIPPLE_TX_SETSIGNERLIST_H_INCLUDED
22
23#include <xrpld/app/ledger/Ledger.h>
24#include <xrpld/app/tx/detail/SignerEntries.h>
25#include <xrpld/app/tx/detail/Transactor.h>
26#include <xrpl/basics/Log.h>
27#include <xrpl/protocol/Indexes.h>
28#include <xrpl/protocol/Rules.h>
29#include <xrpl/protocol/STArray.h>
30#include <xrpl/protocol/STObject.h>
31#include <xrpl/protocol/STTx.h>
32#include <algorithm>
33#include <cstdint>
34#include <vector>
35
36namespace ripple {
37
43{
44private:
45 // Values determined during preCompute for use later.
50
51public:
53
55 {
56 }
57
58 static NotTEC
59 preflight(PreflightContext const& ctx);
60
61 TER
62 doApply() override;
63 void
64 preCompute() override;
65
66 // Interface used by DeleteAccount
67 static TER
69 Application& app,
71 AccountID const& account,
73
74private:
75 static std::tuple<
76 NotTEC,
81
82 static NotTEC
84 std::uint32_t quorum,
86 AccountID const& account,
88 Rules const&);
89
90 TER
92 TER
94
95 void
96 writeSignersToSLE(SLE::pointer const& ledgerEntry, std::uint32_t flags)
97 const;
98};
99
101
102} // namespace ripple
103
104#endif
A generic endpoint for log messages.
Definition: Journal.h:59
State information when applying a tx.
Definition: ApplyContext.h:36
Writeable view to a ledger, for applying a transaction.
Definition: ApplyView.h:140
Rules controlling protocol behavior.
Definition: Rules.h:35
See the README.md for an overview of the SetSignerList transaction that this class implements.
Definition: SetSignerList.h:43
void writeSignersToSLE(SLE::pointer const &ledgerEntry, std::uint32_t flags) const
SetSignerList(ApplyContext &ctx)
Definition: SetSignerList.h:54
static NotTEC preflight(PreflightContext const &ctx)
static constexpr ConsequencesFactoryType ConsequencesFactory
Definition: SetSignerList.h:52
static NotTEC validateQuorumAndSignerEntries(std::uint32_t quorum, std::vector< SignerEntries::SignerEntry > const &signers, AccountID const &account, beast::Journal j, Rules const &)
void preCompute() override
static TER removeFromLedger(Application &app, ApplyView &view, AccountID const &account, beast::Journal j)
TER doApply() override
std::uint32_t quorum_
Definition: SetSignerList.h:48
std::vector< SignerEntries::SignerEntry > signers_
Definition: SetSignerList.h:49
static std::tuple< NotTEC, std::uint32_t, std::vector< SignerEntries::SignerEntry >, Operation > determineOperation(STTx const &tx, ApplyFlags flags, beast::Journal j)
ApplyView & view()
Definition: Transactor.h:107
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
ApplyFlags
Definition: ApplyView.h:30
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:587
State information when preflighting a tx.
Definition: Transactor.h:32