Integration test to validate the WS ledger results.

* Also replace a couple of magic values with the relevant Tuning param.
This commit is contained in:
Edward Hennis
2015-05-13 19:35:13 -04:00
committed by Vinnie Falco
parent dddcc09378
commit e838b30def
3 changed files with 185 additions and 2 deletions

View File

@@ -20,6 +20,7 @@
#include <BeastConfig.h>
#include <ripple/app/ledger/InboundLedgers.h>
#include <ripple/app/ledger/LedgerToJson.h>
#include <ripple/rpc/impl/Tuning.h>
namespace ripple {
@@ -52,7 +53,8 @@ Json::Value doLedgerRequest (RPC::Context& context)
return RPC::invalid_field_message (jss::ledger_index);
// We need a validated ledger to get the hash from the sequence
if (ledgerMaster.getValidatedLedgerAge() > 120)
if (ledgerMaster.getValidatedLedgerAge() >
RPC::Tuning::maxValidatedLedgerAge)
return rpcError (rpcNO_CURRENT);
auto ledgerIndex = jsonIndex.asInt();

View File

@@ -486,7 +486,8 @@ checkTxJsonFields (
// Check for current ledger.
if (verify && !getConfig ().RUN_STANDALONE &&
(apiFacade.getValidatedLedgerAge() > 120))
(apiFacade.getValidatedLedgerAge() >
Tuning::maxValidatedLedgerAge))
{
ret.first = rpcError (rpcNO_CURRENT);
return ret;