mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Tidy up sources
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/basics/containers/RangeSet.h>
|
||||
#include <ripple/validators/Manager.h>
|
||||
#include <cassert>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <ripple/nodestore/DummyScheduler.h>
|
||||
#include <ripple/nodestore/Manager.h>
|
||||
#include <ripple/overlay/make_Overlay.h>
|
||||
#include <ripple/validators/Manager.h>
|
||||
#include <fstream>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#include <ripple/module/app/misc/ProofOfWork.h>
|
||||
#include <ripple/module/app/misc/ProofOfWorkFactory.h>
|
||||
#include <ripple/module/data/protocol/Protocol.h>
|
||||
#include <ripple/unity/validators.h>
|
||||
#include <ripple/unity/peerfinder.h>
|
||||
#include <ripple/validators/Manager.h>
|
||||
|
||||
// VFALCO This is unfortunate. Comment this out and
|
||||
// just include what is needed.
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
template <class UnsignedIntegralType>
|
||||
static value_type createFromInteger (UnsignedIntegralType i)
|
||||
{
|
||||
static_bassert (size >= sizeof (UnsignedIntegralType));
|
||||
static_assert (size >= sizeof (UnsignedIntegralType), "");
|
||||
std::array <std::uint8_t, size> data;
|
||||
data.fill (0);
|
||||
i = beast::toNetworkByteOrder <UnsignedIntegralType> (i);
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_TYPES_RIPPLELEDGERHASH_H_INCLUDED
|
||||
#define RIPPLE_TYPES_RIPPLELEDGERHASH_H_INCLUDED
|
||||
|
||||
#include <ripple/types/api/SimpleIdentifier.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
/*
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_TYPES_SIMPLEIDENTIFIER_H_INCLUDED
|
||||
#define RIPPLE_TYPES_SIMPLEIDENTIFIER_H_INCLUDED
|
||||
|
||||
#include <ripple/types/api/base_uint.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
/** Provides common traits for non-signing identifiers like ledger hashes.
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <ripple/unity/websocket.h>
|
||||
#include <ripple/unity/resource.h>
|
||||
#include <ripple/unity/sitefiles.h>
|
||||
#include <ripple/unity/validators.h>
|
||||
|
||||
#include <ripple/http/Server.h>
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
|
||||
#include <ripple/unity/app.h>
|
||||
|
||||
#include <ripple/unity/validators.h>
|
||||
|
||||
#include <ripple/module/app/misc/PowResult.h>
|
||||
|
||||
#include <ripple/module/app/misc/ProofOfWorkFactory.h>
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <ripple/common/seconds_clock.h>
|
||||
#include <ripple/unity/peerfinder.h>
|
||||
#include <ripple/unity/resource.h>
|
||||
#include <ripple/unity/validators.h>
|
||||
#include <ripple/common/RippleSSLContext.h>
|
||||
|
||||
#include <deque>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <BeastConfig.h>
|
||||
|
||||
#if 0
|
||||
#include <ripple/unity/validators.h>
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
@@ -47,6 +48,7 @@
|
||||
#include <ripple/validators/impl/Validation.h>
|
||||
#include <ripple/validators/impl/Validator.h>
|
||||
#include <ripple/validators/impl/Logic.h>
|
||||
#endif
|
||||
|
||||
#include <ripple/validators/impl/Manager.cpp>
|
||||
#include <ripple/validators/impl/Source.cpp>
|
||||
@@ -56,3 +58,5 @@
|
||||
#include <ripple/validators/impl/StoreSqdb.cpp>
|
||||
#include <ripple/validators/impl/Tests.cpp>
|
||||
#include <ripple/validators/impl/Utilities.cpp>
|
||||
|
||||
//#include <ripple/validators/tests/validator.test.cpp>
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_VALIDATORS_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_H_INCLUDED
|
||||
|
||||
#include <beast/http/URL.h>
|
||||
|
||||
#include <ripple/unity/types.h>
|
||||
|
||||
#include <ripple/validators/api/Types.h>
|
||||
#include <ripple/validators/api/Source.h>
|
||||
#include <ripple/validators/api/Manager.h>
|
||||
|
||||
#endif
|
||||
@@ -20,8 +20,12 @@
|
||||
#ifndef RIPPLE_VALIDATORS_MANAGER_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_MANAGER_H_INCLUDED
|
||||
|
||||
#include <ripple/validators/Source.h>
|
||||
#include <ripple/validators/Types.h>
|
||||
#include <beast/threads/Stoppable.h>
|
||||
#include <beast/http/URL.h>
|
||||
#include <beast/module/core/files/File.h>
|
||||
#include <beast/utility/PropertyStream.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
@@ -20,8 +20,10 @@
|
||||
#ifndef RIPPLE_VALIDATORS_SOURCE_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_SOURCE_H_INCLUDED
|
||||
|
||||
#include <ripple/types/api/RipplePublicKey.h>
|
||||
#include <beast/smart_ptr/SharedObject.h>
|
||||
#include <beast/module/core/time/Time.h>
|
||||
#include <beast/utility/Journal.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
@@ -1 +0,0 @@
|
||||
# Validators TODO
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_VALIDATORS_TYPES_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_TYPES_H_INCLUDED
|
||||
|
||||
#include <ripple/types/api/RippleLedgerHash.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define RIPPLE_VALIDATORS_CHOSENLIST_H_INCLUDED
|
||||
|
||||
#include <ripple/common/UnorderedContainers.h>
|
||||
#include <ripple/types/api/RipplePublicKeyHash.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
|
||||
@@ -20,8 +20,14 @@
|
||||
#ifndef RIPPLE_VALIDATORS_LOGIC_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_LOGIC_H_INCLUDED
|
||||
|
||||
#include <ripple/validators/impl/Store.h>
|
||||
#include <ripple/validators/impl/ChosenList.h>
|
||||
#include <ripple/validators/impl/Validation.h>
|
||||
#include <ripple/validators/impl/Validator.h>
|
||||
#include <ripple/validators/impl/Tuning.h>
|
||||
#include <beast/chrono/manual_clock.h>
|
||||
#include <beast/container/aged_unordered_set.h>
|
||||
#include <beast/smart_ptr/SharedPtr.h>
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -17,6 +17,17 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/validators/Manager.h>
|
||||
#include <ripple/validators/impl/Logic.h>
|
||||
#include <ripple/validators/impl/SourceFile.h>
|
||||
#include <ripple/validators/impl/SourceStrings.h>
|
||||
#include <ripple/validators/impl/SourceURL.h>
|
||||
#include <ripple/validators/impl/StoreSqdb.h>
|
||||
#include <beast/module/core/thread/DeadlineTimer.h>
|
||||
#include <beast/threads/ScopedWrapperContext.h>
|
||||
#include <beast/threads/ServiceQueue.h>
|
||||
#include <beast/threads/Thread.h>
|
||||
|
||||
/** ChosenValidators (formerly known as UNL)
|
||||
|
||||
Motivation:
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_VALIDATORS_SOURCEDESC_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_SOURCEDESC_H_INCLUDED
|
||||
|
||||
#include <beast/smart_ptr/SharedPtr.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/validators/impl/Utilities.h>
|
||||
#include <beast/module/core/files/RandomAccessFile.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <beast/module/asio/asio.h>
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_VALIDATORS_STORE_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_STORE_H_INCLUDED
|
||||
|
||||
#include <ripple/validators/impl/SourceDesc.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
#ifndef RIPPLE_VALIDATORS_STORESQDB_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_STORESQDB_H_INCLUDED
|
||||
|
||||
#include <ripple/validators/impl/Store.h>
|
||||
#include <beast/module/sqdb/sqdb.h>
|
||||
#include <beast/utility/Error.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
|
||||
|
||||
@@ -33,70 +33,6 @@ public:
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
struct Payload
|
||||
{
|
||||
Payload ()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <class Config>
|
||||
class PeerLogic : public TestOverlay::PeerLogicBase <Config>
|
||||
{
|
||||
public:
|
||||
typedef TestOverlay::PeerLogicBase <Config> Base;
|
||||
typedef typename Config::Payload Payload;
|
||||
typedef typename Base::Connection Connection;
|
||||
typedef typename Base::Peer Peer;
|
||||
typedef typename Base::Message Message;
|
||||
typedef typename Config::SizeType SizeType;
|
||||
|
||||
explicit PeerLogic (Peer& peer)
|
||||
: TestOverlay::PeerLogicBase <Config> (peer)
|
||||
{
|
||||
}
|
||||
|
||||
~PeerLogic ()
|
||||
{
|
||||
}
|
||||
|
||||
void step ()
|
||||
{
|
||||
if (this->peer().id () == 1)
|
||||
{
|
||||
if (this->peer().network().steps() == 0)
|
||||
{
|
||||
this->peer().network().state().increment();
|
||||
this->peer().send_all (Payload (1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void receive (Connection const& c, Message const& m)
|
||||
{
|
||||
if (this->peer().id () != 1)
|
||||
{
|
||||
this->peer().network().state().increment();
|
||||
this->peer().send_all_if (Message (m.id(),
|
||||
m.payload().withHop ()),
|
||||
typename Connection::IsNotPeer (c.peer()));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct Params : TestOverlay::ConfigType <
|
||||
Params,
|
||||
TestOverlay::StateBase,
|
||||
PeerLogic
|
||||
>
|
||||
{
|
||||
typedef TestOverlay::PremadeInitPolicy <250, 3> InitPolicy;
|
||||
};
|
||||
|
||||
typedef Params::Network Network;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
struct TestSource : Source
|
||||
{
|
||||
TestSource (beast::String const& name, std::uint32_t start, std::uint32_t end)
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
#ifndef RIPPLE_VALIDATORS_VALIDATOR_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_VALIDATOR_H_INCLUDED
|
||||
|
||||
#include <ripple/common/seconds_clock.h>
|
||||
#include <ripple/common/seconds_clock.h> // VFALCO Doesn't belong here
|
||||
#include <ripple/validators/impl/Count.h>
|
||||
#include <beast/container/aged_unordered_map.h>
|
||||
#include <beast/container/aged_map.h>
|
||||
#include <beast/container/aged_container_utility.h>
|
||||
|
||||
Reference in New Issue
Block a user