Five peer doubles existed across seven suites. Two of them, reduce_relay_test's
PeerPartial and LedgerReplay_test's TestPeer, independently stubbed the same 22 of
Peer's 24 pure virtuals in two different directories, so every method added to Peer
broke both files identically. The other three wrapped PeerImp to capture what it would
have sent: src/test/overlay/PeerTest, a same-named copy nested in tx_reduce_relay_test,
and TMGetObjectByHash_test's own overlay wiring.
Both duplications collapse into two headers. CapturePeer, in src/test/overlay, is a real
PeerImp that captures the messages it would have sent, built by CapturePeerBuilder.
PeerStub, in src/test/jtx, is a null Peer whose methods all return defaults; PeerPartial
and TestPeer derive from it and override only what they exercise.
CapturePeer replaces PeerTest rather than the reverse on four counts: it hands out a
distinct remote address per peer, so the peer finder's per-address limit is never
reached; it holds the connection id counter per builder instead of in a static that
every suite has to reset; it takes the handshake request as a parameter, so a suite
negotiates a feature instead of overriding the negotiated result; and it declares its
two sinks by value, which is what lets a suite write `using CapturePeer::CapturePeer;`
and reach a protected PeerImp member. It also asks for the newest supported protocol
version instead of the unsupported 1.7 that makePeerTest wrote down, which had silently
turned off every feature PeerImp gates on the version, so TMGetLedger_test now reaches
the LedgerNodeDepth reply shape rather than only the legacy one. That version cannot be
derived from outside ProtocolVersion.cpp, whose list is file-local, so this adds a
newestSupportedProtocolVersion() accessor beside the existing
supportedProtocolVersions() and isProtocolSupported(). PeerStub goes in src/test/jtx
because both the overlay and the app suites need it, and test.jtx already sits below
every suite; levelization records the resulting "test.jtx > xrpld.overlay" edge, and
there is no cycle.
This change deletes the `SecretKey` equality/inequality operators from the public library header and moves the comparison logic into test-only code.
Specifically, the `operator==` and `operator!=` free functions on `SecretKey` have been removed from `include/xrpl/protocol/SecretKey.h` and have been replaced with explicitly deleted member functions to prevent accidental use in production code. A named `test::equal()` helper has also been added in `src/test/unit_test/utils.h` for test assertions that need to compare secret keys.
The rdb module was not properly designed, which is fixed in this change. The module had three classes:
1) The abstract class `RelationalDB`.
2) The abstract class `SQLiteDatabase`, which inherited from `RelationalDB` and added some pure virtual methods.
3) The concrete class `SQLiteDatabaseImp`, which inherited from `SQLiteDatabase` and implemented all methods.
The updated code simplifies this as follows:
* The `SQLiteDatabaseImp` has become `SQLiteDatabase`, and
* The former `SQLiteDatabase `has merged with `RelationalDatabase`.
This change modularizes the `WalletDB` and `Manifest`. Note that the wallet db has nothing to do with account wallets and it stores node configuration, which is why it depends on the manifest code.
Currently we're passing the `Application` object around, whereby the `Application` class acts more like a service registry that gives other classes access to other services. In order to allow modularization, we should replace `Application` with a service registry class so that modules depending on `Application` for other services can be moved easily. This change adds the `ServiceRegistry` class.
`PeerImp` processes `TMGetObjectByHash` queries with an unbounded per-request loop, which performs a `NodeStore` fetch and then appends retrieved data to the reply for each queried object without a local count cap or reply-byte budget. However, the `Nodestore` fetches are expensive when high in numbers, which might slow down the process overall. Hence this code change adds an upper cap on the response size.
This change makes the regex in `HttpClient.cpp` that matches the content-length http header case insensitive to improve compatibility, as http headers are case insensitive.