mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 03:26:01 +00:00
Compare commits
8 Commits
a1q123456/
...
bthomee/gi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
149df6a36d | ||
|
|
ddda26d76a | ||
|
|
b93d4a122a | ||
|
|
a3d4be4eaf | ||
|
|
6ff495fd9b | ||
|
|
15997b6683 | ||
|
|
f909d954ee | ||
|
|
e6d3238fb1 |
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -1,10 +1,6 @@
|
||||
# Set default behaviour, in case users don't have core.autocrlf set.
|
||||
#* text=auto
|
||||
|
||||
# These annoying files
|
||||
rippled.1 binary
|
||||
LICENSE binary
|
||||
|
||||
# Visual Studio
|
||||
*.sln text eol=crlf
|
||||
*.vcproj text eol=crlf
|
||||
|
||||
114
.gitignore
vendored
114
.gitignore
vendored
@@ -1,69 +1,43 @@
|
||||
# .gitignore
|
||||
|
||||
bin/boostbook_catalog.xml
|
||||
bin/config.log
|
||||
bin/project-cache.jam
|
||||
|
||||
# Ignore vim swap files.
|
||||
*.swp
|
||||
|
||||
# Ignore SCons support files.
|
||||
.sconsign.dblite
|
||||
|
||||
# Ignore python compiled files.
|
||||
*.pyc
|
||||
|
||||
# Ignore Macintosh Desktop Services Store files.
|
||||
# Macintosh Desktop Services Store files.
|
||||
.DS_Store
|
||||
|
||||
# Ignore backup/temps
|
||||
# Build, intermediate, and temporary artifacts.
|
||||
*~
|
||||
|
||||
# Ignore object files.
|
||||
*.o
|
||||
.nih_c
|
||||
tags
|
||||
TAGS
|
||||
GTAGS
|
||||
GRTAGS
|
||||
GPATH
|
||||
bin/rippled
|
||||
Debug/*.*
|
||||
Release/*.*
|
||||
*.pdb
|
||||
*.swp
|
||||
/.clangd
|
||||
Debug/
|
||||
Release/
|
||||
/.build/
|
||||
/build/
|
||||
/db/
|
||||
/out.txt
|
||||
/Testing/
|
||||
/tmp/
|
||||
CMakeSettings.json
|
||||
CMakeUserPresets.json
|
||||
|
||||
# Ignore coverage files.
|
||||
# Coverage files.
|
||||
*.gcno
|
||||
*.gcda
|
||||
*.gcov
|
||||
|
||||
# Levelization checking
|
||||
# Profiling data.
|
||||
gmon.out
|
||||
|
||||
# Levelization data.
|
||||
.github/scripts/levelization/results/*
|
||||
!.github/scripts/levelization/results/loops.txt
|
||||
!.github/scripts/levelization/results/ordering.txt
|
||||
|
||||
# Ignore tmp directory.
|
||||
tmp
|
||||
# Customized configs.
|
||||
/rippled.cfg
|
||||
/validators.txt
|
||||
|
||||
# Ignore database directory.
|
||||
db/
|
||||
db/*.db
|
||||
db/*.db-*
|
||||
|
||||
# Ignore debug logs
|
||||
debug_log.txt
|
||||
|
||||
# Ignore customized configs
|
||||
rippled.cfg
|
||||
validators.txt
|
||||
|
||||
# Doxygen generated documentation output
|
||||
HtmlDocumentation
|
||||
docs/html_doc
|
||||
|
||||
# Xcode user-specific project settings
|
||||
# Xcode
|
||||
.DS_Store
|
||||
/build/
|
||||
# XCode IDE.
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
@@ -76,38 +50,16 @@ xcuserdata
|
||||
profile
|
||||
*.moved-aside
|
||||
DerivedData
|
||||
.idea/
|
||||
*.hmap
|
||||
|
||||
# Intel Parallel Studio 2013 XE
|
||||
My Amplifier XE Results - RippleD
|
||||
# JetBrains IDE.
|
||||
/.idea/
|
||||
|
||||
# Compiler intermediate output
|
||||
/out.txt
|
||||
# Microsoft Visual Studio IDE.
|
||||
/.vs/
|
||||
/.vscode/
|
||||
|
||||
# Build Log
|
||||
rippled-build.log
|
||||
|
||||
# Profiling data
|
||||
gmon.out
|
||||
|
||||
Builds/VisualStudio2015/*.db
|
||||
Builds/VisualStudio2015/*.user
|
||||
Builds/VisualStudio2015/*.opendb
|
||||
Builds/VisualStudio2015/*.sdf
|
||||
|
||||
# MSVC
|
||||
*.pdb
|
||||
.vs/
|
||||
CMakeSettings.json
|
||||
compile_commands.json
|
||||
.clangd
|
||||
packages
|
||||
pkg_out
|
||||
pkg
|
||||
CMakeUserPresets.json
|
||||
bld.rippled/
|
||||
.vscode
|
||||
|
||||
# Suggested in-tree build directory
|
||||
/.build*/
|
||||
# AI tools.
|
||||
/.augment
|
||||
/.claude
|
||||
/CLAUDE.md
|
||||
|
||||
3
docs/.gitignore
vendored
3
docs/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
html
|
||||
temp
|
||||
out.txt
|
||||
@@ -1103,7 +1103,7 @@ class LedgerEntry_test : public beast::unit_test::suite
|
||||
checkErrorValue(
|
||||
jrr[jss::result],
|
||||
"malformedAuthorizedCredentials",
|
||||
"Invalid field 'authorized_credentials', not array.");
|
||||
"Invalid field 'authorized_credentials', array empty.");
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1144,7 +1144,7 @@ class LedgerEntry_test : public beast::unit_test::suite
|
||||
checkErrorValue(
|
||||
jrr[jss::result],
|
||||
"malformedAuthorizedCredentials",
|
||||
"Invalid field 'authorized_credentials', not array.");
|
||||
"Invalid field 'authorized_credentials', array too long.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1584,8 +1584,6 @@ static RPCCallTestData const rpcCallTestArray[] = {
|
||||
"EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
|
||||
"rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
|
||||
"ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
|
||||
"junk", // Note: indexing bug in parseBookOffers() requires junk
|
||||
// param.
|
||||
"200",
|
||||
},
|
||||
RPCCallTestData::no_exception,
|
||||
@@ -1597,7 +1595,6 @@ static RPCCallTestData const rpcCallTestArray[] = {
|
||||
"issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
|
||||
"ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
|
||||
"limit" : 200,
|
||||
"proof" : true,
|
||||
"taker_gets" : {
|
||||
"currency" : "EUR",
|
||||
"issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
|
||||
@@ -1617,8 +1614,8 @@ static RPCCallTestData const rpcCallTestArray[] = {
|
||||
"EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
|
||||
"rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
|
||||
"ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
|
||||
"junk", // Note: indexing bug in parseBookOffers() requires junk param.
|
||||
"200",
|
||||
"0",
|
||||
"MyMarker"},
|
||||
RPCCallTestData::no_exception,
|
||||
R"({
|
||||
@@ -1630,7 +1627,6 @@ static RPCCallTestData const rpcCallTestArray[] = {
|
||||
"ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
|
||||
"limit" : 200,
|
||||
"marker" : "MyMarker",
|
||||
"proof" : true,
|
||||
"taker_gets" : {
|
||||
"currency" : "EUR",
|
||||
"issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
|
||||
@@ -1665,8 +1661,8 @@ static RPCCallTestData const rpcCallTestArray[] = {
|
||||
"EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
|
||||
"rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
|
||||
"ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
|
||||
"junk", // Note: indexing bug in parseBookOffers() requires junk param.
|
||||
"200",
|
||||
"0",
|
||||
"MyMarker",
|
||||
"extra"},
|
||||
RPCCallTestData::no_exception,
|
||||
@@ -1770,12 +1766,19 @@ static RPCCallTestData const rpcCallTestArray[] = {
|
||||
"EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
|
||||
"rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
|
||||
"ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
|
||||
"junk", // Note: indexing bug in parseBookOffers() requires junk
|
||||
// param.
|
||||
"not_a_number",
|
||||
},
|
||||
RPCCallTestData::bad_cast,
|
||||
R"()"},
|
||||
RPCCallTestData::no_exception,
|
||||
R"({
|
||||
"method" : "book_offers",
|
||||
"params" : [
|
||||
{
|
||||
"error" : "invalidParams",
|
||||
"error_code" : 31,
|
||||
"error_message" : "Invalid field 'limit'."
|
||||
}
|
||||
]
|
||||
})"},
|
||||
|
||||
// can_delete
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
@@ -332,15 +332,31 @@ private:
|
||||
|
||||
if (jvParams.size() >= 5)
|
||||
{
|
||||
int iLimit = jvParams[5u].asInt();
|
||||
try
|
||||
{
|
||||
int iLimit = jvParams[4u].asInt();
|
||||
|
||||
if (iLimit > 0)
|
||||
jvRequest[jss::limit] = iLimit;
|
||||
if (iLimit > 0)
|
||||
jvRequest[jss::limit] = iLimit;
|
||||
}
|
||||
catch (std::exception const&)
|
||||
{
|
||||
return RPC::invalid_field_error(jss::limit);
|
||||
}
|
||||
}
|
||||
|
||||
if (jvParams.size() >= 6 && jvParams[5u].asInt())
|
||||
if (jvParams.size() >= 6)
|
||||
{
|
||||
jvRequest[jss::proof] = true;
|
||||
try
|
||||
{
|
||||
int bProof = jvParams[5u].asInt();
|
||||
if (bProof)
|
||||
jvRequest[jss::proof] = true;
|
||||
}
|
||||
catch (std::exception const&)
|
||||
{
|
||||
return RPC::invalid_field_error(jss::proof);
|
||||
}
|
||||
}
|
||||
|
||||
if (jvParams.size() == 7)
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
#include <xrpl/protocol/STXChainBridge.h>
|
||||
#include <xrpl/protocol/jss.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
static Expected<uint256, Json::Value>
|
||||
@@ -178,18 +176,41 @@ static Expected<STArray, Json::Value>
|
||||
parseAuthorizeCredentials(Json::Value const& jv)
|
||||
{
|
||||
if (!jv.isArray())
|
||||
{
|
||||
return LedgerEntryHelpers::invalidFieldError(
|
||||
"malformedAuthorizedCredentials",
|
||||
jss::authorized_credentials,
|
||||
"array");
|
||||
STArray arr(sfAuthorizeCredentials, jv.size());
|
||||
}
|
||||
|
||||
std::uint32_t const n = jv.size();
|
||||
if (n > maxCredentialsArraySize)
|
||||
{
|
||||
return Unexpected(LedgerEntryHelpers::malformedError(
|
||||
"malformedAuthorizedCredentials",
|
||||
"Invalid field '" + std::string(jss::authorized_credentials) +
|
||||
"', array too long."));
|
||||
}
|
||||
|
||||
if (n == 0)
|
||||
{
|
||||
return Unexpected(LedgerEntryHelpers::malformedError(
|
||||
"malformedAuthorizedCredentials",
|
||||
"Invalid field '" + std::string(jss::authorized_credentials) +
|
||||
"', array empty."));
|
||||
}
|
||||
|
||||
STArray arr(sfAuthorizeCredentials, n);
|
||||
for (auto const& jo : jv)
|
||||
{
|
||||
if (!jo.isObject())
|
||||
{
|
||||
return LedgerEntryHelpers::invalidFieldError(
|
||||
"malformedAuthorizedCredentials",
|
||||
jss::authorized_credentials,
|
||||
"array");
|
||||
}
|
||||
|
||||
if (auto const value = LedgerEntryHelpers::hasRequired(
|
||||
jo,
|
||||
{jss::issuer, jss::credential_type},
|
||||
@@ -260,13 +281,6 @@ parseDepositPreauth(Json::Value const& dp, Json::StaticString const fieldName)
|
||||
auto const arr = parseAuthorizeCredentials(ac);
|
||||
if (!arr.has_value())
|
||||
return Unexpected(arr.error());
|
||||
if (arr->empty() || (arr->size() > maxCredentialsArraySize))
|
||||
{
|
||||
return LedgerEntryHelpers::invalidFieldError(
|
||||
"malformedAuthorizedCredentials",
|
||||
jss::authorized_credentials,
|
||||
"array");
|
||||
}
|
||||
|
||||
auto const& sorted = credentials::makeSorted(arr.value());
|
||||
if (sorted.empty())
|
||||
|
||||
Reference in New Issue
Block a user