mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Levelization, improve structure of source files:
Source files are moved between modules, includes changed and added, and some code rewritten, with the goal of reducing cross-module dependencies and eliminating cycles in the dependency graph of classes. * Remove RippleAddress dependency in CKey_test * ByteOrder.h, Blob.h, and strHex.h are moved to basics/. This makes the basics/ module fully independent of other ripple sources. * types/ is merged into protocol/. The protocol module now contains all primitive types specific to the Ripple protocol. * Move ErrorCodes to protocol/ * Move base_uint to basics/ * Move Base58 to crypto/ * Remove dependence on Serializer in GenerateDeterministicKey * Eliminate unity header json.h * Remove obsolete unity headers * Remove unnecessary includes
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
#define RIPPLE_CORE_TYPES_H_INCLUDED
|
||||
|
||||
#include <ripple/app/ledger/LedgerEntrySet.h>
|
||||
#include <ripple/types/Book.h>
|
||||
#include <ripple/protocol/Book.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <ripple/protocol/UintTypes.h>
|
||||
#include <ripple/protocol/Serializer.h>
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <ripple/app/consensus/DisputedTx.h>
|
||||
#include <ripple/app/consensus/LedgerConsensus.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/app/ledger/InboundLedgers.h>
|
||||
#include <ripple/app/ledger/LedgerMaster.h>
|
||||
#include <ripple/app/ledger/LedgerTiming.h>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <ripple/app/tx/LocalTxs.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <ripple/overlay/Peer.h>
|
||||
#include <ripple/types/RippleLedgerHash.h>
|
||||
#include <ripple/protocol/RippleLedgerHash.h>
|
||||
#include <beast/chrono/abstract_clock.h>
|
||||
#include <chrono>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef RIPPLE_DATABASE_H_INCLUDED
|
||||
#define RIPPLE_DATABASE_H_INCLUDED
|
||||
|
||||
#include <ripple/types/Blob.h>
|
||||
#include <ripple/basics/Blob.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/json/to_string.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
void BookListeners::addSubscriber (InfoSub::ref sub)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define RIPPLE_INBOUNDLEDGERS_H
|
||||
|
||||
#include <ripple/app/ledger/InboundLedger.h>
|
||||
#include <ripple/types/RippleLedgerHash.h>
|
||||
#include <ripple/protocol/RippleLedgerHash.h>
|
||||
#include <beast/threads/Stoppable.h>
|
||||
#include <beast/cxx14/memory.h> // <memory>
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <ripple/core/Config.h>
|
||||
#include <ripple/core/JobQueue.h>
|
||||
#include <ripple/core/LoadFeeTrack.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/nodestore/Database.h>
|
||||
#include <ripple/protocol/HashPrefix.h>
|
||||
#include <beast/unit_test/suite.h>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <ripple/protocol/STLedgerEntry.h>
|
||||
#include <ripple/basics/CountedObject.h>
|
||||
#include <ripple/protocol/Serializer.h>
|
||||
#include <ripple/types/Book.h>
|
||||
#include <ripple/protocol/Book.h>
|
||||
#include <set>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <beast/cxx14/memory.h> // <memory>
|
||||
#include <beast/threads/Stoppable.h>
|
||||
#include <beast/utility/PropertyStream.h>
|
||||
#include <beast/utility/Journal.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef RIPPLE_LEDGERHISTORY_H
|
||||
#define RIPPLE_LEDGERHISTORY_H
|
||||
|
||||
#include <ripple/types/RippleLedgerHash.h>
|
||||
#include <ripple/protocol/RippleLedgerHash.h>
|
||||
#include <beast/insight/Event.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -21,10 +21,11 @@
|
||||
#define RIPPLE_LEDGERMASTER_H_INCLUDED
|
||||
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/types/RippleLedgerHash.h>
|
||||
#include <ripple/protocol/RippleLedgerHash.h>
|
||||
#include <beast/insight/Collector.h>
|
||||
#include <beast/threads/Stoppable.h>
|
||||
#include <beast/threads/UnlockGuard.h>
|
||||
#include <beast/utility/PropertyStream.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -19,13 +19,14 @@
|
||||
|
||||
#include <ripple/app/impl/BasicApp.h>
|
||||
#include <ripple/app/main/Tuning.h>
|
||||
#include <ripple/app/misc/SHAMapStore.h>
|
||||
#include <ripple/app/paths/FindPaths.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/LoggedTimings.h>
|
||||
#include <ripple/basics/Sustain.h>
|
||||
#include <ripple/basics/seconds_clock.h>
|
||||
#include <ripple/basics/make_SSLContext.h>
|
||||
#include <ripple/app/misc/SHAMapStore.h>
|
||||
#include <ripple/json/json_reader.h>
|
||||
#include <ripple/core/LoadFeeTrack.h>
|
||||
#include <ripple/net/SNTPClient.h>
|
||||
#include <ripple/nodestore/Database.h>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef RIPPLE_FULLBELOWCACHE_H_INCLUDED
|
||||
#define RIPPLE_FULLBELOWCACHE_H_INCLUDED
|
||||
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/app/main/BasicFullBelowCache.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <ripple/basics/ThreadName.h>
|
||||
#include <ripple/core/ConfigSections.h>
|
||||
#include <ripple/crypto/RandomNumbers.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/net/RPCCall.h>
|
||||
#include <ripple/resource/Fees.h>
|
||||
#include <ripple/protocol/BuildInfo.h>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef RIPPLE_CANONICALTXSET_H
|
||||
#define RIPPLE_CANONICALTXSET_H
|
||||
|
||||
#include <ripple/types/RippleLedgerHash.h>
|
||||
#include <ripple/protocol/RippleLedgerHash.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define RIPPLE_APP_FEEVOTE_H_INCLUDED
|
||||
|
||||
#include <ripple/basics/BasicConfig.h>
|
||||
#include <ripple/core/SystemParameters.h>
|
||||
#include <ripple/protocol/SystemParameters.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <ripple/core/LoadFeeTrack.h>
|
||||
#include <ripple/crypto/RandomNumbers.h>
|
||||
#include <ripple/crypto/RFC1751.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/overlay/predicates.h>
|
||||
#include <ripple/protocol/BuildInfo.h>
|
||||
#include <ripple/protocol/HashPrefix.h>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <ripple/core/Config.h>
|
||||
#include <ripple/nodestore/Manager.h>
|
||||
#include <ripple/nodestore/Scheduler.h>
|
||||
#include <ripple/rpc/ErrorCodes.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <ripple/core/Config.h>
|
||||
#include <ripple/core/LoadFeeTrack.h>
|
||||
#include <ripple/net/RPCErr.h>
|
||||
#include <ripple/rpc/ErrorCodes.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/UintTypes.h>
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <tuple>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/app/paths/Credit.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <ripple/app/paths/Tuning.h>
|
||||
#include <ripple/app/paths/Pathfinder.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/core/JobQueue.h>
|
||||
#include <tuple>
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_TYPES_H
|
||||
#define RIPPLE_TYPES_H
|
||||
#ifndef RIPPLE_TYPES_H_INCLUDED
|
||||
#define RIPPLE_TYPES_H_INCLUDED
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <ripple/basics/CountedObject.h>
|
||||
#include <ripple/protocol/Serializer.h>
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define RIPPLE_SHAMAPNODEID_H
|
||||
|
||||
#include <ripple/protocol/Serializer.h>
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <ripple/app/book/Taker.h>
|
||||
#include <ripple/app/book/Types.h>
|
||||
#include <ripple/app/book/Amounts.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
|
||||
#include <beast/cxx14/memory.h>
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/protocol/STAccount.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <ripple/core/Config.h>
|
||||
#include <ripple/resource/Manager.h>
|
||||
#include <ripple/server/Port.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <beast/asio/placeholders.h>
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/server/Port.h>
|
||||
#include <ripple/app/websocket/WSConnection.h>
|
||||
#include <ripple/json/json_reader.h>
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -17,11 +17,18 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_RPC_H_INCLUDED
|
||||
#define RIPPLE_RPC_H_INCLUDED
|
||||
#ifndef RIPPLE_BASICS_BLOB_H_INCLUDED
|
||||
#define RIPPLE_BASICS_BLOB_H_INCLUDED
|
||||
|
||||
#include <ripple/rpc/ErrorCodes.h>
|
||||
#include <ripple/rpc/Manager.h>
|
||||
#include <ripple/rpc/Request.h>
|
||||
#include <vector>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
/** Storage for linear binary data.
|
||||
Blocks of binary data appear often in various idioms and structures.
|
||||
*/
|
||||
typedef std::vector <unsigned char> Blob;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_TYPES_BYTEORDER_H
|
||||
#define RIPPLE_TYPES_BYTEORDER_H
|
||||
#ifndef RIPPLE_BASICS_BYTEORDER_H
|
||||
#define RIPPLE_BASICS_BYTEORDER_H
|
||||
|
||||
#include <beast/Config.h>
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
// VFALCO These are all deprecated please use the ones in <beast/ByteOrder.h>
|
||||
// Routines for converting endianness
|
||||
|
||||
// Reference: http://www.mail-archive.com/licq-commits@googlegroups.com/msg02334.html
|
||||
@@ -20,9 +20,9 @@
|
||||
#ifndef RIPPLE_BASICS_STRINGUTILITIES_H_INCLUDED
|
||||
#define RIPPLE_BASICS_STRINGUTILITIES_H_INCLUDED
|
||||
|
||||
#include <ripple/types/Blob.h>
|
||||
#include <ripple/types/ByteOrder.h>
|
||||
#include <ripple/types/strHex.h>
|
||||
#include <ripple/basics/ByteOrder.h>
|
||||
#include <ripple/basics/Blob.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <boost/format.hpp>
|
||||
#include <beast/module/core/text/StringPairArray.h>
|
||||
#include <string>
|
||||
|
||||
541
src/ripple/basics/base_uint.h
Normal file
541
src/ripple/basics/base_uint.h
Normal file
@@ -0,0 +1,541 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2011 The Bitcoin developers
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef RIPPLE_PROTOCOL_BASE_UINT_H_INCLUDED
|
||||
#define RIPPLE_PROTOCOL_BASE_UINT_H_INCLUDED
|
||||
|
||||
#include <ripple/basics/ByteOrder.h>
|
||||
#include <ripple/basics/Blob.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
|
||||
#include <beast/container/hardened_hash.h>
|
||||
#include <beast/utility/Zero.h>
|
||||
|
||||
#include <boost/functional/hash.hpp>
|
||||
|
||||
#include <functional>
|
||||
|
||||
using beast::zero;
|
||||
using beast::Zero;
|
||||
|
||||
namespace ripple {
|
||||
|
||||
// This class stores its values internally in big-endian form
|
||||
|
||||
template <std::size_t Bits, class Tag = void>
|
||||
class base_uint
|
||||
{
|
||||
static_assert ((Bits % 32) == 0,
|
||||
"The length of a base_uint in bits must be a multiple of 32.");
|
||||
|
||||
static_assert (Bits >= 64,
|
||||
"The length of a base_uint in bits must be at least 64.");
|
||||
|
||||
protected:
|
||||
enum { WIDTH = Bits / 32 };
|
||||
|
||||
// This is really big-endian in byte order.
|
||||
// We sometimes use unsigned int for speed.
|
||||
|
||||
// NIKB TODO: migrate to std::array
|
||||
unsigned int pn[WIDTH];
|
||||
|
||||
public:
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
// STL Container Interface
|
||||
//
|
||||
|
||||
static std::size_t const bytes = Bits / 8;
|
||||
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef unsigned char value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef value_type& reference;
|
||||
typedef value_type const* const_pointer;
|
||||
typedef value_type const& const_reference;
|
||||
typedef pointer iterator;
|
||||
typedef const_pointer const_iterator;
|
||||
typedef std::reverse_iterator
|
||||
<iterator> reverse_iterator;
|
||||
typedef std::reverse_iterator
|
||||
<const_iterator> const_reverse_iterator;
|
||||
|
||||
typedef Tag tag_type;
|
||||
|
||||
pointer data() { return reinterpret_cast<pointer>(pn); }
|
||||
const_pointer data() const { return reinterpret_cast<const_pointer>(pn); }
|
||||
|
||||
iterator begin() { return data(); }
|
||||
iterator end() { return data()+bytes; }
|
||||
const_iterator begin() const { return data(); }
|
||||
const_iterator end() const { return data()+bytes; }
|
||||
const_iterator cbegin() const { return data(); }
|
||||
const_iterator cend() const { return data()+bytes; }
|
||||
|
||||
/** Value hashing function.
|
||||
The seed prevents crafted inputs from causing degenarate parent containers.
|
||||
*/
|
||||
typedef beast::hardened_hash <> hasher;
|
||||
|
||||
/** Container equality testing function. */
|
||||
class key_equal
|
||||
{
|
||||
public:
|
||||
bool operator() (base_uint const& lhs, base_uint const& rhs) const
|
||||
{
|
||||
return lhs == rhs;
|
||||
}
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
private:
|
||||
/** Construct from a raw pointer.
|
||||
The buffer pointed to by `data` must be at least Bits/8 bytes.
|
||||
|
||||
@note the structure is used to disambiguate this from the std::uint64_t
|
||||
constructor: something like base_uint(0) is ambiguous.
|
||||
*/
|
||||
// NIKB TODO Remove the need for this constructor.
|
||||
struct VoidHelper {};
|
||||
|
||||
explicit base_uint (void const* data, VoidHelper)
|
||||
{
|
||||
memcpy (&pn [0], data, bytes);
|
||||
}
|
||||
|
||||
public:
|
||||
base_uint () { *this = beast::zero; }
|
||||
|
||||
explicit base_uint (Blob const& vch)
|
||||
{
|
||||
assert (vch.size () == size ());
|
||||
|
||||
if (vch.size () == size ())
|
||||
memcpy (pn, &vch[0], size ());
|
||||
else
|
||||
*this = beast::zero;
|
||||
}
|
||||
|
||||
explicit base_uint (std::uint64_t b)
|
||||
{
|
||||
*this = b;
|
||||
}
|
||||
|
||||
// NIKB TODO remove the need for this constructor - have a free function
|
||||
// to handle the hex string parsing.
|
||||
explicit base_uint (std::string const& str)
|
||||
{
|
||||
SetHex (str);
|
||||
}
|
||||
|
||||
base_uint (base_uint<Bits, Tag> const& other) = default;
|
||||
|
||||
template <class OtherTag>
|
||||
void copyFrom (base_uint<Bits, OtherTag> const& other)
|
||||
{
|
||||
memcpy (&pn [0], other.data(), bytes);
|
||||
}
|
||||
|
||||
/* Construct from a raw pointer.
|
||||
The buffer pointed to by `data` must be at least Bits/8 bytes.
|
||||
*/
|
||||
static base_uint
|
||||
fromVoid (void const* data)
|
||||
{
|
||||
return base_uint (data, VoidHelper ());
|
||||
}
|
||||
|
||||
int signum() const
|
||||
{
|
||||
for (int i = 0; i < WIDTH; i++)
|
||||
if (pn[i] != 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool operator! () const
|
||||
{
|
||||
return *this == beast::zero;
|
||||
}
|
||||
|
||||
const base_uint operator~ () const
|
||||
{
|
||||
base_uint ret;
|
||||
|
||||
for (int i = 0; i < WIDTH; i++)
|
||||
ret.pn[i] = ~pn[i];
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
base_uint& operator= (const base_uint& b)
|
||||
{
|
||||
for (int i = 0; i < WIDTH; i++)
|
||||
pn[i] = b.pn[i];
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
base_uint& operator= (std::uint64_t uHost)
|
||||
{
|
||||
*this = beast::zero;
|
||||
|
||||
// Put in least significant bits.
|
||||
((std::uint64_t*) end ())[-1] = htobe64 (uHost);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
base_uint& operator^= (const base_uint& b)
|
||||
{
|
||||
for (int i = 0; i < WIDTH; i++)
|
||||
pn[i] ^= b.pn[i];
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
base_uint& operator&= (const base_uint& b)
|
||||
{
|
||||
for (int i = 0; i < WIDTH; i++)
|
||||
pn[i] &= b.pn[i];
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
base_uint& operator|= (const base_uint& b)
|
||||
{
|
||||
for (int i = 0; i < WIDTH; i++)
|
||||
pn[i] |= b.pn[i];
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
base_uint& operator++ ()
|
||||
{
|
||||
// prefix operator
|
||||
for (int i = WIDTH - 1; i >= 0; --i)
|
||||
{
|
||||
pn[i] = htobe32 (be32toh (pn[i]) + 1);
|
||||
|
||||
if (pn[i] != 0)
|
||||
break;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
const base_uint operator++ (int)
|
||||
{
|
||||
// postfix operator
|
||||
const base_uint ret = *this;
|
||||
++ (*this);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
base_uint& operator-- ()
|
||||
{
|
||||
for (int i = WIDTH - 1; i >= 0; --i)
|
||||
{
|
||||
std::uint32_t prev = pn[i];
|
||||
pn[i] = htobe32 (be32toh (pn[i]) - 1);
|
||||
|
||||
if (prev != 0)
|
||||
break;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
const base_uint operator-- (int)
|
||||
{
|
||||
// postfix operator
|
||||
const base_uint ret = *this;
|
||||
-- (*this);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
base_uint& operator+= (const base_uint& b)
|
||||
{
|
||||
std::uint64_t carry = 0;
|
||||
|
||||
for (int i = WIDTH; i--;)
|
||||
{
|
||||
std::uint64_t n = carry + be32toh (pn[i]) + be32toh (b.pn[i]);
|
||||
|
||||
pn[i] = htobe32 (n & 0xffffffff);
|
||||
carry = n >> 32;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class Hasher>
|
||||
friend void hash_append(Hasher& h, base_uint const& a) noexcept
|
||||
{
|
||||
using beast::hash_append;
|
||||
hash_append (h, a.pn);
|
||||
}
|
||||
|
||||
bool SetHexExact (const char* psz)
|
||||
{
|
||||
// must be precisely the correct number of hex digits
|
||||
unsigned char* pOut = begin ();
|
||||
|
||||
for (int i = 0; i < sizeof (pn); ++i)
|
||||
{
|
||||
auto cHigh = charUnHex(*psz++);
|
||||
auto cLow = charUnHex(*psz++);
|
||||
|
||||
if (cHigh == -1 || cLow == -1)
|
||||
return false;
|
||||
|
||||
*pOut++ = (cHigh << 4) | cLow;
|
||||
}
|
||||
|
||||
assert (*psz == 0);
|
||||
assert (pOut == end ());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Allow leading whitespace.
|
||||
// Allow leading "0x".
|
||||
// To be valid must be '\0' terminated.
|
||||
bool SetHex (const char* psz, bool bStrict = false)
|
||||
{
|
||||
// skip leading spaces
|
||||
if (!bStrict)
|
||||
while (isspace (*psz))
|
||||
psz++;
|
||||
|
||||
// skip 0x
|
||||
if (!bStrict && psz[0] == '0' && tolower (psz[1]) == 'x')
|
||||
psz += 2;
|
||||
|
||||
const unsigned char* pEnd = reinterpret_cast<const unsigned char*> (psz);
|
||||
const unsigned char* pBegin = pEnd;
|
||||
|
||||
// Find end.
|
||||
while (charUnHex(*pEnd) != -1)
|
||||
pEnd++;
|
||||
|
||||
// Take only last digits of over long string.
|
||||
if ((unsigned int) (pEnd - pBegin) > 2 * size ())
|
||||
pBegin = pEnd - 2 * size ();
|
||||
|
||||
unsigned char* pOut = end () - ((pEnd - pBegin + 1) / 2);
|
||||
|
||||
*this = beast::zero;
|
||||
|
||||
if ((pEnd - pBegin) & 1)
|
||||
*pOut++ = charUnHex(*pBegin++);
|
||||
|
||||
while (pBegin != pEnd)
|
||||
{
|
||||
auto cHigh = charUnHex(*pBegin++);
|
||||
auto cLow = pBegin == pEnd
|
||||
? 0
|
||||
: charUnHex(*pBegin++);
|
||||
|
||||
if (cHigh == -1 || cLow == -1)
|
||||
return false;
|
||||
|
||||
*pOut++ = (cHigh << 4) | cLow;
|
||||
}
|
||||
|
||||
return !*pEnd;
|
||||
}
|
||||
|
||||
bool SetHex (std::string const& str, bool bStrict = false)
|
||||
{
|
||||
return SetHex (str.c_str (), bStrict);
|
||||
}
|
||||
|
||||
void SetHexExact (std::string const& str)
|
||||
{
|
||||
SetHexExact (str.c_str ());
|
||||
}
|
||||
|
||||
unsigned int size () const
|
||||
{
|
||||
return sizeof (pn);
|
||||
}
|
||||
|
||||
base_uint<Bits, Tag>& operator=(Zero)
|
||||
{
|
||||
memset (&pn[0], 0, sizeof (pn));
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Deprecated.
|
||||
bool isZero () const { return *this == beast::zero; }
|
||||
bool isNonZero () const { return *this != beast::zero; }
|
||||
void zero () { *this = beast::zero; }
|
||||
};
|
||||
|
||||
typedef base_uint<128> uint128;
|
||||
typedef base_uint<160> uint160;
|
||||
typedef base_uint<256> uint256;
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline int compare (
|
||||
base_uint<Bits, Tag> const& a, base_uint<Bits, Tag> const& b)
|
||||
{
|
||||
auto ret = std::mismatch (a.cbegin (), a.cend (), b.cbegin ());
|
||||
|
||||
if (ret.first == a.cend ())
|
||||
return 0;
|
||||
|
||||
// a > b
|
||||
if (*ret.first > *ret.second)
|
||||
return 1;
|
||||
|
||||
// a < b
|
||||
return -1;
|
||||
}
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline bool operator< (
|
||||
base_uint<Bits, Tag> const& a, base_uint<Bits, Tag> const& b)
|
||||
{
|
||||
return compare (a, b) < 0;
|
||||
}
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline bool operator<= (
|
||||
base_uint<Bits, Tag> const& a, base_uint<Bits, Tag> const& b)
|
||||
{
|
||||
return compare (a, b) <= 0;
|
||||
}
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline bool operator> (
|
||||
base_uint<Bits, Tag> const& a, base_uint<Bits, Tag> const& b)
|
||||
{
|
||||
return compare (a, b) > 0;
|
||||
}
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline bool operator>= (
|
||||
base_uint<Bits, Tag> const& a, base_uint<Bits, Tag> const& b)
|
||||
{
|
||||
return compare (a, b) >= 0;
|
||||
}
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline bool operator== (
|
||||
base_uint<Bits, Tag> const& a, base_uint<Bits, Tag> const& b)
|
||||
{
|
||||
return compare (a, b) == 0;
|
||||
}
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline bool operator!= (
|
||||
base_uint<Bits, Tag> const& a, base_uint<Bits, Tag> const& b)
|
||||
{
|
||||
return compare (a, b) != 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline bool operator== (base_uint<Bits, Tag> const& a, std::uint64_t b)
|
||||
{
|
||||
return a == base_uint<Bits, Tag>(b);
|
||||
}
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline bool operator!= (base_uint<Bits, Tag> const& a, std::uint64_t b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline const base_uint<Bits, Tag> operator^ (
|
||||
base_uint<Bits, Tag> const& a, base_uint<Bits, Tag> const& b)
|
||||
{
|
||||
return base_uint<Bits, Tag> (a) ^= b;
|
||||
}
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline const base_uint<Bits, Tag> operator& (
|
||||
base_uint<Bits, Tag> const& a, base_uint<Bits, Tag> const& b)
|
||||
{
|
||||
return base_uint<Bits, Tag> (a) &= b;
|
||||
}
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline const base_uint<Bits, Tag> operator| (
|
||||
base_uint<Bits, Tag> const& a, base_uint<Bits, Tag> const& b)
|
||||
{
|
||||
return base_uint<Bits, Tag> (a) |= b;
|
||||
}
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline const base_uint<Bits, Tag> operator+ (
|
||||
base_uint<Bits, Tag> const& a, base_uint<Bits, Tag> const& b)
|
||||
{
|
||||
return base_uint<Bits, Tag> (a) += b;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline std::string to_string (base_uint<Bits, Tag> const& a)
|
||||
{
|
||||
return strHex (a.begin (), a.size ());
|
||||
}
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
inline std::ostream& operator<< (
|
||||
std::ostream& out, base_uint<Bits, Tag> const& u)
|
||||
{
|
||||
return out << to_string (u);
|
||||
}
|
||||
|
||||
} // rippled
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template <std::size_t Bits, class Tag>
|
||||
struct hash<ripple::base_uint<Bits, Tag>>
|
||||
{
|
||||
using argument_type = ripple::base_uint<Bits, Tag>;
|
||||
|
||||
std::size_t
|
||||
operator()(argument_type const& u) const
|
||||
{
|
||||
return beast::hardened_hash<>{}(u);
|
||||
}
|
||||
};
|
||||
|
||||
} // boost
|
||||
|
||||
#endif
|
||||
@@ -22,8 +22,8 @@
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef RIPPLE_TYPES_STRHEX_H_INCLUDED
|
||||
#define RIPPLE_TYPES_STRHEX_H_INCLUDED
|
||||
#ifndef RIPPLE_BASICS_STRHEX_H_INCLUDED
|
||||
#define RIPPLE_BASICS_STRHEX_H_INCLUDED
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#define RIPPLE_CORE_CONFIG_H_INCLUDED
|
||||
|
||||
#include <ripple/basics/BasicConfig.h>
|
||||
#include <ripple/core/SystemParameters.h>
|
||||
#include <ripple/protocol/SystemParameters.h>
|
||||
#include <ripple/protocol/RippleAddress.h>
|
||||
#include <ripple/unity/json.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <beast/http/URL.h>
|
||||
#include <beast/net/IPEndpoint.h>
|
||||
#include <beast/module/core/files/File.h>
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include <ripple/basics/BasicTypes.h>
|
||||
#include <ripple/core/LoadMonitor.h>
|
||||
#include <ripple/unity/json.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
#include <ripple/core/Config.h>
|
||||
#include <ripple/core/ConfigSections.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/core/SystemParameters.h>
|
||||
#include <ripple/json/json_reader.h>
|
||||
#include <ripple/protocol/SystemParameters.h>
|
||||
#include <ripple/net/HTTPClient.h>
|
||||
#include <beast/http/URL.h>
|
||||
#include <beast/module/core/text/LexicalCast.h>
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
// - E-mail usually won't line-break if there's no punctuation to break at.
|
||||
// - Doubleclicking selects the whole number as one word if it's all alphanumeric.
|
||||
//
|
||||
#ifndef RIPPLE_TYPES_BASE58_H
|
||||
#define RIPPLE_TYPES_BASE58_H
|
||||
#ifndef RIPPLE_CRYPTO_BASE58_H
|
||||
#define RIPPLE_CRYPTO_BASE58_H
|
||||
|
||||
#include <ripple/types/Blob.h>
|
||||
#include <ripple/basics/Blob.h>
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
@@ -32,8 +32,8 @@
|
||||
#ifndef RIPPLE_CRYPTO_BASE58DATA_H
|
||||
#define RIPPLE_CRYPTO_BASE58DATA_H
|
||||
|
||||
#include <ripple/types/Base58.h>
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/crypto/Base58.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#ifndef RIPPLE_CRYPTO_CBIGNUM_H_INCLUDED
|
||||
#define RIPPLE_CRYPTO_CBIGNUM_H_INCLUDED
|
||||
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <openssl/bn.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#define RIPPLE_ECDSA_H
|
||||
|
||||
#include <ripple/crypto/ec_key.h>
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/types/Blob.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/basics/Blob.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef RIPPLE_CRYPTO_ECDSACANONICAL_H_INCLUDED
|
||||
#define RIPPLE_CRYPTO_ECDSACANONICAL_H_INCLUDED
|
||||
|
||||
#include <ripple/types/Blob.h>
|
||||
#include <ripple/basics/Blob.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define RIPPLE_ECIES_H
|
||||
|
||||
#include <ripple/crypto/ec_key.h>
|
||||
#include <ripple/types/Blob.h>
|
||||
#include <ripple/basics/Blob.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#define RIPPLE_CKEYDETERMINISTIC_H
|
||||
|
||||
#include <ripple/crypto/ec_key.h>
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <openssl/bn.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef RIPPLE_ECKEY_H
|
||||
#define RIPPLE_ECKEY_H
|
||||
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace openssl {
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/crypto/Base58.h>
|
||||
#include <ripple/crypto/CAutoBN_CTX.h>
|
||||
#include <ripple/crypto/CBigNum.h>
|
||||
#include <ripple/types/Base58.h>
|
||||
#include <openssl/sha.h>
|
||||
|
||||
#include <stdexcept>
|
||||
@@ -18,15 +18,34 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/crypto/GenerateDeterministicKey.h>
|
||||
|
||||
#include <ripple/crypto/Base58.h>
|
||||
#include <ripple/crypto/CBigNum.h>
|
||||
#include <ripple/protocol/Serializer.h>
|
||||
#include <array>
|
||||
#include <string>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
using openssl::ec_key;
|
||||
|
||||
uint256
|
||||
getSHA512Half (void const* data, std::size_t bytes)
|
||||
{
|
||||
uint256 j[2];
|
||||
SHA512 (reinterpret_cast<unsigned char const*>(data), bytes,
|
||||
reinterpret_cast<unsigned char*> (j));
|
||||
return j[0];
|
||||
}
|
||||
|
||||
template <class FwdIt>
|
||||
void
|
||||
copy_uint32 (FwdIt out, std::uint32_t v)
|
||||
{
|
||||
*out++ = v >> 24;
|
||||
*out++ = (v >> 16) & 0xff;
|
||||
*out++ = (v >> 8) & 0xff;
|
||||
*out = v & 0xff;
|
||||
}
|
||||
|
||||
// #define EC_DEBUG
|
||||
|
||||
// Functions to add support for deterministic EC keys
|
||||
@@ -67,19 +86,20 @@ ec_key GenerateRootDeterministicKey (uint128 const& seed)
|
||||
return ec_key::invalid;
|
||||
}
|
||||
|
||||
// find non-zero private key less than the curve's order
|
||||
BIGNUM* privKey = nullptr;
|
||||
int seq = 0;
|
||||
|
||||
std::uint32_t seq = 0;
|
||||
do
|
||||
{
|
||||
// private key must be non-zero and less than the curve's order
|
||||
Serializer s ((128 + 32) / 8);
|
||||
s.add128 (seed);
|
||||
s.add32 (seq++);
|
||||
uint256 root = s.getSHA512Half ();
|
||||
s.secureErase ();
|
||||
// buf: 0 seed 16 seq 20
|
||||
// |<--------------------------------->|<------>|
|
||||
std::array<std::uint8_t, 20> buf;
|
||||
std::copy(seed.begin(), seed.end(), buf.begin());
|
||||
copy_uint32 (buf.begin() + 16, seq++);
|
||||
++seq;
|
||||
uint256 root = getSHA512Half (buf.data(), buf.size());
|
||||
std::fill (buf.begin(), buf.end(), 0); // security erase
|
||||
privKey = BN_bin2bn ((const unsigned char*) &root, sizeof (root), privKey);
|
||||
|
||||
if (privKey == nullptr)
|
||||
{
|
||||
EC_KEY_free (pkey);
|
||||
@@ -88,7 +108,7 @@ ec_key GenerateRootDeterministicKey (uint128 const& seed)
|
||||
return ec_key::invalid;
|
||||
}
|
||||
|
||||
root.zero ();
|
||||
root.zero(); // security erase
|
||||
}
|
||||
while (BN_is_zero (privKey) || (BN_cmp (privKey, order) >= 0));
|
||||
|
||||
@@ -188,17 +208,20 @@ static BIGNUM* makeHash (Blob const& pubGen, int seq, BIGNUM const* order)
|
||||
int subSeq = 0;
|
||||
BIGNUM* ret = nullptr;
|
||||
|
||||
assert(pubGen.size() == 33);
|
||||
do
|
||||
{
|
||||
Serializer s ((33 * 8 + 32 + 32) / 8);
|
||||
s.addRaw (pubGen);
|
||||
s.add32 (seq);
|
||||
s.add32 (subSeq++);
|
||||
uint256 root = s.getSHA512Half ();
|
||||
s.secureErase ();
|
||||
// buf: 0 pubGen 33 seq 37 subSeq 41
|
||||
// |<--------------------------->|<------>|<-------->|
|
||||
std::array<std::uint8_t, 41> buf;
|
||||
std::copy (pubGen.begin(), pubGen.end(), buf.begin());
|
||||
copy_uint32 (buf.begin() + 33, seq);
|
||||
copy_uint32 (buf.begin() + 37, subSeq++);
|
||||
uint256 root = getSHA512Half (buf.data(), buf.size());
|
||||
std::fill(buf.begin(), buf.end(), 0); // security erase
|
||||
ret = BN_bin2bn ((const unsigned char*) &root, sizeof (root), ret);
|
||||
|
||||
if (!ret) return nullptr;
|
||||
root.zero(); // security erase
|
||||
}
|
||||
while (BN_is_zero (ret) || (BN_cmp (ret, order) >= 0));
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/crypto/GenerateDeterministicKey.h>
|
||||
#include <ripple/protocol/RippleAddress.h>
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <beast/unit_test/suite.h>
|
||||
|
||||
namespace ripple {
|
||||
@@ -51,15 +50,6 @@ public:
|
||||
|
||||
unexpected (to_string (priv2) != "98BC2EACB26EB021D1A6293C044D88BA2F0B6729A2772DEEBF2E21A263C1740B",
|
||||
"Incorrect private key for generator");
|
||||
|
||||
RippleAddress nSeed;
|
||||
nSeed.setSeed (seed1);
|
||||
|
||||
unexpected (nSeed.humanSeed () != "shHM53KPZ87Gwdqarm1bAmPeXg8Tn",
|
||||
"Incorrect human seed");
|
||||
|
||||
unexpected (nSeed.humanSeed1751 () != "MAD BODY ACE MINT OKAY HUB WHAT DATA SACK FLAT DANA MATH",
|
||||
"Incorrect 1751 seed");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/json/JsonPropertyStream.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
JsonPropertyStream::JsonPropertyStream ()
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/json/json_reader.h>
|
||||
|
||||
namespace Json
|
||||
{
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <ripple/basics/CountedObject.h>
|
||||
#include <ripple/protocol/RippleAddress.h>
|
||||
#include <ripple/resource/Consumer.h>
|
||||
#include <ripple/types/Book.h>
|
||||
#include <ripple/protocol/Book.h>
|
||||
#include <beast/threads/Stoppable.h>
|
||||
#include <mutex>
|
||||
|
||||
|
||||
@@ -17,8 +17,10 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/json/json_reader.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/rpc/ErrorCodes.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/server/ServerHandler.h>
|
||||
#include <ripple/net/RPCCall.h>
|
||||
#include <ripple/net/RPCErr.h>
|
||||
|
||||
@@ -21,11 +21,9 @@
|
||||
#define RIPPLE_OVERLAY_PEER_H_INCLUDED
|
||||
|
||||
#include <ripple/overlay/Message.h>
|
||||
|
||||
#include <ripple/unity/json.h>
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <ripple/protocol/RippleAddress.h>
|
||||
|
||||
#include <beast/net/IPEndpoint.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
#include <ripple/overlay/impl/ConnectAttempt.h>
|
||||
#include <ripple/overlay/impl/Tuning.h>
|
||||
|
||||
#include <ripple/json/json_reader.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
ConnectAttempt::ConnectAttempt (boost::asio::io_service& io_service,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef RIPPLE_PEERFINDER_SLOT_H_INCLUDED
|
||||
#define RIPPLE_PEERFINDER_SLOT_H_INCLUDED
|
||||
|
||||
#include <ripple/types/RipplePublicKey.h>
|
||||
#include <ripple/protocol/RipplePublicKey.h>
|
||||
#include <beast/net/IPEndpoint.h>
|
||||
#include <boost/optional.hpp>
|
||||
#include <memory>
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_TYPES_BOOK_H_INCLUDED
|
||||
#define RIPPLE_TYPES_BOOK_H_INCLUDED
|
||||
#ifndef RIPPLE_PROTOCOL_BOOK_H_INCLUDED
|
||||
#define RIPPLE_PROTOCOL_BOOK_H_INCLUDED
|
||||
|
||||
#include <ripple/types/Issue.h>
|
||||
#include <ripple/protocol/Issue.h>
|
||||
#include <boost/utility/base_from_member.hpp>
|
||||
|
||||
namespace ripple {
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_RPC_ERRORCODES_H_INCLUDED
|
||||
#define RIPPLE_RPC_ERRORCODES_H_INCLUDED
|
||||
#ifndef RIPPLE_PROTOCOL_ERRORCODES_H_INCLUDED
|
||||
#define RIPPLE_PROTOCOL_ERRORCODES_H_INCLUDED
|
||||
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/unity/json.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#include <ripple/protocol/RippleAddress.h>
|
||||
#include <ripple/protocol/Serializer.h>
|
||||
#include <ripple/protocol/UintTypes.h>
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/types/Book.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/protocol/Book.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_TYPES_ISSUE_INCLUDED
|
||||
#define RIPPLE_TYPES_ISSUE_INCLUDED
|
||||
#ifndef RIPPLE_PROTOCOL_ISSUE_INCLUDED
|
||||
#define RIPPLE_PROTOCOL_ISSUE_INCLUDED
|
||||
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_PROTOCOL_JSONFIELDS_H_INCLUDED
|
||||
#define RIPPLE_PROTOCOL_JSONFIELDS_H_INCLUDED
|
||||
|
||||
#include <ripple/json/json_value.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace jss {
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef RIPPLE_PROTOCOL_PROTOCOL_H_INCLUDED
|
||||
#define RIPPLE_PROTOCOL_PROTOCOL_H_INCLUDED
|
||||
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <cstdint>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
#include <ripple/crypto/Base58Data.h>
|
||||
#include <ripple/crypto/ECDSACanonical.h>
|
||||
#include <ripple/types/RipplePublicKey.h>
|
||||
#include <ripple/types/UInt160.h>
|
||||
#include <ripple/protocol/RipplePublicKey.h>
|
||||
#include <ripple/protocol/UInt160.h>
|
||||
#include <ripple/protocol/UintTypes.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_TYPES_RIPPLELEDGERHASH_H_INCLUDED
|
||||
#define RIPPLE_TYPES_RIPPLELEDGERHASH_H_INCLUDED
|
||||
#ifndef RIPPLE_PROTOCOL_RIPPLELEDGERHASH_H_INCLUDED
|
||||
#define RIPPLE_PROTOCOL_RIPPLELEDGERHASH_H_INCLUDED
|
||||
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_TYPES_RIPPLEPUBLICKEY_H_INCLUDED
|
||||
#define RIPPLE_TYPES_RIPPLEPUBLICKEY_H_INCLUDED
|
||||
#ifndef RIPPLE_PROTOCOL_RIPPLEPUBLICKEY_H_INCLUDED
|
||||
#define RIPPLE_PROTOCOL_RIPPLEPUBLICKEY_H_INCLUDED
|
||||
|
||||
#include <ripple/types/Base58.h>
|
||||
#include <ripple/crypto/Base58.h>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <ripple/protocol/SField.h>
|
||||
#include <ripple/protocol/Serializer.h>
|
||||
#include <ripple/protocol/STBase.h>
|
||||
#include <ripple/types/Issue.h>
|
||||
#include <ripple/protocol/Issue.h>
|
||||
#include <beast/cxx14/memory.h> // <memory>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <ripple/basics/byte_view.h>
|
||||
#include <ripple/protocol/SField.h>
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef RIPPLE_TYPES_UINT160_H_INCLUDED
|
||||
#define RIPPLE_TYPES_UINT160_H_INCLUDED
|
||||
#ifndef RIPPLE_PROTOCOL_UINT160_H_INCLUDED
|
||||
#define RIPPLE_PROTOCOL_UINT160_H_INCLUDED
|
||||
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/types/strHex.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <functional>
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_TYPES_BASICS
|
||||
#define RIPPLE_TYPES_BASICS
|
||||
#ifndef RIPPLE_PROTOCOL_BASICS
|
||||
#define RIPPLE_PROTOCOL_BASICS
|
||||
|
||||
#include <ripple/basics/UnorderedContainers.h>
|
||||
#include <ripple/types/base_uint.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace detail {
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef RIPPLE_TYPES_BASE_UINT_H_INCLUDED
|
||||
#define RIPPLE_TYPES_BASE_UINT_H_INCLUDED
|
||||
#ifndef RIPPLE_BASICS_BASE_UINT_H_INCLUDED
|
||||
#define RIPPLE_BASICS_BASE_UINT_H_INCLUDED
|
||||
|
||||
#include <ripple/types/Blob.h>
|
||||
#include <ripple/types/strHex.h>
|
||||
#include <ripple/types/ByteOrder.h>
|
||||
#include <ripple/basics/ByteOrder.h>
|
||||
#include <ripple/basics/Blob.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
|
||||
#include <beast/container/hardened_hash.h>
|
||||
#include <beast/utility/Zero.h>
|
||||
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
#include <ripple/rpc/ErrorCodes.h>
|
||||
|
||||
namespace std {
|
||||
|
||||
template <>
|
||||
@@ -41,7 +41,7 @@ namespace detail {
|
||||
class ErrorCategory
|
||||
{
|
||||
public:
|
||||
typedef hash_map <error_code_i, ErrorInfo> Map;
|
||||
using Map = std::unordered_map <error_code_i, ErrorInfo> ;
|
||||
|
||||
ErrorCategory ()
|
||||
: m_unknown (rpcUNKNOWN, "unknown", "An unknown error code.")
|
||||
@@ -18,8 +18,8 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/basics/UnorderedContainers.h>
|
||||
#include <ripple/types/Book.h>
|
||||
#include <ripple/types/Issue.h>
|
||||
#include <ripple/protocol/Book.h>
|
||||
#include <ripple/protocol/Issue.h>
|
||||
#include <beast/unit_test/suite.h>
|
||||
#include <map>
|
||||
#include <set>
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <ripple/crypto/RFC1751.h>
|
||||
#include <ripple/protocol/RippleAddress.h>
|
||||
#include <ripple/protocol/Serializer.h>
|
||||
#include <ripple/types/RipplePublicKey.h>
|
||||
#include <ripple/protocol/RipplePublicKey.h>
|
||||
#include <beast/unit_test/suite.h>
|
||||
#include <openssl/ripemd.h>
|
||||
#include <openssl/bn.h>
|
||||
@@ -957,6 +957,17 @@ public:
|
||||
= naAccountPrivate1.accountPrivateDecrypt (naAccountPublic0, vucTextCipher);
|
||||
|
||||
expect (vucTextSrc == vucTextRecovered, "Encrypt-decrypt failed.");
|
||||
|
||||
{
|
||||
RippleAddress nSeed;
|
||||
uint128 seed1, seed2;
|
||||
seed1.SetHex ("71ED064155FFADFA38782C5E0158CB26");
|
||||
nSeed.setSeed (seed1);
|
||||
expect (nSeed.humanSeed() == "shHM53KPZ87Gwdqarm1bAmPeXg8Tn",
|
||||
"Incorrect human seed");
|
||||
expect (nSeed.humanSeed1751() == "MAD BODY ACE MINT OKAY HUB WHAT DATA SACK FLAT DANA MATH",
|
||||
"Incorrect 1751 seed");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/crypto/CBigNum.h>
|
||||
#include <ripple/core/SystemParameters.h>
|
||||
#include <ripple/protocol/SystemParameters.h>
|
||||
#include <ripple/protocol/STAmount.h>
|
||||
#include <ripple/protocol/UintTypes.h>
|
||||
#include <beast/module/core/text/LexicalCast.h>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/protocol/STInteger.h>
|
||||
#include <ripple/rpc/ErrorCodes.h> // VFALCO Questionable dependency
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <beast/module/core/text/LexicalCast.h>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/core/Config.h>
|
||||
#include <ripple/protocol/STValidation.h>
|
||||
#include <ripple/protocol/HashPrefix.h>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/core/SystemParameters.h>
|
||||
#include <ripple/protocol/SystemParameters.h>
|
||||
#include <ripple/protocol/RippleAddress.h>
|
||||
#include <ripple/protocol/UintTypes.h>
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define RIPPLE_RPC_MANAGER_H_INCLUDED
|
||||
|
||||
#include <ripple/rpc/Request.h>
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
namespace RPC {
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
|
||||
#include <ripple/resource/Charge.h>
|
||||
#include <ripple/resource/Fees.h>
|
||||
#include <ripple/unity/json.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <beast/utility/Journal.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define RIPPLE_STATUS_H
|
||||
|
||||
#include <ripple/protocol/TER.h>
|
||||
#include <ripple/rpc/ErrorCodes.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace RPC {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <ripple/app/ledger/LedgerToJson.h>
|
||||
#include <ripple/core/LoadFeeTrack.h>
|
||||
#include <ripple/rpc/ErrorCodes.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/rpc/handlers/Ledger.h>
|
||||
#include <ripple/rpc/impl/JsonObject.h>
|
||||
#include <ripple/server/Role.h>
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <ripple/core/Config.h>
|
||||
#include <ripple/rpc/Yield.h>
|
||||
#include <ripple/server/Role.h>
|
||||
#include <ripple/server/ServerHandler.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace RPC {
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_RPC_PRINT_H_INCLUDED
|
||||
#define RIPPLE_RPC_PRINT_H_INCLUDED
|
||||
|
||||
#include <ripple/json/JsonPropertyStream.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace RPC {
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#define RIPPLED_RIPPLE_BASICS_TYPES_JSONWRITER_H
|
||||
|
||||
#include <ripple/basics/ToString.h>
|
||||
#include <ripple/rpc/ErrorCodes.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/rpc/Output.h>
|
||||
#include <ripple/rpc/ErrorCodes.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace RPC {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/core/JobQueue.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/net/RPCErr.h>
|
||||
#include <ripple/rpc/RPCHandler.h>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <ripple/app/paths/FindPaths.h>
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/json/json_reader.h>
|
||||
#include <ripple/protocol/TxFlags.h>
|
||||
#include <ripple/rpc/impl/TransactionSign.h>
|
||||
#include <beast/unit_test.h>
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
#ifndef RIPPLE_RPC_TRANSACTIONSIGN_H_INCLUDED
|
||||
#define RIPPLE_RPC_TRANSACTIONSIGN_H_INCLUDED
|
||||
|
||||
#include <ripple/server/ServerHandler.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace RPC {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <ripple/server/impl/JSONRPCUtil.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/protocol/BuildInfo.h>
|
||||
#include <ripple/core/SystemParameters.h>
|
||||
#include <ripple/protocol/SystemParameters.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/json/json_reader.h>
|
||||
#include <ripple/server/make_ServerHandler.h>
|
||||
#include <ripple/server/impl/JSONRPCUtil.h>
|
||||
#include <ripple/server/impl/ServerHandlerImp.h>
|
||||
|
||||
@@ -20,18 +20,17 @@
|
||||
#ifndef RIPPLE_SERVER_MAKE_SERVERHANDLER_H_INCLUDED
|
||||
#define RIPPLE_SERVER_MAKE_SERVERHANDLER_H_INCLUDED
|
||||
|
||||
#include <ripple/core/Config.h>
|
||||
#include <ripple/server/Server.h>
|
||||
#include <ripple/overlay/Overlay.h>
|
||||
#include <ripple/core/JobQueue.h>
|
||||
#include <ripple/resource/Manager.h>
|
||||
#include <ripple/server/ServerHandler.h>
|
||||
#include <beast/utility/Journal.h>
|
||||
#include <beast/utility/PropertyStream.h>
|
||||
#include <beast/cxx14/memory.h> // <memory>
|
||||
#include <beast/threads/Stoppable.h>
|
||||
#include <boost/asio/io_service.hpp>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
class NetworkOPs;
|
||||
|
||||
std::unique_ptr <ServerHandler>
|
||||
make_ServerHandler (beast::Stoppable& parent, boost::asio::io_service& io_service,
|
||||
JobQueue& jobQueue, NetworkOPs& networkOPs, Resource::Manager& resourceManager);
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Types
|
||||
|
||||
Provides various types that are specific to the Ripple payment network.
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
#include <BeastConfig.h>
|
||||
|
||||
#include <ripple/rpc/Manager.h>
|
||||
#include <ripple/unity/app.h>
|
||||
#include <ripple/unity/rpcx.h>
|
||||
#include <ripple/unity/websocket.h>
|
||||
#include <ripple/app/impl/BasicApp.cpp>
|
||||
#include <ripple/app/main/CollectorManager.cpp>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <BeastConfig.h>
|
||||
|
||||
#include <ripple/crypto/impl/Base58.cpp>
|
||||
#include <ripple/crypto/impl/Base58Data.cpp>
|
||||
#include <ripple/crypto/impl/CBigNum.cpp>
|
||||
#include <ripple/crypto/impl/DHUtil.cpp>
|
||||
|
||||
@@ -1,103 +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_DATA_H_INCLUDED
|
||||
#define RIPPLE_DATA_H_INCLUDED
|
||||
|
||||
#include <ripple/unity/types.h>
|
||||
#include <ripple/unity/json.h>
|
||||
#include <ripple/sslutil/ECDSACanonical.h>
|
||||
|
||||
struct bignum_st;
|
||||
typedef struct bignum_st BIGNUM;
|
||||
|
||||
#include <ripple/crypto/Base58Data.h>
|
||||
#include <ripple/crypto/RFC1751.h>
|
||||
#include <ripple/protocol/BuildInfo.h>
|
||||
#include <ripple/protocol/SField.h>
|
||||
#include <ripple/protocol/HashPrefix.h>
|
||||
#include <ripple/protocol/Protocol.h>
|
||||
#include <ripple/protocol/RippleAddress.h>
|
||||
#include <ripple/protocol/Serializer.h> // needs CKey
|
||||
#include <ripple/protocol/TER.h>
|
||||
#include <ripple/protocol/SerializedTypes.h> // needs Serializer, TER
|
||||
#include <ripple/protocol/SerializedObjectTemplate.h>
|
||||
#include <ripple/protocol/KnownFormats.h>
|
||||
#include <ripple/protocol/LedgerFormats.h> // needs SOTemplate from SerializedObjectTemplate
|
||||
#include <ripple/protocol/TxFormats.h>
|
||||
#include <ripple/protocol/STObject.h>
|
||||
#include <ripple/protocol/STArray.h>
|
||||
#include <ripple/protocol/TxFlags.h>
|
||||
|
||||
#include <ripple/protocol/STParsedJSON.h>
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <>
|
||||
struct range_mutable_iterator <ripple::STPath>
|
||||
{
|
||||
typedef std::vector <ripple::STPathElement>::iterator type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct range_const_iterator <ripple::STPath>
|
||||
{
|
||||
typedef std::vector <ripple::STPathElement>::const_iterator type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct range_mutable_iterator <ripple::STPathSet>
|
||||
{
|
||||
typedef std::vector <ripple::STPath>::iterator type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct range_const_iterator <ripple::STPathSet>
|
||||
{
|
||||
typedef std::vector <ripple::STPath>::const_iterator type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct range_mutable_iterator <ripple::STObject>
|
||||
{
|
||||
typedef ripple::STObject::iterator type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct range_const_iterator <ripple::STObject>
|
||||
{
|
||||
typedef ripple::STObject::const_iterator type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct range_mutable_iterator <ripple::STArray>
|
||||
{
|
||||
typedef ripple::STArray::iterator type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct range_const_iterator <ripple::STArray>
|
||||
{
|
||||
typedef ripple::STArray::const_iterator type;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -34,8 +34,6 @@
|
||||
#include <ripple/json/impl/json_batchallocator.h>
|
||||
#endif
|
||||
|
||||
#include <ripple/unity/json.h>
|
||||
|
||||
#define JSON_ASSERT_UNREACHABLE assert( false )
|
||||
#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw
|
||||
#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message );
|
||||
|
||||
@@ -1,53 +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_JSON_H_INCLUDED
|
||||
#define RIPPLE_JSON_H_INCLUDED
|
||||
|
||||
#include <beast/Config.h>
|
||||
|
||||
#include <beast/strings/String.h>
|
||||
#include <beast/utility/PropertyStream.h>
|
||||
|
||||
#include <deque>
|
||||
#include <stack>
|
||||
#include <vector>
|
||||
|
||||
// For json/
|
||||
//
|
||||
// VFALCO TODO Clean up these one-offs
|
||||
#include <ripple/json/json_config.h> // Needed before these cpptl includes
|
||||
#ifndef JSON_USE_CPPTL_SMALLMAP
|
||||
#include <map>
|
||||
#else
|
||||
#include <cpptl/smallmap.h>
|
||||
#endif
|
||||
#ifdef JSON_USE_CPPTL
|
||||
#include <cpptl/forwards.h>
|
||||
#endif
|
||||
|
||||
#include <ripple/json/json_forwards.h>
|
||||
#include <ripple/json/json_features.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <ripple/json/json_reader.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
|
||||
#include <ripple/json/JsonPropertyStream.h>
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user