Add error code extension mechanism and use malformed currency code (#396)

Fixes #275
This commit is contained in:
Alex Kremer
2022-11-15 18:08:09 +01:00
committed by GitHub
parent 6015faa0d3
commit 0a5bf911c1
31 changed files with 808 additions and 434 deletions

View File

@@ -14,7 +14,7 @@ doTransactionEntry(Context const& context)
ripple::uint256 hash;
if (!hash.parseHex(getRequiredString(context.params, JS(tx_hash))))
return Status{Error::rpcINVALID_PARAMS, "malformedTransaction"};
return Status{RippledError::rpcINVALID_PARAMS, "malformedTransaction"};
auto dbResponse = context.backend->fetchTransaction(hash, context.yield);
// Note: transaction_entry is meant to only search a specified ledger for
@@ -28,7 +28,7 @@ doTransactionEntry(Context const& context)
// is in a different ledger than the one specified.
if (!dbResponse || dbResponse->ledgerSequence != lgrInfo.seq)
return Status{
Error::rpcTXN_NOT_FOUND,
RippledError::rpcTXN_NOT_FOUND,
"transactionNotFound",
"Transaction not found."};