From fe9c8d568fcf6ac21483024e01f58962dd5c8260 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 29 Jan 2026 18:19:32 +0000 Subject: [PATCH 01/26] chore: Format all cmake files without comments (#6294) --- .cmake-format.yaml | 13 +- .pre-commit-config.yaml | 12 -- cmake/CodeCoverage.cmake | 309 ++++++++++++++-------------- cmake/XrplCore.cmake | 240 ++++++++------------- cmake/XrplDocs.cmake | 93 ++++----- cmake/XrplInstall.cmake | 99 ++++----- cmake/add_module.cmake | 34 +-- cmake/isolate_headers.cmake | 18 +- cmake/target_link_modules.cmake | 32 +-- cmake/target_protobuf_sources.cmake | 40 ++-- tests/conan/CMakeLists.txt | 6 +- 11 files changed, 386 insertions(+), 510 deletions(-) diff --git a/.cmake-format.yaml b/.cmake-format.yaml index 1c4d6684e8..1a3337fe8c 100644 --- a/.cmake-format.yaml +++ b/.cmake-format.yaml @@ -2,6 +2,17 @@ _help_parse: Options affecting listfile parsing parse: _help_additional_commands: - Specify structure for custom cmake functions + additional_commands: + target_protobuf_sources: + pargs: + - target + - prefix + kwargs: + PROTOS: "*" + LANGUAGE: cpp + IMPORT_DIRS: "*" + GENERATE_EXTENSIONS: "*" + PLUGIN: "*" _help_override_spec: - Override configurations per-command where available override_spec: {} @@ -159,7 +170,7 @@ markup: canonicalize_hashrulers: true _help_enable_markup: - enable comment markup parsing and reflow - enable_markup: true + enable_markup: false _help_lint: Options affecting the linter lint: _help_disabled_codes: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d38c11af38..79a3e4e7ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,18 +31,6 @@ repos: hooks: - id: cmake-format additional_dependencies: [PyYAML] - exclude: | - (?x)^( - cmake/CodeCoverage.cmake| - cmake/XrplCore.cmake| - cmake/XrplDocs.cmake| - cmake/XrplInstall.cmake| - cmake/add_module.cmake| - cmake/isolate_headers.cmake| - cmake/target_link_modules.cmake| - cmake/target_protobuf_sources.cmake| - tests/conan/CMakeLists.txt - )$ - repo: https://github.com/rbubley/mirrors-prettier rev: 5ba47274f9b181bce26a5150a725577f3c336011 # frozen: v3.6.2 diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake index e1b44e656d..0178d68cc0 100644 --- a/cmake/CodeCoverage.cmake +++ b/cmake/CodeCoverage.cmake @@ -172,51 +172,47 @@ include(CMakeParseArguments) option(CODE_COVERAGE_VERBOSE "Verbose information" FALSE) # Check prereqs -find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test) +find_program(GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test) -if(DEFINED CODE_COVERAGE_GCOV_TOOL) - set(GCOV_TOOL "${CODE_COVERAGE_GCOV_TOOL}") -elseif(DEFINED ENV{CODE_COVERAGE_GCOV_TOOL}) - set(GCOV_TOOL "$ENV{CODE_COVERAGE_GCOV_TOOL}") -elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang") - if(APPLE) - execute_process( COMMAND xcrun -f llvm-cov - OUTPUT_VARIABLE LLVMCOV_PATH - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - else() - find_program( LLVMCOV_PATH llvm-cov ) - endif() - if(LLVMCOV_PATH) - set(GCOV_TOOL "${LLVMCOV_PATH} gcov") - endif() -elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") - find_program( GCOV_PATH gcov ) - set(GCOV_TOOL "${GCOV_PATH}") -endif() +if (DEFINED CODE_COVERAGE_GCOV_TOOL) + set(GCOV_TOOL "${CODE_COVERAGE_GCOV_TOOL}") +elseif (DEFINED ENV{CODE_COVERAGE_GCOV_TOOL}) + set(GCOV_TOOL "$ENV{CODE_COVERAGE_GCOV_TOOL}") +elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang") + if (APPLE) + execute_process(COMMAND xcrun -f llvm-cov OUTPUT_VARIABLE LLVMCOV_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) + else () + find_program(LLVMCOV_PATH llvm-cov) + endif () + if (LLVMCOV_PATH) + set(GCOV_TOOL "${LLVMCOV_PATH} gcov") + endif () +elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + find_program(GCOV_PATH gcov) + set(GCOV_TOOL "${GCOV_PATH}") +endif () # Check supported compiler (Clang, GNU and Flang) get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) -foreach(LANG ${LANGUAGES}) - if("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang") - if("${CMAKE_${LANG}_COMPILER_VERSION}" VERSION_LESS 3) - message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...") - endif() - elseif(NOT "${CMAKE_${LANG}_COMPILER_ID}" MATCHES "GNU" - AND NOT "${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(LLVM)?[Ff]lang") - message(FATAL_ERROR "Compiler is not GNU or Flang! Aborting...") - endif() -endforeach() +foreach (LANG ${LANGUAGES}) + if ("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang") + if ("${CMAKE_${LANG}_COMPILER_VERSION}" VERSION_LESS 3) + message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...") + endif () + elseif (NOT "${CMAKE_${LANG}_COMPILER_ID}" MATCHES "GNU" AND NOT "${CMAKE_${LANG}_COMPILER_ID}" MATCHES + "(LLVM)?[Ff]lang") + message(FATAL_ERROR "Compiler is not GNU or Flang! Aborting...") + endif () +endforeach () -set(COVERAGE_COMPILER_FLAGS "-g --coverage" - CACHE INTERNAL "") +set(COVERAGE_COMPILER_FLAGS "-g --coverage" CACHE INTERNAL "") set(COVERAGE_CXX_COMPILER_FLAGS "") set(COVERAGE_C_COMPILER_FLAGS "") set(COVERAGE_CXX_LINKER_FLAGS "") set(COVERAGE_C_LINKER_FLAGS "") -if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") +if (CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") include(CheckCXXCompilerFlag) include(CheckCCompilerFlag) include(CheckLinkerFlag) @@ -227,51 +223,51 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") set(COVERAGE_C_LINKER_FLAGS ${COVERAGE_COMPILER_FLAGS}) check_cxx_compiler_flag(-fprofile-abs-path HAVE_cxx_fprofile_abs_path) - if(HAVE_cxx_fprofile_abs_path) + if (HAVE_cxx_fprofile_abs_path) set(COVERAGE_CXX_COMPILER_FLAGS "${COVERAGE_CXX_COMPILER_FLAGS} -fprofile-abs-path") - endif() + endif () check_c_compiler_flag(-fprofile-abs-path HAVE_c_fprofile_abs_path) - if(HAVE_c_fprofile_abs_path) + if (HAVE_c_fprofile_abs_path) set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_C_COMPILER_FLAGS} -fprofile-abs-path") - endif() + endif () check_linker_flag(CXX -fprofile-abs-path HAVE_cxx_linker_fprofile_abs_path) - if(HAVE_cxx_linker_fprofile_abs_path) + if (HAVE_cxx_linker_fprofile_abs_path) set(COVERAGE_CXX_LINKER_FLAGS "${COVERAGE_CXX_LINKER_FLAGS} -fprofile-abs-path") - endif() + endif () check_linker_flag(C -fprofile-abs-path HAVE_c_linker_fprofile_abs_path) - if(HAVE_c_linker_fprofile_abs_path) + if (HAVE_c_linker_fprofile_abs_path) set(COVERAGE_C_LINKER_FLAGS "${COVERAGE_C_LINKER_FLAGS} -fprofile-abs-path") - endif() + endif () check_cxx_compiler_flag(-fprofile-update=atomic HAVE_cxx_fprofile_update) - if(HAVE_cxx_fprofile_update) + if (HAVE_cxx_fprofile_update) set(COVERAGE_CXX_COMPILER_FLAGS "${COVERAGE_CXX_COMPILER_FLAGS} -fprofile-update=atomic") - endif() + endif () check_c_compiler_flag(-fprofile-update=atomic HAVE_c_fprofile_update) - if(HAVE_c_fprofile_update) + if (HAVE_c_fprofile_update) set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_C_COMPILER_FLAGS} -fprofile-update=atomic") - endif() + endif () check_linker_flag(CXX -fprofile-update=atomic HAVE_cxx_linker_fprofile_update) - if(HAVE_cxx_linker_fprofile_update) + if (HAVE_cxx_linker_fprofile_update) set(COVERAGE_CXX_LINKER_FLAGS "${COVERAGE_CXX_LINKER_FLAGS} -fprofile-update=atomic") - endif() + endif () check_linker_flag(C -fprofile-update=atomic HAVE_c_linker_fprofile_update) - if(HAVE_c_linker_fprofile_update) + if (HAVE_c_linker_fprofile_update) set(COVERAGE_C_LINKER_FLAGS "${COVERAGE_C_LINKER_FLAGS} -fprofile-update=atomic") - endif() + endif () -endif() +endif () get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -if(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG)) +if (NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG)) message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading") -endif() # NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG) +endif () # NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG) # Defines a target for running and collection code coverage information # Builds dependencies, runs the given executable and outputs reports. @@ -295,193 +291,186 @@ endif() # NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG) # ) # The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the # GCVOR command. -function(setup_target_for_coverage_gcovr) +function (setup_target_for_coverage_gcovr) set(options NONE) set(oneValueArgs BASE_DIRECTORY NAME FORMAT) set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES) cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if(NOT GCOV_TOOL) + if (NOT GCOV_TOOL) message(FATAL_ERROR "Could not find gcov or llvm-cov tool! Aborting...") - endif() + endif () - if(NOT GCOVR_PATH) + if (NOT GCOVR_PATH) message(FATAL_ERROR "Could not find gcovr tool! Aborting...") - endif() + endif () # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR - if(DEFINED Coverage_BASE_DIRECTORY) + if (DEFINED Coverage_BASE_DIRECTORY) get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE) - else() + else () set(BASEDIR ${PROJECT_SOURCE_DIR}) - endif() + endif () - if(NOT DEFINED Coverage_FORMAT) + if (NOT DEFINED Coverage_FORMAT) set(Coverage_FORMAT xml) - endif() + endif () - if(NOT DEFINED Coverage_EXECUTABLE AND DEFINED Coverage_EXECUTABLE_ARGS) + if (NOT DEFINED Coverage_EXECUTABLE AND DEFINED Coverage_EXECUTABLE_ARGS) message(FATAL_ERROR "EXECUTABLE_ARGS must not be set if EXECUTABLE is not set") - endif() + endif () - if("--output" IN_LIST GCOVR_ADDITIONAL_ARGS) + if ("--output" IN_LIST GCOVR_ADDITIONAL_ARGS) message(FATAL_ERROR "Unsupported --output option detected in GCOVR_ADDITIONAL_ARGS! Aborting...") - else() - if((Coverage_FORMAT STREQUAL "html-details") - OR (Coverage_FORMAT STREQUAL "html-nested")) + else () + if ((Coverage_FORMAT STREQUAL "html-details") OR (Coverage_FORMAT STREQUAL "html-nested")) set(GCOVR_OUTPUT_FILE ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html) set(GCOVR_CREATE_FOLDER ${PROJECT_BINARY_DIR}/${Coverage_NAME}) - elseif(Coverage_FORMAT STREQUAL "html-single") + elseif (Coverage_FORMAT STREQUAL "html-single") set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.html) - elseif((Coverage_FORMAT STREQUAL "json-summary") - OR (Coverage_FORMAT STREQUAL "json-details") - OR (Coverage_FORMAT STREQUAL "coveralls")) + elseif ((Coverage_FORMAT STREQUAL "json-summary") OR (Coverage_FORMAT STREQUAL "json-details") + OR (Coverage_FORMAT STREQUAL "coveralls")) set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.json) - elseif(Coverage_FORMAT STREQUAL "txt") + elseif (Coverage_FORMAT STREQUAL "txt") set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.txt) - elseif(Coverage_FORMAT STREQUAL "csv") + elseif (Coverage_FORMAT STREQUAL "csv") set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.csv) - elseif(Coverage_FORMAT STREQUAL "lcov") + elseif (Coverage_FORMAT STREQUAL "lcov") set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.lcov) - else() + else () set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.xml) - endif() - endif() + endif () + endif () - if((Coverage_FORMAT STREQUAL "cobertura") - OR (Coverage_FORMAT STREQUAL "xml")) - list(APPEND GCOVR_ADDITIONAL_ARGS --cobertura "${GCOVR_OUTPUT_FILE}" ) - list(APPEND GCOVR_ADDITIONAL_ARGS --cobertura-pretty ) + if ((Coverage_FORMAT STREQUAL "cobertura") OR (Coverage_FORMAT STREQUAL "xml")) + list(APPEND GCOVR_ADDITIONAL_ARGS --cobertura "${GCOVR_OUTPUT_FILE}") + list(APPEND GCOVR_ADDITIONAL_ARGS --cobertura-pretty) set(Coverage_FORMAT cobertura) # overwrite xml - elseif(Coverage_FORMAT STREQUAL "sonarqube") - list(APPEND GCOVR_ADDITIONAL_ARGS --sonarqube "${GCOVR_OUTPUT_FILE}" ) - elseif(Coverage_FORMAT STREQUAL "jacoco") - list(APPEND GCOVR_ADDITIONAL_ARGS --jacoco "${GCOVR_OUTPUT_FILE}" ) - list(APPEND GCOVR_ADDITIONAL_ARGS --jacoco-pretty ) - elseif(Coverage_FORMAT STREQUAL "clover") - list(APPEND GCOVR_ADDITIONAL_ARGS --clover "${GCOVR_OUTPUT_FILE}" ) - list(APPEND GCOVR_ADDITIONAL_ARGS --clover-pretty ) - elseif(Coverage_FORMAT STREQUAL "lcov") - list(APPEND GCOVR_ADDITIONAL_ARGS --lcov "${GCOVR_OUTPUT_FILE}" ) - elseif(Coverage_FORMAT STREQUAL "json-summary") - list(APPEND GCOVR_ADDITIONAL_ARGS --json-summary "${GCOVR_OUTPUT_FILE}" ) + elseif (Coverage_FORMAT STREQUAL "sonarqube") + list(APPEND GCOVR_ADDITIONAL_ARGS --sonarqube "${GCOVR_OUTPUT_FILE}") + elseif (Coverage_FORMAT STREQUAL "jacoco") + list(APPEND GCOVR_ADDITIONAL_ARGS --jacoco "${GCOVR_OUTPUT_FILE}") + list(APPEND GCOVR_ADDITIONAL_ARGS --jacoco-pretty) + elseif (Coverage_FORMAT STREQUAL "clover") + list(APPEND GCOVR_ADDITIONAL_ARGS --clover "${GCOVR_OUTPUT_FILE}") + list(APPEND GCOVR_ADDITIONAL_ARGS --clover-pretty) + elseif (Coverage_FORMAT STREQUAL "lcov") + list(APPEND GCOVR_ADDITIONAL_ARGS --lcov "${GCOVR_OUTPUT_FILE}") + elseif (Coverage_FORMAT STREQUAL "json-summary") + list(APPEND GCOVR_ADDITIONAL_ARGS --json-summary "${GCOVR_OUTPUT_FILE}") list(APPEND GCOVR_ADDITIONAL_ARGS --json-summary-pretty) - elseif(Coverage_FORMAT STREQUAL "json-details") - list(APPEND GCOVR_ADDITIONAL_ARGS --json "${GCOVR_OUTPUT_FILE}" ) + elseif (Coverage_FORMAT STREQUAL "json-details") + list(APPEND GCOVR_ADDITIONAL_ARGS --json "${GCOVR_OUTPUT_FILE}") list(APPEND GCOVR_ADDITIONAL_ARGS --json-pretty) - elseif(Coverage_FORMAT STREQUAL "coveralls") - list(APPEND GCOVR_ADDITIONAL_ARGS --coveralls "${GCOVR_OUTPUT_FILE}" ) + elseif (Coverage_FORMAT STREQUAL "coveralls") + list(APPEND GCOVR_ADDITIONAL_ARGS --coveralls "${GCOVR_OUTPUT_FILE}") list(APPEND GCOVR_ADDITIONAL_ARGS --coveralls-pretty) - elseif(Coverage_FORMAT STREQUAL "csv") - list(APPEND GCOVR_ADDITIONAL_ARGS --csv "${GCOVR_OUTPUT_FILE}" ) - elseif(Coverage_FORMAT STREQUAL "txt") - list(APPEND GCOVR_ADDITIONAL_ARGS --txt "${GCOVR_OUTPUT_FILE}" ) - elseif(Coverage_FORMAT STREQUAL "html-single") - list(APPEND GCOVR_ADDITIONAL_ARGS --html "${GCOVR_OUTPUT_FILE}" ) + elseif (Coverage_FORMAT STREQUAL "csv") + list(APPEND GCOVR_ADDITIONAL_ARGS --csv "${GCOVR_OUTPUT_FILE}") + elseif (Coverage_FORMAT STREQUAL "txt") + list(APPEND GCOVR_ADDITIONAL_ARGS --txt "${GCOVR_OUTPUT_FILE}") + elseif (Coverage_FORMAT STREQUAL "html-single") + list(APPEND GCOVR_ADDITIONAL_ARGS --html "${GCOVR_OUTPUT_FILE}") list(APPEND GCOVR_ADDITIONAL_ARGS --html-self-contained) - elseif(Coverage_FORMAT STREQUAL "html-nested") - list(APPEND GCOVR_ADDITIONAL_ARGS --html-nested "${GCOVR_OUTPUT_FILE}" ) - elseif(Coverage_FORMAT STREQUAL "html-details") - list(APPEND GCOVR_ADDITIONAL_ARGS --html-details "${GCOVR_OUTPUT_FILE}" ) - else() + elseif (Coverage_FORMAT STREQUAL "html-nested") + list(APPEND GCOVR_ADDITIONAL_ARGS --html-nested "${GCOVR_OUTPUT_FILE}") + elseif (Coverage_FORMAT STREQUAL "html-details") + list(APPEND GCOVR_ADDITIONAL_ARGS --html-details "${GCOVR_OUTPUT_FILE}") + else () message(FATAL_ERROR "Unsupported output style ${Coverage_FORMAT}! Aborting...") - endif() + endif () # Collect excludes (CMake 3.4+: Also compute absolute paths) set(GCOVR_EXCLUDES "") - foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES}) - if(CMAKE_VERSION VERSION_GREATER 3.4) + foreach (EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES}) + if (CMAKE_VERSION VERSION_GREATER 3.4) get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR}) - endif() + endif () list(APPEND GCOVR_EXCLUDES "${EXCLUDE}") - endforeach() + endforeach () list(REMOVE_DUPLICATES GCOVR_EXCLUDES) # Combine excludes to several -e arguments set(GCOVR_EXCLUDE_ARGS "") - foreach(EXCLUDE ${GCOVR_EXCLUDES}) + foreach (EXCLUDE ${GCOVR_EXCLUDES}) list(APPEND GCOVR_EXCLUDE_ARGS "-e") list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}") - endforeach() + endforeach () # Set up commands which will be run to generate coverage data # If EXECUTABLE is not set, the user is expected to run the tests manually # before running the coverage target NAME - if(DEFINED Coverage_EXECUTABLE) - set(GCOVR_EXEC_TESTS_CMD - ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} - ) - endif() + if (DEFINED Coverage_EXECUTABLE) + set(GCOVR_EXEC_TESTS_CMD ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}) + endif () # Create folder - if(DEFINED GCOVR_CREATE_FOLDER) - set(GCOVR_FOLDER_CMD - ${CMAKE_COMMAND} -E make_directory ${GCOVR_CREATE_FOLDER}) - endif() + if (DEFINED GCOVR_CREATE_FOLDER) + set(GCOVR_FOLDER_CMD ${CMAKE_COMMAND} -E make_directory ${GCOVR_CREATE_FOLDER}) + endif () # Running gcovr set(GCOVR_CMD ${GCOVR_PATH} - --gcov-executable ${GCOV_TOOL} + --gcov-executable + ${GCOV_TOOL} --gcov-ignore-parse-errors=negative_hits.warn_once_per_file - -r ${BASEDIR} + -r + ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS} ${GCOVR_EXCLUDE_ARGS} - --object-directory=${PROJECT_BINARY_DIR} - ) + --object-directory=${PROJECT_BINARY_DIR}) - if(CODE_COVERAGE_VERBOSE) + if (CODE_COVERAGE_VERBOSE) message(STATUS "Executed command report") - if(NOT "${GCOVR_EXEC_TESTS_CMD}" STREQUAL "") + if (NOT "${GCOVR_EXEC_TESTS_CMD}" STREQUAL "") message(STATUS "Command to run tests: ") string(REPLACE ";" " " GCOVR_EXEC_TESTS_CMD_SPACED "${GCOVR_EXEC_TESTS_CMD}") message(STATUS "${GCOVR_EXEC_TESTS_CMD_SPACED}") - endif() + endif () - if(NOT "${GCOVR_FOLDER_CMD}" STREQUAL "") + if (NOT "${GCOVR_FOLDER_CMD}" STREQUAL "") message(STATUS "Command to create a folder: ") string(REPLACE ";" " " GCOVR_FOLDER_CMD_SPACED "${GCOVR_FOLDER_CMD}") message(STATUS "${GCOVR_FOLDER_CMD_SPACED}") - endif() + endif () message(STATUS "Command to generate gcovr coverage data: ") string(REPLACE ";" " " GCOVR_CMD_SPACED "${GCOVR_CMD}") message(STATUS "${GCOVR_CMD_SPACED}") - endif() + endif () add_custom_target(${Coverage_NAME} - COMMAND ${GCOVR_EXEC_TESTS_CMD} - COMMAND ${GCOVR_FOLDER_CMD} - COMMAND ${GCOVR_CMD} - - BYPRODUCTS ${GCOVR_OUTPUT_FILE} - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - DEPENDS ${Coverage_DEPENDENCIES} - VERBATIM # Protect arguments to commands - COMMENT "Running gcovr to produce code coverage report." - ) + COMMAND ${GCOVR_EXEC_TESTS_CMD} + COMMAND ${GCOVR_FOLDER_CMD} + COMMAND ${GCOVR_CMD} + BYPRODUCTS ${GCOVR_OUTPUT_FILE} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + DEPENDS ${Coverage_DEPENDENCIES} + VERBATIM # Protect arguments to commands + COMMENT "Running gcovr to produce code coverage report.") # Show info where to find the report - add_custom_command(TARGET ${Coverage_NAME} POST_BUILD - COMMAND echo - COMMENT "Code coverage report saved in ${GCOVR_OUTPUT_FILE} formatted as ${Coverage_FORMAT}" - ) -endfunction() # setup_target_for_coverage_gcovr + add_custom_command(TARGET ${Coverage_NAME} POST_BUILD COMMAND echo + COMMENT "Code coverage report saved in ${GCOVR_OUTPUT_FILE} formatted as ${Coverage_FORMAT}") +endfunction () # setup_target_for_coverage_gcovr -function(add_code_coverage_to_target name scope) +function (add_code_coverage_to_target name scope) separate_arguments(COVERAGE_CXX_COMPILER_FLAGS NATIVE_COMMAND "${COVERAGE_CXX_COMPILER_FLAGS}") separate_arguments(COVERAGE_C_COMPILER_FLAGS NATIVE_COMMAND "${COVERAGE_C_COMPILER_FLAGS}") separate_arguments(COVERAGE_CXX_LINKER_FLAGS NATIVE_COMMAND "${COVERAGE_CXX_LINKER_FLAGS}") separate_arguments(COVERAGE_C_LINKER_FLAGS NATIVE_COMMAND "${COVERAGE_C_LINKER_FLAGS}") # Add compiler options to the target - target_compile_options(${name} ${scope} - $<$:${COVERAGE_CXX_COMPILER_FLAGS}> - $<$:${COVERAGE_C_COMPILER_FLAGS}>) + target_compile_options(${name} ${scope} $<$:${COVERAGE_CXX_COMPILER_FLAGS}> + $<$:${COVERAGE_C_COMPILER_FLAGS}>) - target_link_libraries (${name} ${scope} - $<$:${COVERAGE_CXX_LINKER_FLAGS} gcov> - $<$:${COVERAGE_C_LINKER_FLAGS} gcov> - ) -endfunction() # add_code_coverage_to_target + target_link_libraries( + ${name} + ${scope} + $<$:${COVERAGE_CXX_LINKER_FLAGS} + gcov> + $<$:${COVERAGE_C_LINKER_FLAGS} + gcov>) +endfunction () # add_code_coverage_to_target diff --git a/cmake/XrplCore.cmake b/cmake/XrplCore.cmake index 2e50cd2f7a..0651b8e0d8 100644 --- a/cmake/XrplCore.cmake +++ b/cmake/XrplCore.cmake @@ -10,63 +10,44 @@ include(target_protobuf_sources) # so we just build them as a separate library. add_library(xrpl.libpb) set_target_properties(xrpl.libpb PROPERTIES UNITY_BUILD OFF) -target_protobuf_sources(xrpl.libpb xrpl/proto - LANGUAGE cpp - IMPORT_DIRS include/xrpl/proto - PROTOS include/xrpl/proto/xrpl.proto -) +target_protobuf_sources(xrpl.libpb xrpl/proto LANGUAGE cpp IMPORT_DIRS include/xrpl/proto + PROTOS include/xrpl/proto/xrpl.proto) file(GLOB_RECURSE protos "include/xrpl/proto/org/*.proto") -target_protobuf_sources(xrpl.libpb xrpl/proto - LANGUAGE cpp - IMPORT_DIRS include/xrpl/proto - PROTOS "${protos}" -) -target_protobuf_sources(xrpl.libpb xrpl/proto - LANGUAGE grpc - IMPORT_DIRS include/xrpl/proto - PROTOS "${protos}" - PLUGIN protoc-gen-grpc=$ - GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc -) +target_protobuf_sources(xrpl.libpb xrpl/proto LANGUAGE cpp IMPORT_DIRS include/xrpl/proto PROTOS "${protos}") +target_protobuf_sources( + xrpl.libpb xrpl/proto + LANGUAGE grpc + IMPORT_DIRS include/xrpl/proto + PROTOS "${protos}" + PLUGIN protoc-gen-grpc=$ + GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc) -target_compile_options(xrpl.libpb - PUBLIC - $<$:-wd4996> - $<$: - --system-header-prefix="google/protobuf" - -Wno-deprecated-dynamic-exception-spec - > - PRIVATE - $<$:-wd4065> - $<$>:-Wno-deprecated-declarations> -) +target_compile_options( + xrpl.libpb PUBLIC $<$:-wd4996> $<$: --system-header-prefix="google/protobuf" + -Wno-deprecated-dynamic-exception-spec > + PRIVATE $<$:-wd4065> $<$>:-Wno-deprecated-declarations>) -target_link_libraries(xrpl.libpb - PUBLIC - protobuf::libprotobuf - gRPC::grpc++ -) +target_link_libraries(xrpl.libpb PUBLIC protobuf::libprotobuf gRPC::grpc++) # TODO: Clean up the number of library targets later. add_library(xrpl.imports.main INTERFACE) -target_link_libraries(xrpl.imports.main - INTERFACE - absl::random_random - date::date - ed25519::ed25519 - LibArchive::LibArchive - OpenSSL::Crypto - Xrpl::boost - Xrpl::libs - Xrpl::opts - Xrpl::syslibs - secp256k1::secp256k1 - xrpl.libpb - xxHash::xxhash - $<$:antithesis-sdk-cpp> -) +target_link_libraries( + xrpl.imports.main + INTERFACE absl::random_random + date::date + ed25519::ed25519 + LibArchive::LibArchive + OpenSSL::Crypto + Xrpl::boost + Xrpl::libs + Xrpl::opts + Xrpl::syslibs + secp256k1::secp256k1 + xrpl.libpb + xxHash::xxhash + $<$:antithesis-sdk-cpp>) include(add_module) include(target_link_modules) @@ -88,18 +69,11 @@ target_link_libraries(xrpl.libxrpl.crypto PUBLIC xrpl.libxrpl.basics) # Level 04 add_module(xrpl protocol) -target_link_libraries(xrpl.libxrpl.protocol PUBLIC - xrpl.libxrpl.crypto - xrpl.libxrpl.json -) +target_link_libraries(xrpl.libxrpl.protocol PUBLIC xrpl.libxrpl.crypto xrpl.libxrpl.json) # Level 05 add_module(xrpl core) -target_link_libraries(xrpl.libxrpl.core PUBLIC - xrpl.libxrpl.basics - xrpl.libxrpl.json - xrpl.libxrpl.protocol -) +target_link_libraries(xrpl.libxrpl.core PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json xrpl.libxrpl.protocol) # Level 06 add_module(xrpl resource) @@ -107,62 +81,45 @@ target_link_libraries(xrpl.libxrpl.resource PUBLIC xrpl.libxrpl.protocol) # Level 07 add_module(xrpl net) -target_link_libraries(xrpl.libxrpl.net PUBLIC - xrpl.libxrpl.basics - xrpl.libxrpl.json - xrpl.libxrpl.protocol - xrpl.libxrpl.resource -) +target_link_libraries(xrpl.libxrpl.net PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json xrpl.libxrpl.protocol + xrpl.libxrpl.resource) add_module(xrpl server) target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol) add_module(xrpl nodestore) -target_link_libraries(xrpl.libxrpl.nodestore PUBLIC - xrpl.libxrpl.basics - xrpl.libxrpl.json - xrpl.libxrpl.protocol -) +target_link_libraries(xrpl.libxrpl.nodestore PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json xrpl.libxrpl.protocol) add_module(xrpl shamap) -target_link_libraries(xrpl.libxrpl.shamap PUBLIC - xrpl.libxrpl.basics - xrpl.libxrpl.crypto - xrpl.libxrpl.protocol - xrpl.libxrpl.nodestore -) +target_link_libraries(xrpl.libxrpl.shamap PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.crypto xrpl.libxrpl.protocol + xrpl.libxrpl.nodestore) add_module(xrpl ledger) -target_link_libraries(xrpl.libxrpl.ledger PUBLIC - xrpl.libxrpl.basics - xrpl.libxrpl.json - xrpl.libxrpl.protocol -) +target_link_libraries(xrpl.libxrpl.ledger PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json xrpl.libxrpl.protocol) add_library(xrpl.libxrpl) set_target_properties(xrpl.libxrpl PROPERTIES OUTPUT_NAME xrpl) add_library(xrpl::libxrpl ALIAS xrpl.libxrpl) -file(GLOB_RECURSE sources CONFIGURE_DEPENDS - "${CMAKE_CURRENT_SOURCE_DIR}/src/libxrpl/*.cpp" -) +file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/libxrpl/*.cpp") target_sources(xrpl.libxrpl PRIVATE ${sources}) -target_link_modules(xrpl PUBLIC - basics - beast - core - crypto - json - protocol - resource - server - nodestore - shamap - net - ledger -) +target_link_modules( + xrpl + PUBLIC + basics + beast + core + crypto + json + protocol + resource + server + nodestore + shamap + net + ledger) # All headers in libxrpl are in modules. # Uncomment this stanza if you have not yet moved new headers into a module. @@ -173,63 +130,42 @@ target_link_modules(xrpl PUBLIC # $ # $) -if(xrpld) - add_executable(xrpld) - if(tests) - target_compile_definitions(xrpld PUBLIC ENABLE_TESTS) - target_compile_definitions(xrpld PRIVATE - UNIT_TEST_REFERENCE_FEE=${UNIT_TEST_REFERENCE_FEE} - ) - endif() - target_include_directories(xrpld - PRIVATE - $ - ) +if (xrpld) + add_executable(xrpld) + if (tests) + target_compile_definitions(xrpld PUBLIC ENABLE_TESTS) + target_compile_definitions(xrpld PRIVATE UNIT_TEST_REFERENCE_FEE=${UNIT_TEST_REFERENCE_FEE}) + endif () + target_include_directories(xrpld PRIVATE $) - file(GLOB_RECURSE sources CONFIGURE_DEPENDS - "${CMAKE_CURRENT_SOURCE_DIR}/src/xrpld/*.cpp" - ) - target_sources(xrpld PRIVATE ${sources}) - - if(tests) - file(GLOB_RECURSE sources CONFIGURE_DEPENDS - "${CMAKE_CURRENT_SOURCE_DIR}/src/test/*.cpp" - ) + file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/xrpld/*.cpp") target_sources(xrpld PRIVATE ${sources}) - endif() - target_link_libraries(xrpld - Xrpl::boost - Xrpl::opts - Xrpl::libs - xrpl.libxrpl - ) - exclude_if_included(xrpld) - # define a macro for tests that might need to - # be excluded or run differently in CI environment - if(is_ci) - target_compile_definitions(xrpld PRIVATE XRPL_RUNNING_IN_CI) - endif () + if (tests) + file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/test/*.cpp") + target_sources(xrpld PRIVATE ${sources}) + endif () - if(voidstar) - target_compile_options(xrpld - PRIVATE - -fsanitize-coverage=trace-pc-guard - ) - # xrpld requires access to antithesis-sdk-cpp implementation file - # antithesis_instrumentation.h, which is not exported as INTERFACE - target_include_directories(xrpld - PRIVATE - ${CMAKE_SOURCE_DIR}/external/antithesis-sdk - ) - endif() + target_link_libraries(xrpld Xrpl::boost Xrpl::opts Xrpl::libs xrpl.libxrpl) + exclude_if_included(xrpld) + # define a macro for tests that might need to + # be excluded or run differently in CI environment + if (is_ci) + target_compile_definitions(xrpld PRIVATE XRPL_RUNNING_IN_CI) + endif () - # any files that don't play well with unity should be added here - if(tests) - set_source_files_properties( - # these two seem to produce conflicts in beast teardown template methods - src/test/rpc/ValidatorRPC_test.cpp - src/test/ledger/Invariants_test.cpp - PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE) - endif() -endif() + if (voidstar) + target_compile_options(xrpld PRIVATE -fsanitize-coverage=trace-pc-guard) + # xrpld requires access to antithesis-sdk-cpp implementation file + # antithesis_instrumentation.h, which is not exported as INTERFACE + target_include_directories(xrpld PRIVATE ${CMAKE_SOURCE_DIR}/external/antithesis-sdk) + endif () + + # any files that don't play well with unity should be added here + if (tests) + set_source_files_properties( + # these two seem to produce conflicts in beast teardown template methods + src/test/rpc/ValidatorRPC_test.cpp src/test/ledger/Invariants_test.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION + TRUE) + endif () +endif () diff --git a/cmake/XrplDocs.cmake b/cmake/XrplDocs.cmake index a99bbe076b..69581a99c7 100644 --- a/cmake/XrplDocs.cmake +++ b/cmake/XrplDocs.cmake @@ -2,45 +2,44 @@ docs target (optional) #]===================================================================] -if(NOT only_docs) - return() -endif() +if (NOT only_docs) + return() +endif () find_package(Doxygen) -if(NOT TARGET Doxygen::doxygen) - message(STATUS "doxygen executable not found -- skipping docs target") - return() -endif() +if (NOT TARGET Doxygen::doxygen) + message(STATUS "doxygen executable not found -- skipping docs target") + return() +endif () set(doxygen_output_directory "${CMAKE_BINARY_DIR}/docs") set(doxygen_include_path "${CMAKE_CURRENT_SOURCE_DIR}/src") set(doxygen_index_file "${doxygen_output_directory}/html/index.html") set(doxyfile "${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile") -file(GLOB_RECURSE doxygen_input - docs/*.md - include/*.h - include/*.cpp - include/*.md - src/*.h - src/*.cpp - src/*.md - Builds/*.md - *.md) -list(APPEND doxygen_input - external/README.md - ) +file(GLOB_RECURSE + doxygen_input + docs/*.md + include/*.h + include/*.cpp + include/*.md + src/*.h + src/*.cpp + src/*.md + Builds/*.md + *.md) +list(APPEND doxygen_input external/README.md) set(dependencies "${doxygen_input}" "${doxyfile}") -function(verbose_find_path variable name) - # find_path sets a CACHE variable, so don't try using a "local" variable. - find_path(${variable} "${name}" ${ARGN}) - if(NOT ${variable}) - message(NOTICE "could not find ${name}") - else() - message(STATUS "found ${name}: ${${variable}}/${name}") - endif() -endfunction() +function (verbose_find_path variable name) + # find_path sets a CACHE variable, so don't try using a "local" variable. + find_path(${variable} "${name}" ${ARGN}) + if (NOT ${variable}) + message(NOTICE "could not find ${name}") + else () + message(STATUS "found ${name}: ${${variable}}/${name}") + endif () +endfunction () verbose_find_path(doxygen_plantuml_jar_path plantuml.jar PATH_SUFFIXES share/plantuml) verbose_find_path(doxygen_dot_path dot) @@ -48,36 +47,26 @@ verbose_find_path(doxygen_dot_path dot) # https://en.cppreference.com/w/Cppreference:Archives # https://stackoverflow.com/questions/60822559/how-to-move-a-file-download-from-configure-step-to-build-step set(download_script "${CMAKE_BINARY_DIR}/docs/download-cppreference.cmake") -file(WRITE - "${download_script}" - "file(DOWNLOAD \ +file(WRITE "${download_script}" + "file(DOWNLOAD \ https://github.com/PeterFeicht/cppreference-doc/releases/download/v20250209/html-book-20250209.zip \ ${CMAKE_BINARY_DIR}/docs/cppreference.zip \ EXPECTED_HASH MD5=bda585f72fbca4b817b29a3d5746567b \ )\n \ execute_process( \ COMMAND \"${CMAKE_COMMAND}\" -E tar -xf cppreference.zip \ - )\n" -) + )\n") set(tagfile "${CMAKE_BINARY_DIR}/docs/cppreference-doxygen-web.tag.xml") -add_custom_command( - OUTPUT "${tagfile}" - COMMAND "${CMAKE_COMMAND}" -P "${download_script}" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/docs" -) +add_custom_command(OUTPUT "${tagfile}" COMMAND "${CMAKE_COMMAND}" -P "${download_script}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/docs") set(doxygen_tagfiles "${tagfile}=http://en.cppreference.com/w/") add_custom_command( - OUTPUT "${doxygen_index_file}" - COMMAND "${CMAKE_COMMAND}" -E env - "DOXYGEN_OUTPUT_DIRECTORY=${doxygen_output_directory}" - "DOXYGEN_INCLUDE_PATH=${doxygen_include_path}" - "DOXYGEN_TAGFILES=${doxygen_tagfiles}" - "DOXYGEN_PLANTUML_JAR_PATH=${doxygen_plantuml_jar_path}" - "DOXYGEN_DOT_PATH=${doxygen_dot_path}" - "${DOXYGEN_EXECUTABLE}" "${doxyfile}" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - DEPENDS "${dependencies}" "${tagfile}") -add_custom_target(docs - DEPENDS "${doxygen_index_file}" - SOURCES "${dependencies}") + OUTPUT "${doxygen_index_file}" + COMMAND "${CMAKE_COMMAND}" -E env "DOXYGEN_OUTPUT_DIRECTORY=${doxygen_output_directory}" + "DOXYGEN_INCLUDE_PATH=${doxygen_include_path}" "DOXYGEN_TAGFILES=${doxygen_tagfiles}" + "DOXYGEN_PLANTUML_JAR_PATH=${doxygen_plantuml_jar_path}" "DOXYGEN_DOT_PATH=${doxygen_dot_path}" + "${DOXYGEN_EXECUTABLE}" "${doxyfile}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + DEPENDS "${dependencies}" "${tagfile}") +add_custom_target(docs DEPENDS "${doxygen_index_file}" SOURCES "${dependencies}") diff --git a/cmake/XrplInstall.cmake b/cmake/XrplInstall.cmake index 0599a8268c..141dc56089 100644 --- a/cmake/XrplInstall.cmake +++ b/cmake/XrplInstall.cmake @@ -6,61 +6,51 @@ include(create_symbolic_link) # If no suffix is defined for executables (e.g. Windows uses .exe but Linux # and macOS use none), then explicitly set it to the empty string. -if(NOT DEFINED suffix) - set(suffix "") -endif() +if (NOT DEFINED suffix) + set(suffix "") +endif () -install ( - TARGETS - common - opts - xrpl_boost - xrpl_libs - xrpl_syslibs - xrpl.imports.main - xrpl.libpb - xrpl.libxrpl - xrpl.libxrpl.basics - xrpl.libxrpl.beast - xrpl.libxrpl.core - xrpl.libxrpl.crypto - xrpl.libxrpl.json - xrpl.libxrpl.ledger - xrpl.libxrpl.net - xrpl.libxrpl.nodestore - xrpl.libxrpl.protocol - xrpl.libxrpl.resource - xrpl.libxrpl.server - xrpl.libxrpl.shamap - antithesis-sdk-cpp - EXPORT XrplExports - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include) +install(TARGETS common + opts + xrpl_boost + xrpl_libs + xrpl_syslibs + xrpl.imports.main + xrpl.libpb + xrpl.libxrpl + xrpl.libxrpl.basics + xrpl.libxrpl.beast + xrpl.libxrpl.core + xrpl.libxrpl.crypto + xrpl.libxrpl.json + xrpl.libxrpl.ledger + xrpl.libxrpl.net + xrpl.libxrpl.nodestore + xrpl.libxrpl.protocol + xrpl.libxrpl.resource + xrpl.libxrpl.server + xrpl.libxrpl.shamap + antithesis-sdk-cpp + EXPORT XrplExports + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + INCLUDES + DESTINATION include) -install( - DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" -) +install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") -install (EXPORT XrplExports - FILE XrplTargets.cmake - NAMESPACE Xrpl:: - DESTINATION lib/cmake/xrpl) -include (CMakePackageConfigHelpers) -write_basic_package_version_file ( - XrplConfigVersion.cmake - VERSION ${xrpld_version} - COMPATIBILITY SameMajorVersion) +install(EXPORT XrplExports FILE XrplTargets.cmake NAMESPACE Xrpl:: DESTINATION lib/cmake/xrpl) +include(CMakePackageConfigHelpers) +write_basic_package_version_file(XrplConfigVersion.cmake VERSION ${xrpld_version} COMPATIBILITY SameMajorVersion) if (is_root_project AND TARGET xrpld) - install (TARGETS xrpld RUNTIME DESTINATION bin) - set_target_properties(xrpld PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON) - # sample configs should not overwrite existing files - # install if-not-exists workaround as suggested by - # https://cmake.org/Bug/view.php?id=12646 - install(CODE " + install(TARGETS xrpld RUNTIME DESTINATION bin) + set_target_properties(xrpld PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON) + # sample configs should not overwrite existing files + # install if-not-exists workaround as suggested by + # https://cmake.org/Bug/view.php?id=12646 + install(CODE " macro (copy_if_not_exists SRC DEST NEWNAME) if (NOT EXISTS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DEST}/\${NEWNAME}\") file (INSTALL FILE_PERMISSIONS OWNER_READ OWNER_WRITE DESTINATION \"\${CMAKE_INSTALL_PREFIX}/\${DEST}\" FILES \"\${SRC}\" RENAME \"\${NEWNAME}\") @@ -71,7 +61,7 @@ if (is_root_project AND TARGET xrpld) copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/xrpld-example.cfg\" etc xrpld.cfg) copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/validators-example.txt\" etc validators.txt) ") - install(CODE " + install(CODE " set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\") include(create_symbolic_link) create_symbolic_link(xrpld${suffix} \ @@ -79,8 +69,5 @@ if (is_root_project AND TARGET xrpld) ") endif () -install ( - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/XrplConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/XrplConfigVersion.cmake - DESTINATION lib/cmake/xrpl) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/XrplConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/XrplConfigVersion.cmake + DESTINATION lib/cmake/xrpl) diff --git a/cmake/add_module.cmake b/cmake/add_module.cmake index bcfce1bf60..a3cb247fd2 100644 --- a/cmake/add_module.cmake +++ b/cmake/add_module.cmake @@ -12,26 +12,14 @@ include(isolate_headers) # add_module(parent a) # add_module(parent b) # target_link_libraries(project.libparent.b PUBLIC project.libparent.a) -function(add_module parent name) - set(target ${PROJECT_NAME}.lib${parent}.${name}) - add_library(${target} OBJECT) - file(GLOB_RECURSE sources CONFIGURE_DEPENDS - "${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}/*.cpp" - ) - target_sources(${target} PRIVATE ${sources}) - target_include_directories(${target} PUBLIC - "$" - ) - isolate_headers( - ${target} - "${CMAKE_CURRENT_SOURCE_DIR}/include" - "${CMAKE_CURRENT_SOURCE_DIR}/include/${parent}/${name}" - PUBLIC - ) - isolate_headers( - ${target} - "${CMAKE_CURRENT_SOURCE_DIR}/src" - "${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}" - PRIVATE - ) -endfunction() +function (add_module parent name) + set(target ${PROJECT_NAME}.lib${parent}.${name}) + add_library(${target} OBJECT) + file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}/*.cpp") + target_sources(${target} PRIVATE ${sources}) + target_include_directories(${target} PUBLIC "$") + isolate_headers(${target} "${CMAKE_CURRENT_SOURCE_DIR}/include" + "${CMAKE_CURRENT_SOURCE_DIR}/include/${parent}/${name}" PUBLIC) + isolate_headers(${target} "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}" + PRIVATE) +endfunction () diff --git a/cmake/isolate_headers.cmake b/cmake/isolate_headers.cmake index 0a5a43a6a2..ef53b3f20a 100644 --- a/cmake/isolate_headers.cmake +++ b/cmake/isolate_headers.cmake @@ -37,12 +37,12 @@ include(create_symbolic_link) # `${CMAKE_CURRENT_BINARY_DIR}/include/${target}`. # # isolate_headers(target A B scope) -function(isolate_headers target A B scope) - file(RELATIVE_PATH C "${A}" "${B}") - set(X "${CMAKE_CURRENT_BINARY_DIR}/modules/${target}") - set(Y "${X}/${C}") - cmake_path(GET Y PARENT_PATH parent) - file(MAKE_DIRECTORY "${parent}") - create_symbolic_link("${B}" "${Y}") - target_include_directories(${target} ${scope} "$") -endfunction() +function (isolate_headers target A B scope) + file(RELATIVE_PATH C "${A}" "${B}") + set(X "${CMAKE_CURRENT_BINARY_DIR}/modules/${target}") + set(Y "${X}/${C}") + cmake_path(GET Y PARENT_PATH parent) + file(MAKE_DIRECTORY "${parent}") + create_symbolic_link("${B}" "${Y}") + target_include_directories(${target} ${scope} "$") +endfunction () diff --git a/cmake/target_link_modules.cmake b/cmake/target_link_modules.cmake index acbf67903a..bcd80591b0 100644 --- a/cmake/target_link_modules.cmake +++ b/cmake/target_link_modules.cmake @@ -6,19 +6,19 @@ # target_link_libraries(project.libparent.b PUBLIC project.libparent.a) # add_library(project.libparent) # target_link_modules(parent PUBLIC a b) -function(target_link_modules parent scope) - set(library ${PROJECT_NAME}.lib${parent}) - foreach(name ${ARGN}) - set(module ${library}.${name}) - get_target_property(sources ${library} SOURCES) - list(LENGTH sources before) - get_target_property(dupes ${module} SOURCES) - list(LENGTH dupes expected) - list(REMOVE_ITEM sources ${dupes}) - list(LENGTH sources after) - math(EXPR actual "${before} - ${after}") - message(STATUS "${module} with ${expected} sources took ${actual} sources from ${library}") - set_target_properties(${library} PROPERTIES SOURCES "${sources}") - target_link_libraries(${library} ${scope} ${module}) - endforeach() -endfunction() +function (target_link_modules parent scope) + set(library ${PROJECT_NAME}.lib${parent}) + foreach (name ${ARGN}) + set(module ${library}.${name}) + get_target_property(sources ${library} SOURCES) + list(LENGTH sources before) + get_target_property(dupes ${module} SOURCES) + list(LENGTH dupes expected) + list(REMOVE_ITEM sources ${dupes}) + list(LENGTH sources after) + math(EXPR actual "${before} - ${after}") + message(STATUS "${module} with ${expected} sources took ${actual} sources from ${library}") + set_target_properties(${library} PROPERTIES SOURCES "${sources}") + target_link_libraries(${library} ${scope} ${module}) + endforeach () +endfunction () diff --git a/cmake/target_protobuf_sources.cmake b/cmake/target_protobuf_sources.cmake index da2ef6dc9a..bb5de02b53 100644 --- a/cmake/target_protobuf_sources.cmake +++ b/cmake/target_protobuf_sources.cmake @@ -35,28 +35,20 @@ find_package(Protobuf REQUIRED) # This prefix should appear at the start of all your consumer includes. # ARGN: # A list of .proto files. -function(target_protobuf_sources target prefix) - set(dir "${CMAKE_CURRENT_BINARY_DIR}/pb-${target}") - file(MAKE_DIRECTORY "${dir}/${prefix}") +function (target_protobuf_sources target prefix) + set(dir "${CMAKE_CURRENT_BINARY_DIR}/pb-${target}") + file(MAKE_DIRECTORY "${dir}/${prefix}") - protobuf_generate( - TARGET ${target} - PROTOC_OUT_DIR "${dir}/${prefix}" - "${ARGN}" - ) - target_include_directories(${target} SYSTEM PUBLIC - # Allows #include used by consumer files. - $ - # Allows #include "path/to/file.proto" used by generated files. - $ - # Allows #include used by consumer files. - $ - # Allows #include "path/to/file.proto" used by generated files. - $ - ) - install( - DIRECTORY ${dir}/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING PATTERN "*.h" - ) -endfunction() + protobuf_generate(TARGET ${target} PROTOC_OUT_DIR "${dir}/${prefix}" "${ARGN}") + target_include_directories( + ${target} SYSTEM + PUBLIC # Allows #include used by consumer files. + $ + # Allows #include "path/to/file.proto" used by generated files. + $ + # Allows #include used by consumer files. + $ + # Allows #include "path/to/file.proto" used by generated files. + $) + install(DIRECTORY ${dir}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h") +endfunction () diff --git a/tests/conan/CMakeLists.txt b/tests/conan/CMakeLists.txt index f1b37e7a69..871c4c60c0 100644 --- a/tests/conan/CMakeLists.txt +++ b/tests/conan/CMakeLists.txt @@ -3,11 +3,7 @@ cmake_minimum_required(VERSION 3.21) set(name example) set(version 0.1.0) -project( - ${name} - VERSION ${version} - LANGUAGES CXX -) +project(${name} VERSION ${version} LANGUAGES CXX) find_package(xrpl CONFIG REQUIRED) From ff4520cc45cd6ce00ac59e50b49c84af3ec43b94 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 2 Feb 2026 19:37:06 +0000 Subject: [PATCH 02/26] ci: Update hashes of XRPLF/actions (#6316) This updates the hashes of all XRPLF/actions to their latest versions. --- .github/workflows/pre-commit.yml | 2 +- .github/workflows/publish-docs.yml | 2 +- .github/workflows/reusable-build-test-config.yml | 6 +++--- .github/workflows/upload-conan-deps.yml | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 6b8fd9955e..f43275201c 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -11,7 +11,7 @@ on: jobs: # Call the workflow in the XRPLF/actions repo that runs the pre-commit hooks. run-hooks: - uses: XRPLF/actions/.github/workflows/pre-commit.yml@282890f46d6921249d5659dd38babcb0bd8aef48 + uses: XRPLF/actions/.github/workflows/pre-commit.yml@320be44621ca2a080f05aeb15817c44b84518108 with: runs_on: ubuntu-latest container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit:sha-ab4d1f0" }' diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index c37a82a2f3..f61559d6d3 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -36,7 +36,7 @@ jobs: uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - name: Get number of processors - uses: XRPLF/actions/get-nproc@2ece4ec6ab7de266859a6f053571425b2bd684b6 + uses: XRPLF/actions/get-nproc@cf0433aa74563aead044a1e395610c96d65a37cf id: nproc with: subtract: ${{ env.NPROC_SUBTRACT }} diff --git a/.github/workflows/reusable-build-test-config.yml b/.github/workflows/reusable-build-test-config.yml index d298c85726..85b973ea0c 100644 --- a/.github/workflows/reusable-build-test-config.yml +++ b/.github/workflows/reusable-build-test-config.yml @@ -101,13 +101,13 @@ jobs: steps: - name: Cleanup workspace (macOS and Windows) if: ${{ runner.os == 'macOS' || runner.os == 'Windows' }} - uses: XRPLF/actions/cleanup-workspace@2ece4ec6ab7de266859a6f053571425b2bd684b6 + uses: XRPLF/actions/cleanup-workspace@cf0433aa74563aead044a1e395610c96d65a37cf - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - name: Prepare runner - uses: XRPLF/actions/prepare-runner@f05cab7b8541eee6473aa42beb9d2fe35608a190 + uses: XRPLF/actions/prepare-runner@2cbf481018d930656e9276fcc20dc0e3a0be5b6d with: enable_ccache: ${{ inputs.ccache_enabled }} @@ -119,7 +119,7 @@ jobs: uses: ./.github/actions/print-env - name: Get number of processors - uses: XRPLF/actions/get-nproc@2ece4ec6ab7de266859a6f053571425b2bd684b6 + uses: XRPLF/actions/get-nproc@cf0433aa74563aead044a1e395610c96d65a37cf id: nproc with: subtract: ${{ inputs.nproc_subtract }} diff --git a/.github/workflows/upload-conan-deps.yml b/.github/workflows/upload-conan-deps.yml index 2dada1ef08..60696a9769 100644 --- a/.github/workflows/upload-conan-deps.yml +++ b/.github/workflows/upload-conan-deps.yml @@ -64,13 +64,13 @@ jobs: steps: - name: Cleanup workspace (macOS and Windows) if: ${{ runner.os == 'macOS' || runner.os == 'Windows' }} - uses: XRPLF/actions/cleanup-workspace@2ece4ec6ab7de266859a6f053571425b2bd684b6 + uses: XRPLF/actions/cleanup-workspace@cf0433aa74563aead044a1e395610c96d65a37cf - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - name: Prepare runner - uses: XRPLF/actions/prepare-runner@f05cab7b8541eee6473aa42beb9d2fe35608a190 + uses: XRPLF/actions/prepare-runner@2cbf481018d930656e9276fcc20dc0e3a0be5b6d with: enable_ccache: false @@ -78,7 +78,7 @@ jobs: uses: ./.github/actions/print-env - name: Get number of processors - uses: XRPLF/actions/get-nproc@2ece4ec6ab7de266859a6f053571425b2bd684b6 + uses: XRPLF/actions/get-nproc@cf0433aa74563aead044a1e395610c96d65a37cf id: nproc with: subtract: ${{ env.NPROC_SUBTRACT }} From fe31cdc9f62b2be8981e02f0075c9f9dc0d115db Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Mon, 2 Feb 2026 19:57:10 -0400 Subject: [PATCH 03/26] chore: Add upper-case match for ARM64 in CompilationEnv (#6315) --- cmake/CompilationEnv.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CompilationEnv.cmake b/cmake/CompilationEnv.cmake index 39ec383398..59b903c13a 100644 --- a/cmake/CompilationEnv.cmake +++ b/cmake/CompilationEnv.cmake @@ -51,7 +51,7 @@ set(is_amd64 FALSE) set(is_arm64 FALSE) if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64") set(is_amd64 TRUE) -elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64") +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|ARM64") set(is_arm64 TRUE) else () message(FATAL_ERROR "Unknown architecture: ${CMAKE_SYSTEM_PROCESSOR}") From b1824301789f0e03add198e1664182711565d6e9 Mon Sep 17 00:00:00 2001 From: Bart Date: Mon, 2 Feb 2026 20:15:56 -0500 Subject: [PATCH 04/26] fix: Restore config changes that broke standalone mode (#6301) When support was added for `xrpld.cfg` in addition to `rippled.cfg` in https://github.com/XRPLF/rippled/pull/6098, as part of an effort to rename occurrences of ripple(d) to xrpl(d), the clearing and creation of the data directory were modified for what, at the time, seemed to result in an equivalent code flow. This has turned out to not be true, which is why this change restores two modifications to `Config.cpp` that currently break running the binary in standalone mode. --- src/xrpld/core/detail/Config.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xrpld/core/detail/Config.cpp b/src/xrpld/core/detail/Config.cpp index 74dfa6d5a8..0a60416af7 100644 --- a/src/xrpld/core/detail/Config.cpp +++ b/src/xrpld/core/detail/Config.cpp @@ -358,9 +358,11 @@ Config::setup(std::string const& strConf, bool bQuiet, bool bSilent, bool bStand std::string const dbPath(legacy("database_path")); if (!dbPath.empty()) dataDir = boost::filesystem::path(dbPath); + else if (RUN_STANDALONE) + dataDir.clear(); } - if (!RUN_STANDALONE) + if (!dataDir.empty()) { boost::system::error_code ec; boost::filesystem::create_directories(dataDir, ec); From 6d369e0f0250a81077214bfeef00fae0ffbf15bd Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Mon, 2 Feb 2026 21:12:26 -0500 Subject: [PATCH 05/26] docs: Update API changelog, add APIv2+APIv3 version documentation (#6308) This change cleans up the `API-CHANGELOG.md` file. It moves the version-specific documentation to other files and fleshes out the changelog with all the API-related changes in each version. --- API-CHANGELOG.md | 200 ++++++++++++++++++++++++----------------------- API-VERSION-2.md | 66 ++++++++++++++++ API-VERSION-3.md | 27 +++++++ CONTRIBUTING.md | 3 +- 4 files changed, 199 insertions(+), 97 deletions(-) create mode 100644 API-VERSION-2.md create mode 100644 API-VERSION-3.md diff --git a/API-CHANGELOG.md b/API-CHANGELOG.md index dd3fcd018b..c7a31d27fa 100644 --- a/API-CHANGELOG.md +++ b/API-CHANGELOG.md @@ -6,90 +6,85 @@ For info about how [API versioning](https://xrpl.org/request-formatting.html#api The API version controls the API behavior you see. This includes what properties you see in responses, what parameters you're permitted to send in requests, and so on. You specify the API version in each of your requests. When a breaking change is introduced to the `rippled` API, a new version is released. To avoid breaking your code, you should set (or increase) your version when you're ready to upgrade. +The [commandline](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#commandline-format) always uses the latest API version. The command line is intended for ad-hoc usage by humans, not programs or automated scripts. The command line is not meant for use in production code. + For a log of breaking changes, see the **API Version [number]** headings. In general, breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the **XRP Ledger version [x.y.z]** headings. Non-breaking changes are associated with a particular XRP Ledger (`rippled`) release. +## API Version 3 (Beta) + +API version 3 is currently a beta API. It requires enabling `[beta_rpc_api]` in the rippled configuration to use. See [API-VERSION-3.md](API-VERSION-3.md) for the full list of changes in API version 3. + ## API Version 2 -API version 2 is available in `rippled` version 2.0.0 and later. To use this API, clients specify `"api_version" : 2` in each request. - -#### Removed methods - -In API version 2, the following deprecated methods are no longer available: (https://github.com/XRPLF/rippled/pull/4759) - -- `tx_history` - Instead, use other methods such as `account_tx` or `ledger` with the `transactions` field set to `true`. -- `ledger_header` - Instead, use the `ledger` method. - -#### Modifications to JSON transaction element in V2 - -In API version 2, JSON elements for transaction output have been changed and made consistent for all methods which output transactions. (https://github.com/XRPLF/rippled/pull/4775) -This helps to unify the JSON serialization format of transactions. (https://github.com/XRPLF/clio/issues/722, https://github.com/XRPLF/rippled/issues/4727) - -- JSON transaction element is named `tx_json` -- Binary transaction element is named `tx_blob` -- JSON transaction metadata element is named `meta` -- Binary transaction metadata element is named `meta_blob` - -Additionally, these elements are now consistently available next to `tx_json` (i.e. sibling elements), where possible: - -- `hash` - Transaction ID. This data was stored inside transaction output in API version 1, but in API version 2 is a sibling element. -- `ledger_index` - Ledger index (only set on validated ledgers) -- `ledger_hash` - Ledger hash (only set on closed or validated ledgers) -- `close_time_iso` - Ledger close time expressed in ISO 8601 time format (only set on validated ledgers) -- `validated` - Bool element set to `true` if the transaction is in a validated ledger, otherwise `false` - -This change affects the following methods: - -- `tx` - Transaction data moved into element `tx_json` (was inline inside `result`) or, if binary output was requested, moved from `tx` to `tx_blob`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements -- `account_tx` - Renamed transaction element from `tx` to `tx_json`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements -- `transaction_entry` - Renamed transaction metadata element from `metadata` to `meta`. Changed location of `hash` and added new elements -- `subscribe` - Renamed transaction element from `transaction` to `tx_json`. Changed location of `hash` and added new elements -- `sign`, `sign_for`, `submit` and `submit_multisigned` - Changed location of `hash` element. - -#### Modification to `Payment` transaction JSON schema - -When reading Payments, the `Amount` field should generally **not** be used. Instead, use [delivered_amount](https://xrpl.org/partial-payments.html#the-delivered_amount-field) to see the amount that the Payment delivered. To clarify its meaning, the `Amount` field is being renamed to `DeliverMax`. (https://github.com/XRPLF/rippled/pull/4733) - -- In `Payment` transaction type, JSON RPC field `Amount` is renamed to `DeliverMax`. To enable smooth client transition, `Amount` is still handled, as described below: (https://github.com/XRPLF/rippled/pull/4733) - - On JSON RPC input (e.g. `submit_multisigned` etc. methods), `Amount` is recognized as an alias to `DeliverMax` for both API version 1 and version 2 clients. - - On JSON RPC input, submitting both `Amount` and `DeliverMax` fields is allowed _only_ if they are identical; otherwise such input is rejected with `rpcINVALID_PARAMS` error. - - On JSON RPC output (e.g. `subscribe`, `account_tx` etc. methods), `DeliverMax` is present in both API version 1 and version 2. - - On JSON RPC output, `Amount` is only present in API version 1 and _not_ in version 2. - -#### Modifications to account_info response - -- `signer_lists` is returned in the root of the response. (In API version 1, it was nested under `account_data`.) (https://github.com/XRPLF/rippled/pull/3770) -- When using an invalid `signer_lists` value, the API now returns an "invalidParams" error. (https://github.com/XRPLF/rippled/pull/4585) - - (`signer_lists` must be a boolean. In API version 1, strings were accepted and may return a normal response - i.e. as if `signer_lists` were `true`.) - -#### Modifications to [account_tx](https://xrpl.org/account_tx.html#account_tx) response - -- Using `ledger_index_min`, `ledger_index_max`, and `ledger_index` returns `invalidParams` because if you use `ledger_index_min` or `ledger_index_max`, then it does not make sense to also specify `ledger_index`. In API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4571) - - The same applies for `ledger_index_min`, `ledger_index_max`, and `ledger_hash`. (https://github.com/XRPLF/rippled/issues/4545#issuecomment-1565065579) -- Using a `ledger_index_min` or `ledger_index_max` beyond the range of ledgers that the server has: - - returns `lgrIdxMalformed` in API version 2. Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/issues/4288) -- Attempting to use a non-boolean value (such as a string) for the `binary` or `forward` parameters returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620) - -#### Modifications to [noripple_check](https://xrpl.org/noripple_check.html#noripple_check) response - -- Attempting to use a non-boolean value (such as a string) for the `transactions` parameter returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620) +API version 2 is available in `rippled` version 2.0.0 and later. See [API-VERSION-2.md](API-VERSION-2.md) for the full list of changes in API version 2. ## API Version 1 This version is supported by all `rippled` versions. For WebSocket and HTTP JSON-RPC requests, it is currently the default API version used when no `api_version` is specified. -The [commandline](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#commandline-format) always uses the latest API version. The command line is intended for ad-hoc usage by humans, not programs or automated scripts. The command line is not meant for use in production code. +## XRP Ledger server version 3.1.0 -### Inconsistency: server_info - network_id +[Version 3.1.0](https://github.com/XRPLF/rippled/releases/tag/3.1.0) was released on Jan 27, 2026. -The `network_id` field was added in the `server_info` response in version 1.5.0 (2019), but it is not returned in [reporting mode](https://xrpl.org/rippled-server-modes.html#reporting-mode). However, use of reporting mode is now discouraged, in favor of using [Clio](https://github.com/XRPLF/clio) instead. +### Additions in 3.1.0 + +- `vault_info`: New RPC method to retrieve information about a specific vault (part of XLS-66 Lending Protocol). ([#6156](https://github.com/XRPLF/rippled/pull/6156)) + +## XRP Ledger server version 3.0.0 + +[Version 3.0.0](https://github.com/XRPLF/rippled/releases/tag/3.0.0) was released on Dec 9, 2025. + +### Additions in 3.0.0 + +- `ledger_entry`: Supports all ledger entry types with dedicated parsers. ([#5237](https://github.com/XRPLF/rippled/pull/5237)) +- `ledger_entry`: New error codes `entryNotFound` and `unexpectedLedgerType` for more specific error handling. ([#5237](https://github.com/XRPLF/rippled/pull/5237)) +- `ledger_entry`: Improved error messages with more context (e.g., specifying which field is invalid or missing). ([#5237](https://github.com/XRPLF/rippled/pull/5237)) +- `ledger_entry`: Assorted bug fixes in RPC processing. ([#5237](https://github.com/XRPLF/rippled/pull/5237)) +- `simulate`: Supports additional metadata in the response. ([#5754](https://github.com/XRPLF/rippled/pull/5754)) + +## XRP Ledger server version 2.6.2 + +[Version 2.6.2](https://github.com/XRPLF/rippled/releases/tag/2.6.2) was released on Nov 19, 2025. + +This release contains bug fixes only and no API changes. + +## XRP Ledger server version 2.6.1 + +[Version 2.6.1](https://github.com/XRPLF/rippled/releases/tag/2.6.1) was released on Sep 30, 2025. + +This release contains bug fixes only and no API changes. + +## XRP Ledger server version 2.6.0 + +[Version 2.6.0](https://github.com/XRPLF/rippled/releases/tag/2.6.0) was released on Aug 27, 2025. + +### Additions in 2.6.0 + +- `account_info`: Added `allowTrustLineLocking` flag in response. ([#5525](https://github.com/XRPLF/rippled/pull/5525)) +- `ledger`: Removed the type filter from the RPC command. ([#4934](https://github.com/XRPLF/rippled/pull/4934)) +- `subscribe` (`validations` stream): `network_id` is now included. ([#5579](https://github.com/XRPLF/rippled/pull/5579)) +- `subscribe` (`transactions` stream): `nftoken_id`, `nftoken_ids`, and `offer_id` are now included in transaction metadata. ([#5230](https://github.com/XRPLF/rippled/pull/5230)) + +## XRP Ledger server version 2.5.1 + +[Version 2.5.1](https://github.com/XRPLF/rippled/releases/tag/2.5.1) was released on Sep 17, 2025. + +This release contains bug fixes only and no API changes. ## XRP Ledger server version 2.5.0 -As of 2025-04-04, version 2.5.0 is in development. You can use a pre-release version by building from source or [using the `nightly` package](https://xrpl.org/docs/infrastructure/installation/install-rippled-on-ubuntu). +[Version 2.5.0](https://github.com/XRPLF/rippled/releases/tag/2.5.0) was released on Jun 24, 2025. ### Additions and bugfixes in 2.5.0 -- `channel_authorize`: If `signing_support` is not enabled in the config, the RPC is disabled. +- `tx`: Added `ctid` field to the response and improved error handling. ([#4738](https://github.com/XRPLF/rippled/pull/4738)) +- `ledger_entry`: Improved error messages in `permissioned_domain`. ([#5344](https://github.com/XRPLF/rippled/pull/5344)) +- `simulate`: Improved multi-sign usage. ([#5479](https://github.com/XRPLF/rippled/pull/5479)) +- `channel_authorize`: If `signing_support` is not enabled in the config, the RPC is disabled. ([#5385](https://github.com/XRPLF/rippled/pull/5385)) +- `subscribe` (admin): Removed webhook queue limit to prevent dropping notifications; reduced HTTP timeout from 10 minutes to 30 seconds. ([#5163](https://github.com/XRPLF/rippled/pull/5163)) +- `ledger_data` (gRPC): Fixed crashing issue with some invalid markers. ([#5137](https://github.com/XRPLF/rippled/pull/5137)) +- `account_lines`: Fixed error with `no_ripple` and `no_ripple_peer` sometimes showing up incorrectly. ([#5345](https://github.com/XRPLF/rippled/pull/5345)) +- `account_tx`: Fixed issue with incorrect CTIDs. ([#5408](https://github.com/XRPLF/rippled/pull/5408)) ## XRP Ledger server version 2.4.0 @@ -97,11 +92,19 @@ As of 2025-04-04, version 2.5.0 is in development. You can use a pre-release ver ### Additions and bugfixes in 2.4.0 -- `ledger_entry`: `state` is added an alias for `ripple_state`. -- `ledger_entry`: Enables case-insensitive filtering by canonical name in addition to case-sensitive filtering by RPC name. -- `validators`: Added new field `validator_list_threshold` in response. -- `simulate`: A new RPC that executes a [dry run of a transaction submission](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0069d-simulate#2-rpc-simulate) -- Signing methods autofill fees better and properly handle transactions that don't have a base fee, and will also autofill the `NetworkID` field. +- `simulate`: A new RPC that executes a [dry run of a transaction submission](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0069d-simulate#2-rpc-simulate). ([#5069](https://github.com/XRPLF/rippled/pull/5069)) +- Signing methods (`sign`, `sign_for`, `submit`): Autofill fees better, properly handle transactions without a base fee, and autofill the `NetworkID` field. ([#5069](https://github.com/XRPLF/rippled/pull/5069)) +- `ledger_entry`: `state` is added as an alias for `ripple_state`. ([#5199](https://github.com/XRPLF/rippled/pull/5199)) +- `ledger`, `ledger_data`, `account_objects`: Support filtering ledger entry types by their canonical names (case-insensitive). ([#5271](https://github.com/XRPLF/rippled/pull/5271)) +- `validators`: Added new field `validator_list_threshold` in response. ([#5112](https://github.com/XRPLF/rippled/pull/5112)) +- `server_info`: Added git commit hash info on admin connection. ([#5225](https://github.com/XRPLF/rippled/pull/5225)) +- `server_definitions`: Changed larger `UInt` serialized types to `Hash`. ([#5231](https://github.com/XRPLF/rippled/pull/5231)) + +## XRP Ledger server version 2.3.1 + +[Version 2.3.1](https://github.com/XRPLF/rippled/releases/tag/2.3.1) was released on Jan 29, 2025. + +This release contains bug fixes only and no API changes. ## XRP Ledger server version 2.3.0 @@ -109,19 +112,30 @@ As of 2025-04-04, version 2.5.0 is in development. You can use a pre-release ver ### Breaking changes in 2.3.0 -- `book_changes`: If the requested ledger version is not available on this node, a `ledgerNotFound` error is returned and the node does not attempt to acquire the ledger from the p2p network (as with other non-admin RPCs). - -Admins can still attempt to retrieve old ledgers with the `ledger_request` RPC. +- `book_changes`: If the requested ledger version is not available on this node, a `ledgerNotFound` error is returned and the node does not attempt to acquire the ledger from the p2p network (as with other non-admin RPCs). Admins can still attempt to retrieve old ledgers with the `ledger_request` RPC. ### Additions and bugfixes in 2.3.0 -- `book_changes`: Returns a `validated` field in its response, which was missing in prior versions. +- `book_changes`: Returns a `validated` field in its response. ([#5096](https://github.com/XRPLF/rippled/pull/5096)) +- `book_changes`: Accepts shortcut strings (`current`, `closed`, `validated`) for the `ledger_index` parameter. ([#5096](https://github.com/XRPLF/rippled/pull/5096)) +- `server_definitions`: Include `index` in response. ([#5190](https://github.com/XRPLF/rippled/pull/5190)) +- `account_nfts`: Fix issue where unassociated marker would return incorrect results. ([#5045](https://github.com/XRPLF/rippled/pull/5045)) +- `account_objects`: Fix issue where invalid marker would not return an error. ([#5046](https://github.com/XRPLF/rippled/pull/5046)) +- `account_objects`: Disallow filtering by ledger entry types that an account cannot hold. ([#5056](https://github.com/XRPLF/rippled/pull/5056)) +- `tx`: Allow lowercase CTID. ([#5049](https://github.com/XRPLF/rippled/pull/5049)) +- `feature`: Better error handling for invalid values of `feature`. ([#5063](https://github.com/XRPLF/rippled/pull/5063)) ## XRP Ledger server version 2.2.0 [Version 2.2.0](https://github.com/XRPLF/rippled/releases/tag/2.2.0) was released on Jun 5, 2024. The following additions are non-breaking (because they are purely additive): -- The `feature` method now has a non-admin mode for users. (It was previously only available to admin connections.) The method returns an updated list of amendments, including their names and other information. ([#4781](https://github.com/XRPLF/rippled/pull/4781)) +- `feature`: Add a non-admin mode for users. (It was previously only available to admin connections.) The method returns an updated list of amendments, including their names and other information. ([#4781](https://github.com/XRPLF/rippled/pull/4781)) + +## XRP Ledger server version 2.0.1 + +[Version 2.0.1](https://github.com/XRPLF/rippled/releases/tag/2.0.1) was released on Jan 29, 2024. The following additions are non-breaking: + +- `path_find`: Fixes unbounded memory growth. ([#4822](https://github.com/XRPLF/rippled/pull/4822)) ## XRP Ledger server version 2.0.0 @@ -129,24 +143,18 @@ Admins can still attempt to retrieve old ledgers with the `ledger_request` RPC. - `server_definitions`: A new RPC that generates a `definitions.json`-like output that can be used in XRPL libraries. - In `Payment` transactions, `DeliverMax` has been added. This is a replacement for the `Amount` field, which should not be used. Typically, the `delivered_amount` (in transaction metadata) should be used. To ease the transition, `DeliverMax` is present regardless of API version, since adding a field is non-breaking. -- API version 2 has been moved from beta to supported, meaning that it is generally available (regardless of the `beta_rpc_api` setting). - -## XRP Ledger server version 2.2.0 - -The following is a non-breaking addition to the API. - -- The `feature` method now has a non-admin mode for users. (It was previously only available to admin connections.) The method returns an updated list of amendments, including their names and other information. ([#4781](https://github.com/XRPLF/rippled/pull/4781)) +- API version 2 has been moved from beta to supported, meaning that it is generally available (regardless of the `beta_rpc_api` setting). The full list of changes is in [API-VERSION-2.md](API-VERSION-2.md). ## XRP Ledger server version 1.12.0 -[Version 1.12.0](https://github.com/XRPLF/rippled/releases/tag/1.12.0) was released on Sep 6, 2023. The following additions are non-breaking (because they are purely additive). +[Version 1.12.0](https://github.com/XRPLF/rippled/releases/tag/1.12.0) was released on Sep 6, 2023. The following additions are non-breaking (because they are purely additive): -- `server_info`: Added `ports`, an array which advertises the RPC and WebSocket ports. This information is also included in the `/crawl` endpoint (which calls `server_info` internally). `grpc` and `peer` ports are also included. (https://github.com/XRPLF/rippled/pull/4427) +- `server_info`: Added `ports`, an array which advertises the RPC and WebSocket ports. This information is also included in the `/crawl` endpoint (which calls `server_info` internally). `grpc` and `peer` ports are also included. ([#4427](https://github.com/XRPLF/rippled/pull/4427)) - `ports` contains objects, each containing a `port` for the listening port (a number string), and a `protocol` array listing the supported protocols on that port. - This allows crawlers to build a more detailed topology without needing to port-scan nodes. - (For peers and other non-admin clients, the info about admin ports is excluded.) -- Clawback: The following additions are gated by the Clawback amendment (`featureClawback`). (https://github.com/XRPLF/rippled/pull/4553) - - Adds an [AccountRoot flag](https://xrpl.org/accountroot.html#accountroot-flags) called `lsfAllowTrustLineClawback` (https://github.com/XRPLF/rippled/pull/4617) +- Clawback: The following additions are gated by the Clawback amendment (`featureClawback`). ([#4553](https://github.com/XRPLF/rippled/pull/4553)) + - Adds an [AccountRoot flag](https://xrpl.org/accountroot.html#accountroot-flags) called `lsfAllowTrustLineClawback`. ([#4617](https://github.com/XRPLF/rippled/pull/4617)) - Adds the corresponding `asfAllowTrustLineClawback` [AccountSet Flag](https://xrpl.org/accountset.html#accountset-flags) as well. - Clawback is disabled by default, so if an issuer desires the ability to claw back funds, they must use an `AccountSet` transaction to set the AllowTrustLineClawback flag. They must do this before creating any trust lines, offers, escrows, payment channels, or checks. - Adds the [Clawback transaction type](https://github.com/XRPLF/XRPL-Standards/blob/master/XLS-39d-clawback/README.md#331-clawback-transaction), containing these fields: @@ -181,16 +189,16 @@ The following is a non-breaking addition to the API. ### Breaking changes in 1.11 -- Added the ability to mark amendments as obsolete. For the `feature` admin API, there is a new possible value for the `vetoed` field. (https://github.com/XRPLF/rippled/pull/4291) +- Added the ability to mark amendments as obsolete. For the `feature` admin API, there is a new possible value for the `vetoed` field. ([#4291](https://github.com/XRPLF/rippled/pull/4291)) - The value of `vetoed` can now be `true`, `false`, or `"Obsolete"`. -- Removed the acceptance of seeds or public keys in place of account addresses. (https://github.com/XRPLF/rippled/pull/4404) +- Removed the acceptance of seeds or public keys in place of account addresses. ([#4404](https://github.com/XRPLF/rippled/pull/4404)) - This simplifies the API and encourages better security practices (i.e. seeds should never be sent over the network). -- For the `ledger_data` method, when all entries are filtered out, the `state` field of the response is now an empty list (in other words, an empty array, `[]`). (Previously, it would return `null`.) While this is technically a breaking change, the new behavior is consistent with the documentation, so this is considered only a bug fix. (https://github.com/XRPLF/rippled/pull/4398) +- For the `ledger_data` method, when all entries are filtered out, the `state` field of the response is now an empty list (in other words, an empty array, `[]`). (Previously, it would return `null`.) While this is technically a breaking change, the new behavior is consistent with the documentation, so this is considered only a bug fix. ([#4398](https://github.com/XRPLF/rippled/pull/4398)) - If and when the `fixNFTokenRemint` amendment activates, there will be a new AccountRoot field, `FirstNFTSequence`. This field is set to the current account sequence when the account issues their first NFT. If an account has not issued any NFTs, then the field is not set. ([#4406](https://github.com/XRPLF/rippled/pull/4406)) - There is a new account deletion restriction: an account can only be deleted if `FirstNFTSequence` + `MintedNFTokens` + `256` is less than the current ledger sequence. - This is potentially a breaking change if clients have logic for determining whether an account can be deleted. - NetworkID - - For sidechains and networks with a network ID greater than 1024, there is a new [transaction common field](https://xrpl.org/transaction-common-fields.html), `NetworkID`. (https://github.com/XRPLF/rippled/pull/4370) + - For sidechains and networks with a network ID greater than 1024, there is a new [transaction common field](https://xrpl.org/transaction-common-fields.html), `NetworkID`. ([#4370](https://github.com/XRPLF/rippled/pull/4370)) - This field helps to prevent replay attacks and is now required for chains whose network ID is 1025 or higher. - The field must be omitted for Mainnet, so there is no change for Mainnet users. - There are three new local error codes: @@ -200,10 +208,10 @@ The following is a non-breaking addition to the API. ### Additions and bug fixes in 1.11 -- Added `nftoken_id`, `nftoken_ids` and `offer_id` meta fields into NFT `tx` and `account_tx` responses. (https://github.com/XRPLF/rippled/pull/4447) -- Added an `account_flags` object to the `account_info` method response. (https://github.com/XRPLF/rippled/pull/4459) -- Added `NFTokenPages` to the `account_objects` RPC. (https://github.com/XRPLF/rippled/pull/4352) -- Fixed: `marker` returned from the `account_lines` command would not work on subsequent commands. (https://github.com/XRPLF/rippled/pull/4361) +- Added `nftoken_id`, `nftoken_ids` and `offer_id` meta fields into NFT `tx` and `account_tx` responses. ([#4447](https://github.com/XRPLF/rippled/pull/4447)) +- Added an `account_flags` object to the `account_info` method response. ([#4459](https://github.com/XRPLF/rippled/pull/4459)) +- Added `NFTokenPages` to the `account_objects` RPC. ([#4352](https://github.com/XRPLF/rippled/pull/4352)) +- Fixed: `marker` returned from the `account_lines` command would not work on subsequent commands. ([#4361](https://github.com/XRPLF/rippled/pull/4361)) ## XRP Ledger server version 1.10.0 diff --git a/API-VERSION-2.md b/API-VERSION-2.md new file mode 100644 index 0000000000..2296795271 --- /dev/null +++ b/API-VERSION-2.md @@ -0,0 +1,66 @@ +# API Version 2 + +API version 2 is available in `rippled` version 2.0.0 and later. To use this API, clients specify `"api_version" : 2` in each request. + +For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior. + +## Removed methods + +In API version 2, the following deprecated methods are no longer available: ([#4759](https://github.com/XRPLF/rippled/pull/4759)) + +- `tx_history` - Instead, use other methods such as `account_tx` or `ledger` with the `transactions` field set to `true`. +- `ledger_header` - Instead, use the `ledger` method. + +## Modifications to JSON transaction element in API version 2 + +In API version 2, JSON elements for transaction output have been changed and made consistent for all methods which output transactions. ([#4775](https://github.com/XRPLF/rippled/pull/4775)) +This helps to unify the JSON serialization format of transactions. ([clio#722](https://github.com/XRPLF/clio/issues/722), [#4727](https://github.com/XRPLF/rippled/issues/4727)) + +- JSON transaction element is named `tx_json` +- Binary transaction element is named `tx_blob` +- JSON transaction metadata element is named `meta` +- Binary transaction metadata element is named `meta_blob` + +Additionally, these elements are now consistently available next to `tx_json` (i.e. sibling elements), where possible: + +- `hash` - Transaction ID. This data was stored inside transaction output in API version 1, but in API version 2 is a sibling element. +- `ledger_index` - Ledger index (only set on validated ledgers) +- `ledger_hash` - Ledger hash (only set on closed or validated ledgers) +- `close_time_iso` - Ledger close time expressed in ISO 8601 time format (only set on validated ledgers) +- `validated` - Bool element set to `true` if the transaction is in a validated ledger, otherwise `false` + +This change affects the following methods: + +- `tx` - Transaction data moved into element `tx_json` (was inline inside `result`) or, if binary output was requested, moved from `tx` to `tx_blob`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements +- `account_tx` - Renamed transaction element from `tx` to `tx_json`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements +- `transaction_entry` - Renamed transaction metadata element from `metadata` to `meta`. Changed location of `hash` and added new elements +- `subscribe` - Renamed transaction element from `transaction` to `tx_json`. Changed location of `hash` and added new elements +- `sign`, `sign_for`, `submit` and `submit_multisigned` - Changed location of `hash` element. + +## Modifications to `Payment` transaction JSON schema + +When reading Payments, the `Amount` field should generally **not** be used. Instead, use [delivered_amount](https://xrpl.org/partial-payments.html#the-delivered_amount-field) to see the amount that the Payment delivered. To clarify its meaning, the `Amount` field is being renamed to `DeliverMax`. ([#4733](https://github.com/XRPLF/rippled/pull/4733)) + +- In `Payment` transaction type, JSON RPC field `Amount` is renamed to `DeliverMax`. To enable smooth client transition, `Amount` is still handled, as described below: ([#4733](https://github.com/XRPLF/rippled/pull/4733)) + - On JSON RPC input (e.g. `submit_multisigned` etc. methods), `Amount` is recognized as an alias to `DeliverMax` for both API version 1 and version 2 clients. + - On JSON RPC input, submitting both `Amount` and `DeliverMax` fields is allowed _only_ if they are identical; otherwise such input is rejected with `rpcINVALID_PARAMS` error. + - On JSON RPC output (e.g. `subscribe`, `account_tx` etc. methods), `DeliverMax` is present in both API version 1 and version 2. + - On JSON RPC output, `Amount` is only present in API version 1 and _not_ in version 2. + +## Modifications to account_info response + +- `signer_lists` is returned in the root of the response. (In API version 1, it was nested under `account_data`.) ([#3770](https://github.com/XRPLF/rippled/pull/3770)) +- When using an invalid `signer_lists` value, the API now returns an "invalidParams" error. ([#4585](https://github.com/XRPLF/rippled/pull/4585)) + - (`signer_lists` must be a boolean. In API version 1, strings were accepted and may return a normal response - i.e. as if `signer_lists` were `true`.) + +## Modifications to [account_tx](https://xrpl.org/account_tx.html#account_tx) response + +- Using `ledger_index_min`, `ledger_index_max`, and `ledger_index` returns `invalidParams` because if you use `ledger_index_min` or `ledger_index_max`, then it does not make sense to also specify `ledger_index`. In API version 1, no error was returned. ([#4571](https://github.com/XRPLF/rippled/pull/4571)) + - The same applies for `ledger_index_min`, `ledger_index_max`, and `ledger_hash`. ([#4545](https://github.com/XRPLF/rippled/issues/4545#issuecomment-1565065579)) +- Using a `ledger_index_min` or `ledger_index_max` beyond the range of ledgers that the server has: + - returns `lgrIdxMalformed` in API version 2. Previously, in API version 1, no error was returned. ([#4288](https://github.com/XRPLF/rippled/issues/4288)) +- Attempting to use a non-boolean value (such as a string) for the `binary` or `forward` parameters returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. ([#4620](https://github.com/XRPLF/rippled/pull/4620)) + +## Modifications to [noripple_check](https://xrpl.org/noripple_check.html#noripple_check) response + +- Attempting to use a non-boolean value (such as a string) for the `transactions` parameter returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. ([#4620](https://github.com/XRPLF/rippled/pull/4620)) diff --git a/API-VERSION-3.md b/API-VERSION-3.md new file mode 100644 index 0000000000..46dc3f504d --- /dev/null +++ b/API-VERSION-3.md @@ -0,0 +1,27 @@ +# API Version 3 + +API version 3 is currently a **beta API**. It requires enabling `[beta_rpc_api]` in the rippled configuration to use. To use this API, clients specify `"api_version" : 3` in each request. + +For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior. + +## Breaking Changes + +### Modifications to `amm_info` + +The order of error checks has been changed to provide more specific error messages. ([#4924](https://github.com/XRPLF/rippled/pull/4924)) + +- **Before (API v2)**: When sending an invalid account or asset to `amm_info` while other parameters are not set as expected, the method returns a generic `rpcINVALID_PARAMS` error. +- **After (API v3)**: The same scenario returns a more specific error: `rpcISSUE_MALFORMED` for malformed assets or `rpcACT_MALFORMED` for malformed accounts. + +### Modifications to `ledger_entry` + +Added support for string shortcuts to look up fixed-location ledger entries using the `"index"` parameter. ([#5644](https://github.com/XRPLF/rippled/pull/5644)) + +In API version 3, the following string values can be used with the `"index"` parameter: + +- `"index": "amendments"` - Returns the `Amendments` ledger entry +- `"index": "fee"` - Returns the `FeeSettings` ledger entry +- `"index": "nunl"` - Returns the `NegativeUNL` ledger entry +- `"index": "hashes"` - Returns the "short" `LedgerHashes` ledger entry (recent ledger hashes) + +These shortcuts are only available in API version 3 and later. In API versions 1 and 2, these string values would result in an error. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4f99972713..808d553e17 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -872,7 +872,8 @@ git push --delete upstream-push master-next 11. [Create a new release on Github](https://github.com/XRPLF/rippled/releases). Be sure that "Set as the latest release" is checked. -12. Finally [reverse merge the release into `develop`](#follow-up-reverse-merge). +12. Open a PR to update the [API-CHANGELOG](API-CHANGELOG.md) and `API-VERSION-[n].md` with the changes for this release (if any are missing). +13. Finally, [reverse merge the release into `develop`](#follow-up-reverse-merge). #### Special cases: point releases, hotfixes, etc. From b814a09a08f47c99b5fdb9a2970e9f7bffd41ddc Mon Sep 17 00:00:00 2001 From: Vito Tumas <5780819+Tapanito@users.noreply.github.com> Date: Tue, 3 Feb 2026 16:13:10 +0100 Subject: [PATCH 06/26] chore: Add .zed editor config directory to .gitignore (#6317) This change adds the project configuration directory to `.gitignore` for the `zed` editor. As per the [documentation](https://zed.dev/docs/remote-development?highlight=.zed#zed-settings), the project configuration files are stored in the `.zed` directory at the project root dir. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index b899cf8436..2692d707e7 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,9 @@ DerivedData /.vs/ /.vscode/ +# zed IDE. +/.zed/ + # AI tools. /.augment /.claude From 78136830914f39024da0665806756e216b562d09 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Feb 2026 16:37:24 +0000 Subject: [PATCH 07/26] fix: Deletes expired NFToken offers from ledger (#5707) This change introduces the `fixExpiredNFTokenOfferRemoval` amendment that allows expired offers to pass through `preclaim()` and be deleted in `doApply()`, following the same pattern used for expired credentials. --- include/xrpl/protocol/detail/features.macro | 1 + src/test/app/NFToken_test.cpp | 412 ++++++++++++------ .../app/tx/detail/NFTokenAcceptOffer.cpp | 47 +- 3 files changed, 328 insertions(+), 132 deletions(-) diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index 0c952bf59b..d8498ffa2f 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -16,6 +16,7 @@ // Add new amendments to the top of this list. // Keep it sorted in reverse chronological order. +XRPL_FIX (ExpiredNFTokenOfferRemoval, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (BatchInnerSigs, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(LendingProtocol, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(PermissionDelegationV1_1, Supported::no, VoteBehavior::DefaultNo) diff --git a/src/test/app/NFToken_test.cpp b/src/test/app/NFToken_test.cpp index 51590903e3..2ab2e2a94c 100644 --- a/src/test/app/NFToken_test.cpp +++ b/src/test/app/NFToken_test.cpp @@ -876,42 +876,48 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite env.fund(XRP(1000), alice, buyer, gw); env.close(); BEAST_EXPECT(ownerCount(env, alice) == 0); + BEAST_EXPECT(ownerCount(env, buyer) == 0); uint256 const nftAlice0ID = token::getNextID(env, alice, 0, tfTransferable); env(token::mint(alice, 0u), txflags(tfTransferable)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 1); + uint8_t aliceCount = 1; + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); uint256 const nftXrpOnlyID = token::getNextID(env, alice, 0, tfOnlyXRP | tfTransferable); env(token::mint(alice, 0), txflags(tfOnlyXRP | tfTransferable)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 1); + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); uint256 nftNoXferID = token::getNextID(env, alice, 0); env(token::mint(alice, 0)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 1); + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); // alice creates sell offers for her nfts. uint256 const plainOfferIndex = keylet::nftoffer(alice, env.seq(alice)).key; env(token::createOffer(alice, nftAlice0ID, XRP(10)), txflags(tfSellNFToken)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 2); + aliceCount++; + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); uint256 const audOfferIndex = keylet::nftoffer(alice, env.seq(alice)).key; env(token::createOffer(alice, nftAlice0ID, gwAUD(30)), txflags(tfSellNFToken)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 3); + aliceCount++; + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); uint256 const xrpOnlyOfferIndex = keylet::nftoffer(alice, env.seq(alice)).key; env(token::createOffer(alice, nftXrpOnlyID, XRP(20)), txflags(tfSellNFToken)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 4); + aliceCount++; + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); uint256 const noXferOfferIndex = keylet::nftoffer(alice, env.seq(alice)).key; env(token::createOffer(alice, nftNoXferID, XRP(30)), txflags(tfSellNFToken)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 5); + aliceCount++; + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); // alice creates a sell offer that will expire soon. uint256 const aliceExpOfferIndex = keylet::nftoffer(alice, env.seq(alice)).key; @@ -919,7 +925,17 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite txflags(tfSellNFToken), token::expiration(lastClose(env) + 5)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 6); + aliceCount++; + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); + + // buyer creates a Buy offer that will expire soon. + uint256 const buyerExpOfferIndex = keylet::nftoffer(buyer, env.seq(buyer)).key; + env(token::createOffer(buyer, nftAlice0ID, XRP(40)), + token::owner(alice), + token::expiration(lastClose(env) + 5)); + env.close(); + uint8_t buyerCount = 1; + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); //---------------------------------------------------------------------- // preflight @@ -927,12 +943,12 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite // Set a negative fee. env(token::acceptSellOffer(buyer, noXferOfferIndex), fee(STAmount(10ull, true)), ter(temBAD_FEE)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Set an invalid flag. env(token::acceptSellOffer(buyer, noXferOfferIndex), txflags(0x00008000), ter(temINVALID_FLAG)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Supply nether an sfNFTokenBuyOffer nor an sfNFTokenSellOffer field. { @@ -940,7 +956,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite jv.removeMember(sfNFTokenSellOffer.jsonName); env(jv, ter(temMALFORMED)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); } // A buy offer may not contain a sfNFTokenBrokerFee field. @@ -949,7 +965,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite jv[sfNFTokenBrokerFee.jsonName] = STAmount(500000).getJson(JsonOptions::none); env(jv, ter(temMALFORMED)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); } // A sell offer may not contain a sfNFTokenBrokerFee field. @@ -958,7 +974,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite jv[sfNFTokenBrokerFee.jsonName] = STAmount(500000).getJson(JsonOptions::none); env(jv, ter(temMALFORMED)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); } // A brokered offer may not contain a negative or zero brokerFee. @@ -966,7 +982,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite token::brokerFee(gwAUD(0)), ter(temMALFORMED)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); //---------------------------------------------------------------------- // preclaim @@ -974,33 +990,48 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite // The buy offer must be non-zero. env(token::acceptBuyOffer(buyer, beast::zero), ter(tecOBJECT_NOT_FOUND)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // The buy offer must be present in the ledger. uint256 const missingOfferIndex = keylet::nftoffer(alice, 1).key; env(token::acceptBuyOffer(buyer, missingOfferIndex), ter(tecOBJECT_NOT_FOUND)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // The buy offer must not have expired. - env(token::acceptBuyOffer(buyer, aliceExpOfferIndex), ter(tecEXPIRED)); + // NOTE: this is only a preclaim check with the + // fixExpiredNFTokenOfferRemoval amendment disabled. + env(token::acceptBuyOffer(alice, buyerExpOfferIndex), ter(tecEXPIRED)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + if (features[fixExpiredNFTokenOfferRemoval]) + { + buyerCount--; + } + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // The sell offer must be non-zero. env(token::acceptSellOffer(buyer, beast::zero), ter(tecOBJECT_NOT_FOUND)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // The sell offer must be present in the ledger. env(token::acceptSellOffer(buyer, missingOfferIndex), ter(tecOBJECT_NOT_FOUND)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // The sell offer must not have expired. + // NOTE: this is only a preclaim check with the + // fixExpiredNFTokenOfferRemoval amendment disabled. env(token::acceptSellOffer(buyer, aliceExpOfferIndex), ter(tecEXPIRED)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + // Alice's count is decremented by one when the expired offer is + // removed. + if (features[fixExpiredNFTokenOfferRemoval]) + { + aliceCount--; + } + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); //---------------------------------------------------------------------- // preclaim brokered @@ -1012,8 +1043,13 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite env.close(); env(pay(gw, buyer, gwAUD(30))); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 7); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + aliceCount++; + buyerCount++; + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); + + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // We're about to exercise offer brokering, so we need // corresponding buy and sell offers. @@ -1022,35 +1058,38 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite uint256 const buyerOfferIndex = keylet::nftoffer(buyer, env.seq(buyer)).key; env(token::createOffer(buyer, nftAlice0ID, gwAUD(29)), token::owner(alice)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + buyerCount++; + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // gw attempts to broker offers that are not for the same token. env(token::brokerOffers(gw, buyerOfferIndex, xrpOnlyOfferIndex), ter(tecNFTOKEN_BUY_SELL_MISMATCH)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // gw attempts to broker offers that are not for the same currency. env(token::brokerOffers(gw, buyerOfferIndex, plainOfferIndex), ter(tecNFTOKEN_BUY_SELL_MISMATCH)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // In a brokered offer, the buyer must offer greater than or // equal to the selling price. env(token::brokerOffers(gw, buyerOfferIndex, audOfferIndex), ter(tecINSUFFICIENT_PAYMENT)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Remove buyer's offer. env(token::cancelOffer(buyer, {buyerOfferIndex})); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + buyerCount--; + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); } { // buyer creates a buy offer for one of alice's nfts. uint256 const buyerOfferIndex = keylet::nftoffer(buyer, env.seq(buyer)).key; env(token::createOffer(buyer, nftAlice0ID, gwAUD(31)), token::owner(alice)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + buyerCount++; + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Broker sets their fee in a denomination other than the one // used by the offers @@ -1058,14 +1097,14 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite token::brokerFee(XRP(40)), ter(tecNFTOKEN_BUY_SELL_MISMATCH)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Broker fee way too big. env(token::brokerOffers(gw, buyerOfferIndex, audOfferIndex), token::brokerFee(gwAUD(31)), ter(tecINSUFFICIENT_PAYMENT)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Broker fee is smaller, but still too big once the offer // seller's minimum is taken into account. @@ -1073,12 +1112,13 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite token::brokerFee(gwAUD(1.5)), ter(tecINSUFFICIENT_PAYMENT)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Remove buyer's offer. env(token::cancelOffer(buyer, {buyerOfferIndex})); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + buyerCount--; + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); } //---------------------------------------------------------------------- // preclaim buy @@ -1087,17 +1127,18 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite uint256 const buyerOfferIndex = keylet::nftoffer(buyer, env.seq(buyer)).key; env(token::createOffer(buyer, nftAlice0ID, gwAUD(30)), token::owner(alice)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + buyerCount++; + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Don't accept a buy offer if the sell flag is set. env(token::acceptBuyOffer(buyer, plainOfferIndex), ter(tecNFTOKEN_OFFER_TYPE_MISMATCH)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 7); + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); // An account can't accept its own offer. env(token::acceptBuyOffer(buyer, buyerOfferIndex), ter(tecCANT_ACCEPT_OWN_NFTOKEN_OFFER)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // An offer acceptor must have enough funds to pay for the offer. env(pay(buyer, gw, gwAUD(30))); @@ -1105,7 +1146,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite BEAST_EXPECT(env.balance(buyer, gwAUD) == gwAUD(0)); env(token::acceptBuyOffer(alice, buyerOfferIndex), ter(tecINSUFFICIENT_FUNDS)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // alice gives her NFT to gw, so alice no longer owns nftAlice0. { @@ -1114,7 +1155,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite env.close(); env(token::acceptSellOffer(gw, offerIndex)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 7); + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); } env(pay(gw, buyer, gwAUD(30))); env.close(); @@ -1122,12 +1163,13 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite // alice can't accept a buy offer for an NFT she no longer owns. env(token::acceptBuyOffer(alice, buyerOfferIndex), ter(tecNO_PERMISSION)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Remove buyer's offer. env(token::cancelOffer(buyer, {buyerOfferIndex})); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + buyerCount--; + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); } //---------------------------------------------------------------------- // preclaim sell @@ -1136,23 +1178,24 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite uint256 const buyerOfferIndex = keylet::nftoffer(buyer, env.seq(buyer)).key; env(token::createOffer(buyer, nftXrpOnlyID, XRP(30)), token::owner(alice)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + buyerCount++; + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Don't accept a sell offer without the sell flag set. env(token::acceptSellOffer(alice, buyerOfferIndex), ter(tecNFTOKEN_OFFER_TYPE_MISMATCH)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 7); + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); // An account can't accept its own offer. env(token::acceptSellOffer(alice, plainOfferIndex), ter(tecCANT_ACCEPT_OWN_NFTOKEN_OFFER)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // The seller must currently be in possession of the token they // are selling. alice gave nftAlice0ID to gw. env(token::acceptSellOffer(buyer, plainOfferIndex), ter(tecNO_PERMISSION)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // gw gives nftAlice0ID back to alice. That allows us to check // buyer attempting to accept one of alice's offers with @@ -1163,14 +1206,14 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite env.close(); env(token::acceptSellOffer(alice, offerIndex)); env.close(); - BEAST_EXPECT(ownerCount(env, alice) == 7); + BEAST_EXPECT(ownerCount(env, alice) == aliceCount); } env(pay(buyer, gw, gwAUD(30))); env.close(); BEAST_EXPECT(env.balance(buyer, gwAUD) == gwAUD(0)); env(token::acceptSellOffer(buyer, audOfferIndex), ter(tecINSUFFICIENT_FUNDS)); env.close(); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); } //---------------------------------------------------------------------- @@ -2769,6 +2812,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite uint256 const nftokenID1 = token::getNextID(env, issuer, 0, tfTransferable); env(token::mint(minter, 0), token::issuer(issuer), txflags(tfTransferable)); env.close(); + uint8_t issuerCount, minterCount, buyerCount; // Test how adding an Expiration field to an offer affects permissions // for cancelling offers. @@ -2792,9 +2836,12 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite uint256 const offerBuyerToMinter = keylet::nftoffer(buyer, env.seq(buyer)).key; env(token::createOffer(buyer, nftokenID0, drops(1)), token::owner(minter), token::expiration(expiration)); env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 1); - BEAST_EXPECT(ownerCount(env, minter) == 3); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + issuerCount = 1; + minterCount = 3; + buyerCount = 1; + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Test who gets to cancel the offers. Anyone outside of the // offer-owner/destination pair should not be able to cancel @@ -2806,32 +2853,36 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite env(token::cancelOffer(buyer, {offerIssuerToMinter}), ter(tecNO_PERMISSION)); env.close(); BEAST_EXPECT(lastClose(env) < expiration); - BEAST_EXPECT(ownerCount(env, issuer) == 1); - BEAST_EXPECT(ownerCount(env, minter) == 3); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // The offer creator can cancel their own unexpired offer. env(token::cancelOffer(minter, {offerMinterToAnyone})); + minterCount--; // The destination of a sell offer can cancel the NFT owner's // unexpired offer. env(token::cancelOffer(issuer, {offerMinterToIssuer})); + minterCount--; // Close enough ledgers to get past the expiration. while (lastClose(env) < expiration) env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 1); - BEAST_EXPECT(ownerCount(env, minter) == 1); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Anyone can cancel expired offers. env(token::cancelOffer(issuer, {offerBuyerToMinter})); + buyerCount--; env(token::cancelOffer(buyer, {offerIssuerToMinter})); + issuerCount--; env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 1); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); } // Show that: // 1. An unexpired sell offer with an expiration can be accepted. @@ -2844,44 +2895,70 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite env(token::createOffer(minter, nftokenID0, drops(1)), token::expiration(expiration), txflags(tfSellNFToken)); + minterCount++; uint256 const offer1 = keylet::nftoffer(minter, env.seq(minter)).key; env(token::createOffer(minter, nftokenID1, drops(1)), token::expiration(expiration), txflags(tfSellNFToken)); + minterCount++; env.close(); BEAST_EXPECT(lastClose(env) < expiration); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 3); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // Anyone can accept an unexpired sell offer. env(token::acceptSellOffer(buyer, offer0)); + minterCount--; + buyerCount++; // Close enough ledgers to get past the expiration. while (lastClose(env) < expiration) env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 2); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // No one can accept an expired sell offer. env(token::acceptSellOffer(buyer, offer1), ter(tecEXPIRED)); - env(token::acceptSellOffer(issuer, offer1), ter(tecEXPIRED)); + + // With fixExpiredNFTokenOfferRemoval amendment, the first accept + // attempt deletes the expired offer. Without the amendment, + // the offer remains and we can try to accept it again. + if (features[fixExpiredNFTokenOfferRemoval]) + { + // After amendment: offer was deleted by first accept attempt + minterCount--; + env(token::acceptSellOffer(issuer, offer1), ter(tecOBJECT_NOT_FOUND)); + } + else + { + // Before amendment: offer still exists, second accept also + // fails + env(token::acceptSellOffer(issuer, offer1), ter(tecEXPIRED)); + } env.close(); - // The expired sell offer is still in the ledger. - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 2); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + // Check if the expired sell offer behavior matches amendment status + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); - // Anyone can cancel the expired sell offer. - env(token::cancelOffer(issuer, {offer1})); - env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 1); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + if (!features[fixExpiredNFTokenOfferRemoval]) + { + // Before amendment: expired offer still exists and needs to be + // cancelled + env(token::cancelOffer(issuer, {offer1})); + env.close(); + minterCount--; + } + // Ensure that owner counts are correct with and without the + // amendment + BEAST_EXPECT(ownerCount(env, issuer) == 0 && issuerCount == 0); + BEAST_EXPECT(ownerCount(env, minter) == 1 && minterCount == 1); + BEAST_EXPECT(ownerCount(env, buyer) == 1 && buyerCount == 1); // Transfer nftokenID0 back to minter so we start the next test in // a simple place. @@ -2889,10 +2966,11 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite env(token::createOffer(buyer, nftokenID0, XRP(0)), txflags(tfSellNFToken), token::destination(minter)); env.close(); env(token::acceptSellOffer(minter, offerSellBack)); + buyerCount--; env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 1); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); } // Show that: // 1. An unexpired buy offer with an expiration can be accepted. @@ -2903,14 +2981,16 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite uint256 const offer0 = keylet::nftoffer(buyer, env.seq(buyer)).key; env(token::createOffer(buyer, nftokenID0, drops(1)), token::owner(minter), token::expiration(expiration)); + buyerCount++; uint256 const offer1 = keylet::nftoffer(buyer, env.seq(buyer)).key; env(token::createOffer(buyer, nftokenID1, drops(1)), token::owner(minter), token::expiration(expiration)); + buyerCount++; env.close(); BEAST_EXPECT(lastClose(env) < expiration); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 1); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // An unexpired buy offer can be accepted. env(token::acceptBuyOffer(minter, offer0)); @@ -2919,26 +2999,48 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite while (lastClose(env) < expiration) env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 1); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // An expired buy offer cannot be accepted. env(token::acceptBuyOffer(minter, offer1), ter(tecEXPIRED)); - env(token::acceptBuyOffer(issuer, offer1), ter(tecEXPIRED)); + + // With fixExpiredNFTokenOfferRemoval amendment, the first accept + // attempt deletes the expired offer. Without the amendment, + // the offer remains and we can try to accept it again. + if (features[fixExpiredNFTokenOfferRemoval]) + { + // After amendment: offer was deleted by first accept attempt + buyerCount--; + env(token::acceptBuyOffer(issuer, offer1), ter(tecOBJECT_NOT_FOUND)); + } + else + { + // Before amendment: offer still exists, second accept also + // fails + env(token::acceptBuyOffer(issuer, offer1), ter(tecEXPIRED)); + } env.close(); - // The expired buy offer is still in the ledger. - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 1); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + // Check if the expired buy offer behavior matches amendment status + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); - // Anyone can cancel the expired buy offer. - env(token::cancelOffer(issuer, {offer1})); - env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 1); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + if (!features[fixExpiredNFTokenOfferRemoval]) + { + // Before amendment: expired offer still exists and can be + // cancelled + env(token::cancelOffer(issuer, {offer1})); + env.close(); + buyerCount--; + } + // Ensure that owner counts are the same with and without the + // amendment + BEAST_EXPECT(ownerCount(env, issuer) == 0 && issuerCount == 0); + BEAST_EXPECT(ownerCount(env, minter) == 1 && minterCount == 1); + BEAST_EXPECT(ownerCount(env, buyer) == 1 && buyerCount == 1); // Transfer nftokenID0 back to minter so we start the next test in // a simple place. @@ -2947,9 +3049,10 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite env.close(); env(token::acceptSellOffer(minter, offerSellBack)); env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 1); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + buyerCount--; + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); } // Show that in brokered mode: // 1. An unexpired sell offer with an expiration can be accepted. @@ -2962,50 +3065,74 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite env(token::createOffer(minter, nftokenID0, drops(1)), token::expiration(expiration), txflags(tfSellNFToken)); + minterCount++; uint256 const sellOffer1 = keylet::nftoffer(minter, env.seq(minter)).key; env(token::createOffer(minter, nftokenID1, drops(1)), token::expiration(expiration), txflags(tfSellNFToken)); + minterCount++; uint256 const buyOffer0 = keylet::nftoffer(buyer, env.seq(buyer)).key; env(token::createOffer(buyer, nftokenID0, drops(1)), token::owner(minter)); + buyerCount++; uint256 const buyOffer1 = keylet::nftoffer(buyer, env.seq(buyer)).key; env(token::createOffer(buyer, nftokenID1, drops(1)), token::owner(minter)); + buyerCount++; env.close(); BEAST_EXPECT(lastClose(env) < expiration); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 3); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // An unexpired offer can be brokered. env(token::brokerOffers(issuer, buyOffer0, sellOffer0)); + minterCount--; // Close enough ledgers to get past the expiration. while (lastClose(env) < expiration) env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 2); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); // If the sell offer is expired it cannot be brokered. env(token::brokerOffers(issuer, buyOffer1, sellOffer1), ter(tecEXPIRED)); env.close(); - // The expired sell offer is still in the ledger. - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 2); - BEAST_EXPECT(ownerCount(env, buyer) == 2); + if (features[fixExpiredNFTokenOfferRemoval]) + { + // With amendment: expired offers are deleted + minterCount--; + } - // Anyone can cancel the expired sell offer. - env(token::cancelOffer(buyer, {buyOffer1, sellOffer1})); + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); + + if (features[fixExpiredNFTokenOfferRemoval]) + { + // The buy offer was deleted, so no need to cancel it + // The sell offer still exists, so we can cancel it + env(token::cancelOffer(buyer, {buyOffer1})); + buyerCount--; + } + else + { + // Anyone can cancel the expired offers + env(token::cancelOffer(buyer, {buyOffer1, sellOffer1})); + minterCount--; + buyerCount--; + } env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 1); - BEAST_EXPECT(ownerCount(env, buyer) == 1); + // Ensure that owner counts are the same with and without the + // amendment + BEAST_EXPECT(ownerCount(env, issuer) == 0 && issuerCount == 0); + BEAST_EXPECT(ownerCount(env, minter) == 1 && minterCount == 1); + BEAST_EXPECT(ownerCount(env, buyer) == 1 && buyerCount == 1); // Transfer nftokenID0 back to minter so we start the next test in // a simple place. @@ -3014,9 +3141,10 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite env.close(); env(token::acceptSellOffer(minter, offerSellBack)); env.close(); - BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 1); - BEAST_EXPECT(ownerCount(env, buyer) == 0); + buyerCount--; + BEAST_EXPECT(ownerCount(env, issuer) == issuerCount); + BEAST_EXPECT(ownerCount(env, minter) == minterCount); + BEAST_EXPECT(ownerCount(env, buyer) == buyerCount); } // Show that in brokered mode: // 1. An unexpired buy offer with an expiration can be accepted. @@ -3054,17 +3182,28 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite BEAST_EXPECT(ownerCount(env, minter) == 2); BEAST_EXPECT(ownerCount(env, buyer) == 2); - // If the buy offer is expired it cannot be brokered. env(token::brokerOffers(issuer, buyOffer1, sellOffer1), ter(tecEXPIRED)); env.close(); - // The expired buy offer is still in the ledger. BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 2); - BEAST_EXPECT(ownerCount(env, buyer) == 2); - - // Anyone can cancel the expired buy offer. - env(token::cancelOffer(minter, {buyOffer1, sellOffer1})); + if (features[fixExpiredNFTokenOfferRemoval]) + { + // After amendment: expired offers were deleted during broker + // attempt + BEAST_EXPECT(ownerCount(env, minter) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == 1); + // The buy offer was deleted, so no need to cancel it + // The sell offer still exists, so we can cancel it + env(token::cancelOffer(minter, {sellOffer1})); + } + else + { + // Before amendment: expired offers still exist in ledger + BEAST_EXPECT(ownerCount(env, minter) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == 2); + // Anyone can cancel the expired offers + env(token::cancelOffer(minter, {buyOffer1, sellOffer1})); + } env.close(); BEAST_EXPECT(ownerCount(env, issuer) == 0); BEAST_EXPECT(ownerCount(env, minter) == 1); @@ -3122,17 +3261,19 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite BEAST_EXPECT(ownerCount(env, minter) == 2); BEAST_EXPECT(ownerCount(env, buyer) == 2); - // If the offers are expired they cannot be brokered. env(token::brokerOffers(issuer, buyOffer1, sellOffer1), ter(tecEXPIRED)); env.close(); // The expired offers are still in the ledger. BEAST_EXPECT(ownerCount(env, issuer) == 0); - BEAST_EXPECT(ownerCount(env, minter) == 2); - BEAST_EXPECT(ownerCount(env, buyer) == 2); - - // Anyone can cancel the expired offers. - env(token::cancelOffer(issuer, {buyOffer1, sellOffer1})); + if (!features[fixExpiredNFTokenOfferRemoval]) + { + // Before amendment: expired offers still exist in ledger + BEAST_EXPECT(ownerCount(env, minter) == 2); + BEAST_EXPECT(ownerCount(env, buyer) == 2); + // Anyone can cancel the expired offers + env(token::cancelOffer(issuer, {buyOffer1, sellOffer1})); + } env.close(); BEAST_EXPECT(ownerCount(env, issuer) == 0); BEAST_EXPECT(ownerCount(env, minter) == 1); @@ -6736,7 +6877,9 @@ public: void run() override { - testWithFeats(allFeatures - fixNFTokenReserve - featureNFTokenMintOffer - featureDynamicNFT); + testWithFeats( + allFeatures - fixNFTokenReserve - featureNFTokenMintOffer - featureDynamicNFT - + fixExpiredNFTokenOfferRemoval); } }; @@ -6767,6 +6910,15 @@ class NFTokenWOModify_test : public NFTokenBaseUtil_test } }; +class NFTokenWOExpiredOfferRemoval_test : public NFTokenBaseUtil_test +{ + void + run() override + { + testWithFeats(allFeatures - fixExpiredNFTokenOfferRemoval); + } +}; + class NFTokenAllFeatures_test : public NFTokenBaseUtil_test { void diff --git a/src/xrpld/app/tx/detail/NFTokenAcceptOffer.cpp b/src/xrpld/app/tx/detail/NFTokenAcceptOffer.cpp index 4e91bdc1b6..349dc2c1ea 100644 --- a/src/xrpld/app/tx/detail/NFTokenAcceptOffer.cpp +++ b/src/xrpld/app/tx/detail/NFTokenAcceptOffer.cpp @@ -53,7 +53,17 @@ NFTokenAcceptOffer::preclaim(PreclaimContext const& ctx) return {nullptr, tecOBJECT_NOT_FOUND}; if (hasExpired(ctx.view, (*offerSLE)[~sfExpiration])) - return {nullptr, tecEXPIRED}; + { + // Before fixExpiredNFTokenOfferRemoval amendment, expired + // offers caused tecEXPIRED in preclaim, leaving them on ledger + // forever. After the amendment, we allow expired offers to + // reach doApply() where they get deleted and tecEXPIRED is + // returned. + if (!ctx.view.rules().enabled(fixExpiredNFTokenOfferRemoval)) + return {nullptr, tecEXPIRED}; + // Amendment enabled: return the expired offer to be handled in + // doApply + } if ((*offerSLE)[sfAmount].negative()) return {nullptr, temBAD_OFFER}; @@ -299,7 +309,7 @@ NFTokenAcceptOffer::pay(AccountID const& from, AccountID const& to, STAmount con { // This should never happen, but it's easy and quick to check. if (amount < beast::zero) - return tecINTERNAL; + return tecINTERNAL; // LCOV_EXCL_LINE auto const result = accountSend(view(), from, to, amount, j_); @@ -410,6 +420,39 @@ NFTokenAcceptOffer::doApply() auto bo = loadToken(ctx_.tx[~sfNFTokenBuyOffer]); auto so = loadToken(ctx_.tx[~sfNFTokenSellOffer]); + // With fixExpiredNFTokenOfferRemoval amendment, check for expired offers + // and delete them, returning tecEXPIRED. This ensures expired offers + // are properly cleaned up from the ledger. + if (view().rules().enabled(fixExpiredNFTokenOfferRemoval)) + { + bool foundExpired = false; + + auto const deleteOfferIfExpired = [this, &foundExpired](std::shared_ptr const& offer) -> TER { + if (offer && hasExpired(view(), (*offer)[~sfExpiration])) + { + JLOG(j_.trace()) << "Offer is expired, deleting: " << offer->key(); + if (!nft::deleteTokenOffer(view(), offer)) + { + // LCOV_EXCL_START + JLOG(j_.fatal()) << "Unable to delete expired offer '" << offer->key() << "': ignoring"; + return tecINTERNAL; + // LCOV_EXCL_STOP + } + JLOG(j_.trace()) << "Deleted offer " << offer->key(); + foundExpired = true; + } + return tesSUCCESS; + }; + + if (auto const r = deleteOfferIfExpired(bo); !isTesSuccess(r)) + return r; + if (auto const r = deleteOfferIfExpired(so); !isTesSuccess(r)) + return r; + + if (foundExpired) + return tecEXPIRED; + } + if (bo && !nft::deleteTokenOffer(view(), bo)) { // LCOV_EXCL_START From 6c1a92fe935a226a0fcea10778bae88cb74726c3 Mon Sep 17 00:00:00 2001 From: Jingchen Date: Tue, 3 Feb 2026 19:08:27 +0000 Subject: [PATCH 08/26] refactor: Add ServiceRegistry to help modularization (#6222) 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. --- .../scripts/levelization/results/ordering.txt | 1 + include/xrpl/core/ServiceRegistry.h | 202 ++++++++++++++++++ src/xrpld/app/main/Application.h | 83 +------ 3 files changed, 205 insertions(+), 81 deletions(-) create mode 100644 include/xrpl/core/ServiceRegistry.h diff --git a/.github/scripts/levelization/results/ordering.txt b/.github/scripts/levelization/results/ordering.txt index 8d17e1167f..88a3441fa1 100644 --- a/.github/scripts/levelization/results/ordering.txt +++ b/.github/scripts/levelization/results/ordering.txt @@ -153,6 +153,7 @@ tests.libxrpl > xrpl.json tests.libxrpl > xrpl.net xrpl.core > xrpl.basics xrpl.core > xrpl.json +xrpl.core > xrpl.ledger xrpl.json > xrpl.basics xrpl.ledger > xrpl.basics xrpl.ledger > xrpl.protocol diff --git a/include/xrpl/core/ServiceRegistry.h b/include/xrpl/core/ServiceRegistry.h new file mode 100644 index 0000000000..a70d96292c --- /dev/null +++ b/include/xrpl/core/ServiceRegistry.h @@ -0,0 +1,202 @@ +#ifndef XRPL_CORE_SERVICEREGISTRY_H_INCLUDED +#define XRPL_CORE_SERVICEREGISTRY_H_INCLUDED + +#include +#include +#include +#include + +namespace xrpl { + +// Forward declarations +namespace NodeStore { +class Database; +} +namespace Resource { +class Manager; +} +namespace perf { +class PerfLog; +} + +class AcceptedLedger; +class AmendmentTable; +class Cluster; +class CollectorManager; +class DatabaseCon; +class Family; +class HashRouter; +class InboundLedgers; +class InboundTransactions; +class JobQueue; +class LedgerCleaner; +class LedgerMaster; +class LedgerReplayer; +class LoadFeeTrack; +class LoadManager; +class ManifestCache; +class NetworkOPs; +class OpenLedger; +class OrderBookDB; +class Overlay; +class PathRequests; +class PeerReservationTable; +class PendingSaves; +class RelationalDatabase; +class ServerHandler; +class SHAMapStore; +class TimeKeeper; +class TransactionMaster; +class TxQ; +class ValidatorList; +class ValidatorSite; + +template +class Validations; +class RCLValidationsAdaptor; +using RCLValidations = Validations; + +using NodeCache = TaggedCache; + +/** Service registry for dependency injection. + + This abstract interface provides access to various services and components + used throughout the application. It separates the service locator pattern + from the Application lifecycle management. + + Components that need access to services can hold a reference to + ServiceRegistry rather than Application when they only need service + access and not lifecycle management. + +*/ +class ServiceRegistry +{ +public: + ServiceRegistry() = default; + virtual ~ServiceRegistry() = default; + + // Core infrastructure services + virtual CollectorManager& + getCollectorManager() = 0; + + virtual Family& + getNodeFamily() = 0; + + virtual TimeKeeper& + timeKeeper() = 0; + + virtual JobQueue& + getJobQueue() = 0; + + virtual NodeCache& + getTempNodeCache() = 0; + + virtual CachedSLEs& + cachedSLEs() = 0; + + // Protocol and validation services + virtual AmendmentTable& + getAmendmentTable() = 0; + + virtual HashRouter& + getHashRouter() = 0; + + virtual LoadFeeTrack& + getFeeTrack() = 0; + + virtual LoadManager& + getLoadManager() = 0; + + virtual RCLValidations& + getValidations() = 0; + + virtual ValidatorList& + validators() = 0; + + virtual ValidatorSite& + validatorSites() = 0; + + virtual ManifestCache& + validatorManifests() = 0; + + virtual ManifestCache& + publisherManifests() = 0; + + // Network services + virtual Overlay& + overlay() = 0; + + virtual Cluster& + cluster() = 0; + + virtual PeerReservationTable& + peerReservations() = 0; + + virtual Resource::Manager& + getResourceManager() = 0; + + // Storage services + virtual NodeStore::Database& + getNodeStore() = 0; + + virtual SHAMapStore& + getSHAMapStore() = 0; + + virtual RelationalDatabase& + getRelationalDatabase() = 0; + + // Ledger services + virtual InboundLedgers& + getInboundLedgers() = 0; + + virtual InboundTransactions& + getInboundTransactions() = 0; + + virtual TaggedCache& + getAcceptedLedgerCache() = 0; + + virtual LedgerMaster& + getLedgerMaster() = 0; + + virtual LedgerCleaner& + getLedgerCleaner() = 0; + + virtual LedgerReplayer& + getLedgerReplayer() = 0; + + virtual PendingSaves& + pendingSaves() = 0; + + virtual OpenLedger& + openLedger() = 0; + + virtual OpenLedger const& + openLedger() const = 0; + + // Transaction and operation services + virtual NetworkOPs& + getOPs() = 0; + + virtual OrderBookDB& + getOrderBookDB() = 0; + + virtual TransactionMaster& + getMasterTransaction() = 0; + + virtual TxQ& + getTxQ() = 0; + + virtual PathRequests& + getPathRequests() = 0; + + // Server services + virtual ServerHandler& + getServerHandler() = 0; + + virtual perf::PerfLog& + getPerfLog() = 0; +}; + +} // namespace xrpl + +#endif diff --git a/src/xrpld/app/main/Application.h b/src/xrpld/app/main/Application.h index 07edd5f558..bb8bac8bbb 100644 --- a/src/xrpld/app/main/Application.h +++ b/src/xrpld/app/main/Application.h @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -91,7 +92,7 @@ class Validations; class RCLValidationsAdaptor; using RCLValidations = Validations; -class Application : public beast::PropertyStream::Source +class Application : public ServiceRegistry, public beast::PropertyStream::Source { public: /* VFALCO NOTE @@ -146,92 +147,12 @@ public: virtual boost::asio::io_context& getIOContext() = 0; - virtual CollectorManager& - getCollectorManager() = 0; - virtual Family& - getNodeFamily() = 0; - virtual TimeKeeper& - timeKeeper() = 0; - virtual JobQueue& - getJobQueue() = 0; - virtual NodeCache& - getTempNodeCache() = 0; - virtual CachedSLEs& - cachedSLEs() = 0; - virtual AmendmentTable& - getAmendmentTable() = 0; - virtual HashRouter& - getHashRouter() = 0; - virtual LoadFeeTrack& - getFeeTrack() = 0; - virtual LoadManager& - getLoadManager() = 0; - virtual Overlay& - overlay() = 0; - virtual TxQ& - getTxQ() = 0; - virtual ValidatorList& - validators() = 0; - virtual ValidatorSite& - validatorSites() = 0; - virtual ManifestCache& - validatorManifests() = 0; - virtual ManifestCache& - publisherManifests() = 0; - virtual Cluster& - cluster() = 0; - virtual PeerReservationTable& - peerReservations() = 0; - virtual RCLValidations& - getValidations() = 0; - virtual NodeStore::Database& - getNodeStore() = 0; - virtual InboundLedgers& - getInboundLedgers() = 0; - virtual InboundTransactions& - getInboundTransactions() = 0; - - virtual TaggedCache& - getAcceptedLedgerCache() = 0; - - virtual LedgerMaster& - getLedgerMaster() = 0; - virtual LedgerCleaner& - getLedgerCleaner() = 0; - virtual LedgerReplayer& - getLedgerReplayer() = 0; - virtual NetworkOPs& - getOPs() = 0; - virtual OrderBookDB& - getOrderBookDB() = 0; - virtual ServerHandler& - getServerHandler() = 0; - virtual TransactionMaster& - getMasterTransaction() = 0; - virtual perf::PerfLog& - getPerfLog() = 0; - virtual std::pair const& nodeIdentity() = 0; virtual std::optional getValidationPublicKey() const = 0; - virtual Resource::Manager& - getResourceManager() = 0; - virtual PathRequests& - getPathRequests() = 0; - virtual SHAMapStore& - getSHAMapStore() = 0; - virtual PendingSaves& - pendingSaves() = 0; - virtual OpenLedger& - openLedger() = 0; - virtual OpenLedger const& - openLedger() const = 0; - virtual RelationalDatabase& - getRelationalDatabase() = 0; - virtual std::chrono::milliseconds getIOLatency() = 0; From 3a172301cec7a43aa7b9b170508f0f0b5be66c19 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 3 Feb 2026 17:55:22 -0500 Subject: [PATCH 09/26] chore: Remove unity builds (#6300) Unity builds were intended to speed up builds, by bundling multiple files into compilation units. However, now that ccache is available on all platforms, there is no need for unity builds anymore, as ccache stores compiled individual build objects for reuse. This change therefore removes the ability to make unity builds. --- .github/scripts/strategy-matrix/generate.py | 61 +++++++------------- .github/scripts/strategy-matrix/linux.json | 2 +- .github/scripts/strategy-matrix/macos.json | 5 +- .github/scripts/strategy-matrix/windows.json | 2 +- BUILD.md | 37 +++++++++--- cmake/XrplAddTest.cmake | 3 - cmake/XrplCore.cmake | 13 ----- cmake/XrplSettings.cmake | 8 --- conanfile.py | 3 - include/xrpl/basics/rocksdb.h | 4 +- src/libxrpl/net/RegisterSSLCerts.cpp | 3 +- 11 files changed, 58 insertions(+), 83 deletions(-) diff --git a/.github/scripts/strategy-matrix/generate.py b/.github/scripts/strategy-matrix/generate.py index 0e44b1be54..75847b4d9d 100755 --- a/.github/scripts/strategy-matrix/generate.py +++ b/.github/scripts/strategy-matrix/generate.py @@ -51,22 +51,20 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: # Only generate a subset of configurations in PRs. if not all: # Debian: - # - Bookworm using GCC 13: Release and Unity on linux/amd64, set - # the reference fee to 500. - # - Bookworm using GCC 15: Debug and no Unity on linux/amd64, enable - # code coverage (which will be done below). - # - Bookworm using Clang 16: Debug and no Unity on linux/arm64, - # enable voidstar. - # - Bookworm using Clang 17: Release and no Unity on linux/amd64, - # set the reference fee to 1000. - # - Bookworm using Clang 20: Debug and Unity on linux/amd64. + # - Bookworm using GCC 13: Release on linux/amd64, set the reference + # fee to 500. + # - Bookworm using GCC 15: Debug on linux/amd64, enable code + # coverage (which will be done below). + # - Bookworm using Clang 16: Debug on linux/arm64, enable voidstar. + # - Bookworm using Clang 17: Release on linux/amd64, set the + # reference fee to 1000. + # - Bookworm using Clang 20: Debug on linux/amd64. if os["distro_name"] == "debian": skip = True if os["distro_version"] == "bookworm": if ( f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-13" and build_type == "Release" - and "-Dunity=ON" in cmake_args and architecture["platform"] == "linux/amd64" ): cmake_args = f"-DUNIT_TEST_REFERENCE_FEE=500 {cmake_args}" @@ -74,14 +72,12 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: if ( f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-15" and build_type == "Debug" - and "-Dunity=OFF" in cmake_args and architecture["platform"] == "linux/amd64" ): skip = False if ( f"{os['compiler_name']}-{os['compiler_version']}" == "clang-16" and build_type == "Debug" - and "-Dunity=OFF" in cmake_args and architecture["platform"] == "linux/arm64" ): cmake_args = f"-Dvoidstar=ON {cmake_args}" @@ -89,7 +85,6 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: if ( f"{os['compiler_name']}-{os['compiler_version']}" == "clang-17" and build_type == "Release" - and "-Dunity=ON" in cmake_args and architecture["platform"] == "linux/amd64" ): cmake_args = f"-DUNIT_TEST_REFERENCE_FEE=1000 {cmake_args}" @@ -97,7 +92,6 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: if ( f"{os['compiler_name']}-{os['compiler_version']}" == "clang-20" and build_type == "Debug" - and "-Dunity=ON" in cmake_args and architecture["platform"] == "linux/amd64" ): skip = False @@ -105,15 +99,14 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: continue # RHEL: - # - 9 using GCC 12: Debug and Unity on linux/amd64. - # - 10 using Clang: Release and no Unity on linux/amd64. + # - 9 using GCC 12: Debug on linux/amd64. + # - 10 using Clang: Release on linux/amd64. if os["distro_name"] == "rhel": skip = True if os["distro_version"] == "9": if ( f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-12" and build_type == "Debug" - and "-Dunity=ON" in cmake_args and architecture["platform"] == "linux/amd64" ): skip = False @@ -121,7 +114,6 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: if ( f"{os['compiler_name']}-{os['compiler_version']}" == "clang-any" and build_type == "Release" - and "-Dunity=OFF" in cmake_args and architecture["platform"] == "linux/amd64" ): skip = False @@ -129,17 +121,16 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: continue # Ubuntu: - # - Jammy using GCC 12: Debug and no Unity on linux/arm64. - # - Noble using GCC 14: Release and Unity on linux/amd64. - # - Noble using Clang 18: Debug and no Unity on linux/amd64. - # - Noble using Clang 19: Release and Unity on linux/arm64. + # - Jammy using GCC 12: Debug on linux/arm64. + # - Noble using GCC 14: Release on linux/amd64. + # - Noble using Clang 18: Debug on linux/amd64. + # - Noble using Clang 19: Release on linux/arm64. if os["distro_name"] == "ubuntu": skip = True if os["distro_version"] == "jammy": if ( f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-12" and build_type == "Debug" - and "-Dunity=OFF" in cmake_args and architecture["platform"] == "linux/arm64" ): skip = False @@ -147,21 +138,18 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: if ( f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-14" and build_type == "Release" - and "-Dunity=ON" in cmake_args and architecture["platform"] == "linux/amd64" ): skip = False if ( f"{os['compiler_name']}-{os['compiler_version']}" == "clang-18" and build_type == "Debug" - and "-Dunity=OFF" in cmake_args and architecture["platform"] == "linux/amd64" ): skip = False if ( f"{os['compiler_name']}-{os['compiler_version']}" == "clang-19" and build_type == "Release" - and "-Dunity=ON" in cmake_args and architecture["platform"] == "linux/arm64" ): skip = False @@ -169,20 +157,16 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: continue # MacOS: - # - Debug and no Unity on macos/arm64. + # - Debug on macos/arm64. if os["distro_name"] == "macos" and not ( - build_type == "Debug" - and "-Dunity=OFF" in cmake_args - and architecture["platform"] == "macos/arm64" + build_type == "Debug" and architecture["platform"] == "macos/arm64" ): continue # Windows: - # - Release and Unity on windows/amd64. + # - Release on windows/amd64. if os["distro_name"] == "windows" and not ( - build_type == "Release" - and "-Dunity=ON" in cmake_args - and architecture["platform"] == "windows/amd64" + build_type == "Release" and architecture["platform"] == "windows/amd64" ): continue @@ -209,18 +193,17 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: ): continue - # Enable code coverage for Debian Bookworm using GCC 15 in Debug and no - # Unity on linux/amd64 + # Enable code coverage for Debian Bookworm using GCC 15 in Debug on + # linux/amd64 if ( f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-15" and build_type == "Debug" - and "-Dunity=OFF" in cmake_args and architecture["platform"] == "linux/amd64" ): cmake_args = f"-Dcoverage=ON -Dcoverage_format=xml -DCODE_COVERAGE_VERBOSE=ON -DCMAKE_C_FLAGS=-O0 -DCMAKE_CXX_FLAGS=-O0 {cmake_args}" # Generate a unique name for the configuration, e.g. macos-arm64-debug - # or debian-bookworm-gcc-12-amd64-release-unity. + # or debian-bookworm-gcc-12-amd64-release. config_name = os["distro_name"] if (n := os["distro_version"]) != "": config_name += f"-{n}" @@ -234,8 +217,6 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: config_name += f"-{build_type.lower()}" if "-Dcoverage=ON" in cmake_args: config_name += "-coverage" - if "-Dunity=ON" in cmake_args: - config_name += "-unity" # Add the configuration to the list, with the most unique fields first, # so that they are easier to identify in the GitHub Actions UI, as long diff --git a/.github/scripts/strategy-matrix/linux.json b/.github/scripts/strategy-matrix/linux.json index e64a05f925..4943579be8 100644 --- a/.github/scripts/strategy-matrix/linux.json +++ b/.github/scripts/strategy-matrix/linux.json @@ -208,5 +208,5 @@ } ], "build_type": ["Debug", "Release"], - "cmake_args": ["-Dunity=OFF", "-Dunity=ON"] + "cmake_args": [""] } diff --git a/.github/scripts/strategy-matrix/macos.json b/.github/scripts/strategy-matrix/macos.json index 14b6089620..6fc44d0f80 100644 --- a/.github/scripts/strategy-matrix/macos.json +++ b/.github/scripts/strategy-matrix/macos.json @@ -15,8 +15,5 @@ } ], "build_type": ["Debug", "Release"], - "cmake_args": [ - "-Dunity=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5", - "-Dunity=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5" - ] + "cmake_args": ["-DCMAKE_POLICY_VERSION_MINIMUM=3.5"] } diff --git a/.github/scripts/strategy-matrix/windows.json b/.github/scripts/strategy-matrix/windows.json index 8637b31012..8c536c70f2 100644 --- a/.github/scripts/strategy-matrix/windows.json +++ b/.github/scripts/strategy-matrix/windows.json @@ -15,5 +15,5 @@ } ], "build_type": ["Debug", "Release"], - "cmake_args": ["-Dunity=OFF", "-Dunity=ON"] + "cmake_args": [""] } diff --git a/BUILD.md b/BUILD.md index f90aa0c148..35668aeabd 100644 --- a/BUILD.md +++ b/BUILD.md @@ -368,6 +368,36 @@ The workaround for this error is to add two lines to your profile: tools.build:cxxflags=['-DBOOST_ASIO_DISABLE_CONCEPTS'] ``` +### Set Up Ccache + +To speed up repeated compilations, we recommend that you install +[ccache](https://ccache.dev), a tool that wraps your compiler so that it can +cache build objects locally. + +#### Linux + +You can install it using the package manager, e.g. `sudo apt install ccache` +(Ubuntu) or `sudo dnf install ccache` (RHEL). + +#### macOS + +You can install it using Homebrew, i.e. `brew install ccache`. + +#### Windows + +You can install it using Chocolatey, i.e. `choco install ccache`. If you already +have Ccache installed, then `choco upgrade ccache` will update it to the latest +version. However, if you see an error such as: + +``` +terminate called after throwing an instance of 'std::bad_alloc' + what(): std::bad_alloc +C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(617,5): error MSB6006: "cl.exe" exited with code 3. +``` + +then please install a specific version of Ccache that we know works, via: `choco +install ccache --version 4.11.3 --allow-downgrade`. + ### Build and Test 1. Create a build directory and move into it. @@ -545,16 +575,10 @@ See [Sanitizers docs](./docs/build/sanitizers.md) for more details. | `assert` | OFF | Enable assertions. | | `coverage` | OFF | Prepare the coverage report. | | `tests` | OFF | Build tests. | -| `unity` | OFF | Configure a unity build. | | `xrpld` | OFF | Build the xrpld application, and not just the libxrpl library. | | `werr` | OFF | Treat compilation warnings as errors | | `wextra` | OFF | Enable additional compilation warnings | -[Unity builds][5] may be faster for the first build -(at the cost of much more memory) since they concatenate sources into fewer -translation units. Non-unity builds may be faster for incremental builds, -and can be helpful for detecting `#include` omissions. - ## Troubleshooting ### Conan @@ -621,7 +645,6 @@ If you want to experiment with a new package, follow these steps: [1]: https://github.com/conan-io/conan-center-index/issues/13168 [2]: https://en.cppreference.com/w/cpp/compiler_support/20 [3]: https://docs.conan.io/en/latest/getting_started.html -[5]: https://en.wikipedia.org/wiki/Unity_build [6]: https://github.com/boostorg/beast/issues/2648 [7]: https://github.com/boostorg/beast/issues/2661 [gcovr]: https://gcovr.com/en/stable/getting-started.html diff --git a/cmake/XrplAddTest.cmake b/cmake/XrplAddTest.cmake index 135b975a02..35189e203f 100644 --- a/cmake/XrplAddTest.cmake +++ b/cmake/XrplAddTest.cmake @@ -9,8 +9,5 @@ function (xrpl_add_test name) isolate_headers(${target} "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests/${name}" PRIVATE) - # Make sure the test isn't optimized away in unity builds - set_target_properties(${target} PROPERTIES UNITY_BUILD_MODE GROUP UNITY_BUILD_BATCH_SIZE 0) # Adjust as needed - add_test(NAME ${target} COMMAND ${target}) endfunction () diff --git a/cmake/XrplCore.cmake b/cmake/XrplCore.cmake index 0651b8e0d8..afefa8457d 100644 --- a/cmake/XrplCore.cmake +++ b/cmake/XrplCore.cmake @@ -4,12 +4,7 @@ include(target_protobuf_sources) -# Protocol buffers cannot participate in a unity build, -# because all the generated sources -# define a bunch of `static const` variables with the same names, -# so we just build them as a separate library. add_library(xrpl.libpb) -set_target_properties(xrpl.libpb PROPERTIES UNITY_BUILD OFF) target_protobuf_sources(xrpl.libpb xrpl/proto LANGUAGE cpp IMPORT_DIRS include/xrpl/proto PROTOS include/xrpl/proto/xrpl.proto) @@ -160,12 +155,4 @@ if (xrpld) # antithesis_instrumentation.h, which is not exported as INTERFACE target_include_directories(xrpld PRIVATE ${CMAKE_SOURCE_DIR}/external/antithesis-sdk) endif () - - # any files that don't play well with unity should be added here - if (tests) - set_source_files_properties( - # these two seem to produce conflicts in beast teardown template methods - src/test/rpc/ValidatorRPC_test.cpp src/test/ledger/Invariants_test.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION - TRUE) - endif () endif () diff --git a/cmake/XrplSettings.cmake b/cmake/XrplSettings.cmake index 6d332be19d..0957e41918 100644 --- a/cmake/XrplSettings.cmake +++ b/cmake/XrplSettings.cmake @@ -30,14 +30,6 @@ if (tests) endif () endif () -option(unity "Creates a build using UNITY support in cmake." OFF) -if (unity) - if (NOT is_ci) - set(CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "") - endif () - set(CMAKE_UNITY_BUILD ON CACHE BOOL "Do a unity build") -endif () - if (is_clang AND is_linux) option(voidstar "Enable Antithesis instrumentation." OFF) endif () diff --git a/conanfile.py b/conanfile.py index a7a19405de..35a461cec7 100644 --- a/conanfile.py +++ b/conanfile.py @@ -23,7 +23,6 @@ class Xrpl(ConanFile): "shared": [True, False], "static": [True, False], "tests": [True, False], - "unity": [True, False], "xrpld": [True, False], } @@ -55,7 +54,6 @@ class Xrpl(ConanFile): "shared": False, "static": True, "tests": False, - "unity": False, "xrpld": False, "date/*:header_only": True, "ed25519/*:shared": False, @@ -168,7 +166,6 @@ class Xrpl(ConanFile): tc.variables["rocksdb"] = self.options.rocksdb tc.variables["BUILD_SHARED_LIBS"] = self.options.shared tc.variables["static"] = self.options.static - tc.variables["unity"] = self.options.unity tc.variables["xrpld"] = self.options.xrpld tc.generate() diff --git a/include/xrpl/basics/rocksdb.h b/include/xrpl/basics/rocksdb.h index b9b89677f9..59a69a9b44 100644 --- a/include/xrpl/basics/rocksdb.h +++ b/include/xrpl/basics/rocksdb.h @@ -1,5 +1,5 @@ -#ifndef XRPL_UNITY_ROCKSDB_H_INCLUDED -#define XRPL_UNITY_ROCKSDB_H_INCLUDED +#ifndef XRPL_BASICS_ROCKSDB_H_INCLUDED +#define XRPL_BASICS_ROCKSDB_H_INCLUDED #if XRPL_ROCKSDB_AVAILABLE // #include diff --git a/src/libxrpl/net/RegisterSSLCerts.cpp b/src/libxrpl/net/RegisterSSLCerts.cpp index a15472969e..1b97a17e5c 100644 --- a/src/libxrpl/net/RegisterSSLCerts.cpp +++ b/src/libxrpl/net/RegisterSSLCerts.cpp @@ -85,7 +85,8 @@ registerSSLCerts(boost::asio::ssl::context& ctx, boost::system::error_code& ec, // There is a very unpleasant interaction between and // openssl x509 types (namely the former has macros that stomp // on the latter), these undefs allow this TU to be safely used in -// unity builds without messing up subsequent TUs. +// unity builds without messing up subsequent TUs. Although we +// no longer use unity builds, leaving the undefs here does no harm. #if BOOST_OS_WINDOWS #undef X509_NAME #undef X509_EXTENSIONS From 34ef577604782ca8d6e1c17df8bd7470990a52ff Mon Sep 17 00:00:00 2001 From: Bart Date: Wed, 4 Feb 2026 09:50:21 -0500 Subject: [PATCH 10/26] refactor: Replace include guards by '#pragma once' (#6322) This change replaces all include guards in the `src/` and `include/` directories by `#pragma once`. --- .github/scripts/rename/include.sh | 30 ++++ .github/workflows/reusable-check-rename.yml | 2 + convert_include_guards.py | 139 ++++++++++++++++++ include/xrpl/basics/Archive.h | 5 +- include/xrpl/basics/BasicConfig.h | 5 +- include/xrpl/basics/Blob.h | 5 +- include/xrpl/basics/Buffer.h | 5 +- include/xrpl/basics/ByteUtilities.h | 5 +- include/xrpl/basics/CompressionAlgorithms.h | 5 +- include/xrpl/basics/CountedObject.h | 5 +- include/xrpl/basics/DecayingSample.h | 5 +- include/xrpl/basics/Expected.h | 5 +- include/xrpl/basics/FileUtilities.h | 5 +- include/xrpl/basics/IntrusivePointer.h | 4 +- include/xrpl/basics/IntrusivePointer.ipp | 4 +- include/xrpl/basics/IntrusiveRefCounts.h | 4 +- include/xrpl/basics/KeyCache.h | 5 +- include/xrpl/basics/LocalValue.h | 5 +- include/xrpl/basics/Log.h | 5 +- include/xrpl/basics/MathUtilities.h | 5 +- include/xrpl/basics/Number.h | 5 +- include/xrpl/basics/RangeSet.h | 5 +- include/xrpl/basics/Resolver.h | 5 +- include/xrpl/basics/ResolverAsio.h | 5 +- include/xrpl/basics/SHAMapHash.h | 5 +- include/xrpl/basics/SharedWeakCachePointer.h | 4 +- .../xrpl/basics/SharedWeakCachePointer.ipp | 4 +- include/xrpl/basics/SlabAllocator.h | 5 +- include/xrpl/basics/Slice.h | 5 +- include/xrpl/basics/StringUtilities.h | 5 +- include/xrpl/basics/TaggedCache.h | 5 +- include/xrpl/basics/TaggedCache.ipp | 5 +- include/xrpl/basics/ToString.h | 5 +- include/xrpl/basics/UnorderedContainers.h | 5 +- include/xrpl/basics/UptimeClock.h | 5 +- include/xrpl/basics/algorithm.h | 5 +- include/xrpl/basics/base64.h | 5 +- include/xrpl/basics/base_uint.h | 5 +- include/xrpl/basics/chrono.h | 5 +- include/xrpl/basics/comparators.h | 5 +- include/xrpl/basics/contract.h | 5 +- include/xrpl/basics/hardened_hash.h | 5 +- include/xrpl/basics/join.h | 5 +- include/xrpl/basics/make_SSLContext.h | 5 +- include/xrpl/basics/mulDiv.h | 5 +- .../xrpl/basics/partitioned_unordered_map.h | 5 +- include/xrpl/basics/random.h | 5 +- include/xrpl/basics/rocksdb.h | 5 +- include/xrpl/basics/safe_cast.h | 5 +- include/xrpl/basics/scope.h | 5 +- include/xrpl/basics/spinlock.h | 5 +- include/xrpl/basics/strHex.h | 5 +- include/xrpl/basics/tagged_integer.h | 4 +- include/xrpl/beast/asio/io_latency_probe.h | 5 +- include/xrpl/beast/clock/abstract_clock.h | 5 +- .../xrpl/beast/clock/basic_seconds_clock.h | 5 +- include/xrpl/beast/clock/manual_clock.h | 5 +- include/xrpl/beast/container/aged_container.h | 5 +- .../beast/container/aged_container_utility.h | 5 +- include/xrpl/beast/container/aged_map.h | 5 +- include/xrpl/beast/container/aged_multimap.h | 5 +- include/xrpl/beast/container/aged_multiset.h | 5 +- include/xrpl/beast/container/aged_set.h | 5 +- .../xrpl/beast/container/aged_unordered_map.h | 5 +- .../beast/container/aged_unordered_multimap.h | 5 +- .../beast/container/aged_unordered_multiset.h | 5 +- .../xrpl/beast/container/aged_unordered_set.h | 5 +- .../detail/aged_associative_container.h | 5 +- .../detail/aged_container_iterator.h | 5 +- .../container/detail/aged_ordered_container.h | 5 +- .../detail/aged_unordered_container.h | 5 +- .../detail/empty_base_optimization.h | 5 +- include/xrpl/beast/core/CurrentThreadName.h | 5 +- include/xrpl/beast/core/LexicalCast.h | 5 +- include/xrpl/beast/core/List.h | 5 +- include/xrpl/beast/core/LockFreeStack.h | 5 +- include/xrpl/beast/core/SemanticVersion.h | 5 +- include/xrpl/beast/hash/hash_append.h | 5 +- include/xrpl/beast/hash/uhash.h | 5 +- include/xrpl/beast/hash/xxhasher.h | 5 +- include/xrpl/beast/insight/Collector.h | 5 +- include/xrpl/beast/insight/Counter.h | 5 +- include/xrpl/beast/insight/CounterImpl.h | 5 +- include/xrpl/beast/insight/Event.h | 5 +- include/xrpl/beast/insight/EventImpl.h | 5 +- include/xrpl/beast/insight/Gauge.h | 5 +- include/xrpl/beast/insight/GaugeImpl.h | 5 +- include/xrpl/beast/insight/Group.h | 5 +- include/xrpl/beast/insight/Groups.h | 5 +- include/xrpl/beast/insight/Hook.h | 5 +- include/xrpl/beast/insight/HookImpl.h | 5 +- include/xrpl/beast/insight/Insight.h | 5 +- include/xrpl/beast/insight/Meter.h | 5 +- include/xrpl/beast/insight/MeterImpl.h | 5 +- include/xrpl/beast/insight/NullCollector.h | 5 +- include/xrpl/beast/insight/StatsDCollector.h | 5 +- include/xrpl/beast/net/IPAddress.h | 5 +- include/xrpl/beast/net/IPAddressConversion.h | 5 +- include/xrpl/beast/net/IPAddressV4.h | 5 +- include/xrpl/beast/net/IPAddressV6.h | 5 +- include/xrpl/beast/net/IPEndpoint.h | 5 +- include/xrpl/beast/rfc2616.h | 5 +- include/xrpl/beast/test/yield_to.h | 5 +- include/xrpl/beast/type_name.h | 5 +- include/xrpl/beast/unit_test.h | 5 +- include/xrpl/beast/unit_test/amount.h | 5 +- .../beast/unit_test/detail/const_container.h | 5 +- include/xrpl/beast/unit_test/global_suites.h | 5 +- include/xrpl/beast/unit_test/match.h | 5 +- include/xrpl/beast/unit_test/recorder.h | 5 +- include/xrpl/beast/unit_test/reporter.h | 5 +- include/xrpl/beast/unit_test/results.h | 5 +- include/xrpl/beast/unit_test/runner.h | 5 +- include/xrpl/beast/unit_test/suite.h | 5 +- include/xrpl/beast/unit_test/suite_info.h | 5 +- include/xrpl/beast/unit_test/suite_list.h | 5 +- include/xrpl/beast/unit_test/thread.h | 5 +- include/xrpl/beast/utility/Journal.h | 5 +- include/xrpl/beast/utility/PropertyStream.h | 5 +- include/xrpl/beast/utility/WrappedSink.h | 5 +- include/xrpl/beast/utility/Zero.h | 5 +- include/xrpl/beast/utility/instrumentation.h | 5 +- include/xrpl/beast/utility/maybe_const.h | 5 +- include/xrpl/beast/utility/rngfill.h | 5 +- include/xrpl/beast/utility/temp_dir.h | 5 +- include/xrpl/beast/xor_shift_engine.h | 5 +- include/xrpl/core/ClosureCounter.h | 5 +- include/xrpl/core/Coro.ipp | 5 +- include/xrpl/core/Job.h | 5 +- include/xrpl/core/JobQueue.h | 5 +- include/xrpl/core/JobTypeData.h | 5 +- include/xrpl/core/JobTypeInfo.h | 5 +- include/xrpl/core/JobTypes.h | 5 +- include/xrpl/core/LoadEvent.h | 5 +- include/xrpl/core/LoadMonitor.h | 5 +- include/xrpl/core/PerfLog.h | 5 +- include/xrpl/core/ServiceRegistry.h | 5 +- include/xrpl/core/detail/Workers.h | 5 +- include/xrpl/core/detail/semaphore.h | 5 +- include/xrpl/crypto/RFC1751.h | 5 +- include/xrpl/crypto/csprng.h | 5 +- include/xrpl/crypto/secure_erase.h | 5 +- include/xrpl/json/JsonPropertyStream.h | 5 +- include/xrpl/json/Output.h | 5 +- include/xrpl/json/Writer.h | 5 +- include/xrpl/json/detail/json_assert.h | 5 +- include/xrpl/json/json_errors.h | 5 +- include/xrpl/json/json_forwards.h | 5 +- include/xrpl/json/json_reader.h | 5 +- include/xrpl/json/json_value.h | 5 +- include/xrpl/json/json_writer.h | 5 +- include/xrpl/json/to_string.h | 5 +- include/xrpl/ledger/ApplyView.h | 5 +- include/xrpl/ledger/ApplyViewImpl.h | 5 +- include/xrpl/ledger/BookDirs.h | 5 +- include/xrpl/ledger/CachedSLEs.h | 5 +- include/xrpl/ledger/CachedView.h | 5 +- include/xrpl/ledger/CredentialHelpers.h | 5 +- include/xrpl/ledger/Credit.h | 5 +- include/xrpl/ledger/Dir.h | 5 +- include/xrpl/ledger/OpenView.h | 5 +- include/xrpl/ledger/PaymentSandbox.h | 5 +- include/xrpl/ledger/RawView.h | 5 +- include/xrpl/ledger/ReadView.h | 5 +- include/xrpl/ledger/Sandbox.h | 5 +- include/xrpl/ledger/View.h | 5 +- include/xrpl/ledger/detail/ApplyStateTable.h | 5 +- include/xrpl/ledger/detail/ApplyViewBase.h | 5 +- include/xrpl/ledger/detail/RawStateTable.h | 5 +- include/xrpl/ledger/detail/ReadViewFwdRange.h | 5 +- .../xrpl/ledger/detail/ReadViewFwdRange.ipp | 5 +- include/xrpl/net/AutoSocket.h | 5 +- include/xrpl/net/HTTPClient.h | 5 +- include/xrpl/net/HTTPClientSSLContext.h | 5 +- include/xrpl/net/RegisterSSLCerts.h | 5 +- include/xrpl/nodestore/Backend.h | 5 +- include/xrpl/nodestore/Database.h | 5 +- include/xrpl/nodestore/DatabaseRotating.h | 5 +- include/xrpl/nodestore/DummyScheduler.h | 5 +- include/xrpl/nodestore/Factory.h | 5 +- include/xrpl/nodestore/Manager.h | 5 +- include/xrpl/nodestore/NodeObject.h | 5 +- include/xrpl/nodestore/Scheduler.h | 5 +- include/xrpl/nodestore/Task.h | 5 +- include/xrpl/nodestore/Types.h | 5 +- include/xrpl/nodestore/detail/BatchWriter.h | 5 +- .../xrpl/nodestore/detail/DatabaseNodeImp.h | 5 +- .../nodestore/detail/DatabaseRotatingImp.h | 5 +- include/xrpl/nodestore/detail/DecodedBlob.h | 5 +- include/xrpl/nodestore/detail/EncodedBlob.h | 5 +- include/xrpl/nodestore/detail/ManagerImp.h | 5 +- include/xrpl/nodestore/detail/codec.h | 5 +- include/xrpl/nodestore/detail/varint.h | 5 +- include/xrpl/protocol/AMMCore.h | 5 +- include/xrpl/protocol/AccountID.h | 5 +- include/xrpl/protocol/AmountConversions.h | 5 +- include/xrpl/protocol/ApiVersion.h | 5 +- include/xrpl/protocol/Asset.h | 5 +- include/xrpl/protocol/Book.h | 5 +- include/xrpl/protocol/BuildInfo.h | 5 +- include/xrpl/protocol/ErrorCodes.h | 5 +- include/xrpl/protocol/Feature.h | 5 +- include/xrpl/protocol/Fees.h | 5 +- include/xrpl/protocol/HashPrefix.h | 5 +- include/xrpl/protocol/IOUAmount.h | 5 +- include/xrpl/protocol/Indexes.h | 5 +- include/xrpl/protocol/InnerObjectFormats.h | 5 +- include/xrpl/protocol/Issue.h | 5 +- include/xrpl/protocol/KeyType.h | 5 +- include/xrpl/protocol/Keylet.h | 5 +- include/xrpl/protocol/KnownFormats.h | 5 +- include/xrpl/protocol/LedgerFormats.h | 5 +- include/xrpl/protocol/LedgerHeader.h | 5 +- include/xrpl/protocol/MPTAmount.h | 5 +- include/xrpl/protocol/MPTIssue.h | 5 +- include/xrpl/protocol/MultiApiJson.h | 5 +- .../xrpl/protocol/NFTSyntheticSerializer.h | 5 +- include/xrpl/protocol/NFTokenID.h | 5 +- include/xrpl/protocol/NFTokenOfferID.h | 5 +- include/xrpl/protocol/PayChan.h | 5 +- include/xrpl/protocol/Permissions.h | 5 +- include/xrpl/protocol/Protocol.h | 5 +- include/xrpl/protocol/PublicKey.h | 5 +- include/xrpl/protocol/Quality.h | 5 +- include/xrpl/protocol/QualityFunction.h | 5 +- include/xrpl/protocol/RPCErr.h | 5 +- include/xrpl/protocol/Rate.h | 5 +- include/xrpl/protocol/RippleLedgerHash.h | 5 +- include/xrpl/protocol/Rules.h | 4 +- include/xrpl/protocol/SField.h | 5 +- include/xrpl/protocol/SOTemplate.h | 5 +- include/xrpl/protocol/STAccount.h | 5 +- include/xrpl/protocol/STAmount.h | 4 +- include/xrpl/protocol/STArray.h | 5 +- include/xrpl/protocol/STBase.h | 5 +- include/xrpl/protocol/STBitString.h | 5 +- include/xrpl/protocol/STBlob.h | 5 +- include/xrpl/protocol/STCurrency.h | 5 +- include/xrpl/protocol/STExchange.h | 5 +- include/xrpl/protocol/STInteger.h | 5 +- include/xrpl/protocol/STIssue.h | 5 +- include/xrpl/protocol/STLedgerEntry.h | 5 +- include/xrpl/protocol/STNumber.h | 5 +- include/xrpl/protocol/STObject.h | 5 +- include/xrpl/protocol/STParsedJSON.h | 5 +- include/xrpl/protocol/STPathSet.h | 5 +- include/xrpl/protocol/STTakesAsset.h | 5 +- include/xrpl/protocol/STTx.h | 5 +- include/xrpl/protocol/STValidation.h | 5 +- include/xrpl/protocol/STVector256.h | 5 +- include/xrpl/protocol/STXChainBridge.h | 5 +- include/xrpl/protocol/SecretKey.h | 5 +- include/xrpl/protocol/Seed.h | 5 +- include/xrpl/protocol/SeqProxy.h | 5 +- include/xrpl/protocol/Serializer.h | 5 +- include/xrpl/protocol/Sign.h | 5 +- include/xrpl/protocol/SystemParameters.h | 5 +- include/xrpl/protocol/TER.h | 5 +- include/xrpl/protocol/TxFlags.h | 5 +- include/xrpl/protocol/TxFormats.h | 5 +- include/xrpl/protocol/TxMeta.h | 5 +- include/xrpl/protocol/UintTypes.h | 5 +- include/xrpl/protocol/Units.h | 5 +- include/xrpl/protocol/XChainAttestations.h | 5 +- include/xrpl/protocol/XRPAmount.h | 5 +- include/xrpl/protocol/detail/STVar.h | 5 +- include/xrpl/protocol/detail/b58_utils.h | 4 +- include/xrpl/protocol/detail/secp256k1.h | 5 +- include/xrpl/protocol/detail/token_errors.h | 4 +- include/xrpl/protocol/digest.h | 5 +- include/xrpl/protocol/json_get_or_throw.h | 5 +- include/xrpl/protocol/jss.h | 5 +- include/xrpl/protocol/messages.h | 5 +- include/xrpl/protocol/nft.h | 5 +- include/xrpl/protocol/nftPageMask.h | 5 +- include/xrpl/protocol/serialize.h | 5 +- include/xrpl/protocol/st.h | 5 +- include/xrpl/protocol/tokens.h | 5 +- include/xrpl/resource/Charge.h | 5 +- include/xrpl/resource/Consumer.h | 5 +- include/xrpl/resource/Disposition.h | 5 +- include/xrpl/resource/Fees.h | 5 +- include/xrpl/resource/Gossip.h | 5 +- include/xrpl/resource/ResourceManager.h | 5 +- include/xrpl/resource/Types.h | 5 +- include/xrpl/resource/detail/Entry.h | 5 +- include/xrpl/resource/detail/Import.h | 5 +- include/xrpl/resource/detail/Key.h | 5 +- include/xrpl/resource/detail/Kind.h | 5 +- include/xrpl/resource/detail/Logic.h | 5 +- include/xrpl/resource/detail/Tuning.h | 5 +- include/xrpl/server/Handoff.h | 5 +- include/xrpl/server/Port.h | 5 +- include/xrpl/server/Server.h | 5 +- include/xrpl/server/Session.h | 5 +- include/xrpl/server/SimpleWriter.h | 5 +- include/xrpl/server/WSSession.h | 5 +- include/xrpl/server/Writer.h | 5 +- include/xrpl/server/detail/BaseHTTPPeer.h | 5 +- include/xrpl/server/detail/BasePeer.h | 5 +- include/xrpl/server/detail/BaseWSPeer.h | 5 +- include/xrpl/server/detail/Door.h | 5 +- include/xrpl/server/detail/JSONRPCUtil.h | 5 +- include/xrpl/server/detail/LowestLayer.h | 5 +- include/xrpl/server/detail/PlainHTTPPeer.h | 5 +- include/xrpl/server/detail/PlainWSPeer.h | 5 +- include/xrpl/server/detail/SSLHTTPPeer.h | 5 +- include/xrpl/server/detail/SSLWSPeer.h | 5 +- include/xrpl/server/detail/ServerImpl.h | 5 +- include/xrpl/server/detail/Spawn.h | 5 +- include/xrpl/server/detail/io_list.h | 5 +- include/xrpl/shamap/Family.h | 5 +- include/xrpl/shamap/FullBelowCache.h | 5 +- include/xrpl/shamap/SHAMap.h | 5 +- .../xrpl/shamap/SHAMapAccountStateLeafNode.h | 5 +- include/xrpl/shamap/SHAMapAddNode.h | 5 +- include/xrpl/shamap/SHAMapInnerNode.h | 4 +- include/xrpl/shamap/SHAMapItem.h | 5 +- include/xrpl/shamap/SHAMapLeafNode.h | 5 +- include/xrpl/shamap/SHAMapMissingNode.h | 5 +- include/xrpl/shamap/SHAMapNodeID.h | 5 +- include/xrpl/shamap/SHAMapSyncFilter.h | 5 +- include/xrpl/shamap/SHAMapTreeNode.h | 5 +- include/xrpl/shamap/SHAMapTxLeafNode.h | 5 +- .../xrpl/shamap/SHAMapTxPlusMetaLeafNode.h | 5 +- include/xrpl/shamap/TreeNodeCache.h | 5 +- include/xrpl/shamap/detail/TaggedPointer.h | 5 +- src/test/csf/BasicNetwork.h | 5 +- src/test/csf/CollectorRef.h | 5 +- src/test/csf/Digraph.h | 4 +- src/test/csf/Histogram.h | 5 +- src/test/csf/Peer.h | 4 +- src/test/csf/PeerGroup.h | 4 +- src/test/csf/Proposal.h | 5 +- src/test/csf/Scheduler.h | 5 +- src/test/csf/Sim.h | 5 +- src/test/csf/SimTime.h | 5 +- src/test/csf/TrustGraph.h | 5 +- src/test/csf/Tx.h | 5 +- src/test/csf/Validation.h | 5 +- src/test/csf/collectors.h | 5 +- src/test/csf/events.h | 5 +- src/test/csf/ledgers.h | 5 +- src/test/csf/random.h | 5 +- src/test/csf/submitters.h | 5 +- src/test/csf/timers.h | 5 +- src/test/json/TestOutputSuite.h | 5 +- src/test/jtx.h | 5 +- src/test/jtx/AMM.h | 5 +- src/test/jtx/AMMTest.h | 5 +- src/test/jtx/AbstractClient.h | 5 +- src/test/jtx/Account.h | 5 +- src/test/jtx/CaptureLogs.h | 5 +- src/test/jtx/CheckMessageLogs.h | 5 +- src/test/jtx/Env.h | 5 +- src/test/jtx/Env_ss.h | 5 +- src/test/jtx/JSONRPCClient.h | 5 +- src/test/jtx/JTx.h | 5 +- src/test/jtx/ManualTimeKeeper.h | 5 +- src/test/jtx/Oracle.h | 5 +- src/test/jtx/PathSet.h | 5 +- src/test/jtx/SignerUtils.h | 5 +- src/test/jtx/TestHelpers.h | 5 +- src/test/jtx/TestSuite.h | 5 +- src/test/jtx/TrustedPublisherServer.h | 4 +- src/test/jtx/WSClient.h | 5 +- src/test/jtx/account_txn_id.h | 4 +- src/test/jtx/acctdelete.h | 5 +- src/test/jtx/amount.h | 5 +- src/test/jtx/attester.h | 5 +- src/test/jtx/balance.h | 5 +- src/test/jtx/basic_prop.h | 5 +- src/test/jtx/batch.h | 5 +- src/test/jtx/check.h | 5 +- src/test/jtx/credentials.h | 5 +- src/test/jtx/delivermin.h | 5 +- src/test/jtx/deposit.h | 5 +- src/test/jtx/did.h | 5 +- src/test/jtx/directory.h | 5 +- src/test/jtx/envconfig.h | 5 +- src/test/jtx/escrow.h | 5 +- src/test/jtx/fee.h | 5 +- src/test/jtx/flags.h | 5 +- src/test/jtx/invoice_id.h | 4 +- src/test/jtx/jtx_json.h | 5 +- src/test/jtx/last_ledger_sequence.h | 5 +- src/test/jtx/ledgerStateFix.h | 5 +- src/test/jtx/memo.h | 5 +- src/test/jtx/mpt.h | 5 +- src/test/jtx/multisign.h | 5 +- src/test/jtx/noop.h | 5 +- src/test/jtx/offer.h | 5 +- src/test/jtx/owners.h | 5 +- src/test/jtx/paths.h | 5 +- src/test/jtx/pay.h | 5 +- src/test/jtx/permissioned_domains.h | 5 +- src/test/jtx/prop.h | 5 +- src/test/jtx/quality.h | 5 +- src/test/jtx/rate.h | 5 +- src/test/jtx/regkey.h | 5 +- src/test/jtx/require.h | 5 +- src/test/jtx/requires.h | 5 +- src/test/jtx/rpc.h | 5 +- src/test/jtx/sendmax.h | 5 +- src/test/jtx/seq.h | 5 +- src/test/jtx/sig.h | 5 +- src/test/jtx/tag.h | 5 +- src/test/jtx/tags.h | 5 +- src/test/jtx/ter.h | 5 +- src/test/jtx/testline.h | 5 +- src/test/jtx/ticket.h | 5 +- src/test/jtx/token.h | 5 +- src/test/jtx/trust.h | 5 +- src/test/jtx/txflags.h | 5 +- src/test/jtx/utility.h | 5 +- src/test/jtx/vault.h | 5 +- src/test/jtx/xchain_bridge.h | 5 +- src/test/nodestore/TestBase.h | 5 +- src/test/protocol/Issue_test.cpp | 8 - src/test/rpc/GRPCTestClientBase.h | 4 +- src/test/shamap/common.h | 5 +- src/test/unit_test/FileDirGuard.h | 5 +- src/test/unit_test/SuiteJournal.h | 5 +- src/test/unit_test/multi_runner.h | 5 +- src/tests/libxrpl/helpers/TestSink.h | 4 +- .../app/consensus/RCLCensorshipDetector.h | 5 +- src/xrpld/app/consensus/RCLConsensus.h | 5 +- src/xrpld/app/consensus/RCLCxLedger.h | 4 +- src/xrpld/app/consensus/RCLCxPeerPos.h | 5 +- src/xrpld/app/consensus/RCLCxTx.h | 4 +- src/xrpld/app/consensus/RCLValidations.h | 5 +- .../app/ledger/AbstractFetchPackContainer.h | 5 +- src/xrpld/app/ledger/AcceptedLedger.h | 5 +- src/xrpld/app/ledger/AcceptedLedgerTx.h | 5 +- src/xrpld/app/ledger/AccountStateSF.h | 5 +- src/xrpld/app/ledger/BookListeners.h | 5 +- src/xrpld/app/ledger/BuildLedger.h | 4 +- src/xrpld/app/ledger/ConsensusTransSetSF.h | 5 +- src/xrpld/app/ledger/InboundLedger.h | 5 +- src/xrpld/app/ledger/InboundLedgers.h | 5 +- src/xrpld/app/ledger/InboundTransactions.h | 5 +- src/xrpld/app/ledger/Ledger.h | 5 +- src/xrpld/app/ledger/LedgerCleaner.h | 5 +- src/xrpld/app/ledger/LedgerHistory.h | 5 +- src/xrpld/app/ledger/LedgerHolder.h | 5 +- src/xrpld/app/ledger/LedgerMaster.h | 5 +- src/xrpld/app/ledger/LedgerReplay.h | 5 +- src/xrpld/app/ledger/LedgerReplayTask.h | 5 +- src/xrpld/app/ledger/LedgerReplayer.h | 5 +- src/xrpld/app/ledger/LedgerToJson.h | 5 +- src/xrpld/app/ledger/LocalTxs.h | 5 +- src/xrpld/app/ledger/OpenLedger.h | 5 +- src/xrpld/app/ledger/OrderBookDB.h | 5 +- src/xrpld/app/ledger/PendingSaves.h | 5 +- src/xrpld/app/ledger/TransactionMaster.h | 5 +- src/xrpld/app/ledger/TransactionStateSF.h | 5 +- .../app/ledger/detail/LedgerDeltaAcquire.h | 5 +- .../ledger/detail/LedgerReplayMsgHandler.h | 5 +- src/xrpld/app/ledger/detail/SkipListAcquire.h | 5 +- src/xrpld/app/ledger/detail/TimeoutCounter.h | 5 +- .../app/ledger/detail/TransactionAcquire.h | 5 +- src/xrpld/app/main/Application.h | 5 +- src/xrpld/app/main/BasicApp.h | 5 +- src/xrpld/app/main/CollectorManager.h | 5 +- src/xrpld/app/main/DBInit.h | 5 +- src/xrpld/app/main/GRPCServer.h | 4 +- src/xrpld/app/main/LoadManager.h | 5 +- src/xrpld/app/main/NodeIdentity.h | 5 +- src/xrpld/app/main/NodeStoreScheduler.h | 5 +- src/xrpld/app/main/Tuning.h | 5 +- src/xrpld/app/misc/AMMHelpers.h | 5 +- src/xrpld/app/misc/AMMUtils.h | 5 +- src/xrpld/app/misc/AmendmentTable.h | 5 +- src/xrpld/app/misc/CanonicalTXSet.h | 5 +- src/xrpld/app/misc/DelegateUtils.h | 5 +- src/xrpld/app/misc/DeliverMax.h | 5 +- src/xrpld/app/misc/FeeVote.h | 5 +- src/xrpld/app/misc/HashRouter.h | 5 +- src/xrpld/app/misc/LendingHelpers.h | 5 +- src/xrpld/app/misc/LoadFeeTrack.h | 5 +- src/xrpld/app/misc/Manifest.h | 5 +- src/xrpld/app/misc/NegativeUNLVote.h | 5 +- src/xrpld/app/misc/NetworkOPs.h | 5 +- src/xrpld/app/misc/SHAMapStore.h | 5 +- src/xrpld/app/misc/SHAMapStoreImp.h | 5 +- src/xrpld/app/misc/Transaction.h | 5 +- src/xrpld/app/misc/TxQ.h | 5 +- src/xrpld/app/misc/ValidatorKeys.h | 5 +- src/xrpld/app/misc/ValidatorList.h | 5 +- src/xrpld/app/misc/ValidatorSite.h | 5 +- src/xrpld/app/misc/detail/AccountTxPaging.h | 5 +- src/xrpld/app/misc/detail/Work.h | 5 +- src/xrpld/app/misc/detail/WorkBase.h | 5 +- src/xrpld/app/misc/detail/WorkFile.h | 5 +- src/xrpld/app/misc/detail/WorkPlain.h | 5 +- src/xrpld/app/misc/detail/WorkSSL.h | 5 +- src/xrpld/app/paths/AMMContext.h | 5 +- src/xrpld/app/paths/AMMLiquidity.h | 5 +- src/xrpld/app/paths/AMMOffer.h | 5 +- src/xrpld/app/paths/AccountCurrencies.h | 5 +- src/xrpld/app/paths/Flow.h | 5 +- src/xrpld/app/paths/PathRequest.h | 5 +- src/xrpld/app/paths/PathRequests.h | 5 +- src/xrpld/app/paths/Pathfinder.h | 5 +- src/xrpld/app/paths/RippleCalc.h | 5 +- src/xrpld/app/paths/RippleLineCache.h | 5 +- src/xrpld/app/paths/TrustLine.h | 5 +- src/xrpld/app/paths/detail/AmountSpec.h | 5 +- src/xrpld/app/paths/detail/FlatSets.h | 5 +- src/xrpld/app/paths/detail/FlowDebugInfo.h | 4 +- src/xrpld/app/paths/detail/PathfinderUtils.h | 5 +- src/xrpld/app/paths/detail/StepChecks.h | 5 +- src/xrpld/app/paths/detail/Steps.h | 5 +- src/xrpld/app/paths/detail/StrandFlow.h | 5 +- src/xrpld/app/rdb/PeerFinder.h | 5 +- src/xrpld/app/rdb/RelationalDatabase.h | 5 +- src/xrpld/app/rdb/State.h | 5 +- src/xrpld/app/rdb/Vacuum.h | 5 +- src/xrpld/app/rdb/Wallet.h | 5 +- src/xrpld/app/rdb/backend/SQLiteDatabase.h | 5 +- src/xrpld/app/rdb/backend/detail/Node.h | 5 +- src/xrpld/app/tx/apply.h | 5 +- src/xrpld/app/tx/applySteps.h | 5 +- src/xrpld/app/tx/detail/AMMBid.h | 5 +- src/xrpld/app/tx/detail/AMMClawback.h | 5 +- src/xrpld/app/tx/detail/AMMCreate.h | 5 +- src/xrpld/app/tx/detail/AMMDelete.h | 5 +- src/xrpld/app/tx/detail/AMMDeposit.h | 5 +- src/xrpld/app/tx/detail/AMMVote.h | 5 +- src/xrpld/app/tx/detail/AMMWithdraw.h | 5 +- src/xrpld/app/tx/detail/ApplyContext.h | 5 +- src/xrpld/app/tx/detail/Batch.h | 5 +- src/xrpld/app/tx/detail/BookTip.h | 5 +- src/xrpld/app/tx/detail/CancelCheck.h | 5 +- src/xrpld/app/tx/detail/CancelOffer.h | 5 +- src/xrpld/app/tx/detail/CashCheck.h | 5 +- src/xrpld/app/tx/detail/Change.h | 5 +- src/xrpld/app/tx/detail/Clawback.h | 5 +- src/xrpld/app/tx/detail/CreateCheck.h | 5 +- src/xrpld/app/tx/detail/CreateOffer.h | 5 +- src/xrpld/app/tx/detail/CreateTicket.h | 5 +- src/xrpld/app/tx/detail/Credentials.h | 5 +- src/xrpld/app/tx/detail/DID.h | 5 +- src/xrpld/app/tx/detail/DelegateSet.h | 5 +- src/xrpld/app/tx/detail/DeleteAccount.h | 5 +- src/xrpld/app/tx/detail/DeleteOracle.h | 5 +- src/xrpld/app/tx/detail/DepositPreauth.h | 5 +- src/xrpld/app/tx/detail/Escrow.h | 5 +- src/xrpld/app/tx/detail/InvariantCheck.h | 5 +- src/xrpld/app/tx/detail/LedgerStateFix.h | 5 +- .../app/tx/detail/LoanBrokerCoverClawback.h | 5 +- .../app/tx/detail/LoanBrokerCoverDeposit.h | 5 +- .../app/tx/detail/LoanBrokerCoverWithdraw.h | 5 +- src/xrpld/app/tx/detail/LoanBrokerDelete.h | 5 +- src/xrpld/app/tx/detail/LoanBrokerSet.h | 5 +- src/xrpld/app/tx/detail/LoanDelete.h | 5 +- src/xrpld/app/tx/detail/LoanManage.h | 5 +- src/xrpld/app/tx/detail/LoanPay.h | 5 +- src/xrpld/app/tx/detail/LoanSet.h | 5 +- src/xrpld/app/tx/detail/MPTokenAuthorize.h | 5 +- .../app/tx/detail/MPTokenIssuanceCreate.h | 5 +- .../app/tx/detail/MPTokenIssuanceDestroy.h | 5 +- src/xrpld/app/tx/detail/MPTokenIssuanceSet.h | 5 +- src/xrpld/app/tx/detail/NFTokenAcceptOffer.h | 5 +- src/xrpld/app/tx/detail/NFTokenBurn.h | 5 +- src/xrpld/app/tx/detail/NFTokenCancelOffer.h | 5 +- src/xrpld/app/tx/detail/NFTokenCreateOffer.h | 5 +- src/xrpld/app/tx/detail/NFTokenMint.h | 5 +- src/xrpld/app/tx/detail/NFTokenModify.h | 5 +- src/xrpld/app/tx/detail/NFTokenUtils.h | 5 +- src/xrpld/app/tx/detail/Offer.h | 5 +- src/xrpld/app/tx/detail/OfferStream.h | 5 +- src/xrpld/app/tx/detail/PayChan.h | 5 +- src/xrpld/app/tx/detail/Payment.h | 5 +- .../app/tx/detail/PermissionedDomainDelete.h | 5 +- .../app/tx/detail/PermissionedDomainSet.h | 5 +- src/xrpld/app/tx/detail/SetAccount.h | 5 +- src/xrpld/app/tx/detail/SetOracle.h | 5 +- src/xrpld/app/tx/detail/SetRegularKey.h | 5 +- src/xrpld/app/tx/detail/SetSignerList.h | 5 +- src/xrpld/app/tx/detail/SetTrust.h | 5 +- src/xrpld/app/tx/detail/SignerEntries.h | 5 +- src/xrpld/app/tx/detail/Transactor.h | 5 +- src/xrpld/app/tx/detail/VaultClawback.h | 5 +- src/xrpld/app/tx/detail/VaultCreate.h | 5 +- src/xrpld/app/tx/detail/VaultDelete.h | 5 +- src/xrpld/app/tx/detail/VaultDeposit.h | 5 +- src/xrpld/app/tx/detail/VaultSet.h | 5 +- src/xrpld/app/tx/detail/VaultWithdraw.h | 5 +- src/xrpld/app/tx/detail/XChainBridge.h | 5 +- src/xrpld/conditions/Condition.h | 5 +- src/xrpld/conditions/Fulfillment.h | 5 +- src/xrpld/conditions/detail/PreimageSha256.h | 5 +- src/xrpld/conditions/detail/error.h | 5 +- src/xrpld/conditions/detail/utils.h | 5 +- src/xrpld/consensus/Consensus.h | 5 +- src/xrpld/consensus/ConsensusParms.h | 4 +- src/xrpld/consensus/ConsensusProposal.h | 4 +- src/xrpld/consensus/ConsensusTypes.h | 5 +- src/xrpld/consensus/DisputedTx.h | 5 +- src/xrpld/consensus/LedgerTiming.h | 4 +- src/xrpld/consensus/LedgerTrie.h | 4 +- src/xrpld/consensus/Validations.h | 4 +- src/xrpld/core/Config.h | 5 +- src/xrpld/core/ConfigSections.h | 5 +- src/xrpld/core/DatabaseCon.h | 5 +- src/xrpld/core/SociDB.h | 5 +- src/xrpld/core/TimeKeeper.h | 5 +- src/xrpld/overlay/Cluster.h | 5 +- src/xrpld/overlay/ClusterNode.h | 5 +- src/xrpld/overlay/Compression.h | 5 +- src/xrpld/overlay/Message.h | 5 +- src/xrpld/overlay/Overlay.h | 5 +- src/xrpld/overlay/Peer.h | 5 +- src/xrpld/overlay/PeerReservationTable.h | 5 +- src/xrpld/overlay/PeerSet.h | 5 +- src/xrpld/overlay/ReduceRelayCommon.h | 5 +- src/xrpld/overlay/Slot.h | 5 +- src/xrpld/overlay/Squelch.h | 5 +- src/xrpld/overlay/detail/ConnectAttempt.h | 5 +- src/xrpld/overlay/detail/Handshake.h | 5 +- src/xrpld/overlay/detail/OverlayImpl.h | 5 +- src/xrpld/overlay/detail/PeerImp.h | 5 +- src/xrpld/overlay/detail/ProtocolMessage.h | 5 +- src/xrpld/overlay/detail/ProtocolVersion.h | 5 +- src/xrpld/overlay/detail/TrafficCount.h | 4 +- src/xrpld/overlay/detail/Tuning.h | 5 +- src/xrpld/overlay/detail/TxMetrics.h | 5 +- src/xrpld/overlay/detail/ZeroCopyStream.h | 5 +- src/xrpld/overlay/make_Overlay.h | 5 +- src/xrpld/overlay/predicates.h | 5 +- src/xrpld/peerfinder/PeerfinderManager.h | 5 +- src/xrpld/peerfinder/Slot.h | 5 +- src/xrpld/peerfinder/detail/Bootcache.h | 5 +- src/xrpld/peerfinder/detail/Checker.h | 5 +- src/xrpld/peerfinder/detail/Counts.h | 5 +- src/xrpld/peerfinder/detail/Fixed.h | 5 +- src/xrpld/peerfinder/detail/Handouts.h | 5 +- src/xrpld/peerfinder/detail/Livecache.h | 5 +- src/xrpld/peerfinder/detail/Logic.h | 5 +- src/xrpld/peerfinder/detail/SlotImp.h | 5 +- src/xrpld/peerfinder/detail/Source.h | 5 +- src/xrpld/peerfinder/detail/SourceStrings.h | 5 +- src/xrpld/peerfinder/detail/Store.h | 5 +- src/xrpld/peerfinder/detail/StoreSqdb.h | 5 +- src/xrpld/peerfinder/detail/Tuning.h | 5 +- src/xrpld/peerfinder/detail/iosformat.h | 5 +- src/xrpld/peerfinder/make_Manager.h | 5 +- src/xrpld/perflog/detail/PerfLogImp.h | 5 +- src/xrpld/rpc/BookChanges.h | 5 +- src/xrpld/rpc/CTID.h | 5 +- src/xrpld/rpc/Context.h | 5 +- src/xrpld/rpc/DeliveredAmount.h | 5 +- src/xrpld/rpc/GRPCHandlers.h | 5 +- src/xrpld/rpc/InfoSub.h | 5 +- src/xrpld/rpc/MPTokenIssuanceID.h | 5 +- src/xrpld/rpc/Output.h | 5 +- src/xrpld/rpc/RPCCall.h | 5 +- src/xrpld/rpc/RPCHandler.h | 5 +- src/xrpld/rpc/RPCSub.h | 5 +- src/xrpld/rpc/Request.h | 5 +- src/xrpld/rpc/Role.h | 5 +- src/xrpld/rpc/ServerHandler.h | 5 +- src/xrpld/rpc/Status.h | 5 +- src/xrpld/rpc/detail/Handler.h | 5 +- src/xrpld/rpc/detail/LegacyPathFind.h | 5 +- src/xrpld/rpc/detail/RPCHelpers.h | 5 +- src/xrpld/rpc/detail/RPCLedgerHelpers.h | 5 +- src/xrpld/rpc/detail/TransactionSign.h | 5 +- src/xrpld/rpc/detail/Tuning.h | 5 +- src/xrpld/rpc/detail/WSInfoSub.h | 5 +- src/xrpld/rpc/handlers/GetCounts.h | 5 +- src/xrpld/rpc/handlers/Handlers.h | 5 +- src/xrpld/rpc/handlers/LedgerHandler.h | 5 +- src/xrpld/rpc/handlers/Version.h | 5 +- src/xrpld/rpc/handlers/WalletPropose.h | 5 +- src/xrpld/rpc/json_body.h | 5 +- src/xrpld/shamap/NodeFamily.h | 5 +- 678 files changed, 845 insertions(+), 2674 deletions(-) create mode 100755 .github/scripts/rename/include.sh create mode 100644 convert_include_guards.py diff --git a/.github/scripts/rename/include.sh b/.github/scripts/rename/include.sh new file mode 100755 index 0000000000..fbf165b975 --- /dev/null +++ b/.github/scripts/rename/include.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Exit the script as soon as an error occurs. +set -e + +# This script checks whether there are no new include guards introduced by a new +# PR, as header files should use "#pragma once" instead. The script assumes any +# include guards will use "XRPL_" as prefix. +# Usage: .github/scripts/rename/include.sh + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +DIRECTORY=$1 +echo "Processing directory: ${DIRECTORY}" +if [ ! -d "${DIRECTORY}" ]; then + echo "Error: Directory '${DIRECTORY}' does not exist." + exit 1 +fi + +find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" \) | while read -r FILE; do + echo "Processing file: ${FILE}" + if grep -q "#ifndef XRPL_" "${FILE}"; then + echo "Please replace all include guards by #pragma once." + exit 1 + fi +done +echo "Checking complete." diff --git a/.github/workflows/reusable-check-rename.yml b/.github/workflows/reusable-check-rename.yml index af55084405..a73ac49b7d 100644 --- a/.github/workflows/reusable-check-rename.yml +++ b/.github/workflows/reusable-check-rename.yml @@ -31,6 +31,8 @@ jobs: run: .github/scripts/rename/namespace.sh . - name: Check config name run: .github/scripts/rename/config.sh . + - name: Check include guards + run: .github/scripts/rename/include.sh . - name: Check for differences env: MESSAGE: | diff --git a/convert_include_guards.py b/convert_include_guards.py new file mode 100644 index 0000000000..c4f06ecc54 --- /dev/null +++ b/convert_include_guards.py @@ -0,0 +1,139 @@ +#!/usr/bin/env python3 +""" +Script to replace include guards with #pragma once +Handles guards starting with XRPL_, BEAST_, or TEST_ +""" + +import sys +from pathlib import Path + + +def convert_file(file_path, prefixes=None): + """ + Convert a file from include guards to #pragma once + + Args: + file_path: Path to the file to convert + prefixes: List of prefixes to match (e.g., ['XRPL_', 'BEAST_', 'TEST_']) + If None, defaults to ['XRPL_', 'BEAST_', 'TEST_'] + + Returns True if the file was modified, False otherwise + """ + if prefixes is None: + prefixes = ["XRPL_", "BEAST_", "TEST_"] + + try: + with open(file_path, "r", encoding="utf-8") as f: + lines = f.readlines() + except Exception as e: + print(f"Error reading {file_path}: {e}", file=sys.stderr) + return False + + if len(lines) < 3: + print(f"Skipping {file_path}: too few lines", file=sys.stderr) + return False + + # Find the #ifndef with any of the specified prefixes + ifndef_idx = -1 + define_idx = -1 + found_prefix = None + + for i, line in enumerate(lines): + stripped = line.strip() + for prefix in prefixes: + if stripped.startswith(f"#ifndef {prefix}"): + ifndef_idx = i + found_prefix = prefix + # The #define should be the next line + if i + 1 < len(lines) and lines[i + 1].strip().startswith( + f"#define {prefix}" + ): + define_idx = i + 1 + break + if ifndef_idx != -1: + break + + if ifndef_idx == -1 or define_idx == -1: + print( + f"No include guard with prefixes {prefixes} found in {file_path}", + file=sys.stderr, + ) + return False + + # Find the last #endif line + endif_idx = -1 + for i in range(len(lines) - 1, -1, -1): + stripped = lines[i].strip() + if stripped.startswith("#endif"): + endif_idx = i + break + + if endif_idx == -1: + print(f"No closing #endif found in {file_path}", file=sys.stderr) + return False + + # Build the new content + new_lines = [] + + # Add everything before the #ifndef + new_lines.extend(lines[:ifndef_idx]) + + # Add #pragma once with exactly one empty line after it + new_lines.append("#pragma once\n") + new_lines.append("\n") + + # Add everything between #define and #endif, but skip leading empty lines + content_lines = lines[define_idx + 1 : endif_idx] + # Skip leading empty lines + start_idx = 0 + while start_idx < len(content_lines) and content_lines[start_idx].strip() == "": + start_idx += 1 + new_lines.extend(content_lines[start_idx:]) + + # Add everything after #endif (usually just empty lines, but include it) + new_lines.extend(lines[endif_idx + 1 :]) + + # Remove trailing empty lines at the end, then ensure exactly one newline at end + while new_lines and new_lines[-1].strip() == "": + new_lines.pop() + + if new_lines and not new_lines[-1].endswith("\n"): + new_lines[-1] += "\n" + else: + new_lines.append("\n") + + # Write the file + try: + with open(file_path, "w", encoding="utf-8") as f: + f.writelines(new_lines) + print(f"Converted: {file_path}") + return True + except Exception as e: + print(f"Error writing {file_path}: {e}", file=sys.stderr) + return False + + +def main(): + if len(sys.argv) < 2: + print("Usage: python convert_include_guards.py [file2 ...]") + sys.exit(1) + + files = sys.argv[1:] + success_count = 0 + fail_count = 0 + + for file_path in files: + if convert_file(file_path): + success_count += 1 + else: + fail_count += 1 + + print( + f"\nSummary: {success_count} files converted, {fail_count} files failed/unchanged" + ) + + return 0 if fail_count == 0 else 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/include/xrpl/basics/Archive.h b/include/xrpl/basics/Archive.h index 84af8a7c7d..58e12bbb71 100644 --- a/include/xrpl/basics/Archive.h +++ b/include/xrpl/basics/Archive.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_ARCHIVE_H_INCLUDED -#define XRPL_BASICS_ARCHIVE_H_INCLUDED +#pragma once #include @@ -16,5 +15,3 @@ void extractTarLz4(boost::filesystem::path const& src, boost::filesystem::path const& dst); } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/BasicConfig.h b/include/xrpl/basics/BasicConfig.h index 9aa7f3e612..d18019fa9f 100644 --- a/include/xrpl/basics/BasicConfig.h +++ b/include/xrpl/basics/BasicConfig.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_BASICCONFIG_H_INCLUDED -#define XRPL_BASICS_BASICCONFIG_H_INCLUDED +#pragma once #include @@ -369,5 +368,3 @@ get_if_exists(Section const& section, std::string const& name, bool& v) } } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/Blob.h b/include/xrpl/basics/Blob.h index 986f829371..ee0d6cf3b5 100644 --- a/include/xrpl/basics/Blob.h +++ b/include/xrpl/basics/Blob.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_BLOB_H_INCLUDED -#define XRPL_BASICS_BLOB_H_INCLUDED +#pragma once #include @@ -11,5 +10,3 @@ namespace xrpl { using Blob = std::vector; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/Buffer.h b/include/xrpl/basics/Buffer.h index b7e0878477..5192daf632 100644 --- a/include/xrpl/basics/Buffer.h +++ b/include/xrpl/basics/Buffer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_BUFFER_H_INCLUDED -#define XRPL_BASICS_BUFFER_H_INCLUDED +#pragma once #include #include @@ -213,5 +212,3 @@ operator!=(Buffer const& lhs, Buffer const& rhs) noexcept } } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/ByteUtilities.h b/include/xrpl/basics/ByteUtilities.h index 88bb297346..cd10611a50 100644 --- a/include/xrpl/basics/ByteUtilities.h +++ b/include/xrpl/basics/ByteUtilities.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_BYTEUTILITIES_H_INCLUDED -#define XRPL_BASICS_BYTEUTILITIES_H_INCLUDED +#pragma once namespace xrpl { @@ -20,5 +19,3 @@ megabytes(T value) noexcept static_assert(kilobytes(2) == 2048, "kilobytes(2) == 2048"); static_assert(megabytes(3) == 3145728, "megabytes(3) == 3145728"); } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/CompressionAlgorithms.h b/include/xrpl/basics/CompressionAlgorithms.h index 52dc406d5d..b8fe4c8018 100644 --- a/include/xrpl/basics/CompressionAlgorithms.h +++ b/include/xrpl/basics/CompressionAlgorithms.h @@ -1,5 +1,4 @@ -#ifndef XRPL_COMPRESSIONALGORITHMS_H_INCLUDED -#define XRPL_COMPRESSIONALGORITHMS_H_INCLUDED +#pragma once #include @@ -133,5 +132,3 @@ lz4Decompress(InputStream& in, std::size_t inSize, std::uint8_t* decompressed, s } // namespace compression_algorithms } // namespace xrpl - -#endif // XRPL_COMPRESSIONALGORITHMS_H_INCLUDED diff --git a/include/xrpl/basics/CountedObject.h b/include/xrpl/basics/CountedObject.h index e464e470af..55a895dbb1 100644 --- a/include/xrpl/basics/CountedObject.h +++ b/include/xrpl/basics/CountedObject.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_COUNTEDOBJECT_H_INCLUDED -#define XRPL_BASICS_COUNTEDOBJECT_H_INCLUDED +#pragma once #include @@ -134,5 +133,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/DecayingSample.h b/include/xrpl/basics/DecayingSample.h index 3b5e947f1f..e4c9ad5d7a 100644 --- a/include/xrpl/basics/DecayingSample.h +++ b/include/xrpl/basics/DecayingSample.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_DECAYINGSAMPLE_H_INCLUDED -#define XRPL_BASICS_DECAYINGSAMPLE_H_INCLUDED +#pragma once #include #include @@ -130,5 +129,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/Expected.h b/include/xrpl/basics/Expected.h index 9ce771dc23..7c98e72107 100644 --- a/include/xrpl/basics/Expected.h +++ b/include/xrpl/basics/Expected.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_EXPECTED_H_INCLUDED -#define XRPL_BASICS_EXPECTED_H_INCLUDED +#pragma once #include @@ -229,5 +228,3 @@ public: }; } // namespace xrpl - -#endif // XRPL_BASICS_EXPECTED_H_INCLUDED diff --git a/include/xrpl/basics/FileUtilities.h b/include/xrpl/basics/FileUtilities.h index 03013da63a..299269703a 100644 --- a/include/xrpl/basics/FileUtilities.h +++ b/include/xrpl/basics/FileUtilities.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_FILEUTILITIES_H_INCLUDED -#define XRPL_BASICS_FILEUTILITIES_H_INCLUDED +#pragma once #include #include @@ -18,5 +17,3 @@ void writeFileContents(boost::system::error_code& ec, boost::filesystem::path const& destPath, std::string const& contents); } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/IntrusivePointer.h b/include/xrpl/basics/IntrusivePointer.h index 366392885b..4464c37dc5 100644 --- a/include/xrpl/basics/IntrusivePointer.h +++ b/include/xrpl/basics/IntrusivePointer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_INTRUSIVEPOINTER_H_INCLUDED -#define XRPL_BASICS_INTRUSIVEPOINTER_H_INCLUDED +#pragma once #include #include @@ -485,4 +484,3 @@ dynamic_pointer_cast(TT const& v) } } // namespace intr_ptr } // namespace xrpl -#endif diff --git a/include/xrpl/basics/IntrusivePointer.ipp b/include/xrpl/basics/IntrusivePointer.ipp index 85eda5cb16..d52aa6299f 100644 --- a/include/xrpl/basics/IntrusivePointer.ipp +++ b/include/xrpl/basics/IntrusivePointer.ipp @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_INTRUSIVEPOINTER_IPP_INCLUDED -#define XRPL_BASICS_INTRUSIVEPOINTER_IPP_INCLUDED +#pragma once #include #include @@ -703,4 +702,3 @@ SharedWeakUnion::unsafeReleaseNoStore() } } // namespace xrpl -#endif diff --git a/include/xrpl/basics/IntrusiveRefCounts.h b/include/xrpl/basics/IntrusiveRefCounts.h index e9214a5adc..0273ed4647 100644 --- a/include/xrpl/basics/IntrusiveRefCounts.h +++ b/include/xrpl/basics/IntrusiveRefCounts.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_INTRUSIVEREFCOUNTS_H_INCLUDED -#define XRPL_BASICS_INTRUSIVEREFCOUNTS_H_INCLUDED +#pragma once #include @@ -461,4 +460,3 @@ partialDestructorFinished(T** o) //------------------------------------------------------------------------------ } // namespace xrpl -#endif diff --git a/include/xrpl/basics/KeyCache.h b/include/xrpl/basics/KeyCache.h index 038bf7b9b7..4f2ca20cca 100644 --- a/include/xrpl/basics/KeyCache.h +++ b/include/xrpl/basics/KeyCache.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_KEYCACHE_H -#define XRPL_BASICS_KEYCACHE_H +#pragma once #include #include @@ -9,5 +8,3 @@ namespace xrpl { using KeyCache = TaggedCache; } // namespace xrpl - -#endif // XRPL_BASICS_KEYCACHE_H diff --git a/include/xrpl/basics/LocalValue.h b/include/xrpl/basics/LocalValue.h index 8c664116c3..94af41a41d 100644 --- a/include/xrpl/basics/LocalValue.h +++ b/include/xrpl/basics/LocalValue.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_LOCALVALUE_H_INCLUDED -#define XRPL_BASICS_LOCALVALUE_H_INCLUDED +#pragma once #include @@ -107,5 +106,3 @@ LocalValue::operator*() lvs->values.emplace(this, std::make_unique>(t_)).first->second->get()); } } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/Log.h b/include/xrpl/basics/Log.h index 92fd2c0e9c..786fbc5da2 100644 --- a/include/xrpl/basics/Log.h +++ b/include/xrpl/basics/Log.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_LOG_H_INCLUDED -#define XRPL_BASICS_LOG_H_INCLUDED +#pragma once #include #include @@ -258,5 +257,3 @@ beast::Journal debugLog(); } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/MathUtilities.h b/include/xrpl/basics/MathUtilities.h index bd8ea883fb..4552b335e1 100644 --- a/include/xrpl/basics/MathUtilities.h +++ b/include/xrpl/basics/MathUtilities.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_MATHUTILITIES_H_INCLUDED -#define XRPL_BASICS_MATHUTILITIES_H_INCLUDED +#pragma once #include #include @@ -45,5 +44,3 @@ static_assert(calculatePercent(50'000'001, 100'000'000) == 51); static_assert(calculatePercent(99'999'999, 100'000'000) == 100); } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/Number.h b/include/xrpl/basics/Number.h index cdd971d8b0..c269d27781 100644 --- a/include/xrpl/basics/Number.h +++ b/include/xrpl/basics/Number.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_NUMBER_H_INCLUDED -#define XRPL_BASICS_NUMBER_H_INCLUDED +#pragma once #include @@ -819,5 +818,3 @@ public: }; } // namespace xrpl - -#endif // XRPL_BASICS_NUMBER_H_INCLUDED diff --git a/include/xrpl/basics/RangeSet.h b/include/xrpl/basics/RangeSet.h index ee95577271..f6e03cac79 100644 --- a/include/xrpl/basics/RangeSet.h +++ b/include/xrpl/basics/RangeSet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_RANGESET_H_INCLUDED -#define XRPL_BASICS_RANGESET_H_INCLUDED +#pragma once #include @@ -173,5 +172,3 @@ prevMissing(RangeSet const& rs, T t, T minVal = 0) } } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/Resolver.h b/include/xrpl/basics/Resolver.h index b66f4a5ed5..5bfa6796d2 100644 --- a/include/xrpl/basics/Resolver.h +++ b/include/xrpl/basics/Resolver.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_RESOLVER_H_INCLUDED -#define XRPL_BASICS_RESOLVER_H_INCLUDED +#pragma once #include @@ -45,5 +44,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/ResolverAsio.h b/include/xrpl/basics/ResolverAsio.h index f2a3da0d58..d0dcc9f185 100644 --- a/include/xrpl/basics/ResolverAsio.h +++ b/include/xrpl/basics/ResolverAsio.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_RESOLVERASIO_H_INCLUDED -#define XRPL_BASICS_RESOLVERASIO_H_INCLUDED +#pragma once #include #include @@ -18,5 +17,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/SHAMapHash.h b/include/xrpl/basics/SHAMapHash.h index eb635b516c..22f8505912 100644 --- a/include/xrpl/basics/SHAMapHash.h +++ b/include/xrpl/basics/SHAMapHash.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_SHAMAP_HASH_H_INCLUDED -#define XRPL_BASICS_SHAMAP_HASH_H_INCLUDED +#pragma once #include #include @@ -98,5 +97,3 @@ extract(SHAMapHash const& key) } } // namespace xrpl - -#endif // XRPL_BASICS_SHAMAP_HASH_H_INCLUDED diff --git a/include/xrpl/basics/SharedWeakCachePointer.h b/include/xrpl/basics/SharedWeakCachePointer.h index 49369265eb..afc701ed5a 100644 --- a/include/xrpl/basics/SharedWeakCachePointer.h +++ b/include/xrpl/basics/SharedWeakCachePointer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_SHAREDWEAKCACHEPOINTER_H_INCLUDED -#define XRPL_BASICS_SHAREDWEAKCACHEPOINTER_H_INCLUDED +#pragma once #include #include @@ -113,4 +112,3 @@ private: std::variant, std::weak_ptr> combo_; }; } // namespace xrpl -#endif diff --git a/include/xrpl/basics/SharedWeakCachePointer.ipp b/include/xrpl/basics/SharedWeakCachePointer.ipp index eeb1a1927b..6e7514ffae 100644 --- a/include/xrpl/basics/SharedWeakCachePointer.ipp +++ b/include/xrpl/basics/SharedWeakCachePointer.ipp @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_SHAREDWEAKCACHEPOINTER_IPP_INCLUDED -#define XRPL_BASICS_SHAREDWEAKCACHEPOINTER_IPP_INCLUDED +#pragma once #include @@ -164,4 +163,3 @@ SharedWeakCachePointer::convertToWeak() return false; } } // namespace xrpl -#endif diff --git a/include/xrpl/basics/SlabAllocator.h b/include/xrpl/basics/SlabAllocator.h index 199eaf3bcc..2578afdc5a 100644 --- a/include/xrpl/basics/SlabAllocator.h +++ b/include/xrpl/basics/SlabAllocator.h @@ -1,7 +1,6 @@ // Copyright (c) 2022, Nikolaos D. Bougalis -#ifndef XRPL_BASICS_SLABALLOCATOR_H_INCLUDED -#define XRPL_BASICS_SLABALLOCATOR_H_INCLUDED +#pragma once #include #include @@ -386,5 +385,3 @@ public: }; } // namespace xrpl - -#endif // XRPL_BASICS_SLABALLOCATOR_H_INCLUDED diff --git a/include/xrpl/basics/Slice.h b/include/xrpl/basics/Slice.h index b8990cb1bb..2f6081760f 100644 --- a/include/xrpl/basics/Slice.h +++ b/include/xrpl/basics/Slice.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_SLICE_H_INCLUDED -#define XRPL_BASICS_SLICE_H_INCLUDED +#pragma once #include #include @@ -231,5 +230,3 @@ makeSlice(std::basic_string const& s) } } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/StringUtilities.h b/include/xrpl/basics/StringUtilities.h index 3d5a18f120..9b1cf4892d 100644 --- a/include/xrpl/basics/StringUtilities.h +++ b/include/xrpl/basics/StringUtilities.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_STRINGUTILITIES_H_INCLUDED -#define XRPL_BASICS_STRINGUTILITIES_H_INCLUDED +#pragma once #include #include @@ -132,5 +131,3 @@ bool isProperlyFormedTomlDomain(std::string_view domain); } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/TaggedCache.h b/include/xrpl/basics/TaggedCache.h index 2b82f63a00..78c4ea7aeb 100644 --- a/include/xrpl/basics/TaggedCache.h +++ b/include/xrpl/basics/TaggedCache.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_TAGGEDCACHE_H_INCLUDED -#define XRPL_BASICS_TAGGEDCACHE_H_INCLUDED +#pragma once #include #include @@ -298,5 +297,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/TaggedCache.ipp b/include/xrpl/basics/TaggedCache.ipp index 837db67c32..3d0c0342cc 100644 --- a/include/xrpl/basics/TaggedCache.ipp +++ b/include/xrpl/basics/TaggedCache.ipp @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_TAGGEDCACHE_IPP_INCLUDED -#define XRPL_BASICS_TAGGEDCACHE_IPP_INCLUDED +#pragma once #include #include @@ -784,5 +783,3 @@ TaggedCache #include @@ -44,5 +43,3 @@ to_string(char const* s) } } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/UnorderedContainers.h b/include/xrpl/basics/UnorderedContainers.h index 75d1fdb8da..c614f9ea80 100644 --- a/include/xrpl/basics/UnorderedContainers.h +++ b/include/xrpl/basics/UnorderedContainers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_UNORDEREDCONTAINERS_H_INCLUDED -#define XRPL_BASICS_UNORDEREDCONTAINERS_H_INCLUDED +#pragma once #include #include @@ -99,5 +98,3 @@ template < using hardened_hash_multiset = std::unordered_multiset; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/UptimeClock.h b/include/xrpl/basics/UptimeClock.h index 9e1ef10d19..4edd38d274 100644 --- a/include/xrpl/basics/UptimeClock.h +++ b/include/xrpl/basics/UptimeClock.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_UPTIMETIMER_H_INCLUDED -#define XRPL_BASICS_UPTIMETIMER_H_INCLUDED +#pragma once #include #include @@ -46,5 +45,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/algorithm.h b/include/xrpl/basics/algorithm.h index 1f536764db..2378c695df 100644 --- a/include/xrpl/basics/algorithm.h +++ b/include/xrpl/basics/algorithm.h @@ -1,5 +1,4 @@ -#ifndef XRPL_ALGORITHM_H_INCLUDED -#define XRPL_ALGORITHM_H_INCLUDED +#pragma once #include @@ -90,5 +89,3 @@ remove_if_intersect_or_match(FwdIter1 first1, FwdIter1 last1, InputIter2 first2, } } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/base64.h b/include/xrpl/basics/base64.h index 508196cf11..1725ee42f6 100644 --- a/include/xrpl/basics/base64.h +++ b/include/xrpl/basics/base64.h @@ -32,8 +32,7 @@ */ -#ifndef XRPL_BASICS_BASE64_H_INCLUDED -#define XRPL_BASICS_BASE64_H_INCLUDED +#pragma once #include #include @@ -53,5 +52,3 @@ std::string base64_decode(std::string_view data); } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/base_uint.h b/include/xrpl/basics/base_uint.h index 32d6ad20fc..745cb7ab40 100644 --- a/include/xrpl/basics/base_uint.h +++ b/include/xrpl/basics/base_uint.h @@ -3,8 +3,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. -#ifndef XRPL_BASICS_BASE_UINT_H_INCLUDED -#define XRPL_BASICS_BASE_UINT_H_INCLUDED +#pragma once #include #include @@ -644,5 +643,3 @@ struct is_uniquely_represented> : public std::true_ty }; } // namespace beast - -#endif diff --git a/include/xrpl/basics/chrono.h b/include/xrpl/basics/chrono.h index b542d1ded2..bcf988b45e 100644 --- a/include/xrpl/basics/chrono.h +++ b/include/xrpl/basics/chrono.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_CHRONO_H_INCLUDED -#define XRPL_BASICS_CHRONO_H_INCLUDED +#pragma once #include #include @@ -99,5 +98,3 @@ stopwatch() } } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/comparators.h b/include/xrpl/basics/comparators.h index 7c848f0b3b..0e21d38d6b 100644 --- a/include/xrpl/basics/comparators.h +++ b/include/xrpl/basics/comparators.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_COMPARATORS_H_INCLUDED -#define XRPL_BASICS_COMPARATORS_H_INCLUDED +#pragma once #include @@ -53,5 +52,3 @@ using equal_to = std::equal_to; #endif } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/contract.h b/include/xrpl/basics/contract.h index bd2025dd17..8be257bb02 100644 --- a/include/xrpl/basics/contract.h +++ b/include/xrpl/basics/contract.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_CONTRACT_H_INCLUDED -#define XRPL_BASICS_CONTRACT_H_INCLUDED +#pragma once #include @@ -48,5 +47,3 @@ Throw(Args&&... args) LogicError(std::string const& how) noexcept; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/hardened_hash.h b/include/xrpl/basics/hardened_hash.h index a25dcb3c34..b05ecda7a6 100644 --- a/include/xrpl/basics/hardened_hash.h +++ b/include/xrpl/basics/hardened_hash.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_HARDENED_HASH_H_INCLUDED -#define XRPL_BASICS_HARDENED_HASH_H_INCLUDED +#pragma once #include #include @@ -93,5 +92,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/join.h b/include/xrpl/basics/join.h index 890b6fdc10..16fae4ff87 100644 --- a/include/xrpl/basics/join.h +++ b/include/xrpl/basics/join.h @@ -1,5 +1,4 @@ -#ifndef JOIN_H_INCLUDED -#define JOIN_H_INCLUDED +#pragma once #include @@ -80,5 +79,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/make_SSLContext.h b/include/xrpl/basics/make_SSLContext.h index fb91dd40a9..1714d3e58c 100644 --- a/include/xrpl/basics/make_SSLContext.h +++ b/include/xrpl/basics/make_SSLContext.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_MAKE_SSLCONTEXT_H_INCLUDED -#define XRPL_BASICS_MAKE_SSLCONTEXT_H_INCLUDED +#pragma once #include @@ -20,5 +19,3 @@ make_SSLContextAuthed( std::string const& cipherList); } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/mulDiv.h b/include/xrpl/basics/mulDiv.h index fb38d0cd63..2495f07728 100644 --- a/include/xrpl/basics/mulDiv.h +++ b/include/xrpl/basics/mulDiv.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_MULDIV_H_INCLUDED -#define XRPL_BASICS_MULDIV_H_INCLUDED +#pragma once #include #include @@ -22,5 +21,3 @@ std::optional mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div); } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/partitioned_unordered_map.h b/include/xrpl/basics/partitioned_unordered_map.h index f011fb9508..181597ca69 100644 --- a/include/xrpl/basics/partitioned_unordered_map.h +++ b/include/xrpl/basics/partitioned_unordered_map.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H -#define XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H +#pragma once #include #include @@ -393,5 +392,3 @@ private: }; } // namespace xrpl - -#endif // XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H diff --git a/include/xrpl/basics/random.h b/include/xrpl/basics/random.h index 74ec14c742..34e460fd8a 100644 --- a/include/xrpl/basics/random.h +++ b/include/xrpl/basics/random.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_RANDOM_H_INCLUDED -#define XRPL_BASICS_RANDOM_H_INCLUDED +#pragma once #include #include @@ -174,5 +173,3 @@ rand_bool() /** @} */ } // namespace xrpl - -#endif // XRPL_BASICS_RANDOM_H_INCLUDED diff --git a/include/xrpl/basics/rocksdb.h b/include/xrpl/basics/rocksdb.h index 59a69a9b44..3d468b0f1b 100644 --- a/include/xrpl/basics/rocksdb.h +++ b/include/xrpl/basics/rocksdb.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_ROCKSDB_H_INCLUDED -#define XRPL_BASICS_ROCKSDB_H_INCLUDED +#pragma once #if XRPL_ROCKSDB_AVAILABLE // #include @@ -28,5 +27,3 @@ #include #endif - -#endif diff --git a/include/xrpl/basics/safe_cast.h b/include/xrpl/basics/safe_cast.h index 903f916194..285d76782a 100644 --- a/include/xrpl/basics/safe_cast.h +++ b/include/xrpl/basics/safe_cast.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_SAFE_CAST_H_INCLUDED -#define XRPL_BASICS_SAFE_CAST_H_INCLUDED +#pragma once #include @@ -69,5 +68,3 @@ unsafe_cast(Src s) noexcept } } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/scope.h b/include/xrpl/basics/scope.h index f0643c420c..797a7d3fdc 100644 --- a/include/xrpl/basics/scope.h +++ b/include/xrpl/basics/scope.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_SCOPE_H_INCLUDED -#define XRPL_BASICS_SCOPE_H_INCLUDED +#pragma once #include @@ -220,5 +219,3 @@ template scope_unlock(std::unique_lock&) -> scope_unlock; } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/spinlock.h b/include/xrpl/basics/spinlock.h index f612aaf548..7b05b7c339 100644 --- a/include/xrpl/basics/spinlock.h +++ b/include/xrpl/basics/spinlock.h @@ -1,7 +1,6 @@ // Copyright (c) 2022, Nikolaos D. Bougalis -#ifndef XRPL_BASICS_SPINLOCK_H_INCLUDED -#define XRPL_BASICS_SPINLOCK_H_INCLUDED +#pragma once #include @@ -201,5 +200,3 @@ public: /** @} */ } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/strHex.h b/include/xrpl/basics/strHex.h index 38b9a15668..76a3d86ff3 100644 --- a/include/xrpl/basics/strHex.h +++ b/include/xrpl/basics/strHex.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_STRHEX_H_INCLUDED -#define XRPL_BASICS_STRHEX_H_INCLUDED +#pragma once #include #include @@ -27,5 +26,3 @@ strHex(T const& from) } } // namespace xrpl - -#endif diff --git a/include/xrpl/basics/tagged_integer.h b/include/xrpl/basics/tagged_integer.h index a44daf1342..439cc537e2 100644 --- a/include/xrpl/basics/tagged_integer.h +++ b/include/xrpl/basics/tagged_integer.h @@ -1,7 +1,6 @@ // Copyright (c) 2014, Nikolaos D. Bougalis -#ifndef BEAST_UTILITY_TAGGED_INTEGER_H_INCLUDED -#define BEAST_UTILITY_TAGGED_INTEGER_H_INCLUDED +#pragma once #include @@ -202,4 +201,3 @@ struct is_contiguously_hashable, HashAlgorithm> }; } // namespace beast -#endif diff --git a/include/xrpl/beast/asio/io_latency_probe.h b/include/xrpl/beast/asio/io_latency_probe.h index 8ee4fdb89a..347203acb3 100644 --- a/include/xrpl/beast/asio/io_latency_probe.h +++ b/include/xrpl/beast/asio/io_latency_probe.h @@ -1,5 +1,4 @@ -#ifndef BEAST_ASIO_IO_LATENCY_PROBE_H_INCLUDED -#define BEAST_ASIO_IO_LATENCY_PROBE_H_INCLUDED +#pragma once #include @@ -226,5 +225,3 @@ private: }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/clock/abstract_clock.h b/include/xrpl/beast/clock/abstract_clock.h index 6f71529fda..41b57fdd2c 100644 --- a/include/xrpl/beast/clock/abstract_clock.h +++ b/include/xrpl/beast/clock/abstract_clock.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED -#define BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED +#pragma once namespace beast { @@ -89,5 +88,3 @@ get_abstract_clock() } } // namespace beast - -#endif diff --git a/include/xrpl/beast/clock/basic_seconds_clock.h b/include/xrpl/beast/clock/basic_seconds_clock.h index 65dbe5abc7..5205d92fef 100644 --- a/include/xrpl/beast/clock/basic_seconds_clock.h +++ b/include/xrpl/beast/clock/basic_seconds_clock.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CHRONO_BASIC_SECONDS_CLOCK_H_INCLUDED -#define BEAST_CHRONO_BASIC_SECONDS_CLOCK_H_INCLUDED +#pragma once #include @@ -33,5 +32,3 @@ public: }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/clock/manual_clock.h b/include/xrpl/beast/clock/manual_clock.h index 975656cf63..a301b4e1fe 100644 --- a/include/xrpl/beast/clock/manual_clock.h +++ b/include/xrpl/beast/clock/manual_clock.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CHRONO_MANUAL_CLOCK_H_INCLUDED -#define BEAST_CHRONO_MANUAL_CLOCK_H_INCLUDED +#pragma once #include #include @@ -75,5 +74,3 @@ public: }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/container/aged_container.h b/include/xrpl/beast/container/aged_container.h index 6051db7f69..dd622fcd9a 100644 --- a/include/xrpl/beast/container/aged_container.h +++ b/include/xrpl/beast/container/aged_container.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_AGED_CONTAINER_H_INCLUDED -#define BEAST_CONTAINER_AGED_CONTAINER_H_INCLUDED +#pragma once #include @@ -12,5 +11,3 @@ struct is_aged_container : std::false_type }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/container/aged_container_utility.h b/include/xrpl/beast/container/aged_container_utility.h index 8847fcb321..fd5d481aa5 100644 --- a/include/xrpl/beast/container/aged_container_utility.h +++ b/include/xrpl/beast/container/aged_container_utility.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_AGED_CONTAINER_UTILITY_H_INCLUDED -#define BEAST_CONTAINER_AGED_CONTAINER_UTILITY_H_INCLUDED +#pragma once #include @@ -24,5 +23,3 @@ expire(AgedContainer& c, std::chrono::duration const& age) } } // namespace beast - -#endif diff --git a/include/xrpl/beast/container/aged_map.h b/include/xrpl/beast/container/aged_map.h index f3bc59943d..e9505f2763 100644 --- a/include/xrpl/beast/container/aged_map.h +++ b/include/xrpl/beast/container/aged_map.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_AGED_MAP_H_INCLUDED -#define BEAST_CONTAINER_AGED_MAP_H_INCLUDED +#pragma once #include @@ -18,5 +17,3 @@ template < using aged_map = detail::aged_ordered_container; } - -#endif diff --git a/include/xrpl/beast/container/aged_multimap.h b/include/xrpl/beast/container/aged_multimap.h index 3602996602..7625694f66 100644 --- a/include/xrpl/beast/container/aged_multimap.h +++ b/include/xrpl/beast/container/aged_multimap.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_AGED_MULTIMAP_H_INCLUDED -#define BEAST_CONTAINER_AGED_MULTIMAP_H_INCLUDED +#pragma once #include @@ -18,5 +17,3 @@ template < using aged_multimap = detail::aged_ordered_container; } - -#endif diff --git a/include/xrpl/beast/container/aged_multiset.h b/include/xrpl/beast/container/aged_multiset.h index 851dd8fa6e..2ad09344e5 100644 --- a/include/xrpl/beast/container/aged_multiset.h +++ b/include/xrpl/beast/container/aged_multiset.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_AGED_MULTISET_H_INCLUDED -#define BEAST_CONTAINER_AGED_MULTISET_H_INCLUDED +#pragma once #include @@ -17,5 +16,3 @@ template < using aged_multiset = detail::aged_ordered_container; } - -#endif diff --git a/include/xrpl/beast/container/aged_set.h b/include/xrpl/beast/container/aged_set.h index 99b2c58bf6..2c601f5f41 100644 --- a/include/xrpl/beast/container/aged_set.h +++ b/include/xrpl/beast/container/aged_set.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_AGED_SET_H_INCLUDED -#define BEAST_CONTAINER_AGED_SET_H_INCLUDED +#pragma once #include @@ -17,5 +16,3 @@ template < using aged_set = detail::aged_ordered_container; } - -#endif diff --git a/include/xrpl/beast/container/aged_unordered_map.h b/include/xrpl/beast/container/aged_unordered_map.h index 26e41534d3..116d5669a1 100644 --- a/include/xrpl/beast/container/aged_unordered_map.h +++ b/include/xrpl/beast/container/aged_unordered_map.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_AGED_UNORDERED_MAP_H_INCLUDED -#define BEAST_CONTAINER_AGED_UNORDERED_MAP_H_INCLUDED +#pragma once #include @@ -19,5 +18,3 @@ template < using aged_unordered_map = detail::aged_unordered_container; } - -#endif diff --git a/include/xrpl/beast/container/aged_unordered_multimap.h b/include/xrpl/beast/container/aged_unordered_multimap.h index 3202aef27d..4c3333a099 100644 --- a/include/xrpl/beast/container/aged_unordered_multimap.h +++ b/include/xrpl/beast/container/aged_unordered_multimap.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_AGED_UNORDERED_MULTIMAP_H_INCLUDED -#define BEAST_CONTAINER_AGED_UNORDERED_MULTIMAP_H_INCLUDED +#pragma once #include @@ -19,5 +18,3 @@ template < using aged_unordered_multimap = detail::aged_unordered_container; } - -#endif diff --git a/include/xrpl/beast/container/aged_unordered_multiset.h b/include/xrpl/beast/container/aged_unordered_multiset.h index b42cad6a2f..b251f20077 100644 --- a/include/xrpl/beast/container/aged_unordered_multiset.h +++ b/include/xrpl/beast/container/aged_unordered_multiset.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_AGED_UNORDERED_MULTISET_H_INCLUDED -#define BEAST_CONTAINER_AGED_UNORDERED_MULTISET_H_INCLUDED +#pragma once #include @@ -19,5 +18,3 @@ using aged_unordered_multiset = detail::aged_unordered_container; } - -#endif diff --git a/include/xrpl/beast/container/aged_unordered_set.h b/include/xrpl/beast/container/aged_unordered_set.h index d095408849..a8ee61f1f5 100644 --- a/include/xrpl/beast/container/aged_unordered_set.h +++ b/include/xrpl/beast/container/aged_unordered_set.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_AGED_UNORDERED_SET_H_INCLUDED -#define BEAST_CONTAINER_AGED_UNORDERED_SET_H_INCLUDED +#pragma once #include @@ -18,5 +17,3 @@ template < using aged_unordered_set = detail::aged_unordered_container; } - -#endif diff --git a/include/xrpl/beast/container/detail/aged_associative_container.h b/include/xrpl/beast/container/detail/aged_associative_container.h index ab08484aa3..34e9560cbb 100644 --- a/include/xrpl/beast/container/detail/aged_associative_container.h +++ b/include/xrpl/beast/container/detail/aged_associative_container.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_DETAIL_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED -#define BEAST_CONTAINER_DETAIL_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED +#pragma once namespace beast { namespace detail { @@ -33,5 +32,3 @@ struct aged_associative_container_extract_t } // namespace detail } // namespace beast - -#endif diff --git a/include/xrpl/beast/container/detail/aged_container_iterator.h b/include/xrpl/beast/container/detail/aged_container_iterator.h index 5cee583d74..12cd15f677 100644 --- a/include/xrpl/beast/container/detail/aged_container_iterator.h +++ b/include/xrpl/beast/container/detail/aged_container_iterator.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_DETAIL_AGED_CONTAINER_ITERATOR_H_INCLUDED -#define BEAST_CONTAINER_DETAIL_AGED_CONTAINER_ITERATOR_H_INCLUDED +#pragma once #include #include @@ -146,5 +145,3 @@ private: } // namespace detail } // namespace beast - -#endif diff --git a/include/xrpl/beast/container/detail/aged_ordered_container.h b/include/xrpl/beast/container/detail/aged_ordered_container.h index d4ba81f0b8..2f3d8973e9 100644 --- a/include/xrpl/beast/container/detail/aged_ordered_container.h +++ b/include/xrpl/beast/container/detail/aged_ordered_container.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_DETAIL_AGED_ORDERED_CONTAINER_H_INCLUDED -#define BEAST_CONTAINER_DETAIL_AGED_ORDERED_CONTAINER_H_INCLUDED +#pragma once #include #include @@ -1687,5 +1686,3 @@ expire( } } // namespace beast - -#endif diff --git a/include/xrpl/beast/container/detail/aged_unordered_container.h b/include/xrpl/beast/container/detail/aged_unordered_container.h index 96dd196f32..a73ec107a7 100644 --- a/include/xrpl/beast/container/detail/aged_unordered_container.h +++ b/include/xrpl/beast/container/detail/aged_unordered_container.h @@ -1,5 +1,4 @@ -#ifndef BEAST_CONTAINER_DETAIL_AGED_UNORDERED_CONTAINER_H_INCLUDED -#define BEAST_CONTAINER_DETAIL_AGED_UNORDERED_CONTAINER_H_INCLUDED +#pragma once #include #include @@ -2226,5 +2225,3 @@ expire( } } // namespace beast - -#endif diff --git a/include/xrpl/beast/container/detail/empty_base_optimization.h b/include/xrpl/beast/container/detail/empty_base_optimization.h index 9f3a2ffdf2..21a9d13ce8 100644 --- a/include/xrpl/beast/container/detail/empty_base_optimization.h +++ b/include/xrpl/beast/container/detail/empty_base_optimization.h @@ -4,8 +4,7 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BEAST_CONTAINER_DETAIL_EMPTY_BASE_OPTIMIZATION_H_INCLUDED -#define BEAST_CONTAINER_DETAIL_EMPTY_BASE_OPTIMIZATION_H_INCLUDED +#pragma once #include @@ -89,5 +88,3 @@ public: } // namespace detail } // namespace beast - -#endif diff --git a/include/xrpl/beast/core/CurrentThreadName.h b/include/xrpl/beast/core/CurrentThreadName.h index 87fa042f81..8e99ee90da 100644 --- a/include/xrpl/beast/core/CurrentThreadName.h +++ b/include/xrpl/beast/core/CurrentThreadName.h @@ -2,8 +2,7 @@ // Copyright (c) 2013 - Raw Material Software Ltd. // Please visit http://www.juce.com -#ifndef BEAST_CORE_CURRENT_THREAD_NAME_H_INCLUDED -#define BEAST_CORE_CURRENT_THREAD_NAME_H_INCLUDED +#pragma once #include @@ -53,5 +52,3 @@ std::string getCurrentThreadName(); } // namespace beast - -#endif diff --git a/include/xrpl/beast/core/LexicalCast.h b/include/xrpl/beast/core/LexicalCast.h index b0322614b5..a7c135f23f 100644 --- a/include/xrpl/beast/core/LexicalCast.h +++ b/include/xrpl/beast/core/LexicalCast.h @@ -1,5 +1,4 @@ -#ifndef BEAST_MODULE_CORE_TEXT_LEXICALCAST_H_INCLUDED -#define BEAST_MODULE_CORE_TEXT_LEXICALCAST_H_INCLUDED +#pragma once #include @@ -208,5 +207,3 @@ lexicalCast(In in, Out defaultValue = Out()) } } // namespace beast - -#endif diff --git a/include/xrpl/beast/core/List.h b/include/xrpl/beast/core/List.h index edd1b4530f..75c981ea1b 100644 --- a/include/xrpl/beast/core/List.h +++ b/include/xrpl/beast/core/List.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INTRUSIVE_LIST_H_INCLUDED -#define BEAST_INTRUSIVE_LIST_H_INCLUDED +#pragma once #include @@ -574,5 +573,3 @@ private: }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/core/LockFreeStack.h b/include/xrpl/beast/core/LockFreeStack.h index 7e358dccbd..bb32698dd8 100644 --- a/include/xrpl/beast/core/LockFreeStack.h +++ b/include/xrpl/beast/core/LockFreeStack.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INTRUSIVE_LOCKFREESTACK_H_INCLUDED -#define BEAST_INTRUSIVE_LOCKFREESTACK_H_INCLUDED +#pragma once #include #include @@ -268,5 +267,3 @@ private: }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/core/SemanticVersion.h b/include/xrpl/beast/core/SemanticVersion.h index fabda8290f..1d3525de25 100644 --- a/include/xrpl/beast/core/SemanticVersion.h +++ b/include/xrpl/beast/core/SemanticVersion.h @@ -1,5 +1,4 @@ -#ifndef BEAST_MODULE_CORE_DIAGNOSTIC_SEMANTICVERSION_H_INCLUDED -#define BEAST_MODULE_CORE_DIAGNOSTIC_SEMANTICVERSION_H_INCLUDED +#pragma once #include #include @@ -95,5 +94,3 @@ operator<(SemanticVersion const& lhs, SemanticVersion const& rhs) } } // namespace beast - -#endif diff --git a/include/xrpl/beast/hash/hash_append.h b/include/xrpl/beast/hash/hash_append.h index f69931cb96..e4d646e532 100644 --- a/include/xrpl/beast/hash/hash_append.h +++ b/include/xrpl/beast/hash/hash_append.h @@ -1,5 +1,4 @@ -#ifndef BEAST_HASH_HASH_APPEND_H_INCLUDED -#define BEAST_HASH_HASH_APPEND_H_INCLUDED +#pragma once #include #include @@ -440,5 +439,3 @@ hash_append(HashAlgorithm& h, std::error_code const& ec) } } // namespace beast - -#endif diff --git a/include/xrpl/beast/hash/uhash.h b/include/xrpl/beast/hash/uhash.h index c167412e3a..4f66f058a8 100644 --- a/include/xrpl/beast/hash/uhash.h +++ b/include/xrpl/beast/hash/uhash.h @@ -1,5 +1,4 @@ -#ifndef BEAST_HASH_UHASH_H_INCLUDED -#define BEAST_HASH_UHASH_H_INCLUDED +#pragma once #include #include @@ -25,5 +24,3 @@ struct uhash }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/hash/xxhasher.h b/include/xrpl/beast/hash/xxhasher.h index 098551f02e..473907ea89 100644 --- a/include/xrpl/beast/hash/xxhasher.h +++ b/include/xrpl/beast/hash/xxhasher.h @@ -1,5 +1,4 @@ -#ifndef BEAST_HASH_XXHASHER_H_INCLUDED -#define BEAST_HASH_XXHASHER_H_INCLUDED +#pragma once #include @@ -152,5 +151,3 @@ public: }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/Collector.h b/include/xrpl/beast/insight/Collector.h index 045d9003a9..89aa8c1cb5 100644 --- a/include/xrpl/beast/insight/Collector.h +++ b/include/xrpl/beast/insight/Collector.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_COLLECTOR_H_INCLUDED -#define BEAST_INSIGHT_COLLECTOR_H_INCLUDED +#pragma once #include #include @@ -120,5 +119,3 @@ public: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/Counter.h b/include/xrpl/beast/insight/Counter.h index e1b8c36545..f6722c4e03 100644 --- a/include/xrpl/beast/insight/Counter.h +++ b/include/xrpl/beast/insight/Counter.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_COUNTER_H_INCLUDED -#define BEAST_INSIGHT_COUNTER_H_INCLUDED +#pragma once #include @@ -94,5 +93,3 @@ private: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/CounterImpl.h b/include/xrpl/beast/insight/CounterImpl.h index 409cfe07a7..199315dcb8 100644 --- a/include/xrpl/beast/insight/CounterImpl.h +++ b/include/xrpl/beast/insight/CounterImpl.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_COUNTERIMPL_H_INCLUDED -#define BEAST_INSIGHT_COUNTERIMPL_H_INCLUDED +#pragma once #include #include @@ -21,5 +20,3 @@ public: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/Event.h b/include/xrpl/beast/insight/Event.h index c375c34f9c..bc0c0dd403 100644 --- a/include/xrpl/beast/insight/Event.h +++ b/include/xrpl/beast/insight/Event.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_EVENT_H_INCLUDED -#define BEAST_INSIGHT_EVENT_H_INCLUDED +#pragma once #include @@ -61,5 +60,3 @@ private: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/EventImpl.h b/include/xrpl/beast/insight/EventImpl.h index cec378e71e..abd9741511 100644 --- a/include/xrpl/beast/insight/EventImpl.h +++ b/include/xrpl/beast/insight/EventImpl.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_EVENTIMPL_H_INCLUDED -#define BEAST_INSIGHT_EVENTIMPL_H_INCLUDED +#pragma once #include #include @@ -21,5 +20,3 @@ public: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/Gauge.h b/include/xrpl/beast/insight/Gauge.h index c9c1b64cda..f2a88deda2 100644 --- a/include/xrpl/beast/insight/Gauge.h +++ b/include/xrpl/beast/insight/Gauge.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_GAUGE_H_INCLUDED -#define BEAST_INSIGHT_GAUGE_H_INCLUDED +#pragma once #include @@ -124,5 +123,3 @@ private: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/GaugeImpl.h b/include/xrpl/beast/insight/GaugeImpl.h index c20d93744d..29afbe6a4d 100644 --- a/include/xrpl/beast/insight/GaugeImpl.h +++ b/include/xrpl/beast/insight/GaugeImpl.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_GAUGEIMPL_H_INCLUDED -#define BEAST_INSIGHT_GAUGEIMPL_H_INCLUDED +#pragma once #include #include @@ -24,5 +23,3 @@ public: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/Group.h b/include/xrpl/beast/insight/Group.h index 8119b4004f..c85fd1bfb6 100644 --- a/include/xrpl/beast/insight/Group.h +++ b/include/xrpl/beast/insight/Group.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_GROUP_H_INCLUDED -#define BEAST_INSIGHT_GROUP_H_INCLUDED +#pragma once #include @@ -22,5 +21,3 @@ public: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/Groups.h b/include/xrpl/beast/insight/Groups.h index 2fc996fcf8..8ac93454d3 100644 --- a/include/xrpl/beast/insight/Groups.h +++ b/include/xrpl/beast/insight/Groups.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_GROUPS_H_INCLUDED -#define BEAST_INSIGHT_GROUPS_H_INCLUDED +#pragma once #include #include @@ -35,5 +34,3 @@ make_Groups(Collector::ptr const& collector); } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/Hook.h b/include/xrpl/beast/insight/Hook.h index 1dc4cd0c74..ea511862d9 100644 --- a/include/xrpl/beast/insight/Hook.h +++ b/include/xrpl/beast/insight/Hook.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_HOOK_H_INCLUDED -#define BEAST_INSIGHT_HOOK_H_INCLUDED +#pragma once #include @@ -40,5 +39,3 @@ private: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/HookImpl.h b/include/xrpl/beast/insight/HookImpl.h index dadbc6d106..18208b554a 100644 --- a/include/xrpl/beast/insight/HookImpl.h +++ b/include/xrpl/beast/insight/HookImpl.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_HOOKIMPL_H_INCLUDED -#define BEAST_INSIGHT_HOOKIMPL_H_INCLUDED +#pragma once #include #include @@ -17,5 +16,3 @@ public: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/Insight.h b/include/xrpl/beast/insight/Insight.h index c298510291..bf3743cfd8 100644 --- a/include/xrpl/beast/insight/Insight.h +++ b/include/xrpl/beast/insight/Insight.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_H_INCLUDED -#define BEAST_INSIGHT_H_INCLUDED +#pragma once #include #include @@ -14,5 +13,3 @@ #include #include #include - -#endif diff --git a/include/xrpl/beast/insight/Meter.h b/include/xrpl/beast/insight/Meter.h index 34aa4c59d4..193a1f1003 100644 --- a/include/xrpl/beast/insight/Meter.h +++ b/include/xrpl/beast/insight/Meter.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_METER_H_INCLUDED -#define BEAST_INSIGHT_METER_H_INCLUDED +#pragma once #include @@ -79,5 +78,3 @@ private: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/MeterImpl.h b/include/xrpl/beast/insight/MeterImpl.h index c50dc07295..22efdbe647 100644 --- a/include/xrpl/beast/insight/MeterImpl.h +++ b/include/xrpl/beast/insight/MeterImpl.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_METERIMPL_H_INCLUDED -#define BEAST_INSIGHT_METERIMPL_H_INCLUDED +#pragma once #include #include @@ -21,5 +20,3 @@ public: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/NullCollector.h b/include/xrpl/beast/insight/NullCollector.h index 6c4413007b..1d16a11e17 100644 --- a/include/xrpl/beast/insight/NullCollector.h +++ b/include/xrpl/beast/insight/NullCollector.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_NULLCOLLECTOR_H_INCLUDED -#define BEAST_INSIGHT_NULLCOLLECTOR_H_INCLUDED +#pragma once #include @@ -18,5 +17,3 @@ public: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/insight/StatsDCollector.h b/include/xrpl/beast/insight/StatsDCollector.h index 9c63ab4ed9..ab09967483 100644 --- a/include/xrpl/beast/insight/StatsDCollector.h +++ b/include/xrpl/beast/insight/StatsDCollector.h @@ -1,5 +1,4 @@ -#ifndef BEAST_INSIGHT_STATSDCOLLECTOR_H_INCLUDED -#define BEAST_INSIGHT_STATSDCOLLECTOR_H_INCLUDED +#pragma once #include #include @@ -28,5 +27,3 @@ public: } // namespace insight } // namespace beast - -#endif diff --git a/include/xrpl/beast/net/IPAddress.h b/include/xrpl/beast/net/IPAddress.h index c3c7ee3d56..2ac4c3bc43 100644 --- a/include/xrpl/beast/net/IPAddress.h +++ b/include/xrpl/beast/net/IPAddress.h @@ -1,5 +1,4 @@ -#ifndef BEAST_NET_IPADDRESS_H_INCLUDED -#define BEAST_NET_IPADDRESS_H_INCLUDED +#pragma once #include #include @@ -96,5 +95,3 @@ struct hash<::beast::IP::Address> } }; } // namespace boost - -#endif diff --git a/include/xrpl/beast/net/IPAddressConversion.h b/include/xrpl/beast/net/IPAddressConversion.h index e05ae8541f..2ebd0a6eef 100644 --- a/include/xrpl/beast/net/IPAddressConversion.h +++ b/include/xrpl/beast/net/IPAddressConversion.h @@ -1,5 +1,4 @@ -#ifndef BEAST_NET_IPADDRESSCONVERSION_H_INCLUDED -#define BEAST_NET_IPADDRESSCONVERSION_H_INCLUDED +#pragma once #include @@ -61,5 +60,3 @@ struct IPAddressConversion }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/net/IPAddressV4.h b/include/xrpl/beast/net/IPAddressV4.h index c654db85c0..0d586716d8 100644 --- a/include/xrpl/beast/net/IPAddressV4.h +++ b/include/xrpl/beast/net/IPAddressV4.h @@ -1,5 +1,4 @@ -#ifndef BEAST_NET_IPADDRESSV4_H_INCLUDED -#define BEAST_NET_IPADDRESSV4_H_INCLUDED +#pragma once #include @@ -26,5 +25,3 @@ get_class(AddressV4 const& address); } // namespace IP } // namespace beast - -#endif diff --git a/include/xrpl/beast/net/IPAddressV6.h b/include/xrpl/beast/net/IPAddressV6.h index a4f9c20f16..2f9dedb748 100644 --- a/include/xrpl/beast/net/IPAddressV6.h +++ b/include/xrpl/beast/net/IPAddressV6.h @@ -1,5 +1,4 @@ -#ifndef BEAST_NET_IPADDRESSV6_H_INCLUDED -#define BEAST_NET_IPADDRESSV6_H_INCLUDED +#pragma once #include @@ -20,5 +19,3 @@ is_public(AddressV6 const& addr); } // namespace IP } // namespace beast - -#endif diff --git a/include/xrpl/beast/net/IPEndpoint.h b/include/xrpl/beast/net/IPEndpoint.h index 3d09e7f8e6..7a0394cbd1 100644 --- a/include/xrpl/beast/net/IPEndpoint.h +++ b/include/xrpl/beast/net/IPEndpoint.h @@ -1,5 +1,4 @@ -#ifndef BEAST_NET_IPENDPOINT_H_INCLUDED -#define BEAST_NET_IPENDPOINT_H_INCLUDED +#pragma once #include #include @@ -219,5 +218,3 @@ struct hash<::beast::IP::Endpoint> } }; } // namespace boost - -#endif diff --git a/include/xrpl/beast/rfc2616.h b/include/xrpl/beast/rfc2616.h index 922e4a7dc4..2ff770c011 100644 --- a/include/xrpl/beast/rfc2616.h +++ b/include/xrpl/beast/rfc2616.h @@ -1,5 +1,4 @@ -#ifndef BEAST_RFC2616_HPP -#define BEAST_RFC2616_HPP +#pragma once #include #include @@ -363,5 +362,3 @@ is_keep_alive(boost::beast::http::message const& m) } // namespace rfc2616 } // namespace beast - -#endif diff --git a/include/xrpl/beast/test/yield_to.h b/include/xrpl/beast/test/yield_to.h index b20661bdca..b10530c0d3 100644 --- a/include/xrpl/beast/test/yield_to.h +++ b/include/xrpl/beast/test/yield_to.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_TEST_YIELD_TO_HPP -#define BEAST_TEST_YIELD_TO_HPP +#pragma once #include #include @@ -127,5 +126,3 @@ enable_yield_to::spawn(F0&& f, FN&&... fn) } // namespace test } // namespace beast - -#endif diff --git a/include/xrpl/beast/type_name.h b/include/xrpl/beast/type_name.h index 1534af5eda..99b90d1757 100644 --- a/include/xrpl/beast/type_name.h +++ b/include/xrpl/beast/type_name.h @@ -1,5 +1,4 @@ -#ifndef BEAST_TYPE_NAME_H_INCLUDED -#define BEAST_TYPE_NAME_H_INCLUDED +#pragma once #include #include @@ -41,5 +40,3 @@ type_name() } } // namespace beast - -#endif diff --git a/include/xrpl/beast/unit_test.h b/include/xrpl/beast/unit_test.h index 721faef6f0..51ac96cacb 100644 --- a/include/xrpl/beast/unit_test.h +++ b/include/xrpl/beast/unit_test.h @@ -1,5 +1,4 @@ -#ifndef BEAST_UNIT_TEST_H_INCLUDED -#define BEAST_UNIT_TEST_H_INCLUDED +#pragma once #include #include @@ -19,5 +18,3 @@ //__LINE__);}while(false){} #define BEAST_EXPECT(cond) expect(cond, __FILE__ ":" BEAST_EXPECT_S2(__LINE__)) #endif - -#endif diff --git a/include/xrpl/beast/unit_test/amount.h b/include/xrpl/beast/unit_test/amount.h index 5082361fa6..aedced15a7 100644 --- a/include/xrpl/beast/unit_test/amount.h +++ b/include/xrpl/beast/unit_test/amount.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_AMOUNT_HPP -#define BEAST_UNIT_TEST_AMOUNT_HPP +#pragma once #include #include @@ -45,5 +44,3 @@ operator<<(std::ostream& s, amount const& t) } // namespace unit_test } // namespace beast - -#endif diff --git a/include/xrpl/beast/unit_test/detail/const_container.h b/include/xrpl/beast/unit_test/detail/const_container.h index c1e8c03a27..7c52e0e1ec 100644 --- a/include/xrpl/beast/unit_test/detail/const_container.h +++ b/include/xrpl/beast/unit_test/detail/const_container.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_DETAIL_CONST_CONTAINER_HPP -#define BEAST_UNIT_TEST_DETAIL_CONST_CONTAINER_HPP +#pragma once namespace beast { namespace unit_test { @@ -86,5 +85,3 @@ public: } // namespace detail } // namespace unit_test } // namespace beast - -#endif diff --git a/include/xrpl/beast/unit_test/global_suites.h b/include/xrpl/beast/unit_test/global_suites.h index 0492d5fb4b..68b4e2ced8 100644 --- a/include/xrpl/beast/unit_test/global_suites.h +++ b/include/xrpl/beast/unit_test/global_suites.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_GLOBAL_SUITES_HPP -#define BEAST_UNIT_TEST_GLOBAL_SUITES_HPP +#pragma once #include @@ -40,5 +39,3 @@ global_suites() } // namespace unit_test } // namespace beast - -#endif diff --git a/include/xrpl/beast/unit_test/match.h b/include/xrpl/beast/unit_test/match.h index d88ccb7497..38816bb5c7 100644 --- a/include/xrpl/beast/unit_test/match.h +++ b/include/xrpl/beast/unit_test/match.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_MATCH_HPP -#define BEAST_UNIT_TEST_MATCH_HPP +#pragma once #include @@ -166,5 +165,3 @@ match_library(std::string const& name) } // namespace unit_test } // namespace beast - -#endif diff --git a/include/xrpl/beast/unit_test/recorder.h b/include/xrpl/beast/unit_test/recorder.h index 78b376f519..8f956fda88 100644 --- a/include/xrpl/beast/unit_test/recorder.h +++ b/include/xrpl/beast/unit_test/recorder.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_RECORDER_HPP -#define BEAST_UNIT_TEST_RECORDER_HPP +#pragma once #include #include @@ -76,5 +75,3 @@ private: } // namespace unit_test } // namespace beast - -#endif diff --git a/include/xrpl/beast/unit_test/reporter.h b/include/xrpl/beast/unit_test/reporter.h index adec49c8d4..ee7168d039 100644 --- a/include/xrpl/beast/unit_test/reporter.h +++ b/include/xrpl/beast/unit_test/reporter.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_REPORTER_HPP -#define BEAST_UNIT_TEST_REPORTER_HPP +#pragma once #include #include @@ -248,5 +247,3 @@ using reporter = detail::reporter<>; } // namespace unit_test } // namespace beast - -#endif diff --git a/include/xrpl/beast/unit_test/results.h b/include/xrpl/beast/unit_test/results.h index 478812eff9..cbd0a71057 100644 --- a/include/xrpl/beast/unit_test/results.h +++ b/include/xrpl/beast/unit_test/results.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_RESULTS_HPP -#define BEAST_UNIT_TEST_RESULTS_HPP +#pragma once #include @@ -222,5 +221,3 @@ public: } // namespace unit_test } // namespace beast - -#endif diff --git a/include/xrpl/beast/unit_test/runner.h b/include/xrpl/beast/unit_test/runner.h index f91cc92c91..90d8a2f4b5 100644 --- a/include/xrpl/beast/unit_test/runner.h +++ b/include/xrpl/beast/unit_test/runner.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_RUNNER_H_INCLUDED -#define BEAST_UNIT_TEST_RUNNER_H_INCLUDED +#pragma once #include @@ -276,5 +275,3 @@ runner::log(std::string const& s) } // namespace unit_test } // namespace beast - -#endif diff --git a/include/xrpl/beast/unit_test/suite.h b/include/xrpl/beast/unit_test/suite.h index 70c2d49fbd..0e6b592a87 100644 --- a/include/xrpl/beast/unit_test/suite.h +++ b/include/xrpl/beast/unit_test/suite.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_SUITE_HPP -#define BEAST_UNIT_TEST_SUITE_HPP +#pragma once #include @@ -642,5 +641,3 @@ suite::run(runner& r) #endif //------------------------------------------------------------------------------ - -#endif diff --git a/include/xrpl/beast/unit_test/suite_info.h b/include/xrpl/beast/unit_test/suite_info.h index 5297c0e807..019251b0c4 100644 --- a/include/xrpl/beast/unit_test/suite_info.h +++ b/include/xrpl/beast/unit_test/suite_info.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_SUITE_INFO_HPP -#define BEAST_UNIT_TEST_SUITE_INFO_HPP +#pragma once #include #include @@ -100,5 +99,3 @@ make_suite_info(std::string name, std::string module, std::string library, bool } // namespace unit_test } // namespace beast - -#endif diff --git a/include/xrpl/beast/unit_test/suite_list.h b/include/xrpl/beast/unit_test/suite_list.h index 49bf37cbc6..4412883e31 100644 --- a/include/xrpl/beast/unit_test/suite_list.h +++ b/include/xrpl/beast/unit_test/suite_list.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_SUITE_LIST_HPP -#define BEAST_UNIT_TEST_SUITE_LIST_HPP +#pragma once #include #include @@ -60,5 +59,3 @@ suite_list::insert(char const* name, char const* module, char const* library, bo } // namespace unit_test } // namespace beast - -#endif diff --git a/include/xrpl/beast/unit_test/thread.h b/include/xrpl/beast/unit_test/thread.h index 27c3f85920..b49f8ed36e 100644 --- a/include/xrpl/beast/unit_test/thread.h +++ b/include/xrpl/beast/unit_test/thread.h @@ -2,8 +2,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_UNIT_TEST_THREAD_HPP -#define BEAST_UNIT_TEST_THREAD_HPP +#pragma once #include @@ -111,5 +110,3 @@ private: } // namespace unit_test } // namespace beast - -#endif diff --git a/include/xrpl/beast/utility/Journal.h b/include/xrpl/beast/utility/Journal.h index 7eaf4a627a..dff88826ce 100644 --- a/include/xrpl/beast/utility/Journal.h +++ b/include/xrpl/beast/utility/Journal.h @@ -1,5 +1,4 @@ -#ifndef BEAST_UTILITY_JOURNAL_H_INCLUDED -#define BEAST_UTILITY_JOURNAL_H_INCLUDED +#pragma once #include @@ -431,5 +430,3 @@ using logstream = basic_logstream; using logwstream = basic_logstream; } // namespace beast - -#endif diff --git a/include/xrpl/beast/utility/PropertyStream.h b/include/xrpl/beast/utility/PropertyStream.h index de1fc567f3..3d29138a12 100644 --- a/include/xrpl/beast/utility/PropertyStream.h +++ b/include/xrpl/beast/utility/PropertyStream.h @@ -1,5 +1,4 @@ -#ifndef BEAST_UTILITY_PROPERTYSTREAM_H_INCLUDED -#define BEAST_UTILITY_PROPERTYSTREAM_H_INCLUDED +#pragma once #include @@ -408,5 +407,3 @@ public: }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/utility/WrappedSink.h b/include/xrpl/beast/utility/WrappedSink.h index 7819134e01..bb8a1a6994 100644 --- a/include/xrpl/beast/utility/WrappedSink.h +++ b/include/xrpl/beast/utility/WrappedSink.h @@ -1,5 +1,4 @@ -#ifndef BEAST_UTILITY_WRAPPEDSINK_H_INCLUDED -#define BEAST_UTILITY_WRAPPEDSINK_H_INCLUDED +#pragma once #include @@ -80,5 +79,3 @@ public: }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/utility/Zero.h b/include/xrpl/beast/utility/Zero.h index fbafc59a81..00e91a1a47 100644 --- a/include/xrpl/beast/utility/Zero.h +++ b/include/xrpl/beast/utility/Zero.h @@ -1,7 +1,6 @@ // Copyright (c) 2014, Tom Ritchford -#ifndef BEAST_UTILITY_ZERO_H_INCLUDED -#define BEAST_UTILITY_ZERO_H_INCLUDED +#pragma once namespace beast { @@ -144,5 +143,3 @@ operator<=(Zero, T const& t) } } // namespace beast - -#endif diff --git a/include/xrpl/beast/utility/instrumentation.h b/include/xrpl/beast/utility/instrumentation.h index b2dcd23a3a..0d0b2ce415 100644 --- a/include/xrpl/beast/utility/instrumentation.h +++ b/include/xrpl/beast/utility/instrumentation.h @@ -1,5 +1,4 @@ -#ifndef BEAST_UTILITY_INSTRUMENTATION_H_INCLUDED -#define BEAST_UTILITY_INSTRUMENTATION_H_INCLUDED +#pragma once #include @@ -51,5 +50,3 @@ // instrumentation macros - its name describes the condition which was _not_ // meant to happen, while name in other macros describes the condition that is // meant to happen (e.g. as in "assert that this happens"). - -#endif diff --git a/include/xrpl/beast/utility/maybe_const.h b/include/xrpl/beast/utility/maybe_const.h index 6c577d3c76..4aac7f018e 100644 --- a/include/xrpl/beast/utility/maybe_const.h +++ b/include/xrpl/beast/utility/maybe_const.h @@ -1,5 +1,4 @@ -#ifndef BEAST_UTILITY_MAYBE_CONST_H_INCLUDED -#define BEAST_UTILITY_MAYBE_CONST_H_INCLUDED +#pragma once #include @@ -19,5 +18,3 @@ template using maybe_const_t = typename maybe_const::type; } // namespace beast - -#endif diff --git a/include/xrpl/beast/utility/rngfill.h b/include/xrpl/beast/utility/rngfill.h index ba596b789b..7c694aac4f 100644 --- a/include/xrpl/beast/utility/rngfill.h +++ b/include/xrpl/beast/utility/rngfill.h @@ -1,5 +1,4 @@ -#ifndef BEAST_RANDOM_RNGFILL_H_INCLUDED -#define BEAST_RANDOM_RNGFILL_H_INCLUDED +#pragma once #include @@ -48,5 +47,3 @@ rngfill(std::array& a, Generator& g) } } // namespace beast - -#endif diff --git a/include/xrpl/beast/utility/temp_dir.h b/include/xrpl/beast/utility/temp_dir.h index 37f26b7fec..5aa7b28ac2 100644 --- a/include/xrpl/beast/utility/temp_dir.h +++ b/include/xrpl/beast/utility/temp_dir.h @@ -1,5 +1,4 @@ -#ifndef BEAST_UTILITY_TEMP_DIR_H_INCLUDED -#define BEAST_UTILITY_TEMP_DIR_H_INCLUDED +#pragma once #include @@ -62,5 +61,3 @@ public: }; } // namespace beast - -#endif diff --git a/include/xrpl/beast/xor_shift_engine.h b/include/xrpl/beast/xor_shift_engine.h index 7eab82ff43..d49cb08fc0 100644 --- a/include/xrpl/beast/xor_shift_engine.h +++ b/include/xrpl/beast/xor_shift_engine.h @@ -1,5 +1,4 @@ -#ifndef BEAST_RANDOM_XOR_SHIFT_ENGINE_H_INCLUDED -#define BEAST_RANDOM_XOR_SHIFT_ENGINE_H_INCLUDED +#pragma once #include #include @@ -95,5 +94,3 @@ xor_shift_engine<_>::murmurhash3(result_type x) -> result_type using xor_shift_engine = detail::xor_shift_engine<>; } // namespace beast - -#endif diff --git a/include/xrpl/core/ClosureCounter.h b/include/xrpl/core/ClosureCounter.h index 4127960276..6802a03f3d 100644 --- a/include/xrpl/core/ClosureCounter.h +++ b/include/xrpl/core/ClosureCounter.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_CLOSURE_COUNTER_H_INCLUDED -#define XRPL_CORE_CLOSURE_COUNTER_H_INCLUDED +#pragma once #include @@ -198,5 +197,3 @@ public: }; } // namespace xrpl - -#endif // XRPL_CORE_CLOSURE_COUNTER_H_INCLUDED diff --git a/include/xrpl/core/Coro.ipp b/include/xrpl/core/Coro.ipp index 40067a77e9..2853adf0de 100644 --- a/include/xrpl/core/Coro.ipp +++ b/include/xrpl/core/Coro.ipp @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_COROINL_H_INCLUDED -#define XRPL_CORE_COROINL_H_INCLUDED +#pragma once #include @@ -120,5 +119,3 @@ JobQueue::Coro::join() } } // namespace xrpl - -#endif diff --git a/include/xrpl/core/Job.h b/include/xrpl/core/Job.h index dd60391635..61651fd673 100644 --- a/include/xrpl/core/Job.h +++ b/include/xrpl/core/Job.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_JOB_H_INCLUDED -#define XRPL_CORE_JOB_H_INCLUDED +#pragma once #include #include @@ -128,5 +127,3 @@ private: using JobCounter = ClosureCounter; } // namespace xrpl - -#endif diff --git a/include/xrpl/core/JobQueue.h b/include/xrpl/core/JobQueue.h index 48c92146f2..b410e200e1 100644 --- a/include/xrpl/core/JobQueue.h +++ b/include/xrpl/core/JobQueue.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_JOBQUEUE_H_INCLUDED -#define XRPL_CORE_JOBQUEUE_H_INCLUDED +#pragma once #include #include @@ -402,5 +401,3 @@ JobQueue::postCoro(JobType t, std::string const& name, F&& f) } } // namespace xrpl - -#endif diff --git a/include/xrpl/core/JobTypeData.h b/include/xrpl/core/JobTypeData.h index e15e161e0e..cdcb19c316 100644 --- a/include/xrpl/core/JobTypeData.h +++ b/include/xrpl/core/JobTypeData.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_JOBTYPEDATA_H_INCLUDED -#define XRPL_CORE_JOBTYPEDATA_H_INCLUDED +#pragma once #include #include @@ -75,5 +74,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/core/JobTypeInfo.h b/include/xrpl/core/JobTypeInfo.h index e9525fed81..d4daa1ec68 100644 --- a/include/xrpl/core/JobTypeInfo.h +++ b/include/xrpl/core/JobTypeInfo.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_JOBTYPEINFO_H_INCLUDED -#define XRPL_CORE_JOBTYPEINFO_H_INCLUDED +#pragma once #include @@ -75,5 +74,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/core/JobTypes.h b/include/xrpl/core/JobTypes.h index 4a779507f1..88f98aad66 100644 --- a/include/xrpl/core/JobTypes.h +++ b/include/xrpl/core/JobTypes.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_JOBTYPES_H_INCLUDED -#define XRPL_CORE_JOBTYPES_H_INCLUDED +#pragma once #include #include @@ -160,5 +159,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/core/LoadEvent.h b/include/xrpl/core/LoadEvent.h index 8422fe883e..f94e1020bf 100644 --- a/include/xrpl/core/LoadEvent.h +++ b/include/xrpl/core/LoadEvent.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_LOADEVENT_H_INCLUDED -#define XRPL_CORE_LOADEVENT_H_INCLUDED +#pragma once #include #include @@ -66,5 +65,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/core/LoadMonitor.h b/include/xrpl/core/LoadMonitor.h index 3b79a0ea23..71fbf75d68 100644 --- a/include/xrpl/core/LoadMonitor.h +++ b/include/xrpl/core/LoadMonitor.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_LOADMONITOR_H_INCLUDED -#define XRPL_CORE_LOADMONITOR_H_INCLUDED +#pragma once #include #include @@ -66,5 +65,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/core/PerfLog.h b/include/xrpl/core/PerfLog.h index bc788f86b8..eebd41ae09 100644 --- a/include/xrpl/core/PerfLog.h +++ b/include/xrpl/core/PerfLog.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_PERFLOG_H -#define XRPL_CORE_PERFLOG_H +#pragma once #include #include @@ -178,5 +177,3 @@ measureDurationAndLog( } // namespace perf } // namespace xrpl - -#endif // XRPL_CORE_PERFLOG_H diff --git a/include/xrpl/core/ServiceRegistry.h b/include/xrpl/core/ServiceRegistry.h index a70d96292c..7147242339 100644 --- a/include/xrpl/core/ServiceRegistry.h +++ b/include/xrpl/core/ServiceRegistry.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_SERVICEREGISTRY_H_INCLUDED -#define XRPL_CORE_SERVICEREGISTRY_H_INCLUDED +#pragma once #include #include @@ -198,5 +197,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/core/detail/Workers.h b/include/xrpl/core/detail/Workers.h index 185586e859..c5df622fa1 100644 --- a/include/xrpl/core/detail/Workers.h +++ b/include/xrpl/core/detail/Workers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_WORKERS_H_INCLUDED -#define XRPL_CORE_WORKERS_H_INCLUDED +#pragma once #include #include @@ -208,5 +207,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/core/detail/semaphore.h b/include/xrpl/core/detail/semaphore.h index 4249b3b860..fad3bf5e29 100644 --- a/include/xrpl/core/detail/semaphore.h +++ b/include/xrpl/core/detail/semaphore.h @@ -26,8 +26,7 @@ * version is updated. */ -#ifndef XRPL_CORE_SEMAPHORE_H_INCLUDED -#define XRPL_CORE_SEMAPHORE_H_INCLUDED +#pragma once #include #include @@ -88,5 +87,3 @@ public: using semaphore = basic_semaphore; } // namespace xrpl - -#endif diff --git a/include/xrpl/crypto/RFC1751.h b/include/xrpl/crypto/RFC1751.h index a413c2ac8a..64b3e08813 100644 --- a/include/xrpl/crypto/RFC1751.h +++ b/include/xrpl/crypto/RFC1751.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CRYPTO_RFC1751_H_INCLUDED -#define XRPL_CRYPTO_RFC1751_H_INCLUDED +#pragma once #include #include @@ -43,5 +42,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/crypto/csprng.h b/include/xrpl/crypto/csprng.h index dc89da4f61..e5135c96d7 100644 --- a/include/xrpl/crypto/csprng.h +++ b/include/xrpl/crypto/csprng.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CRYPTO_RANDOM_H_INCLUDED -#define XRPL_CRYPTO_RANDOM_H_INCLUDED +#pragma once #include @@ -71,5 +70,3 @@ csprng_engine& crypto_prng(); } // namespace xrpl - -#endif diff --git a/include/xrpl/crypto/secure_erase.h b/include/xrpl/crypto/secure_erase.h index 3ecde0c7fa..2815a8531a 100644 --- a/include/xrpl/crypto/secure_erase.h +++ b/include/xrpl/crypto/secure_erase.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CRYPTO_SECURE_ERASE_H_INCLUDED -#define XRPL_CRYPTO_SECURE_ERASE_H_INCLUDED +#pragma once #include @@ -23,5 +22,3 @@ void secure_erase(void* dest, std::size_t bytes); } // namespace xrpl - -#endif diff --git a/include/xrpl/json/JsonPropertyStream.h b/include/xrpl/json/JsonPropertyStream.h index 54cfcbfa04..510ed72950 100644 --- a/include/xrpl/json/JsonPropertyStream.h +++ b/include/xrpl/json/JsonPropertyStream.h @@ -1,5 +1,4 @@ -#ifndef XRPL_JSON_JSONPROPERTYSTREAM_H_INCLUDED -#define XRPL_JSON_JSONPROPERTYSTREAM_H_INCLUDED +#pragma once #include #include @@ -67,5 +66,3 @@ protected: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/json/Output.h b/include/xrpl/json/Output.h index db990ab364..b0ba3fa6d4 100644 --- a/include/xrpl/json/Output.h +++ b/include/xrpl/json/Output.h @@ -1,5 +1,4 @@ -#ifndef XRPL_JSON_OUTPUT_H_INCLUDED -#define XRPL_JSON_OUTPUT_H_INCLUDED +#pragma once #include @@ -35,5 +34,3 @@ std::string jsonAsString(Json::Value const&); } // namespace Json - -#endif diff --git a/include/xrpl/json/Writer.h b/include/xrpl/json/Writer.h index ab52427a5b..e348e57825 100644 --- a/include/xrpl/json/Writer.h +++ b/include/xrpl/json/Writer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_JSON_WRITER_H_INCLUDED -#define XRPL_JSON_WRITER_H_INCLUDED +#pragma once #include #include @@ -238,5 +237,3 @@ check(bool condition, std::string const& message) } } // namespace Json - -#endif diff --git a/include/xrpl/json/detail/json_assert.h b/include/xrpl/json/detail/json_assert.h index 3092b65452..e9a66ccef1 100644 --- a/include/xrpl/json/detail/json_assert.h +++ b/include/xrpl/json/detail/json_assert.h @@ -1,5 +1,4 @@ -#ifndef XRPL_JSON_JSON_ASSERT_H_INCLUDED -#define XRPL_JSON_JSON_ASSERT_H_INCLUDED +#pragma once #include #include @@ -7,5 +6,3 @@ #define JSON_ASSERT_MESSAGE(condition, message) \ if (!(condition)) \ xrpl::Throw(message); - -#endif diff --git a/include/xrpl/json/json_errors.h b/include/xrpl/json/json_errors.h index a63637b116..5cbf3bd2a5 100644 --- a/include/xrpl/json/json_errors.h +++ b/include/xrpl/json/json_errors.h @@ -1,5 +1,4 @@ -#ifndef XRPL_JSON_JSON_ERRORS_H_INCLUDED -#define XRPL_JSON_JSON_ERRORS_H_INCLUDED +#pragma once #include @@ -11,5 +10,3 @@ struct error : std::runtime_error }; } // namespace Json - -#endif // JSON_FORWARDS_H_INCLUDED diff --git a/include/xrpl/json/json_forwards.h b/include/xrpl/json/json_forwards.h index 7a6c444660..612648a5f4 100644 --- a/include/xrpl/json/json_forwards.h +++ b/include/xrpl/json/json_forwards.h @@ -1,5 +1,4 @@ -#ifndef XRPL_JSON_JSON_FORWARDS_H_INCLUDED -#define XRPL_JSON_JSON_FORWARDS_H_INCLUDED +#pragma once namespace Json { @@ -13,5 +12,3 @@ class ValueIterator; class ValueConstIterator; } // namespace Json - -#endif // JSON_FORWARDS_H_INCLUDED diff --git a/include/xrpl/json/json_reader.h b/include/xrpl/json/json_reader.h index 814d62dd88..3a1bc38929 100644 --- a/include/xrpl/json/json_reader.h +++ b/include/xrpl/json/json_reader.h @@ -1,5 +1,4 @@ -#ifndef XRPL_JSON_JSON_READER_H_INCLUDED -#define XRPL_JSON_JSON_READER_H_INCLUDED +#pragma once #include #include @@ -217,5 +216,3 @@ std::istream& operator>>(std::istream&, Value&); } // namespace Json - -#endif // XRPL_JSON_JSON_READER_H_INCLUDED diff --git a/include/xrpl/json/json_value.h b/include/xrpl/json/json_value.h index 4a7b1d869a..5895c94065 100644 --- a/include/xrpl/json/json_value.h +++ b/include/xrpl/json/json_value.h @@ -1,5 +1,4 @@ -#ifndef XRPL_JSON_JSON_VALUE_H_INCLUDED -#define XRPL_JSON_JSON_VALUE_H_INCLUDED +#pragma once #include #include @@ -677,5 +676,3 @@ public: }; } // namespace Json - -#endif // XRPL_JSON_JSON_VALUE_H_INCLUDED diff --git a/include/xrpl/json/json_writer.h b/include/xrpl/json/json_writer.h index 9049520a98..9455d4abd9 100644 --- a/include/xrpl/json/json_writer.h +++ b/include/xrpl/json/json_writer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_JSON_JSON_WRITER_H_INCLUDED -#define XRPL_JSON_JSON_WRITER_H_INCLUDED +#pragma once #include #include @@ -322,5 +321,3 @@ public: }; } // namespace Json - -#endif // JSON_WRITER_H_INCLUDED diff --git a/include/xrpl/json/to_string.h b/include/xrpl/json/to_string.h index a930c29231..fb379f5759 100644 --- a/include/xrpl/json/to_string.h +++ b/include/xrpl/json/to_string.h @@ -1,5 +1,4 @@ -#ifndef XRPL_JSON_TO_STRING_H_INCLUDED -#define XRPL_JSON_TO_STRING_H_INCLUDED +#pragma once #include #include @@ -21,5 +20,3 @@ std::ostream& operator<<(std::ostream&, Value const& root); } // namespace Json - -#endif // JSON_TO_STRING_H_INCLUDED diff --git a/include/xrpl/ledger/ApplyView.h b/include/xrpl/ledger/ApplyView.h index c2eabf00bd..2de5f79452 100644 --- a/include/xrpl/ledger/ApplyView.h +++ b/include/xrpl/ledger/ApplyView.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_APPLYVIEW_H_INCLUDED -#define XRPL_LEDGER_APPLYVIEW_H_INCLUDED +#pragma once #include #include @@ -382,5 +381,3 @@ insertPage( } // namespace directory } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/ApplyViewImpl.h b/include/xrpl/ledger/ApplyViewImpl.h index c2b824f196..f6c83462f2 100644 --- a/include/xrpl/ledger/ApplyViewImpl.h +++ b/include/xrpl/ledger/ApplyViewImpl.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_APPLYVIEWIMPL_H_INCLUDED -#define XRPL_LEDGER_APPLYVIEWIMPL_H_INCLUDED +#pragma once #include #include @@ -70,5 +69,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/BookDirs.h b/include/xrpl/ledger/BookDirs.h index 23b9557f37..eb1cbcbfa7 100644 --- a/include/xrpl/ledger/BookDirs.h +++ b/include/xrpl/ledger/BookDirs.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_BOOK_DIRS_H_INCLUDED -#define XRPL_LEDGER_BOOK_DIRS_H_INCLUDED +#pragma once #include #include @@ -87,5 +86,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/CachedSLEs.h b/include/xrpl/ledger/CachedSLEs.h index b478b78b7d..2909501b1d 100644 --- a/include/xrpl/ledger/CachedSLEs.h +++ b/include/xrpl/ledger/CachedSLEs.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_CACHEDSLES_H_INCLUDED -#define XRPL_LEDGER_CACHEDSLES_H_INCLUDED +#pragma once #include #include @@ -8,5 +7,3 @@ namespace xrpl { using CachedSLEs = TaggedCache; } - -#endif // XRPL_LEDGER_CACHEDSLES_H_INCLUDED diff --git a/include/xrpl/ledger/CachedView.h b/include/xrpl/ledger/CachedView.h index 9a93c5f743..7cab1dc1b3 100644 --- a/include/xrpl/ledger/CachedView.h +++ b/include/xrpl/ledger/CachedView.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_CACHEDVIEW_H_INCLUDED -#define XRPL_LEDGER_CACHEDVIEW_H_INCLUDED +#pragma once #include #include @@ -162,5 +161,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/CredentialHelpers.h b/include/xrpl/ledger/CredentialHelpers.h index 09b4d63da0..3744ff47eb 100644 --- a/include/xrpl/ledger/CredentialHelpers.h +++ b/include/xrpl/ledger/CredentialHelpers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_CREDENTIALHELPERS_H_INCLUDED -#define XRPL_APP_MISC_CREDENTIALHELPERS_H_INCLUDED +#pragma once #include #include @@ -79,5 +78,3 @@ verifyDepositPreauth( beast::Journal j); } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/Credit.h b/include/xrpl/ledger/Credit.h index e64c6015aa..58ec23a86a 100644 --- a/include/xrpl/ledger/Credit.h +++ b/include/xrpl/ledger/Credit.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_CREDIT_H_INCLUDED -#define XRPL_LEDGER_CREDIT_H_INCLUDED +#pragma once #include #include @@ -34,5 +33,3 @@ creditBalance(ReadView const& view, AccountID const& account, AccountID const& i /** @} */ } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/Dir.h b/include/xrpl/ledger/Dir.h index 4b7327a015..0c2f1e3765 100644 --- a/include/xrpl/ledger/Dir.h +++ b/include/xrpl/ledger/Dir.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_DIR_H_INCLUDED -#define XRPL_LEDGER_DIR_H_INCLUDED +#pragma once #include #include @@ -109,5 +108,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/OpenView.h b/include/xrpl/ledger/OpenView.h index 5441d35a0e..42f62d5bca 100644 --- a/include/xrpl/ledger/OpenView.h +++ b/include/xrpl/ledger/OpenView.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_OPENVIEW_H_INCLUDED -#define XRPL_LEDGER_OPENVIEW_H_INCLUDED +#pragma once #include #include @@ -240,5 +239,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/PaymentSandbox.h b/include/xrpl/ledger/PaymentSandbox.h index fd77d154d8..fe62d753ec 100644 --- a/include/xrpl/ledger/PaymentSandbox.h +++ b/include/xrpl/ledger/PaymentSandbox.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_PAYMENTSANDBOX_H_INCLUDED -#define XRPL_LEDGER_PAYMENTSANDBOX_H_INCLUDED +#pragma once #include #include @@ -172,5 +171,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/RawView.h b/include/xrpl/ledger/RawView.h index c0e81fb833..cfcf807e13 100644 --- a/include/xrpl/ledger/RawView.h +++ b/include/xrpl/ledger/RawView.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_RAWVIEW_H_INCLUDED -#define XRPL_LEDGER_RAWVIEW_H_INCLUDED +#pragma once #include #include @@ -88,5 +87,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/ReadView.h b/include/xrpl/ledger/ReadView.h index 5e33e7b4ba..faec10993a 100644 --- a/include/xrpl/ledger/ReadView.h +++ b/include/xrpl/ledger/ReadView.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_READVIEW_H_INCLUDED -#define XRPL_LEDGER_READVIEW_H_INCLUDED +#pragma once #include #include @@ -253,5 +252,3 @@ makeRulesGivenLedger(DigestAwareReadView const& ledger, std::unordered_set - -#endif diff --git a/include/xrpl/ledger/Sandbox.h b/include/xrpl/ledger/Sandbox.h index 1e4a816529..dc80df5ba2 100644 --- a/include/xrpl/ledger/Sandbox.h +++ b/include/xrpl/ledger/Sandbox.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_SANDBOX_H_INCLUDED -#define XRPL_LEDGER_SANDBOX_H_INCLUDED +#pragma once #include #include @@ -40,5 +39,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/View.h b/include/xrpl/ledger/View.h index 7bf833fbad..fa16e16006 100644 --- a/include/xrpl/ledger/View.h +++ b/include/xrpl/ledger/View.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_VIEW_H_INCLUDED -#define XRPL_LEDGER_VIEW_H_INCLUDED +#pragma once #include #include @@ -996,5 +995,3 @@ bool after(NetClock::time_point now, std::uint32_t mark); } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/detail/ApplyStateTable.h b/include/xrpl/ledger/detail/ApplyStateTable.h index 9fb7b64fe8..07af5247f6 100644 --- a/include/xrpl/ledger/detail/ApplyStateTable.h +++ b/include/xrpl/ledger/detail/ApplyStateTable.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_APPLYSTATETABLE_H_INCLUDED -#define XRPL_LEDGER_APPLYSTATETABLE_H_INCLUDED +#pragma once #include #include @@ -128,5 +127,3 @@ private: } // namespace detail } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/detail/ApplyViewBase.h b/include/xrpl/ledger/detail/ApplyViewBase.h index 9c048c6d90..b3ec3c0fea 100644 --- a/include/xrpl/ledger/detail/ApplyViewBase.h +++ b/include/xrpl/ledger/detail/ApplyViewBase.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_APPLYVIEWBASE_H_INCLUDED -#define XRPL_LEDGER_APPLYVIEWBASE_H_INCLUDED +#pragma once #include #include @@ -105,5 +104,3 @@ protected: } // namespace detail } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/detail/RawStateTable.h b/include/xrpl/ledger/detail/RawStateTable.h index 881d00be53..e09f2f0e44 100644 --- a/include/xrpl/ledger/detail/RawStateTable.h +++ b/include/xrpl/ledger/detail/RawStateTable.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_RAWSTATETABLE_H_INCLUDED -#define XRPL_LEDGER_RAWSTATETABLE_H_INCLUDED +#pragma once #include #include @@ -109,5 +108,3 @@ private: } // namespace detail } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/detail/ReadViewFwdRange.h b/include/xrpl/ledger/detail/ReadViewFwdRange.h index 05d2b79a50..bf40b04a6a 100644 --- a/include/xrpl/ledger/detail/ReadViewFwdRange.h +++ b/include/xrpl/ledger/detail/ReadViewFwdRange.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_READVIEWFWDRANGE_H_INCLUDED -#define XRPL_LEDGER_READVIEWFWDRANGE_H_INCLUDED +#pragma once #include #include @@ -129,5 +128,3 @@ protected: } // namespace detail } // namespace xrpl - -#endif diff --git a/include/xrpl/ledger/detail/ReadViewFwdRange.ipp b/include/xrpl/ledger/detail/ReadViewFwdRange.ipp index 6978d3abad..212be52432 100644 --- a/include/xrpl/ledger/detail/ReadViewFwdRange.ipp +++ b/include/xrpl/ledger/detail/ReadViewFwdRange.ipp @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_READVIEWFWDRANGEINL_H_INCLUDED -#define XRPL_LEDGER_READVIEWFWDRANGEINL_H_INCLUDED +#pragma once namespace xrpl { namespace detail { @@ -108,5 +107,3 @@ ReadViewFwdRange::iterator::operator++(int) -> iterator } // namespace detail } // namespace xrpl - -#endif diff --git a/include/xrpl/net/AutoSocket.h b/include/xrpl/net/AutoSocket.h index da4d3c30e5..85a3adb456 100644 --- a/include/xrpl/net/AutoSocket.h +++ b/include/xrpl/net/AutoSocket.h @@ -1,5 +1,4 @@ -#ifndef XRPL_WEBSOCKET_AUTOSOCKET_AUTOSOCKET_H_INCLUDED -#define XRPL_WEBSOCKET_AUTOSOCKET_AUTOSOCKET_H_INCLUDED +#pragma once #include #include @@ -268,5 +267,3 @@ private: std::vector mBuffer; beast::Journal j_; }; - -#endif diff --git a/include/xrpl/net/HTTPClient.h b/include/xrpl/net/HTTPClient.h index 0e1a56e42d..289ce8f6e3 100644 --- a/include/xrpl/net/HTTPClient.h +++ b/include/xrpl/net/HTTPClient.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NET_HTTPCLIENT_H_INCLUDED -#define XRPL_NET_HTTPCLIENT_H_INCLUDED +#pragma once #include #include @@ -69,5 +68,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/net/HTTPClientSSLContext.h b/include/xrpl/net/HTTPClientSSLContext.h index f195b031da..1033b9a22b 100644 --- a/include/xrpl/net/HTTPClientSSLContext.h +++ b/include/xrpl/net/HTTPClientSSLContext.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NET_HTTPCLIENTSSLCONTEXT_H_INCLUDED -#define XRPL_NET_HTTPCLIENTSSLCONTEXT_H_INCLUDED +#pragma once #include #include @@ -148,5 +147,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/net/RegisterSSLCerts.h b/include/xrpl/net/RegisterSSLCerts.h index 273d1966d1..e313b1cb06 100644 --- a/include/xrpl/net/RegisterSSLCerts.h +++ b/include/xrpl/net/RegisterSSLCerts.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NET_REGISTER_SSL_CERTS_H_INCLUDED -#define XRPL_NET_REGISTER_SSL_CERTS_H_INCLUDED +#pragma once #include @@ -17,5 +16,3 @@ void registerSSLCerts(boost::asio::ssl::context&, boost::system::error_code&, beast::Journal j); } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/Backend.h b/include/xrpl/nodestore/Backend.h index d3b995b6ed..6af292d5b3 100644 --- a/include/xrpl/nodestore/Backend.h +++ b/include/xrpl/nodestore/Backend.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_BACKEND_H_INCLUDED -#define XRPL_NODESTORE_BACKEND_H_INCLUDED +#pragma once #include @@ -142,5 +141,3 @@ public: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/Database.h b/include/xrpl/nodestore/Database.h index a1de865241..d3dafff85d 100644 --- a/include/xrpl/nodestore/Database.h +++ b/include/xrpl/nodestore/Database.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_DATABASE_H_INCLUDED -#define XRPL_NODESTORE_DATABASE_H_INCLUDED +#pragma once #include #include @@ -274,5 +273,3 @@ private: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/DatabaseRotating.h b/include/xrpl/nodestore/DatabaseRotating.h index 89e2ae8c0c..e20b49805c 100644 --- a/include/xrpl/nodestore/DatabaseRotating.h +++ b/include/xrpl/nodestore/DatabaseRotating.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_DATABASEROTATING_H_INCLUDED -#define XRPL_NODESTORE_DATABASEROTATING_H_INCLUDED +#pragma once #include @@ -34,5 +33,3 @@ public: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/DummyScheduler.h b/include/xrpl/nodestore/DummyScheduler.h index b31613480f..9fce4a6100 100644 --- a/include/xrpl/nodestore/DummyScheduler.h +++ b/include/xrpl/nodestore/DummyScheduler.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_DUMMYSCHEDULER_H_INCLUDED -#define XRPL_NODESTORE_DUMMYSCHEDULER_H_INCLUDED +#pragma once #include @@ -22,5 +21,3 @@ public: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/Factory.h b/include/xrpl/nodestore/Factory.h index d6d33c4b64..e01bdfabf2 100644 --- a/include/xrpl/nodestore/Factory.h +++ b/include/xrpl/nodestore/Factory.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_FACTORY_H_INCLUDED -#define XRPL_NODESTORE_FACTORY_H_INCLUDED +#pragma once #include #include @@ -62,5 +61,3 @@ public: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/Manager.h b/include/xrpl/nodestore/Manager.h index e6d62fbc4a..9553407881 100644 --- a/include/xrpl/nodestore/Manager.h +++ b/include/xrpl/nodestore/Manager.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_MANAGER_H_INCLUDED -#define XRPL_NODESTORE_MANAGER_H_INCLUDED +#pragma once #include #include @@ -80,5 +79,3 @@ public: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/NodeObject.h b/include/xrpl/nodestore/NodeObject.h index 1926d1791c..2274fc8c38 100644 --- a/include/xrpl/nodestore/NodeObject.h +++ b/include/xrpl/nodestore/NodeObject.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_NODEOBJECT_H_INCLUDED -#define XRPL_NODESTORE_NODEOBJECT_H_INCLUDED +#pragma once #include #include @@ -78,5 +77,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/Scheduler.h b/include/xrpl/nodestore/Scheduler.h index 0835e08fa2..6e01533930 100644 --- a/include/xrpl/nodestore/Scheduler.h +++ b/include/xrpl/nodestore/Scheduler.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_SCHEDULER_H_INCLUDED -#define XRPL_NODESTORE_SCHEDULER_H_INCLUDED +#pragma once #include @@ -67,5 +66,3 @@ public: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/Task.h b/include/xrpl/nodestore/Task.h index bd21e61975..4bfc88bd13 100644 --- a/include/xrpl/nodestore/Task.h +++ b/include/xrpl/nodestore/Task.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_TASK_H_INCLUDED -#define XRPL_NODESTORE_TASK_H_INCLUDED +#pragma once namespace xrpl { namespace NodeStore { @@ -18,5 +17,3 @@ struct Task } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/Types.h b/include/xrpl/nodestore/Types.h index 6763196860..5adbc40f70 100644 --- a/include/xrpl/nodestore/Types.h +++ b/include/xrpl/nodestore/Types.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_TYPES_H_INCLUDED -#define XRPL_NODESTORE_TYPES_H_INCLUDED +#pragma once #include @@ -38,5 +37,3 @@ using Batch = std::vector>; } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/detail/BatchWriter.h b/include/xrpl/nodestore/detail/BatchWriter.h index f1faf0a612..1820435133 100644 --- a/include/xrpl/nodestore/detail/BatchWriter.h +++ b/include/xrpl/nodestore/detail/BatchWriter.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_BATCHWRITER_H_INCLUDED -#define XRPL_NODESTORE_BATCHWRITER_H_INCLUDED +#pragma once #include #include @@ -79,5 +78,3 @@ private: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/detail/DatabaseNodeImp.h b/include/xrpl/nodestore/detail/DatabaseNodeImp.h index 900d6a5a59..dd6b8f9ddd 100644 --- a/include/xrpl/nodestore/detail/DatabaseNodeImp.h +++ b/include/xrpl/nodestore/detail/DatabaseNodeImp.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_DATABASENODEIMP_H_INCLUDED -#define XRPL_NODESTORE_DATABASENODEIMP_H_INCLUDED +#pragma once #include #include @@ -126,5 +125,3 @@ private: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/detail/DatabaseRotatingImp.h b/include/xrpl/nodestore/detail/DatabaseRotatingImp.h index 31c9ebbaec..e49c195d67 100644 --- a/include/xrpl/nodestore/detail/DatabaseRotatingImp.h +++ b/include/xrpl/nodestore/detail/DatabaseRotatingImp.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED -#define XRPL_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED +#pragma once #include @@ -73,5 +72,3 @@ private: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/detail/DecodedBlob.h b/include/xrpl/nodestore/detail/DecodedBlob.h index 0eaa169269..dc6704a08d 100644 --- a/include/xrpl/nodestore/detail/DecodedBlob.h +++ b/include/xrpl/nodestore/detail/DecodedBlob.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_DECODEDBLOB_H_INCLUDED -#define XRPL_NODESTORE_DECODEDBLOB_H_INCLUDED +#pragma once #include @@ -44,5 +43,3 @@ private: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/detail/EncodedBlob.h b/include/xrpl/nodestore/detail/EncodedBlob.h index a4c553cf71..78e7153f73 100644 --- a/include/xrpl/nodestore/detail/EncodedBlob.h +++ b/include/xrpl/nodestore/detail/EncodedBlob.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_ENCODEDBLOB_H_INCLUDED -#define XRPL_NODESTORE_ENCODEDBLOB_H_INCLUDED +#pragma once #include #include @@ -107,5 +106,3 @@ public: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/detail/ManagerImp.h b/include/xrpl/nodestore/detail/ManagerImp.h index eb3ee21db4..f46a7d56d0 100644 --- a/include/xrpl/nodestore/detail/ManagerImp.h +++ b/include/xrpl/nodestore/detail/ManagerImp.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_MANAGERIMP_H_INCLUDED -#define XRPL_NODESTORE_MANAGERIMP_H_INCLUDED +#pragma once #include @@ -48,5 +47,3 @@ public: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/detail/codec.h b/include/xrpl/nodestore/detail/codec.h index adbf214ce5..1d08beff59 100644 --- a/include/xrpl/nodestore/detail/codec.h +++ b/include/xrpl/nodestore/detail/codec.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_CODEC_H_INCLUDED -#define XRPL_NODESTORE_CODEC_H_INCLUDED +#pragma once // Disable lz4 deprecation warning due to incompatibility with clang attributes #define LZ4_DISABLE_DEPRECATE_WARNINGS @@ -305,5 +304,3 @@ filter_inner(void* in, std::size_t in_size) } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/nodestore/detail/varint.h b/include/xrpl/nodestore/detail/varint.h index 7cf9fbaf4b..98f8d8ff08 100644 --- a/include/xrpl/nodestore/detail/varint.h +++ b/include/xrpl/nodestore/detail/varint.h @@ -1,5 +1,4 @@ -#ifndef BEAST_NUDB_VARINT_H_INCLUDED -#define BEAST_NUDB_VARINT_H_INCLUDED +#pragma once #include @@ -119,5 +118,3 @@ write(nudb::detail::ostream& os, std::size_t t) } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/AMMCore.h b/include/xrpl/protocol/AMMCore.h index cdd99c65eb..a2c531f361 100644 --- a/include/xrpl/protocol/AMMCore.h +++ b/include/xrpl/protocol/AMMCore.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_AMMCORE_H_INCLUDED -#define XRPL_PROTOCOL_AMMCORE_H_INCLUDED +#pragma once #include #include @@ -97,5 +96,3 @@ feeMultHalf(std::uint16_t tfee) } } // namespace xrpl - -#endif // XRPL_PROTOCOL_AMMCORE_H_INCLUDED diff --git a/include/xrpl/protocol/AccountID.h b/include/xrpl/protocol/AccountID.h index d61938e2a7..bc57058d9e 100644 --- a/include/xrpl/protocol/AccountID.h +++ b/include/xrpl/protocol/AccountID.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_ACCOUNTID_H_INCLUDED -#define XRPL_PROTOCOL_ACCOUNTID_H_INCLUDED +#pragma once #include // VFALCO Uncomment when the header issues are resolved @@ -133,5 +132,3 @@ struct hash : xrpl::AccountID::hasher }; } // namespace std - -#endif diff --git a/include/xrpl/protocol/AmountConversions.h b/include/xrpl/protocol/AmountConversions.h index d4a66c5d94..0807e96c49 100644 --- a/include/xrpl/protocol/AmountConversions.h +++ b/include/xrpl/protocol/AmountConversions.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_AMOUNTCONVERSION_H_INCLUDED -#define XRPL_PROTOCOL_AMOUNTCONVERSION_H_INCLUDED +#pragma once #include #include @@ -184,5 +183,3 @@ get(STAmount const& a) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/ApiVersion.h b/include/xrpl/protocol/ApiVersion.h index b8dc8ecb20..756a41d25e 100644 --- a/include/xrpl/protocol/ApiVersion.h +++ b/include/xrpl/protocol/ApiVersion.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_APIVERSION_H_INCLUDED -#define XRPL_PROTOCOL_APIVERSION_H_INCLUDED +#pragma once #include #include @@ -151,5 +150,3 @@ forAllApiVersions(Fn const& fn, Args&&... args) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Asset.h b/include/xrpl/protocol/Asset.h index e7852cdefe..d48bc94b50 100644 --- a/include/xrpl/protocol/Asset.h +++ b/include/xrpl/protocol/Asset.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_ASSET_H_INCLUDED -#define XRPL_PROTOCOL_ASSET_H_INCLUDED +#pragma once #include #include @@ -225,5 +224,3 @@ Asset assetFromJson(Json::Value const& jv); } // namespace xrpl - -#endif // XRPL_PROTOCOL_ASSET_H_INCLUDED diff --git a/include/xrpl/protocol/Book.h b/include/xrpl/protocol/Book.h index 9e26af9f79..83965cf701 100644 --- a/include/xrpl/protocol/Book.h +++ b/include/xrpl/protocol/Book.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_BOOK_H_INCLUDED -#define XRPL_PROTOCOL_BOOK_H_INCLUDED +#pragma once #include #include @@ -171,5 +170,3 @@ struct hash : std::hash }; } // namespace boost - -#endif diff --git a/include/xrpl/protocol/BuildInfo.h b/include/xrpl/protocol/BuildInfo.h index 0b75f8b0a1..3c42a4323f 100644 --- a/include/xrpl/protocol/BuildInfo.h +++ b/include/xrpl/protocol/BuildInfo.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_BUILDINFO_H_INCLUDED -#define XRPL_PROTOCOL_BUILDINFO_H_INCLUDED +#pragma once #include #include @@ -80,5 +79,3 @@ isNewerVersion(std::uint64_t version); } // namespace BuildInfo } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/ErrorCodes.h b/include/xrpl/protocol/ErrorCodes.h index 172c3fd57f..08c034e38f 100644 --- a/include/xrpl/protocol/ErrorCodes.h +++ b/include/xrpl/protocol/ErrorCodes.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_ERRORCODES_H_INCLUDED -#define XRPL_PROTOCOL_ERRORCODES_H_INCLUDED +#pragma once #include #include @@ -324,5 +323,3 @@ std::string rpcErrorString(Json::Value const& jv); } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Feature.h b/include/xrpl/protocol/Feature.h index fac6627b1c..6d674fbef2 100644 --- a/include/xrpl/protocol/Feature.h +++ b/include/xrpl/protocol/Feature.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_FEATURE_H_INCLUDED -#define XRPL_PROTOCOL_FEATURE_H_INCLUDED +#pragma once #include @@ -361,5 +360,3 @@ foreachFeature(FeatureBitset bs, F&& f) #pragma pop_macro("XRPL_FEATURE") } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Fees.h b/include/xrpl/protocol/Fees.h index 8c7cb51777..84c8ffe81f 100644 --- a/include/xrpl/protocol/Fees.h +++ b/include/xrpl/protocol/Fees.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_FEES_H_INCLUDED -#define XRPL_PROTOCOL_FEES_H_INCLUDED +#pragma once #include @@ -34,5 +33,3 @@ struct Fees }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/HashPrefix.h b/include/xrpl/protocol/HashPrefix.h index babba3f7bd..305b4bfd49 100644 --- a/include/xrpl/protocol/HashPrefix.h +++ b/include/xrpl/protocol/HashPrefix.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_HASHPREFIX_H_INCLUDED -#define XRPL_PROTOCOL_HASHPREFIX_H_INCLUDED +#pragma once #include @@ -79,5 +78,3 @@ hash_append(Hasher& h, HashPrefix const& hp) noexcept } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/IOUAmount.h b/include/xrpl/protocol/IOUAmount.h index 960f8c4521..52c2272da0 100644 --- a/include/xrpl/protocol/IOUAmount.h +++ b/include/xrpl/protocol/IOUAmount.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_IOUAMOUNT_H_INCLUDED -#define XRPL_BASICS_IOUAMOUNT_H_INCLUDED +#pragma once #include #include @@ -208,5 +207,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Indexes.h b/include/xrpl/protocol/Indexes.h index 2ce3b7ad6b..f1e0b1655a 100644 --- a/include/xrpl/protocol/Indexes.h +++ b/include/xrpl/protocol/Indexes.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_INDEXES_H_INCLUDED -#define XRPL_PROTOCOL_INDEXES_H_INCLUDED +#pragma once #include #include @@ -385,5 +384,3 @@ MPTID makeMptID(std::uint32_t sequence, AccountID const& account); } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/InnerObjectFormats.h b/include/xrpl/protocol/InnerObjectFormats.h index 6d656d0065..a00e6e120b 100644 --- a/include/xrpl/protocol/InnerObjectFormats.h +++ b/include/xrpl/protocol/InnerObjectFormats.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_INNER_OBJECT_FORMATS_H_INCLUDED -#define XRPL_PROTOCOL_INNER_OBJECT_FORMATS_H_INCLUDED +#pragma once #include @@ -24,5 +23,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Issue.h b/include/xrpl/protocol/Issue.h index f7da457986..c8e598a540 100644 --- a/include/xrpl/protocol/Issue.h +++ b/include/xrpl/protocol/Issue.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_ISSUE_H_INCLUDED -#define XRPL_PROTOCOL_ISSUE_H_INCLUDED +#pragma once #include #include @@ -116,5 +115,3 @@ isXRP(Issue const& issue) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/KeyType.h b/include/xrpl/protocol/KeyType.h index 454c88780d..d05e421e4b 100644 --- a/include/xrpl/protocol/KeyType.h +++ b/include/xrpl/protocol/KeyType.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_KEYTYPE_H_INCLUDED -#define XRPL_PROTOCOL_KEYTYPE_H_INCLUDED +#pragma once #include #include @@ -43,5 +42,3 @@ operator<<(Stream& s, KeyType type) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Keylet.h b/include/xrpl/protocol/Keylet.h index 4380fdfdac..2931486ac0 100644 --- a/include/xrpl/protocol/Keylet.h +++ b/include/xrpl/protocol/Keylet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_KEYLET_H_INCLUDED -#define XRPL_PROTOCOL_KEYLET_H_INCLUDED +#pragma once #include #include @@ -31,5 +30,3 @@ struct Keylet }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/KnownFormats.h b/include/xrpl/protocol/KnownFormats.h index 58a2710bef..67701c91ca 100644 --- a/include/xrpl/protocol/KnownFormats.h +++ b/include/xrpl/protocol/KnownFormats.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_KNOWNFORMATS_H_INCLUDED -#define XRPL_PROTOCOL_KNOWNFORMATS_H_INCLUDED +#pragma once #include #include @@ -180,5 +179,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/LedgerFormats.h b/include/xrpl/protocol/LedgerFormats.h index b52a25af17..fa39c15843 100644 --- a/include/xrpl/protocol/LedgerFormats.h +++ b/include/xrpl/protocol/LedgerFormats.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_LEDGERFORMATS_H_INCLUDED -#define XRPL_PROTOCOL_LEDGERFORMATS_H_INCLUDED +#pragma once #include @@ -211,5 +210,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/LedgerHeader.h b/include/xrpl/protocol/LedgerHeader.h index 641f794cdb..1dc67cada5 100644 --- a/include/xrpl/protocol/LedgerHeader.h +++ b/include/xrpl/protocol/LedgerHeader.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_LEDGERHEADER_H_INCLUDED -#define XRPL_PROTOCOL_LEDGERHEADER_H_INCLUDED +#pragma once #include #include @@ -74,5 +73,3 @@ LedgerHeader deserializePrefixedHeader(Slice data, bool hasHash = false); } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/MPTAmount.h b/include/xrpl/protocol/MPTAmount.h index be24d4de7f..66027185b3 100644 --- a/include/xrpl/protocol/MPTAmount.h +++ b/include/xrpl/protocol/MPTAmount.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_MPTAMOUNT_H_INCLUDED -#define XRPL_PROTOCOL_MPTAMOUNT_H_INCLUDED +#pragma once #include #include @@ -147,5 +146,3 @@ mulRatio(MPTAmount const& amt, std::uint32_t num, std::uint32_t den, bool roundU } } // namespace xrpl - -#endif // XRPL_BASICS_MPTAMOUNT_H_INCLUDED diff --git a/include/xrpl/protocol/MPTIssue.h b/include/xrpl/protocol/MPTIssue.h index ca81548a29..d84a610418 100644 --- a/include/xrpl/protocol/MPTIssue.h +++ b/include/xrpl/protocol/MPTIssue.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_MPTISSUE_H_INCLUDED -#define XRPL_PROTOCOL_MPTISSUE_H_INCLUDED +#pragma once #include #include @@ -84,5 +83,3 @@ MPTIssue mptIssueFromJson(Json::Value const& jv); } // namespace xrpl - -#endif // XRPL_PROTOCOL_MPTISSUE_H_INCLUDED diff --git a/include/xrpl/protocol/MultiApiJson.h b/include/xrpl/protocol/MultiApiJson.h index 9fdb85f648..ad7a6b8f0d 100644 --- a/include/xrpl/protocol/MultiApiJson.h +++ b/include/xrpl/protocol/MultiApiJson.h @@ -1,5 +1,4 @@ -#ifndef XRPL_JSON_MULTIAPIJSON_H_INCLUDED -#define XRPL_JSON_MULTIAPIJSON_H_INCLUDED +#pragma once #include #include @@ -173,5 +172,3 @@ struct MultiApiJson using MultiApiJson = detail::MultiApiJson; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/NFTSyntheticSerializer.h b/include/xrpl/protocol/NFTSyntheticSerializer.h index 5f7e061454..c33a6edc7d 100644 --- a/include/xrpl/protocol/NFTSyntheticSerializer.h +++ b/include/xrpl/protocol/NFTSyntheticSerializer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_NFTSYNTHETICSERIALIZER_H_INCLUDED -#define XRPL_PROTOCOL_NFTSYNTHETICSERIALIZER_H_INCLUDED +#pragma once #include #include @@ -22,5 +21,3 @@ insertNFTSyntheticInJson(Json::Value&, std::shared_ptr const&, TxMet } // namespace RPC } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/NFTokenID.h b/include/xrpl/protocol/NFTokenID.h index 0cddfa6d55..f3635d6fac 100644 --- a/include/xrpl/protocol/NFTokenID.h +++ b/include/xrpl/protocol/NFTokenID.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_NFTOKENID_H_INCLUDED -#define XRPL_PROTOCOL_NFTOKENID_H_INCLUDED +#pragma once #include #include @@ -34,5 +33,3 @@ insertNFTokenID(Json::Value& response, std::shared_ptr const& transa /** @} */ } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/NFTokenOfferID.h b/include/xrpl/protocol/NFTokenOfferID.h index da358a9b84..c3117db197 100644 --- a/include/xrpl/protocol/NFTokenOfferID.h +++ b/include/xrpl/protocol/NFTokenOfferID.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_NFTOKENOFFERID_H_INCLUDED -#define XRPL_PROTOCOL_NFTOKENOFFERID_H_INCLUDED +#pragma once #include #include @@ -32,5 +31,3 @@ insertNFTokenOfferID( /** @} */ } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/PayChan.h b/include/xrpl/protocol/PayChan.h index a991f124ff..0a1496ca8e 100644 --- a/include/xrpl/protocol/PayChan.h +++ b/include/xrpl/protocol/PayChan.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_PAYCHAN_H_INCLUDED -#define XRPL_PROTOCOL_PAYCHAN_H_INCLUDED +#pragma once #include #include @@ -17,5 +16,3 @@ serializePayChanAuthorization(Serializer& msg, uint256 const& key, XRPAmount con } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Permissions.h b/include/xrpl/protocol/Permissions.h index 0e3bb970bd..e8800a41d2 100644 --- a/include/xrpl/protocol/Permissions.h +++ b/include/xrpl/protocol/Permissions.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_PERMISSION_H_INCLUDED -#define XRPL_PROTOCOL_PERMISSION_H_INCLUDED +#pragma once #include #include @@ -82,5 +81,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Protocol.h b/include/xrpl/protocol/Protocol.h index 99e224cb91..dfb2b9dfe8 100644 --- a/include/xrpl/protocol/Protocol.h +++ b/include/xrpl/protocol/Protocol.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_PROTOCOL_H_INCLUDED -#define XRPL_PROTOCOL_PROTOCOL_H_INCLUDED +#pragma once #include #include @@ -298,5 +297,3 @@ std::size_t constexpr permissionMaxSize = 10; std::size_t constexpr maxBatchTxCount = 8; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/PublicKey.h b/include/xrpl/protocol/PublicKey.h index 0d95fa5818..eff2af6839 100644 --- a/include/xrpl/protocol/PublicKey.h +++ b/include/xrpl/protocol/PublicKey.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_PUBLICKEY_H_INCLUDED -#define XRPL_PROTOCOL_PUBLICKEY_H_INCLUDED +#pragma once #include #include @@ -279,5 +278,3 @@ getOrThrow(Json::Value const& v, xrpl::SField const& field) Throw(field.getJsonName(), "PublicKey"); } } // namespace Json - -#endif diff --git a/include/xrpl/protocol/Quality.h b/include/xrpl/protocol/Quality.h index d8101d7c1e..4d3fcbfcc0 100644 --- a/include/xrpl/protocol/Quality.h +++ b/include/xrpl/protocol/Quality.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_QUALITY_H_INCLUDED -#define XRPL_PROTOCOL_QUALITY_H_INCLUDED +#pragma once #include #include @@ -358,5 +357,3 @@ Quality composed_quality(Quality const& lhs, Quality const& rhs); } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/QualityFunction.h b/include/xrpl/protocol/QualityFunction.h index 2414d86583..4f76f4df0a 100644 --- a/include/xrpl/protocol/QualityFunction.h +++ b/include/xrpl/protocol/QualityFunction.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_QUALITYFUNCTION_H_INCLUDED -#define XRPL_PROTOCOL_QUALITYFUNCTION_H_INCLUDED +#pragma once #include #include @@ -78,5 +77,3 @@ QualityFunction::QualityFunction(TAmounts const& amounts, std::uint32 } } // namespace xrpl - -#endif // XRPL_PROTOCOL_QUALITYFUNCTION_H_INCLUDED diff --git a/include/xrpl/protocol/RPCErr.h b/include/xrpl/protocol/RPCErr.h index fcca15747e..34c4bf8f99 100644 --- a/include/xrpl/protocol/RPCErr.h +++ b/include/xrpl/protocol/RPCErr.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NET_RPCERR_H_INCLUDED -#define XRPL_NET_RPCERR_H_INCLUDED +#pragma once #include @@ -12,5 +11,3 @@ Json::Value rpcError(error_code_i iError); } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Rate.h b/include/xrpl/protocol/Rate.h index 86033e9a38..e57d7e3a99 100644 --- a/include/xrpl/protocol/Rate.h +++ b/include/xrpl/protocol/Rate.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_RATE_H_INCLUDED -#define XRPL_PROTOCOL_RATE_H_INCLUDED +#pragma once #include #include @@ -76,5 +75,3 @@ transferFeeAsRate(std::uint16_t fee); extern Rate const parityRate; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/RippleLedgerHash.h b/include/xrpl/protocol/RippleLedgerHash.h index 516ab49029..2a51298d3d 100644 --- a/include/xrpl/protocol/RippleLedgerHash.h +++ b/include/xrpl/protocol/RippleLedgerHash.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_RIPPLELEDGERHASH_H_INCLUDED -#define XRPL_PROTOCOL_RIPPLELEDGERHASH_H_INCLUDED +#pragma once #include @@ -8,5 +7,3 @@ namespace xrpl { using LedgerHash = uint256; } - -#endif diff --git a/include/xrpl/protocol/Rules.h b/include/xrpl/protocol/Rules.h index 8f622c3f1d..7d4a458fce 100644 --- a/include/xrpl/protocol/Rules.h +++ b/include/xrpl/protocol/Rules.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_RULES_H_INCLUDED -#define XRPL_LEDGER_RULES_H_INCLUDED +#pragma once #include #include @@ -107,4 +106,3 @@ private: }; } // namespace xrpl -#endif diff --git a/include/xrpl/protocol/SField.h b/include/xrpl/protocol/SField.h index 3ca8dbf898..7a864b1b58 100644 --- a/include/xrpl/protocol/SField.h +++ b/include/xrpl/protocol/SField.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_SFIELD_H_INCLUDED -#define XRPL_PROTOCOL_SFIELD_H_INCLUDED +#pragma once #include #include @@ -374,5 +373,3 @@ extern SField const sfGeneric; #pragma pop_macro("UNTYPED_SFIELD") } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/SOTemplate.h b/include/xrpl/protocol/SOTemplate.h index 35be09c5d5..794fc86c11 100644 --- a/include/xrpl/protocol/SOTemplate.h +++ b/include/xrpl/protocol/SOTemplate.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_SOTEMPLATE_H_INCLUDED -#define XRPL_PROTOCOL_SOTEMPLATE_H_INCLUDED +#pragma once #include #include @@ -148,5 +147,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STAccount.h b/include/xrpl/protocol/STAccount.h index 7c193d3425..3fdb2e015e 100644 --- a/include/xrpl/protocol/STAccount.h +++ b/include/xrpl/protocol/STAccount.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STACCOUNT_H_INCLUDED -#define XRPL_PROTOCOL_STACCOUNT_H_INCLUDED +#pragma once #include #include @@ -113,5 +112,3 @@ operator<(AccountID const& lhs, STAccount const& rhs) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STAmount.h b/include/xrpl/protocol/STAmount.h index c678205882..df2b1c19a0 100644 --- a/include/xrpl/protocol/STAmount.h +++ b/include/xrpl/protocol/STAmount.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STAMOUNT_H_INCLUDED -#define XRPL_PROTOCOL_STAMOUNT_H_INCLUDED +#pragma once #include #include @@ -735,4 +734,3 @@ getOrThrow(Json::Value const& v, xrpl::SField const& field) return amountFromJson(field, inner); } } // namespace Json -#endif diff --git a/include/xrpl/protocol/STArray.h b/include/xrpl/protocol/STArray.h index d413e7bdc0..d9c5306d14 100644 --- a/include/xrpl/protocol/STArray.h +++ b/include/xrpl/protocol/STArray.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STARRAY_H_INCLUDED -#define XRPL_PROTOCOL_STARRAY_H_INCLUDED +#pragma once #include #include @@ -287,5 +286,3 @@ STArray::erase(const_iterator first, const_iterator last) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STBase.h b/include/xrpl/protocol/STBase.h index f100b52426..7f06b01ca4 100644 --- a/include/xrpl/protocol/STBase.h +++ b/include/xrpl/protocol/STBase.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STBASE_H_INCLUDED -#define XRPL_PROTOCOL_STBASE_H_INCLUDED +#pragma once #include #include @@ -220,5 +219,3 @@ STBase::emplace(std::size_t n, void* buf, T&& val) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STBitString.h b/include/xrpl/protocol/STBitString.h index 0229d99698..e8b6e7282b 100644 --- a/include/xrpl/protocol/STBitString.h +++ b/include/xrpl/protocol/STBitString.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STBITSTRING_H_INCLUDED -#define XRPL_PROTOCOL_STBITSTRING_H_INCLUDED +#pragma once #include #include @@ -183,5 +182,3 @@ STBitString::isDefault() const } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STBlob.h b/include/xrpl/protocol/STBlob.h index bb9b8a44f8..15a9bd5f78 100644 --- a/include/xrpl/protocol/STBlob.h +++ b/include/xrpl/protocol/STBlob.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STBLOB_H_INCLUDED -#define XRPL_PROTOCOL_STBLOB_H_INCLUDED +#pragma once #include #include @@ -124,5 +123,3 @@ STBlob::setValue(Buffer&& b) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STCurrency.h b/include/xrpl/protocol/STCurrency.h index 1c59d48beb..dc5b079c6d 100644 --- a/include/xrpl/protocol/STCurrency.h +++ b/include/xrpl/protocol/STCurrency.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STCURRENCY_H_INCLUDED -#define XRPL_PROTOCOL_STCURRENCY_H_INCLUDED +#pragma once #include #include @@ -115,5 +114,3 @@ operator<(STCurrency const& lhs, Currency const& rhs) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STExchange.h b/include/xrpl/protocol/STExchange.h index daf5a0e1f2..4b576991b7 100644 --- a/include/xrpl/protocol/STExchange.h +++ b/include/xrpl/protocol/STExchange.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STEXCHANGE_H_INCLUDED -#define XRPL_PROTOCOL_STEXCHANGE_H_INCLUDED +#pragma once #include #include @@ -152,5 +151,3 @@ erase(STObject& st, TypedField const& f) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STInteger.h b/include/xrpl/protocol/STInteger.h index e79f88808e..b5c4dbf6cf 100644 --- a/include/xrpl/protocol/STInteger.h +++ b/include/xrpl/protocol/STInteger.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STINTEGER_H_INCLUDED -#define XRPL_PROTOCOL_STINTEGER_H_INCLUDED +#pragma once #include #include @@ -141,5 +140,3 @@ inline STInteger::operator Integer() const } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STIssue.h b/include/xrpl/protocol/STIssue.h index 404e60578c..7491e3b3ff 100644 --- a/include/xrpl/protocol/STIssue.h +++ b/include/xrpl/protocol/STIssue.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STISSUE_H_INCLUDED -#define XRPL_PROTOCOL_STISSUE_H_INCLUDED +#pragma once #include #include @@ -148,5 +147,3 @@ operator<=>(STIssue const& lhs, Asset const& rhs) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STLedgerEntry.h b/include/xrpl/protocol/STLedgerEntry.h index 24efab5f86..6ba3b36c6b 100644 --- a/include/xrpl/protocol/STLedgerEntry.h +++ b/include/xrpl/protocol/STLedgerEntry.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STLEDGERENTRY_H_INCLUDED -#define XRPL_PROTOCOL_STLEDGERENTRY_H_INCLUDED +#pragma once #include #include @@ -103,5 +102,3 @@ STLedgerEntry::getType() const } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STNumber.h b/include/xrpl/protocol/STNumber.h index 39b0c3b042..137016dfe7 100644 --- a/include/xrpl/protocol/STNumber.h +++ b/include/xrpl/protocol/STNumber.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STNUMBER_H_INCLUDED -#define XRPL_PROTOCOL_STNUMBER_H_INCLUDED +#pragma once #include #include @@ -100,5 +99,3 @@ STNumber numberFromJson(SField const& field, Json::Value const& value); } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STObject.h b/include/xrpl/protocol/STObject.h index 0a2c37356a..5d5d829c99 100644 --- a/include/xrpl/protocol/STObject.h +++ b/include/xrpl/protocol/STObject.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STOBJECT_H_INCLUDED -#define XRPL_PROTOCOL_STOBJECT_H_INCLUDED +#pragma once #include #include @@ -1244,5 +1243,3 @@ STObject::peekField(SField const& field) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STParsedJSON.h b/include/xrpl/protocol/STParsedJSON.h index 4be10840bd..772785fd70 100644 --- a/include/xrpl/protocol/STParsedJSON.h +++ b/include/xrpl/protocol/STParsedJSON.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STPARSEDJSON_H_INCLUDED -#define XRPL_PROTOCOL_STPARSEDJSON_H_INCLUDED +#pragma once #include @@ -36,5 +35,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STPathSet.h b/include/xrpl/protocol/STPathSet.h index 55e2aebe2d..1bab654d3f 100644 --- a/include/xrpl/protocol/STPathSet.h +++ b/include/xrpl/protocol/STPathSet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STPATHSET_H_INCLUDED -#define XRPL_PROTOCOL_STPATHSET_H_INCLUDED +#pragma once #include #include @@ -484,5 +483,3 @@ STPathSet::emplace_back(Args&&... args) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STTakesAsset.h b/include/xrpl/protocol/STTakesAsset.h index 767223b97d..bf75ffccf7 100644 --- a/include/xrpl/protocol/STTakesAsset.h +++ b/include/xrpl/protocol/STTakesAsset.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STTAKESASSET_H_INCLUDED -#define XRPL_PROTOCOL_STTAKESASSET_H_INCLUDED +#pragma once #include #include @@ -59,5 +58,3 @@ void associateAsset(STLedgerEntry& sle, Asset const& asset); } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STTx.h b/include/xrpl/protocol/STTx.h index f6ee91623f..a12c658dc2 100644 --- a/include/xrpl/protocol/STTx.h +++ b/include/xrpl/protocol/STTx.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STTX_H_INCLUDED -#define XRPL_PROTOCOL_STTX_H_INCLUDED +#pragma once #include #include @@ -196,5 +195,3 @@ STTx::getTransactionID() const } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STValidation.h b/include/xrpl/protocol/STValidation.h index 6f071acda1..aa48161f68 100644 --- a/include/xrpl/protocol/STValidation.h +++ b/include/xrpl/protocol/STValidation.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STVALIDATION_H_INCLUDED -#define XRPL_PROTOCOL_STVALIDATION_H_INCLUDED +#pragma once #include #include @@ -245,5 +244,3 @@ STValidation::setSeen(NetClock::time_point s) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STVector256.h b/include/xrpl/protocol/STVector256.h index 884fd70c7c..c83d981bfc 100644 --- a/include/xrpl/protocol/STVector256.h +++ b/include/xrpl/protocol/STVector256.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STVECTOR256_H_INCLUDED -#define XRPL_PROTOCOL_STVECTOR256_H_INCLUDED +#pragma once #include #include @@ -232,5 +231,3 @@ STVector256::clear() noexcept } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/STXChainBridge.h b/include/xrpl/protocol/STXChainBridge.h index fdaed22594..709d3886b7 100644 --- a/include/xrpl/protocol/STXChainBridge.h +++ b/include/xrpl/protocol/STXChainBridge.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STXCHAINBRIDGE_H_INCLUDED -#define XRPL_PROTOCOL_STXCHAINBRIDGE_H_INCLUDED +#pragma once #include #include @@ -197,5 +196,3 @@ STXChainBridge::dstChain(bool wasLockingChainSend) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/SecretKey.h b/include/xrpl/protocol/SecretKey.h index 146e9a7105..a59b1150c1 100644 --- a/include/xrpl/protocol/SecretKey.h +++ b/include/xrpl/protocol/SecretKey.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_SECRETKEY_H_INCLUDED -#define XRPL_PROTOCOL_SECRETKEY_H_INCLUDED +#pragma once #include #include @@ -162,5 +161,3 @@ sign(KeyType type, SecretKey const& sk, Slice const& message) /** @} */ } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Seed.h b/include/xrpl/protocol/Seed.h index 36b2bbfee3..1fad94e2bd 100644 --- a/include/xrpl/protocol/Seed.h +++ b/include/xrpl/protocol/Seed.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_SEED_H_INCLUDED -#define XRPL_PROTOCOL_SEED_H_INCLUDED +#pragma once #include #include @@ -118,5 +117,3 @@ toBase58(Seed const& seed) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/SeqProxy.h b/include/xrpl/protocol/SeqProxy.h index 8dde232e75..563292f8b3 100644 --- a/include/xrpl/protocol/SeqProxy.h +++ b/include/xrpl/protocol/SeqProxy.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_SEQ_PROXY_H_INCLUDED -#define XRPL_PROTOCOL_SEQ_PROXY_H_INCLUDED +#pragma once #include #include @@ -147,5 +146,3 @@ public: } }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Serializer.h b/include/xrpl/protocol/Serializer.h index 7e294bd3a8..98cefb4d08 100644 --- a/include/xrpl/protocol/Serializer.h +++ b/include/xrpl/protocol/Serializer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_SERIALIZER_H_INCLUDED -#define XRPL_PROTOCOL_SERIALIZER_H_INCLUDED +#pragma once #include #include @@ -447,5 +446,3 @@ SerialIter::getBitString() } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/Sign.h b/include/xrpl/protocol/Sign.h index d9af89b774..9f0bf2f1ca 100644 --- a/include/xrpl/protocol/Sign.h +++ b/include/xrpl/protocol/Sign.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_SIGN_H_INCLUDED -#define XRPL_PROTOCOL_SIGN_H_INCLUDED +#pragma once #include #include @@ -59,5 +58,3 @@ finishMultiSigningData(AccountID const& signingID, Serializer& s) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/SystemParameters.h b/include/xrpl/protocol/SystemParameters.h index c2f66e9ea1..70ab67c56f 100644 --- a/include/xrpl/protocol/SystemParameters.h +++ b/include/xrpl/protocol/SystemParameters.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_SYSTEMPARAMETERS_H_INCLUDED -#define XRPL_PROTOCOL_SYSTEMPARAMETERS_H_INCLUDED +#pragma once #include #include @@ -66,5 +65,3 @@ constexpr std::chrono::seconds const defaultAmendmentMajorityTime = weeks{2}; /** Default peer port (IANA registered) */ inline std::uint16_t constexpr DEFAULT_PEER_PORT{2459}; - -#endif diff --git a/include/xrpl/protocol/TER.h b/include/xrpl/protocol/TER.h index 65a339231d..52001ce72b 100644 --- a/include/xrpl/protocol/TER.h +++ b/include/xrpl/protocol/TER.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_TER_H_INCLUDED -#define XRPL_PROTOCOL_TER_H_INCLUDED +#pragma once #include #include @@ -675,5 +674,3 @@ std::optional transCode(std::string const& token); } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/TxFlags.h b/include/xrpl/protocol/TxFlags.h index 5527a264e4..6c6ef5e369 100644 --- a/include/xrpl/protocol/TxFlags.h +++ b/include/xrpl/protocol/TxFlags.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_TXFLAGS_H_INCLUDED -#define XRPL_PROTOCOL_TXFLAGS_H_INCLUDED +#pragma once #include @@ -295,5 +294,3 @@ constexpr std::uint32_t const tfLoanManageMask = ~(tfUniversal | tfLoanDefault | // clang-format on } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/TxFormats.h b/include/xrpl/protocol/TxFormats.h index 05f03c5cdc..b76eef7585 100644 --- a/include/xrpl/protocol/TxFormats.h +++ b/include/xrpl/protocol/TxFormats.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_TXFORMATS_H_INCLUDED -#define XRPL_PROTOCOL_TXFORMATS_H_INCLUDED +#pragma once #include @@ -77,5 +76,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/TxMeta.h b/include/xrpl/protocol/TxMeta.h index 5b6716e380..a295eb4569 100644 --- a/include/xrpl/protocol/TxMeta.h +++ b/include/xrpl/protocol/TxMeta.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_TX_TRANSACTIONMETA_H_INCLUDED -#define XRPL_APP_TX_TRANSACTIONMETA_H_INCLUDED +#pragma once #include #include @@ -118,5 +117,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/UintTypes.h b/include/xrpl/protocol/UintTypes.h index daa66e8286..fd48244d89 100644 --- a/include/xrpl/protocol/UintTypes.h +++ b/include/xrpl/protocol/UintTypes.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_UINTTYPES_H_INCLUDED -#define XRPL_PROTOCOL_UINTTYPES_H_INCLUDED +#pragma once #include #include @@ -125,5 +124,3 @@ struct hash : xrpl::uint256::hasher }; } // namespace std - -#endif diff --git a/include/xrpl/protocol/Units.h b/include/xrpl/protocol/Units.h index e52fbefe46..ecf0bf7798 100644 --- a/include/xrpl/protocol/Units.h +++ b/include/xrpl/protocol/Units.h @@ -1,5 +1,4 @@ -#ifndef PROTOCOL_UNITS_H_INCLUDED -#define PROTOCOL_UNITS_H_INCLUDED +#pragma once #include #include @@ -516,5 +515,3 @@ unsafe_cast(Src s) noexcept } } // namespace xrpl - -#endif // PROTOCOL_UNITS_H_INCLUDED diff --git a/include/xrpl/protocol/XChainAttestations.h b/include/xrpl/protocol/XChainAttestations.h index c5415e518b..fc3c464b92 100644 --- a/include/xrpl/protocol/XChainAttestations.h +++ b/include/xrpl/protocol/XChainAttestations.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STXATTESTATIONS_H_INCLUDED -#define XRPL_PROTOCOL_STXATTESTATIONS_H_INCLUDED +#pragma once #include #include @@ -464,5 +463,3 @@ class XChainCreateAccountAttestations final : public XChainAttestationsBase #include @@ -282,5 +281,3 @@ mulRatio(XRPAmount const& amt, std::uint32_t num, std::uint32_t den, bool roundU } } // namespace xrpl - -#endif // XRPL_BASICS_XRPAMOUNT_H_INCLUDED diff --git a/include/xrpl/protocol/detail/STVar.h b/include/xrpl/protocol/detail/STVar.h index 219d1ed738..b5373d1a4a 100644 --- a/include/xrpl/protocol/detail/STVar.h +++ b/include/xrpl/protocol/detail/STVar.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_STVAR_H_INCLUDED -#define XRPL_PROTOCOL_STVAR_H_INCLUDED +#pragma once #include #include @@ -163,5 +162,3 @@ operator!=(STVar const& lhs, STVar const& rhs) } // namespace detail } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/detail/b58_utils.h b/include/xrpl/protocol/detail/b58_utils.h index 1dce148aed..a34104555e 100644 --- a/include/xrpl/protocol/detail/b58_utils.h +++ b/include/xrpl/protocol/detail/b58_utils.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_B58_UTILS_H_INCLUDED -#define XRPL_PROTOCOL_B58_UTILS_H_INCLUDED +#pragma once #include #include @@ -175,4 +174,3 @@ b58_10_to_b58_be(std::uint64_t input) #endif } // namespace xrpl -#endif // XRPL_PROTOCOL_B58_UTILS_H_INCLUDED diff --git a/include/xrpl/protocol/detail/secp256k1.h b/include/xrpl/protocol/detail/secp256k1.h index 0a2d5fcd8f..0ac810fd80 100644 --- a/include/xrpl/protocol/detail/secp256k1.h +++ b/include/xrpl/protocol/detail/secp256k1.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_SECP256K1_H_INCLUDED -#define XRPL_PROTOCOL_SECP256K1_H_INCLUDED +#pragma once #include @@ -26,5 +25,3 @@ secp256k1Context() } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/detail/token_errors.h b/include/xrpl/protocol/detail/token_errors.h index 1d5276e78b..686851f508 100644 --- a/include/xrpl/protocol/detail/token_errors.h +++ b/include/xrpl/protocol/detail/token_errors.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_TOKEN_ERRORS_H_INCLUDED -#define XRPL_PROTOCOL_TOKEN_ERRORS_H_INCLUDED +#pragma once #include @@ -80,4 +79,3 @@ make_error_code(xrpl::TokenCodecErrc e) return {static_cast(e), TokenCodecErrcCategory()}; } } // namespace xrpl -#endif // TOKEN_ERRORS_H_ diff --git a/include/xrpl/protocol/digest.h b/include/xrpl/protocol/digest.h index bafac699f5..b5ec277e7b 100644 --- a/include/xrpl/protocol/digest.h +++ b/include/xrpl/protocol/digest.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_DIGEST_H_INCLUDED -#define XRPL_PROTOCOL_DIGEST_H_INCLUDED +#pragma once #include #include @@ -227,5 +226,3 @@ sha512Half_s(Args const&... args) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/json_get_or_throw.h b/include/xrpl/protocol/json_get_or_throw.h index 8bc89805d3..7cdf481ad3 100644 --- a/include/xrpl/protocol/json_get_or_throw.h +++ b/include/xrpl/protocol/json_get_or_throw.h @@ -1,5 +1,4 @@ -#ifndef PROTOCOL_GET_OR_THROW_H_ -#define PROTOCOL_GET_OR_THROW_H_ +#pragma once #include #include @@ -152,5 +151,3 @@ getOptional(Json::Value const& v, xrpl::SField const& field) } } // namespace Json - -#endif // PROTOCOL_GET_OR_THROW_H_ diff --git a/include/xrpl/protocol/jss.h b/include/xrpl/protocol/jss.h index d86ca9bf1f..0264f625eb 100644 --- a/include/xrpl/protocol/jss.h +++ b/include/xrpl/protocol/jss.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_JSONFIELDS_H_INCLUDED -#define XRPL_PROTOCOL_JSONFIELDS_H_INCLUDED +#pragma once #include @@ -726,5 +725,3 @@ JSS(write_load); // out: GetCounts } // namespace jss } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/messages.h b/include/xrpl/protocol/messages.h index d14739d532..e6654cc183 100644 --- a/include/xrpl/protocol/messages.h +++ b/include/xrpl/protocol/messages.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_MESSAGES_H_INCLUDED -#define XRPL_PROTOCOL_MESSAGES_H_INCLUDED +#pragma once // Some versions of protobuf generate code that will produce errors during // compilation. See https://github.com/google/protobuf/issues/549 for more @@ -13,5 +12,3 @@ #endif #include - -#endif diff --git a/include/xrpl/protocol/nft.h b/include/xrpl/protocol/nft.h index 3a8cdcd6e2..4be58c381c 100644 --- a/include/xrpl/protocol/nft.h +++ b/include/xrpl/protocol/nft.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_NFT_H_INCLUDED -#define XRPL_PROTOCOL_NFT_H_INCLUDED +#pragma once #include #include @@ -105,5 +104,3 @@ getIssuer(uint256 const& id) } // namespace nft } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/nftPageMask.h b/include/xrpl/protocol/nftPageMask.h index 0877d4976d..05a42ce294 100644 --- a/include/xrpl/protocol/nftPageMask.h +++ b/include/xrpl/protocol/nftPageMask.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_NFT_PAGE_MASK_H_INCLUDED -#define XRPL_PROTOCOL_NFT_PAGE_MASK_H_INCLUDED +#pragma once #include @@ -14,5 +13,3 @@ uint256 constexpr pageMask(std::string_view("00000000000000000000000000000000000 } // namespace nft } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/serialize.h b/include/xrpl/protocol/serialize.h index eedf041baa..5b84a28b5d 100644 --- a/include/xrpl/protocol/serialize.h +++ b/include/xrpl/protocol/serialize.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_SERIALIZE_H_INCLUDED -#define XRPL_PROTOCOL_SERIALIZE_H_INCLUDED +#pragma once #include #include @@ -25,5 +24,3 @@ serializeHex(STObject const& o) } } // namespace xrpl - -#endif diff --git a/include/xrpl/protocol/st.h b/include/xrpl/protocol/st.h index 115c373c7f..61571196f2 100644 --- a/include/xrpl/protocol/st.h +++ b/include/xrpl/protocol/st.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_ST_H_INCLUDED -#define XRPL_PROTOCOL_ST_H_INCLUDED +#pragma once #include #include @@ -17,5 +16,3 @@ #include #include #include - -#endif diff --git a/include/xrpl/protocol/tokens.h b/include/xrpl/protocol/tokens.h index 96b311a366..8cda8efc86 100644 --- a/include/xrpl/protocol/tokens.h +++ b/include/xrpl/protocol/tokens.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PROTOCOL_TOKENS_H_INCLUDED -#define XRPL_PROTOCOL_TOKENS_H_INCLUDED +#pragma once #include #include @@ -100,5 +99,3 @@ b58_to_b256_be(std::string_view input, std::span out); } // namespace b58_fast #endif // _MSC_VER } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/Charge.h b/include/xrpl/resource/Charge.h index 1edaca28b4..55b13731b9 100644 --- a/include/xrpl/resource/Charge.h +++ b/include/xrpl/resource/Charge.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_CHARGE_H_INCLUDED -#define XRPL_RESOURCE_CHARGE_H_INCLUDED +#pragma once #include @@ -50,5 +49,3 @@ operator<<(std::ostream& os, Charge const& v); } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/Consumer.h b/include/xrpl/resource/Consumer.h index 6e973d824c..45cc221212 100644 --- a/include/xrpl/resource/Consumer.h +++ b/include/xrpl/resource/Consumer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_CONSUMER_H_INCLUDED -#define XRPL_RESOURCE_CONSUMER_H_INCLUDED +#pragma once #include #include @@ -82,5 +81,3 @@ operator<<(std::ostream& os, Consumer const& v); } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/Disposition.h b/include/xrpl/resource/Disposition.h index 81675e8376..096afb6a6f 100644 --- a/include/xrpl/resource/Disposition.h +++ b/include/xrpl/resource/Disposition.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_DISPOSITION_H_INCLUDED -#define XRPL_RESOURCE_DISPOSITION_H_INCLUDED +#pragma once namespace xrpl { namespace Resource { @@ -20,5 +19,3 @@ enum Disposition { } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/Fees.h b/include/xrpl/resource/Fees.h index 643a8e624c..0ba083d4fe 100644 --- a/include/xrpl/resource/Fees.h +++ b/include/xrpl/resource/Fees.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_FEES_H_INCLUDED -#define XRPL_RESOURCE_FEES_H_INCLUDED +#pragma once #include @@ -41,5 +40,3 @@ extern Charge const feeDrop; // The cost of being dropped for } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/Gossip.h b/include/xrpl/resource/Gossip.h index dfd04288fc..e581145149 100644 --- a/include/xrpl/resource/Gossip.h +++ b/include/xrpl/resource/Gossip.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_GOSSIP_H_INCLUDED -#define XRPL_RESOURCE_GOSSIP_H_INCLUDED +#pragma once #include @@ -27,5 +26,3 @@ struct Gossip } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/ResourceManager.h b/include/xrpl/resource/ResourceManager.h index 4f331913ef..c04e7bb79b 100644 --- a/include/xrpl/resource/ResourceManager.h +++ b/include/xrpl/resource/ResourceManager.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_MANAGER_H_INCLUDED -#define XRPL_RESOURCE_MANAGER_H_INCLUDED +#pragma once #include #include @@ -62,5 +61,3 @@ make_Manager(beast::insight::Collector::ptr const& collector, beast::Journal jou } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/Types.h b/include/xrpl/resource/Types.h index 8923933f0f..fb71cffe37 100644 --- a/include/xrpl/resource/Types.h +++ b/include/xrpl/resource/Types.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_TYPES_H_INCLUDED -#define XRPL_RESOURCE_TYPES_H_INCLUDED +#pragma once namespace xrpl { namespace Resource { @@ -9,5 +8,3 @@ struct Entry; } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/detail/Entry.h b/include/xrpl/resource/detail/Entry.h index 11f8a08511..ecff8828af 100644 --- a/include/xrpl/resource/detail/Entry.h +++ b/include/xrpl/resource/detail/Entry.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_ENTRY_H_INCLUDED -#define XRPL_RESOURCE_ENTRY_H_INCLUDED +#pragma once #include #include @@ -90,5 +89,3 @@ operator<<(std::ostream& os, Entry const& v) } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/detail/Import.h b/include/xrpl/resource/detail/Import.h index d33bd5f156..790fc0596a 100644 --- a/include/xrpl/resource/detail/Import.h +++ b/include/xrpl/resource/detail/Import.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_IMPORT_H_INCLUDED -#define XRPL_RESOURCE_IMPORT_H_INCLUDED +#pragma once #include #include @@ -32,5 +31,3 @@ struct Import } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/detail/Key.h b/include/xrpl/resource/detail/Key.h index e63d2827ea..0c5164a7d8 100644 --- a/include/xrpl/resource/detail/Key.h +++ b/include/xrpl/resource/detail/Key.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_KEY_H_INCLUDED -#define XRPL_RESOURCE_KEY_H_INCLUDED +#pragma once #include #include @@ -48,5 +47,3 @@ struct Key } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/detail/Kind.h b/include/xrpl/resource/detail/Kind.h index 0e55b65780..fbb6b65e25 100644 --- a/include/xrpl/resource/detail/Kind.h +++ b/include/xrpl/resource/detail/Kind.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_KIND_H_INCLUDED -#define XRPL_RESOURCE_KIND_H_INCLUDED +#pragma once namespace xrpl { namespace Resource { @@ -16,5 +15,3 @@ enum Kind { kindInbound, kindOutbound, kindUnlimited }; } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/detail/Logic.h b/include/xrpl/resource/detail/Logic.h index e12d02b996..066e416550 100644 --- a/include/xrpl/resource/detail/Logic.h +++ b/include/xrpl/resource/detail/Logic.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_LOGIC_H_INCLUDED -#define XRPL_RESOURCE_LOGIC_H_INCLUDED +#pragma once #include #include @@ -548,5 +547,3 @@ public: } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/resource/detail/Tuning.h b/include/xrpl/resource/detail/Tuning.h index 9d7ba31303..d5be5cf0b6 100644 --- a/include/xrpl/resource/detail/Tuning.h +++ b/include/xrpl/resource/detail/Tuning.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RESOURCE_TUNING_H_INCLUDED -#define XRPL_RESOURCE_TUNING_H_INCLUDED +#pragma once #include @@ -33,5 +32,3 @@ std::chrono::seconds constexpr gossipExpirationSeconds{30}; } // namespace Resource } // namespace xrpl - -#endif diff --git a/include/xrpl/server/Handoff.h b/include/xrpl/server/Handoff.h index 2edb6e2203..60ed16def4 100644 --- a/include/xrpl/server/Handoff.h +++ b/include/xrpl/server/Handoff.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_HANDOFF_H_INCLUDED -#define XRPL_SERVER_HANDOFF_H_INCLUDED +#pragma once #include @@ -35,5 +34,3 @@ struct Handoff }; } // namespace xrpl - -#endif diff --git a/include/xrpl/server/Port.h b/include/xrpl/server/Port.h index 995401f8fd..1dfa93b0a7 100644 --- a/include/xrpl/server/Port.h +++ b/include/xrpl/server/Port.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_PORT_H_INCLUDED -#define XRPL_SERVER_PORT_H_INCLUDED +#pragma once #include #include @@ -105,5 +104,3 @@ void parse_Port(ParsedPort& port, Section const& section, std::ostream& log); } // namespace xrpl - -#endif diff --git a/include/xrpl/server/Server.h b/include/xrpl/server/Server.h index 7bc7765cea..52340ac900 100644 --- a/include/xrpl/server/Server.h +++ b/include/xrpl/server/Server.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_SERVER_H_INCLUDED -#define XRPL_SERVER_SERVER_H_INCLUDED +#pragma once #include #include @@ -19,5 +18,3 @@ make_Server(Handler& handler, boost::asio::io_context& io_context, beast::Journa } } // namespace xrpl - -#endif diff --git a/include/xrpl/server/Session.h b/include/xrpl/server/Session.h index e2c640b827..37cbf59775 100644 --- a/include/xrpl/server/Session.h +++ b/include/xrpl/server/Session.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_SESSION_H_INCLUDED -#define XRPL_SERVER_SESSION_H_INCLUDED +#pragma once #include #include @@ -110,5 +109,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/server/SimpleWriter.h b/include/xrpl/server/SimpleWriter.h index 75af7169fc..87b94507a4 100644 --- a/include/xrpl/server/SimpleWriter.h +++ b/include/xrpl/server/SimpleWriter.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_SIMPLEWRITER_H_INCLUDED -#define XRPL_SERVER_SIMPLEWRITER_H_INCLUDED +#pragma once #include @@ -55,5 +54,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/server/WSSession.h b/include/xrpl/server/WSSession.h index b2d116bb45..56105739e9 100644 --- a/include/xrpl/server/WSSession.h +++ b/include/xrpl/server/WSSession.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_WSSESSION_H_INCLUDED -#define XRPL_SERVER_WSSESSION_H_INCLUDED +#pragma once #include #include @@ -125,5 +124,3 @@ struct WSSession }; } // namespace xrpl - -#endif diff --git a/include/xrpl/server/Writer.h b/include/xrpl/server/Writer.h index 7e0c304ea9..05fea863be 100644 --- a/include/xrpl/server/Writer.h +++ b/include/xrpl/server/Writer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_WRITER_H_INCLUDED -#define XRPL_SERVER_WRITER_H_INCLUDED +#pragma once #include @@ -38,5 +37,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/BaseHTTPPeer.h b/include/xrpl/server/detail/BaseHTTPPeer.h index 2a2c523e2b..ab85cb7c89 100644 --- a/include/xrpl/server/detail/BaseHTTPPeer.h +++ b/include/xrpl/server/detail/BaseHTTPPeer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_BASEHTTPPEER_H_INCLUDED -#define XRPL_SERVER_BASEHTTPPEER_H_INCLUDED +#pragma once #include #include @@ -457,5 +456,3 @@ BaseHTTPPeer::close(bool graceful) } } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/BasePeer.h b/include/xrpl/server/detail/BasePeer.h index cbd8ac2c8d..afa1ceb993 100644 --- a/include/xrpl/server/detail/BasePeer.h +++ b/include/xrpl/server/detail/BasePeer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_BASEPEER_H_INCLUDED -#define XRPL_SERVER_BASEPEER_H_INCLUDED +#pragma once #include #include @@ -88,5 +87,3 @@ BasePeer::close() } } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/BaseWSPeer.h b/include/xrpl/server/detail/BaseWSPeer.h index 435930e476..ab985dfac5 100644 --- a/include/xrpl/server/detail/BaseWSPeer.h +++ b/include/xrpl/server/detail/BaseWSPeer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_BASEWSPEER_H_INCLUDED -#define XRPL_SERVER_BASEWSPEER_H_INCLUDED +#pragma once #include #include @@ -451,5 +450,3 @@ BaseWSPeer::fail(error_code ec, String const& what) } } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/Door.h b/include/xrpl/server/detail/Door.h index 9177d373bc..e41049f203 100644 --- a/include/xrpl/server/detail/Door.h +++ b/include/xrpl/server/detail/Door.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_DOOR_H_INCLUDED -#define XRPL_SERVER_DOOR_H_INCLUDED +#pragma once #include #include @@ -424,5 +423,3 @@ Door::should_throttle_for_fds() } } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/JSONRPCUtil.h b/include/xrpl/server/detail/JSONRPCUtil.h index 2d4f6a6771..934085f8e6 100644 --- a/include/xrpl/server/detail/JSONRPCUtil.h +++ b/include/xrpl/server/detail/JSONRPCUtil.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_JSONRPCUTIL_H_INCLUDED -#define XRPL_SERVER_JSONRPCUTIL_H_INCLUDED +#pragma once #include #include @@ -11,5 +10,3 @@ void HTTPReply(int nStatus, std::string const& strMsg, Json::Output const&, beast::Journal j); } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/LowestLayer.h b/include/xrpl/server/detail/LowestLayer.h index c45d948241..b8b0d46180 100644 --- a/include/xrpl/server/detail/LowestLayer.h +++ b/include/xrpl/server/detail/LowestLayer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_LOWESTLAYER_H_INCLUDED -#define XRPL_SERVER_LOWESTLAYER_H_INCLUDED +#pragma once #if BOOST_VERSION >= 107000 #include @@ -22,5 +21,3 @@ get_lowest_layer(T& t) noexcept } } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/PlainHTTPPeer.h b/include/xrpl/server/detail/PlainHTTPPeer.h index 834a99aae8..94c84336f9 100644 --- a/include/xrpl/server/detail/PlainHTTPPeer.h +++ b/include/xrpl/server/detail/PlainHTTPPeer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_PLAINHTTPPEER_H_INCLUDED -#define XRPL_SERVER_PLAINHTTPPEER_H_INCLUDED +#pragma once #include #include @@ -140,5 +139,3 @@ PlainHTTPPeer::do_close() } } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/PlainWSPeer.h b/include/xrpl/server/detail/PlainWSPeer.h index 4d5c57533b..9196d5ea49 100644 --- a/include/xrpl/server/detail/PlainWSPeer.h +++ b/include/xrpl/server/detail/PlainWSPeer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_PLAINWSPEER_H_INCLUDED -#define XRPL_SERVER_PLAINWSPEER_H_INCLUDED +#pragma once #include @@ -59,5 +58,3 @@ PlainWSPeer::PlainWSPeer( } } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/SSLHTTPPeer.h b/include/xrpl/server/detail/SSLHTTPPeer.h index b0102ac24b..138145544e 100644 --- a/include/xrpl/server/detail/SSLHTTPPeer.h +++ b/include/xrpl/server/detail/SSLHTTPPeer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_SSLHTTPPEER_H_INCLUDED -#define XRPL_SERVER_SSLHTTPPEER_H_INCLUDED +#pragma once #include #include @@ -175,5 +174,3 @@ SSLHTTPPeer::on_shutdown(error_code ec) } } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/SSLWSPeer.h b/include/xrpl/server/detail/SSLWSPeer.h index bb5da1c6e7..b80312e55f 100644 --- a/include/xrpl/server/detail/SSLWSPeer.h +++ b/include/xrpl/server/detail/SSLWSPeer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_SSLWSPEER_H_INCLUDED -#define XRPL_SERVER_SSLWSPEER_H_INCLUDED +#pragma once #include #include @@ -68,5 +67,3 @@ SSLWSPeer::SSLWSPeer( } } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/ServerImpl.h b/include/xrpl/server/detail/ServerImpl.h index e341eac849..e836b964d2 100644 --- a/include/xrpl/server/detail/ServerImpl.h +++ b/include/xrpl/server/detail/ServerImpl.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_SERVERIMPL_H_INCLUDED -#define XRPL_SERVER_SERVERIMPL_H_INCLUDED +#pragma once #include #include @@ -180,5 +179,3 @@ ServerImpl::closed() return ios_.closed(); } } // namespace xrpl - -#endif diff --git a/include/xrpl/server/detail/Spawn.h b/include/xrpl/server/detail/Spawn.h index 1fbf9e7003..d94fb4fa05 100644 --- a/include/xrpl/server/detail/Spawn.h +++ b/include/xrpl/server/detail/Spawn.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_SPAWN_H_INCLUDED -#define XRPL_SERVER_SPAWN_H_INCLUDED +#pragma once #include @@ -79,5 +78,3 @@ spawn(Ctx&& ctx, F&& func) } } // namespace xrpl::util - -#endif diff --git a/include/xrpl/server/detail/io_list.h b/include/xrpl/server/detail/io_list.h index e60c33d084..5b1a02e039 100644 --- a/include/xrpl/server/detail/io_list.h +++ b/include/xrpl/server/detail/io_list.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_IO_LIST_H_INCLUDED -#define XRPL_SERVER_IO_LIST_H_INCLUDED +#pragma once #include @@ -243,5 +242,3 @@ io_list::join() } } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/Family.h b/include/xrpl/shamap/Family.h index 6638d67df8..73887fb2dc 100644 --- a/include/xrpl/shamap/Family.h +++ b/include/xrpl/shamap/Family.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_FAMILY_H_INCLUDED -#define XRPL_SHAMAP_FAMILY_H_INCLUDED +#pragma once #include #include @@ -66,5 +65,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/FullBelowCache.h b/include/xrpl/shamap/FullBelowCache.h index 4b7a9aae67..6a6da1463a 100644 --- a/include/xrpl/shamap/FullBelowCache.h +++ b/include/xrpl/shamap/FullBelowCache.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_FULLBELOWCACHE_H_INCLUDED -#define XRPL_SHAMAP_FULLBELOWCACHE_H_INCLUDED +#pragma once #include #include @@ -129,5 +128,3 @@ private: using FullBelowCache = detail::BasicFullBelowCache; } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/SHAMap.h b/include/xrpl/shamap/SHAMap.h index 9013b3cc9c..cd084ab48b 100644 --- a/include/xrpl/shamap/SHAMap.h +++ b/include/xrpl/shamap/SHAMap.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAP_H_INCLUDED -#define XRPL_SHAMAP_SHAMAP_H_INCLUDED +#pragma once #include #include @@ -678,5 +677,3 @@ SHAMap::end() const } } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/SHAMapAccountStateLeafNode.h b/include/xrpl/shamap/SHAMapAccountStateLeafNode.h index c622d68a1f..552d2b4692 100644 --- a/include/xrpl/shamap/SHAMapAccountStateLeafNode.h +++ b/include/xrpl/shamap/SHAMapAccountStateLeafNode.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAPACCOUNTSTATELEAFNODE_H_INCLUDED -#define XRPL_SHAMAP_SHAMAPACCOUNTSTATELEAFNODE_H_INCLUDED +#pragma once #include #include @@ -60,5 +59,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/SHAMapAddNode.h b/include/xrpl/shamap/SHAMapAddNode.h index 2dc3d15486..7d0aaf3be4 100644 --- a/include/xrpl/shamap/SHAMapAddNode.h +++ b/include/xrpl/shamap/SHAMapAddNode.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAPADDNODE_H_INCLUDED -#define XRPL_SHAMAP_SHAMAPADDNODE_H_INCLUDED +#pragma once #include @@ -161,5 +160,3 @@ SHAMapAddNode::get() const } } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/SHAMapInnerNode.h b/include/xrpl/shamap/SHAMapInnerNode.h index eab60f0348..73d59cc1fe 100644 --- a/include/xrpl/shamap/SHAMapInnerNode.h +++ b/include/xrpl/shamap/SHAMapInnerNode.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAPINNERNODE_H_INCLUDED -#define XRPL_SHAMAP_SHAMAPINNERNODE_H_INCLUDED +#pragma once #include #include @@ -200,4 +199,3 @@ SHAMapInnerNode::setFullBelowGen(std::uint32_t gen) } } // namespace xrpl -#endif diff --git a/include/xrpl/shamap/SHAMapItem.h b/include/xrpl/shamap/SHAMapItem.h index a67dfd866c..ab9cf74dc8 100644 --- a/include/xrpl/shamap/SHAMapItem.h +++ b/include/xrpl/shamap/SHAMapItem.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAPITEM_H_INCLUDED -#define XRPL_SHAMAP_SHAMAPITEM_H_INCLUDED +#pragma once #include #include @@ -163,5 +162,3 @@ make_shamapitem(SHAMapItem const& other) } } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/SHAMapLeafNode.h b/include/xrpl/shamap/SHAMapLeafNode.h index 4d18fc9108..aedcb3b79c 100644 --- a/include/xrpl/shamap/SHAMapLeafNode.h +++ b/include/xrpl/shamap/SHAMapLeafNode.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAPLEAFNODE_H_INCLUDED -#define XRPL_SHAMAP_SHAMAPLEAFNODE_H_INCLUDED +#pragma once #include #include @@ -55,5 +54,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/SHAMapMissingNode.h b/include/xrpl/shamap/SHAMapMissingNode.h index 2b9e71dfed..f1670587eb 100644 --- a/include/xrpl/shamap/SHAMapMissingNode.h +++ b/include/xrpl/shamap/SHAMapMissingNode.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAPMISSINGNODE_H_INCLUDED -#define XRPL_SHAMAP_SHAMAPMISSINGNODE_H_INCLUDED +#pragma once #include #include @@ -48,5 +47,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/SHAMapNodeID.h b/include/xrpl/shamap/SHAMapNodeID.h index 9155b6db39..3517246f90 100644 --- a/include/xrpl/shamap/SHAMapNodeID.h +++ b/include/xrpl/shamap/SHAMapNodeID.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAPNODEID_H_INCLUDED -#define XRPL_SHAMAP_SHAMAPNODEID_H_INCLUDED +#pragma once #include #include @@ -139,5 +138,3 @@ deserializeSHAMapNodeID(std::string const& s) selectBranch(SHAMapNodeID const& id, uint256 const& hash); } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/SHAMapSyncFilter.h b/include/xrpl/shamap/SHAMapSyncFilter.h index 32923c741a..219f9ac558 100644 --- a/include/xrpl/shamap/SHAMapSyncFilter.h +++ b/include/xrpl/shamap/SHAMapSyncFilter.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAPSYNCFILTER_H_INCLUDED -#define XRPL_SHAMAP_SHAMAPSYNCFILTER_H_INCLUDED +#pragma once #include @@ -27,5 +26,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/SHAMapTreeNode.h b/include/xrpl/shamap/SHAMapTreeNode.h index 91adc8a88e..668f658754 100644 --- a/include/xrpl/shamap/SHAMapTreeNode.h +++ b/include/xrpl/shamap/SHAMapTreeNode.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAPTREENODE_H_INCLUDED -#define XRPL_SHAMAP_SHAMAPTREENODE_H_INCLUDED +#pragma once #include #include @@ -168,5 +167,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/SHAMapTxLeafNode.h b/include/xrpl/shamap/SHAMapTxLeafNode.h index 0552a86759..0a44380b9b 100644 --- a/include/xrpl/shamap/SHAMapTxLeafNode.h +++ b/include/xrpl/shamap/SHAMapTxLeafNode.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAPTXLEAFNODE_H_INCLUDED -#define XRPL_SHAMAP_SHAMAPTXLEAFNODE_H_INCLUDED +#pragma once #include #include @@ -58,5 +57,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h b/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h index 4d1dbf0a3a..d11cc87ff7 100644 --- a/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h +++ b/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_SHAMAPLEAFTXPLUSMETANODE_H_INCLUDED -#define XRPL_SHAMAP_SHAMAPLEAFTXPLUSMETANODE_H_INCLUDED +#pragma once #include #include @@ -60,5 +59,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/TreeNodeCache.h b/include/xrpl/shamap/TreeNodeCache.h index bf9797c745..4edb6348ec 100644 --- a/include/xrpl/shamap/TreeNodeCache.h +++ b/include/xrpl/shamap/TreeNodeCache.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_TREENODECACHE_H_INCLUDED -#define XRPL_SHAMAP_TREENODECACHE_H_INCLUDED +#pragma once #include #include @@ -14,5 +13,3 @@ using TreeNodeCache = TaggedCache< intr_ptr::SharedWeakUnionPtr, intr_ptr::SharedPtr>; } // namespace xrpl - -#endif diff --git a/include/xrpl/shamap/detail/TaggedPointer.h b/include/xrpl/shamap/detail/TaggedPointer.h index e66568035b..217cd93d0a 100644 --- a/include/xrpl/shamap/detail/TaggedPointer.h +++ b/include/xrpl/shamap/detail/TaggedPointer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_TAGGEDPOINTER_H_INCLUDED -#define XRPL_SHAMAP_TAGGEDPOINTER_H_INCLUDED +#pragma once #include #include @@ -221,5 +220,3 @@ popcnt16(std::uint16_t a) } } // namespace xrpl - -#endif diff --git a/src/test/csf/BasicNetwork.h b/src/test/csf/BasicNetwork.h index 24d762deb0..697b20c2c7 100644 --- a/src/test/csf/BasicNetwork.h +++ b/src/test/csf/BasicNetwork.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_BASICNETWORK_H_INCLUDED -#define XRPL_TEST_CSF_BASICNETWORK_H_INCLUDED +#pragma once #include #include @@ -228,5 +227,3 @@ BasicNetwork::send(Peer const& from, Peer const& to, Function&& f) } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/CollectorRef.h b/src/test/csf/CollectorRef.h index 022db01008..735a42ab16 100644 --- a/src/test/csf/CollectorRef.h +++ b/src/test/csf/CollectorRef.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_COLLECTOREF_H_INCLUDED -#define XRPL_TEST_CSF_COLLECTOREF_H_INCLUDED +#pragma once #include #include @@ -328,5 +327,3 @@ public: } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/Digraph.h b/src/test/csf/Digraph.h index 85baecc813..672445ca95 100644 --- a/src/test/csf/Digraph.h +++ b/src/test/csf/Digraph.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_DIGRAPH_H_INCLUDED -#define XRPL_TEST_CSF_DIGRAPH_H_INCLUDED +#pragma once #include #include @@ -228,4 +227,3 @@ public: } // namespace csf } // namespace test } // namespace xrpl -#endif diff --git a/src/test/csf/Histogram.h b/src/test/csf/Histogram.h index 61ec680939..9e7b471a2b 100644 --- a/src/test/csf/Histogram.h +++ b/src/test/csf/Histogram.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_HISTOGRAM_H_INCLUDED -#define XRPL_TEST_CSF_HISTOGRAM_H_INCLUDED +#pragma once #include #include @@ -112,5 +111,3 @@ public: } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/Peer.h b/src/test/csf/Peer.h index e0bc7059a2..7b19c977d6 100644 --- a/src/test/csf/Peer.h +++ b/src/test/csf/Peer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_PEER_H_INCLUDED -#define XRPL_TEST_CSF_PEER_H_INCLUDED +#pragma once #include #include @@ -937,4 +936,3 @@ struct Peer } // namespace csf } // namespace test } // namespace xrpl -#endif diff --git a/src/test/csf/PeerGroup.h b/src/test/csf/PeerGroup.h index 35a4983e4e..ce7325f659 100644 --- a/src/test/csf/PeerGroup.h +++ b/src/test/csf/PeerGroup.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_PEERGROUP_H_INCLUDED -#define XRPL_TEST_CSF_PEERGROUP_H_INCLUDED +#pragma once #include #include @@ -340,4 +339,3 @@ randomRankedConnect( } // namespace csf } // namespace test } // namespace xrpl -#endif diff --git a/src/test/csf/Proposal.h b/src/test/csf/Proposal.h index 0bcf838080..641fd2010a 100644 --- a/src/test/csf/Proposal.h +++ b/src/test/csf/Proposal.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_PROPOSAL_H_INCLUDED -#define XRPL_TEST_CSF_PROPOSAL_H_INCLUDED +#pragma once #include #include @@ -18,5 +17,3 @@ using Proposal = ConsensusProposal; } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/Scheduler.h b/src/test/csf/Scheduler.h index e6d53f045b..2f7535ef16 100644 --- a/src/test/csf/Scheduler.h +++ b/src/test/csf/Scheduler.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_SCHEDULER_H_INCLUDED -#define XRPL_TEST_CSF_SCHEDULER_H_INCLUDED +#pragma once #include #include @@ -428,5 +427,3 @@ Scheduler::step_for(std::chrono::duration const& amount) } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/Sim.h b/src/test/csf/Sim.h index ff99896e99..709226b216 100644 --- a/src/test/csf/Sim.h +++ b/src/test/csf/Sim.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_SIM_H_INCLUDED -#define XRPL_TEST_CSF_SIM_H_INCLUDED +#pragma once #include #include @@ -148,5 +147,3 @@ public: } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/SimTime.h b/src/test/csf/SimTime.h index 5d8c67b8f8..2131de9b41 100644 --- a/src/test/csf/SimTime.h +++ b/src/test/csf/SimTime.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_SIMTIME_H_INCLUDED -#define XRPL_TEST_CSF_SIMTIME_H_INCLUDED +#pragma once #include @@ -20,5 +19,3 @@ using SimTime = typename SimClock::time_point; } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/TrustGraph.h b/src/test/csf/TrustGraph.h index 2eb8dac418..d25925ad38 100644 --- a/src/test/csf/TrustGraph.h +++ b/src/test/csf/TrustGraph.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_UNL_H_INCLUDED -#define XRPL_TEST_CSF_UNL_H_INCLUDED +#pragma once #include @@ -150,5 +149,3 @@ public: } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/Tx.h b/src/test/csf/Tx.h index 1f355829c8..20c90cbac5 100644 --- a/src/test/csf/Tx.h +++ b/src/test/csf/Tx.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_TX_H_INCLUDED -#define XRPL_TEST_CSF_TX_H_INCLUDED +#pragma once #include #include @@ -207,5 +206,3 @@ hash_append(Hasher& h, Tx const& tx) } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/Validation.h b/src/test/csf/Validation.h index 3ec720e7d2..5ebbcf3ae5 100644 --- a/src/test/csf/Validation.h +++ b/src/test/csf/Validation.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_VALIDATION_H_INCLUDED -#define XRPL_TEST_CSF_VALIDATION_H_INCLUDED +#pragma once #include @@ -176,5 +175,3 @@ public: } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/collectors.h b/src/test/csf/collectors.h index 5669b8a380..20fc31a01f 100644 --- a/src/test/csf/collectors.h +++ b/src/test/csf/collectors.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_COLLECTORS_H_INCLUDED -#define XRPL_TEST_CSF_COLLECTORS_H_INCLUDED +#pragma once #include #include @@ -641,5 +640,3 @@ struct JumpCollector } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/events.h b/src/test/csf/events.h index 29f434f4ad..2aae22d125 100644 --- a/src/test/csf/events.h +++ b/src/test/csf/events.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_EVENTS_H_INCLUDED -#define XRPL_TEST_CSF_EVENTS_H_INCLUDED +#pragma once #include #include @@ -130,5 +129,3 @@ struct FullyValidateLedger } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/ledgers.h b/src/test/csf/ledgers.h index d28abeed4b..d78c7c29fa 100644 --- a/src/test/csf/ledgers.h +++ b/src/test/csf/ledgers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_LEDGERS_H_INCLUDED -#define XRPL_TEST_CSF_LEDGERS_H_INCLUDED +#pragma once #include @@ -330,5 +329,3 @@ struct LedgerHistoryHelper } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/random.h b/src/test/csf/random.h index 12ff03cd64..fc5098af32 100644 --- a/src/test/csf/random.h +++ b/src/test/csf/random.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_RANDOM_H_INCLUDED -#define XRPL_TEST_CSF_RANDOM_H_INCLUDED +#pragma once #include #include @@ -153,5 +152,3 @@ public: } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/submitters.h b/src/test/csf/submitters.h index fce5562014..2300b91388 100644 --- a/src/test/csf/submitters.h +++ b/src/test/csf/submitters.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_SUBMITTERS_H_INCLUDED -#define XRPL_TEST_CSF_SUBMITTERS_H_INCLUDED +#pragma once #include #include @@ -97,5 +96,3 @@ makeSubmitter(Distribution dist, SimTime start, SimTime end, Selector& sel, Sche } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/csf/timers.h b/src/test/csf/timers.h index 0823dbe9b9..a071844a41 100644 --- a/src/test/csf/timers.h +++ b/src/test/csf/timers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_CSF_TIMERS_H_INCLUDED -#define XRPL_TEST_CSF_TIMERS_H_INCLUDED +#pragma once #include #include @@ -61,5 +60,3 @@ public: } // namespace csf } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/json/TestOutputSuite.h b/src/test/json/TestOutputSuite.h index 934fe1de81..88b7e22580 100644 --- a/src/test/json/TestOutputSuite.h +++ b/src/test/json/TestOutputSuite.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_TESTOUTPUTSUITE_H_INCLUDED -#define XRPL_RPC_TESTOUTPUTSUITE_H_INCLUDED +#pragma once #include @@ -35,5 +34,3 @@ protected: } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx.h b/src/test/jtx.h index 1d7f38ff54..903b029f29 100644 --- a/src/test/jtx.h +++ b/src/test/jtx.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_H_INCLUDED -#define XRPL_TEST_JTX_H_INCLUDED +#pragma once // Convenience header that includes everything @@ -60,5 +59,3 @@ #include #include - -#endif diff --git a/src/test/jtx/AMM.h b/src/test/jtx/AMM.h index 54f5e94d03..4d8059d172 100644 --- a/src/test/jtx/AMM.h +++ b/src/test/jtx/AMM.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_AMM_H_INCLUDED -#define XRPL_TEST_JTX_AMM_H_INCLUDED +#pragma once #include #include @@ -415,5 +414,3 @@ ammClawback( } // namespace jtx } // namespace test } // namespace xrpl - -#endif // XRPL_TEST_JTX_AMM_H_INCLUDED diff --git a/src/test/jtx/AMMTest.h b/src/test/jtx/AMMTest.h index f468b0ebad..be6e228c0a 100644 --- a/src/test/jtx/AMMTest.h +++ b/src/test/jtx/AMMTest.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_AMMTEST_H_INCLUDED -#define XRPL_TEST_JTX_AMMTEST_H_INCLUDED +#pragma once #include #include @@ -159,5 +158,3 @@ protected: } // namespace jtx } // namespace test } // namespace xrpl - -#endif // XRPL_TEST_JTX_AMMTEST_H_INCLUDED diff --git a/src/test/jtx/AbstractClient.h b/src/test/jtx/AbstractClient.h index 0bdfbd67de..9b1ef178ca 100644 --- a/src/test/jtx/AbstractClient.h +++ b/src/test/jtx/AbstractClient.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_ABSTRACTCLIENT_H_INCLUDED -#define XRPL_TEST_ABSTRACTCLIENT_H_INCLUDED +#pragma once #include @@ -41,5 +40,3 @@ public: } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/Account.h b/src/test/jtx/Account.h index 2f35d71a5c..6f796e08b3 100644 --- a/src/test/jtx/Account.h +++ b/src/test/jtx/Account.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_ACCOUNT_H_INCLUDED -#define XRPL_TEST_JTX_ACCOUNT_H_INCLUDED +#pragma once #include #include @@ -147,5 +146,3 @@ operator<=>(Account const& lhs, Account const& rhs) noexcept } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/CaptureLogs.h b/src/test/jtx/CaptureLogs.h index 89f207a2fc..f8d0449977 100644 --- a/src/test/jtx/CaptureLogs.h +++ b/src/test/jtx/CaptureLogs.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_CAPTURELOGS_H_INCLUDED -#define XRPL_TEST_JTX_CAPTURELOGS_H_INCLUDED +#pragma once #include @@ -66,5 +65,3 @@ public: } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/CheckMessageLogs.h b/src/test/jtx/CheckMessageLogs.h index 83aa73a337..286cfa1844 100644 --- a/src/test/jtx/CheckMessageLogs.h +++ b/src/test/jtx/CheckMessageLogs.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_CHECKMESSAGELOGS_H_INCLUDED -#define XRPL_TEST_JTX_CHECKMESSAGELOGS_H_INCLUDED +#pragma once #include @@ -58,5 +57,3 @@ public: } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/Env.h b/src/test/jtx/Env.h index 1c07ac2d00..ef6240d48a 100644 --- a/src/test/jtx/Env.h +++ b/src/test/jtx/Env.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_ENV_H_INCLUDED -#define XRPL_TEST_JTX_ENV_H_INCLUDED +#pragma once #include #include @@ -779,5 +778,3 @@ Env::rpc(std::string const& cmd, Args&&... args) } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/Env_ss.h b/src/test/jtx/Env_ss.h index 734eca5819..78146a04a4 100644 --- a/src/test/jtx/Env_ss.h +++ b/src/test/jtx/Env_ss.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_ENV_SS_H_INCLUDED -#define XRPL_TEST_JTX_ENV_SS_H_INCLUDED +#pragma once #include @@ -60,5 +59,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/JSONRPCClient.h b/src/test/jtx/JSONRPCClient.h index 0513b43a93..41129a36ec 100644 --- a/src/test/jtx/JSONRPCClient.h +++ b/src/test/jtx/JSONRPCClient.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_HTTPCLIENT_H_INCLUDED -#define XRPL_TEST_HTTPCLIENT_H_INCLUDED +#pragma once #include @@ -16,5 +15,3 @@ makeJSONRPCClient(Config const& cfg, unsigned rpc_version = 2); } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/JTx.h b/src/test/jtx/JTx.h index 1568df5f18..90fbb8a6b6 100644 --- a/src/test/jtx/JTx.h +++ b/src/test/jtx/JTx.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_JTX_H_INCLUDED -#define XRPL_TEST_JTX_JTX_H_INCLUDED +#pragma once #include #include @@ -159,5 +158,3 @@ private: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/ManualTimeKeeper.h b/src/test/jtx/ManualTimeKeeper.h index df3c7ff89a..d5fdd467e1 100644 --- a/src/test/jtx/ManualTimeKeeper.h +++ b/src/test/jtx/ManualTimeKeeper.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_MANUALTIMEKEEPER_H_INCLUDED -#define XRPL_TEST_MANUALTIMEKEEPER_H_INCLUDED +#pragma once #include @@ -31,5 +30,3 @@ public: } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/Oracle.h b/src/test/jtx/Oracle.h index 6d993c436e..da241c0ce8 100644 --- a/src/test/jtx/Oracle.h +++ b/src/test/jtx/Oracle.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_ORACLE_H_INCLUDED -#define XRPL_TEST_JTX_ORACLE_H_INCLUDED +#pragma once #include @@ -181,5 +180,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif // XRPL_TEST_JTX_ORACLE_H_INCLUDED diff --git a/src/test/jtx/PathSet.h b/src/test/jtx/PathSet.h index fe96a9884a..3f30d7193f 100644 --- a/src/test/jtx/PathSet.h +++ b/src/test/jtx/PathSet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_LEDGER_TESTS_PATHSET_H_INCLUDED -#define XRPL_LEDGER_TESTS_PATHSET_H_INCLUDED +#pragma once #include @@ -159,5 +158,3 @@ private: } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/SignerUtils.h b/src/test/jtx/SignerUtils.h index 4c0218f6b4..37b1d85ec7 100644 --- a/src/test/jtx/SignerUtils.h +++ b/src/test/jtx/SignerUtils.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_SIGNERUTILS_H_INCLUDED -#define XRPL_TEST_JTX_SIGNERUTILS_H_INCLUDED +#pragma once #include @@ -47,5 +46,3 @@ sortSigners(std::vector& signers) } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/TestHelpers.h b/src/test/jtx/TestHelpers.h index ccf270867c..aea9edeb93 100644 --- a/src/test/jtx/TestHelpers.h +++ b/src/test/jtx/TestHelpers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_TESTHELPERS_H_INCLUDED -#define XRPL_TEST_JTX_TESTHELPERS_H_INCLUDED +#pragma once #include @@ -735,5 +734,3 @@ pay(AccountID const& account, uint256 const& loanID, STAmount const& amount, std } // namespace jtx } // namespace test } // namespace xrpl - -#endif // XRPL_TEST_JTX_TESTHELPERS_H_INCLUDED diff --git a/src/test/jtx/TestSuite.h b/src/test/jtx/TestSuite.h index e54bc7d131..1558f68d39 100644 --- a/src/test/jtx/TestSuite.h +++ b/src/test/jtx/TestSuite.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_TESTSUITE_H_INCLUDED -#define XRPL_BASICS_TESTSUITE_H_INCLUDED +#pragma once #include @@ -112,5 +111,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/test/jtx/TrustedPublisherServer.h b/src/test/jtx/TrustedPublisherServer.h index 2d5b98417b..a46e98ad50 100644 --- a/src/test/jtx/TrustedPublisherServer.h +++ b/src/test/jtx/TrustedPublisherServer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_TRUSTED_PUBLISHER_SERVER_H_INCLUDED -#define XRPL_TEST_TRUSTED_PUBLISHER_SERVER_H_INCLUDED +#pragma once #include @@ -647,4 +646,3 @@ make_TrustedPublisherServer( } // namespace test } // namespace xrpl -#endif diff --git a/src/test/jtx/WSClient.h b/src/test/jtx/WSClient.h index 9e9fb60bfc..86b81ac0ac 100644 --- a/src/test/jtx/WSClient.h +++ b/src/test/jtx/WSClient.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_WSCLIENT_H_INCLUDED -#define XRPL_TEST_WSCLIENT_H_INCLUDED +#pragma once #include @@ -34,5 +33,3 @@ makeWSClient( } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/account_txn_id.h b/src/test/jtx/account_txn_id.h index fb48941925..71ac606418 100644 --- a/src/test/jtx/account_txn_id.h +++ b/src/test/jtx/account_txn_id.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_ACCOUNT_TXN_ID_H_INCLUDED -#define XRPL_TEST_JTX_ACCOUNT_TXN_ID_H_INCLUDED +#pragma once #include @@ -23,4 +22,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl -#endif diff --git a/src/test/jtx/acctdelete.h b/src/test/jtx/acctdelete.h index f5d1f7d869..c081eb92a5 100644 --- a/src/test/jtx/acctdelete.h +++ b/src/test/jtx/acctdelete.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_ACCTDELETE_H_INCLUDED -#define XRPL_TEST_JTX_ACCTDELETE_H_INCLUDED +#pragma once #include #include @@ -24,5 +23,3 @@ incLgrSeqForAccDel(jtx::Env& env, jtx::Account const& acc, std::uint32_t margin } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/amount.h b/src/test/jtx/amount.h index 958160224d..c7b66504d3 100644 --- a/src/test/jtx/amount.h +++ b/src/test/jtx/amount.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_AMOUNT_H_INCLUDED -#define XRPL_TEST_JTX_AMOUNT_H_INCLUDED +#pragma once #include #include @@ -588,5 +587,3 @@ extern any_t const any; } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/attester.h b/src/test/jtx/attester.h index 345002f90a..6904135f21 100644 --- a/src/test/jtx/attester.h +++ b/src/test/jtx/attester.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_ATTESTER_H_INCLUDED -#define XRPL_TEST_JTX_ATTESTER_H_INCLUDED +#pragma once #include #include @@ -44,5 +43,3 @@ sign_create_account_attestation( } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/balance.h b/src/test/jtx/balance.h index 741bbcb195..83e2e3ea03 100644 --- a/src/test/jtx/balance.h +++ b/src/test/jtx/balance.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_BALANCE_H_INCLUDED -#define XRPL_TEST_JTX_BALANCE_H_INCLUDED +#pragma once #include #include @@ -43,5 +42,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/basic_prop.h b/src/test/jtx/basic_prop.h index 32655e9f52..080eecd34b 100644 --- a/src/test/jtx/basic_prop.h +++ b/src/test/jtx/basic_prop.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_BASIC_PROP_H_INCLUDED -#define XRPL_TEST_JTX_BASIC_PROP_H_INCLUDED +#pragma once #include @@ -42,5 +41,3 @@ struct prop_type : basic_prop } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/batch.h b/src/test/jtx/batch.h index 51ded4ee1b..c11a9fe17e 100644 --- a/src/test/jtx/batch.h +++ b/src/test/jtx/batch.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_BATCH_H_INCLUDED -#define XRPL_TEST_JTX_BATCH_H_INCLUDED +#pragma once #include #include @@ -133,5 +132,3 @@ public: } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/check.h b/src/test/jtx/check.h index 61ae5033e4..9a1c6b2d2c 100644 --- a/src/test/jtx/check.h +++ b/src/test/jtx/check.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_CHECK_H_INCLUDED -#define XRPL_TEST_JTX_CHECK_H_INCLUDED +#pragma once #include #include @@ -42,5 +41,3 @@ using checks = owner_count; } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/credentials.h b/src/test/jtx/credentials.h index 96b3fcf103..29ecacb11b 100644 --- a/src/test/jtx/credentials.h +++ b/src/test/jtx/credentials.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_CREDENTIALS_H_INCLUDED -#define XRPL_TEST_JTX_CREDENTIALS_H_INCLUDED +#pragma once #include #include @@ -74,5 +73,3 @@ ledgerEntry(jtx::Env& env, std::string const& credIdx); } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/delivermin.h b/src/test/jtx/delivermin.h index 033b3f20b8..3edb38ffef 100644 --- a/src/test/jtx/delivermin.h +++ b/src/test/jtx/delivermin.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_DELIVERMIN_H_INCLUDED -#define XRPL_TEST_JTX_DELIVERMIN_H_INCLUDED +#pragma once #include @@ -27,5 +26,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/deposit.h b/src/test/jtx/deposit.h index 579a7bafb9..d7762e9ae3 100644 --- a/src/test/jtx/deposit.h +++ b/src/test/jtx/deposit.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_DEPOSIT_H_INCLUDED -#define XRPL_TEST_JTX_DEPOSIT_H_INCLUDED +#pragma once #include #include @@ -59,5 +58,3 @@ unauthCredentials(jtx::Account const& account, std::vector } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/did.h b/src/test/jtx/did.h index 65407028eb..9cd98a1324 100644 --- a/src/test/jtx/did.h +++ b/src/test/jtx/did.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_DID_H_INCLUDED -#define XRPL_TEST_JTX_DID_H_INCLUDED +#pragma once #include #include @@ -81,5 +80,3 @@ del(jtx::Account const& account); } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/directory.h b/src/test/jtx/directory.h index 25ec202cec..e9fff35434 100644 --- a/src/test/jtx/directory.h +++ b/src/test/jtx/directory.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_DIRECTORY_H_INCLUDED -#define XRPL_TEST_JTX_DIRECTORY_H_INCLUDED +#pragma once #include @@ -57,5 +56,3 @@ maximumPageIndex(Env const& env) -> std::uint64_t } // namespace directory } // namespace xrpl::test::jtx - -#endif diff --git a/src/test/jtx/envconfig.h b/src/test/jtx/envconfig.h index 9cf5cff146..dc0c48e064 100644 --- a/src/test/jtx/envconfig.h +++ b/src/test/jtx/envconfig.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_ENVCONFIG_H_INCLUDED -#define XRPL_TEST_JTX_ENVCONFIG_H_INCLUDED +#pragma once #include @@ -112,5 +111,3 @@ makeConfig(std::map extraTxQ = {}, std::map #include @@ -86,5 +85,3 @@ auto const fulfillment = JTxFieldWrapper(sfFulfillment); } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/fee.h b/src/test/jtx/fee.h index 3ede9680f8..281066f0aa 100644 --- a/src/test/jtx/fee.h +++ b/src/test/jtx/fee.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_FEE_H_INCLUDED -#define XRPL_TEST_JTX_FEE_H_INCLUDED +#pragma once #include #include @@ -51,5 +50,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/flags.h b/src/test/jtx/flags.h index 3f1f8f71a3..3dde1fa414 100644 --- a/src/test/jtx/flags.h +++ b/src/test/jtx/flags.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_FLAGS_H_INCLUDED -#define XRPL_TEST_JTX_FLAGS_H_INCLUDED +#pragma once #include @@ -139,5 +138,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/invoice_id.h b/src/test/jtx/invoice_id.h index bdf1aa4250..fd1b7ae45b 100644 --- a/src/test/jtx/invoice_id.h +++ b/src/test/jtx/invoice_id.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_INVOICE_ID_H_INCLUDED -#define XRPL_TEST_JTX_INVOICE_ID_H_INCLUDED +#pragma once #include @@ -23,4 +22,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl -#endif diff --git a/src/test/jtx/jtx_json.h b/src/test/jtx/jtx_json.h index 32fd3c8d30..c7f52fe283 100644 --- a/src/test/jtx/jtx_json.h +++ b/src/test/jtx/jtx_json.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_JSON_H_INCLUDED -#define XRPL_TEST_JTX_JSON_H_INCLUDED +#pragma once #include @@ -41,5 +40,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/last_ledger_sequence.h b/src/test/jtx/last_ledger_sequence.h index 6544294bd6..540d6ff384 100644 --- a/src/test/jtx/last_ledger_sequence.h +++ b/src/test/jtx/last_ledger_sequence.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_LAST_LEDGER_SEQUENCE_H_INCLUDED -#define XRPL_TEST_JTX_LAST_LEDGER_SEQUENCE_H_INCLUDED +#pragma once #include @@ -24,5 +23,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/ledgerStateFix.h b/src/test/jtx/ledgerStateFix.h index f93c1bc3d8..7adc863cb4 100644 --- a/src/test/jtx/ledgerStateFix.h +++ b/src/test/jtx/ledgerStateFix.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_LEDGER_STATE_FIX_H_INCLUDED -#define XRPL_TEST_JTX_LEDGER_STATE_FIX_H_INCLUDED +#pragma once #include #include @@ -21,5 +20,3 @@ nftPageLinks(jtx::Account const& acct, jtx::Account const& owner); } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/memo.h b/src/test/jtx/memo.h index c0f8ae5f27..2371490b30 100644 --- a/src/test/jtx/memo.h +++ b/src/test/jtx/memo.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_MEMO_H_INCLUDED -#define XRPL_TEST_JTX_MEMO_H_INCLUDED +#pragma once #include @@ -74,5 +73,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/mpt.h b/src/test/jtx/mpt.h index fc66b50a1e..792d43056f 100644 --- a/src/test/jtx/mpt.h +++ b/src/test/jtx/mpt.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_MPT_H_INCLUDED -#define XRPL_TEST_JTX_MPT_H_INCLUDED +#pragma once #include #include @@ -299,5 +298,3 @@ private: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/multisign.h b/src/test/jtx/multisign.h index f1a50728b9..3bbf43bb05 100644 --- a/src/test/jtx/multisign.h +++ b/src/test/jtx/multisign.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_MULTISIGN_H_INCLUDED -#define XRPL_TEST_JTX_MULTISIGN_H_INCLUDED +#pragma once #include #include @@ -97,5 +96,3 @@ using siglists = owner_count; } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/noop.h b/src/test/jtx/noop.h index 3ef3a57c4b..47d12fb9af 100644 --- a/src/test/jtx/noop.h +++ b/src/test/jtx/noop.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_NOOP_H_INCLUDED -#define XRPL_TEST_JTX_NOOP_H_INCLUDED +#pragma once #include @@ -17,5 +16,3 @@ noop(Account const& account) } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/offer.h b/src/test/jtx/offer.h index 22bc14a09d..dab15a4c8c 100644 --- a/src/test/jtx/offer.h +++ b/src/test/jtx/offer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_OFFER_H_INCLUDED -#define XRPL_TEST_JTX_OFFER_H_INCLUDED +#pragma once #include @@ -21,5 +20,3 @@ offer_cancel(Account const& account, std::uint32_t offerSeq); } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/owners.h b/src/test/jtx/owners.h index 73a244185f..87fa26417a 100644 --- a/src/test/jtx/owners.h +++ b/src/test/jtx/owners.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_OWNERS_H_INCLUDED -#define XRPL_TEST_JTX_OWNERS_H_INCLUDED +#pragma once #include @@ -69,5 +68,3 @@ using offers = owner_count; } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/paths.h b/src/test/jtx/paths.h index a1e5ee0294..c4e69fe3f3 100644 --- a/src/test/jtx/paths.h +++ b/src/test/jtx/paths.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_PATHS_H_INCLUDED -#define XRPL_TEST_JTX_PATHS_H_INCLUDED +#pragma once #include @@ -94,5 +93,3 @@ path::append(T const& t, Args const&... args) } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/pay.h b/src/test/jtx/pay.h index 4ef13d72a3..a155d7bdc8 100644 --- a/src/test/jtx/pay.h +++ b/src/test/jtx/pay.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_PAY_H_INCLUDED -#define XRPL_TEST_JTX_PAY_H_INCLUDED +#pragma once #include #include @@ -19,5 +18,3 @@ pay(Account const& account, Account const& to, AnyAmount amount); } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/permissioned_domains.h b/src/test/jtx/permissioned_domains.h index de015775ce..ff8ab129ae 100644 --- a/src/test/jtx/permissioned_domains.h +++ b/src/test/jtx/permissioned_domains.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_PERMISSIONED_DOMAINS_H_INCLUDED -#define XRPL_TEST_JTX_PERMISSIONED_DOMAINS_H_INCLUDED +#pragma once #include #include @@ -47,5 +46,3 @@ getNewDomain(std::shared_ptr const& meta); } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/prop.h b/src/test/jtx/prop.h index 5c4687f88b..b1f8cb5ffc 100644 --- a/src/test/jtx/prop.h +++ b/src/test/jtx/prop.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_PROP_H_INCLUDED -#define XRPL_TEST_JTX_PROP_H_INCLUDED +#pragma once #include @@ -30,5 +29,3 @@ struct prop } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/quality.h b/src/test/jtx/quality.h index c112ad9934..34c960224f 100644 --- a/src/test/jtx/quality.h +++ b/src/test/jtx/quality.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_QUALITY_H_INCLUDED -#define XRPL_TEST_JTX_QUALITY_H_INCLUDED +#pragma once #include @@ -66,5 +65,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/rate.h b/src/test/jtx/rate.h index 2ed8cec6f2..a92bd2364a 100644 --- a/src/test/jtx/rate.h +++ b/src/test/jtx/rate.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_RATE_H_INCLUDED -#define XRPL_TEST_JTX_RATE_H_INCLUDED +#pragma once #include @@ -16,5 +15,3 @@ rate(Account const& account, double multiplier); } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/regkey.h b/src/test/jtx/regkey.h index b3ab9a0ed9..2c95baacc3 100644 --- a/src/test/jtx/regkey.h +++ b/src/test/jtx/regkey.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_REGKEY_H_INCLUDED -#define XRPL_TEST_JTX_REGKEY_H_INCLUDED +#pragma once #include #include @@ -21,5 +20,3 @@ regkey(Account const& account, Account const& signer); } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/require.h b/src/test/jtx/require.h index 21ff8a29ec..7d712e8ab7 100644 --- a/src/test/jtx/require.h +++ b/src/test/jtx/require.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_REQUIRE_H_INCLUDED -#define XRPL_TEST_JTX_REQUIRE_H_INCLUDED +#pragma once #include @@ -64,5 +63,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/requires.h b/src/test/jtx/requires.h index 379c5ad67d..2411d040c6 100644 --- a/src/test/jtx/requires.h +++ b/src/test/jtx/requires.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_REQUIRES_H_INCLUDED -#define XRPL_TEST_JTX_REQUIRES_H_INCLUDED +#pragma once #include #include @@ -16,5 +15,3 @@ using requires_t = std::vector; } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/rpc.h b/src/test/jtx/rpc.h index 30b4f4b1fd..6946cbc4e1 100644 --- a/src/test/jtx/rpc.h +++ b/src/test/jtx/rpc.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_RPC_H_INCLUDED -#define XRPL_TEST_JTX_RPC_H_INCLUDED +#pragma once #include @@ -59,5 +58,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/sendmax.h b/src/test/jtx/sendmax.h index 9082ef9ddd..8a471be3cd 100644 --- a/src/test/jtx/sendmax.h +++ b/src/test/jtx/sendmax.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_SENDMAX_H_INCLUDED -#define XRPL_TEST_JTX_SENDMAX_H_INCLUDED +#pragma once #include @@ -27,5 +26,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/seq.h b/src/test/jtx/seq.h index 102961db0e..b861800ac9 100644 --- a/src/test/jtx/seq.h +++ b/src/test/jtx/seq.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_SEQ_H_INCLUDED -#define XRPL_TEST_JTX_SEQ_H_INCLUDED +#pragma once #include #include @@ -37,5 +36,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/sig.h b/src/test/jtx/sig.h index 1397e5fc71..ab22a46c69 100644 --- a/src/test/jtx/sig.h +++ b/src/test/jtx/sig.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_SIG_H_INCLUDED -#define XRPL_TEST_JTX_SIG_H_INCLUDED +#pragma once #include @@ -59,5 +58,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/tag.h b/src/test/jtx/tag.h index 688d2e92c1..c8d5723754 100644 --- a/src/test/jtx/tag.h +++ b/src/test/jtx/tag.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_TAG_H_INCLUDED -#define XRPL_TEST_JTX_TAG_H_INCLUDED +#pragma once #include @@ -42,5 +41,3 @@ public: } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/tags.h b/src/test/jtx/tags.h index 445bdebcb4..c8a6170048 100644 --- a/src/test/jtx/tags.h +++ b/src/test/jtx/tags.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_TAGS_H_INCLUDED -#define XRPL_TEST_JTX_TAGS_H_INCLUDED +#pragma once namespace xrpl { namespace test { @@ -44,5 +43,3 @@ static increment_t const increment; } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/ter.h b/src/test/jtx/ter.h index f13c2a90e6..074ba307cb 100644 --- a/src/test/jtx/ter.h +++ b/src/test/jtx/ter.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_TER_H_INCLUDED -#define XRPL_TEST_JTX_TER_H_INCLUDED +#pragma once #include @@ -36,5 +35,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/testline.h b/src/test/jtx/testline.h index beda870345..e2be1f0276 100644 --- a/src/test/jtx/testline.h +++ b/src/test/jtx/testline.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_TESTLINE_H_INCLUDED -#define XRPL_TEST_JTX_TESTLINE_H_INCLUDED +#pragma once #include @@ -30,5 +29,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/ticket.h b/src/test/jtx/ticket.h index 10cb772bbd..dca16ac7c6 100644 --- a/src/test/jtx/ticket.h +++ b/src/test/jtx/ticket.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_TICKET_H_INCLUDED -#define XRPL_TEST_JTX_TICKET_H_INCLUDED +#pragma once #include #include @@ -48,5 +47,3 @@ using tickets = owner_count; } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/token.h b/src/test/jtx/token.h index 2c9ecc8393..f6d562587a 100644 --- a/src/test/jtx/token.h +++ b/src/test/jtx/token.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_NFT_H_INCLUDED -#define XRPL_TEST_JTX_NFT_H_INCLUDED +#pragma once #include #include @@ -218,5 +217,3 @@ modify(jtx::Account const& account, uint256 const& nftokenID); } // namespace test } // namespace xrpl - -#endif // XRPL_TEST_JTX_NFT_H_INCLUDED diff --git a/src/test/jtx/trust.h b/src/test/jtx/trust.h index 34eba0a63b..462538854b 100644 --- a/src/test/jtx/trust.h +++ b/src/test/jtx/trust.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_TRUST_H_INCLUDED -#define XRPL_TEST_JTX_TRUST_H_INCLUDED +#pragma once #include @@ -24,5 +23,3 @@ claw(Account const& account, STAmount const& amount, std::optional cons } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/txflags.h b/src/test/jtx/txflags.h index 75a0d2740b..f51c26d035 100644 --- a/src/test/jtx/txflags.h +++ b/src/test/jtx/txflags.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_TXFLAGS_H_INCLUDED -#define XRPL_TEST_JTX_TXFLAGS_H_INCLUDED +#pragma once #include @@ -25,5 +24,3 @@ public: } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/utility.h b/src/test/jtx/utility.h index b28868af65..895d00f12b 100644 --- a/src/test/jtx/utility.h +++ b/src/test/jtx/utility.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_UTILITY_H_INCLUDED -#define XRPL_TEST_JTX_UTILITY_H_INCLUDED +#pragma once #include @@ -58,5 +57,3 @@ cmdToJSONRPC(std::vector const& args, beast::Journal j, unsigned in } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/vault.h b/src/test/jtx/vault.h index 485940f9f4..65a5706354 100644 --- a/src/test/jtx/vault.h +++ b/src/test/jtx/vault.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_VAULT_H_INCLUDED -#define XRPL_TEST_JTX_VAULT_H_INCLUDED +#pragma once #include #include @@ -86,5 +85,3 @@ struct Vault } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/jtx/xchain_bridge.h b/src/test/jtx/xchain_bridge.h index f7c1f019c9..cdacede234 100644 --- a/src/test/jtx/xchain_bridge.h +++ b/src/test/jtx/xchain_bridge.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TEST_JTX_XCHAINBRIDGE_H_INCLUDED -#define XRPL_TEST_JTX_XCHAINBRIDGE_H_INCLUDED +#pragma once #include #include @@ -219,5 +218,3 @@ struct XChainBridgeObjects } // namespace jtx } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/nodestore/TestBase.h b/src/test/nodestore/TestBase.h index c08559de36..dfa2b05642 100644 --- a/src/test/nodestore/TestBase.h +++ b/src/test/nodestore/TestBase.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NODESTORE_BASE_H_INCLUDED -#define XRPL_NODESTORE_BASE_H_INCLUDED +#pragma once #include #include @@ -197,5 +196,3 @@ public: } // namespace NodeStore } // namespace xrpl - -#endif diff --git a/src/test/protocol/Issue_test.cpp b/src/test/protocol/Issue_test.cpp index 661a8c912b..2321da4a6e 100644 --- a/src/test/protocol/Issue_test.cpp +++ b/src/test/protocol/Issue_test.cpp @@ -17,14 +17,6 @@ #define STL_SET_HAS_EMPLACE 0 #endif -#ifndef XRPL_ASSETS_ENABLE_STD_HASH -#if BEAST_MAC || BEAST_IOS -#define XRPL_ASSETS_ENABLE_STD_HASH 0 -#else -#define XRPL_ASSETS_ENABLE_STD_HASH 1 -#endif -#endif - namespace xrpl { class Issue_test : public beast::unit_test::suite diff --git a/src/test/rpc/GRPCTestClientBase.h b/src/test/rpc/GRPCTestClientBase.h index 5e547b1dfb..3c39cd1747 100644 --- a/src/test/rpc/GRPCTestClientBase.h +++ b/src/test/rpc/GRPCTestClientBase.h @@ -1,5 +1,4 @@ -#ifndef XRPL_GRPCTESTCLIENTBASE_H -#define XRPL_GRPCTESTCLIENTBASE_H +#pragma once #include @@ -26,4 +25,3 @@ struct GRPCTestClientBase } // namespace test } // namespace xrpl -#endif // XRPL_GRPCTESTCLIENTBASE_H diff --git a/src/test/shamap/common.h b/src/test/shamap/common.h index 1779755619..fe2a1884da 100644 --- a/src/test/shamap/common.h +++ b/src/test/shamap/common.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_TESTS_COMMON_H_INCLUDED -#define XRPL_SHAMAP_TESTS_COMMON_H_INCLUDED +#pragma once #include #include @@ -100,5 +99,3 @@ public: } // namespace tests } // namespace xrpl - -#endif diff --git a/src/test/unit_test/FileDirGuard.h b/src/test/unit_test/FileDirGuard.h index 90765f7029..cf2eab7adb 100644 --- a/src/test/unit_test/FileDirGuard.h +++ b/src/test/unit_test/FileDirGuard.h @@ -1,5 +1,4 @@ -#ifndef TEST_UNIT_TEST_DIRGUARD_H -#define TEST_UNIT_TEST_DIRGUARD_H +#pragma once #include @@ -154,5 +153,3 @@ public: } // namespace detail } // namespace xrpl - -#endif // TEST_UNIT_TEST_DIRGUARD_H diff --git a/src/test/unit_test/SuiteJournal.h b/src/test/unit_test/SuiteJournal.h index 0b87706056..ad5f298b74 100644 --- a/src/test/unit_test/SuiteJournal.h +++ b/src/test/unit_test/SuiteJournal.h @@ -1,5 +1,4 @@ -#ifndef TEST_UNIT_TEST_SUITE_JOURNAL_H -#define TEST_UNIT_TEST_SUITE_JOURNAL_H +#pragma once #include #include @@ -133,5 +132,3 @@ public: } // namespace test } // namespace xrpl - -#endif diff --git a/src/test/unit_test/multi_runner.h b/src/test/unit_test/multi_runner.h index 25649d917f..28ecaf85f9 100644 --- a/src/test/unit_test/multi_runner.h +++ b/src/test/unit_test/multi_runner.h @@ -1,5 +1,4 @@ -#ifndef TEST_UNIT_TEST_MULTI_RUNNER_H -#define TEST_UNIT_TEST_MULTI_RUNNER_H +#pragma once #include #include @@ -334,5 +333,3 @@ multi_runner_child::run_multi(Pred pred) } // namespace test } // namespace xrpl - -#endif diff --git a/src/tests/libxrpl/helpers/TestSink.h b/src/tests/libxrpl/helpers/TestSink.h index aa34e16838..daa40d014f 100644 --- a/src/tests/libxrpl/helpers/TestSink.h +++ b/src/tests/libxrpl/helpers/TestSink.h @@ -1,5 +1,4 @@ -#ifndef XRPL_DEBUGSINK_H -#define XRPL_DEBUGSINK_H +#pragma once #include @@ -23,4 +22,3 @@ public: writeAlways(beast::severities::Severity level, std::string const& text) override; }; } // namespace xrpl -#endif // XRPL_DEBUGSINK_H diff --git a/src/xrpld/app/consensus/RCLCensorshipDetector.h b/src/xrpld/app/consensus/RCLCensorshipDetector.h index 671337c118..fbdc6c2397 100644 --- a/src/xrpld/app/consensus/RCLCensorshipDetector.h +++ b/src/xrpld/app/consensus/RCLCensorshipDetector.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_CONSENSUS_RCLCENSORSHIPDETECTOR_H_INCLUDED -#define XRPL_APP_CONSENSUS_RCLCENSORSHIPDETECTOR_H_INCLUDED +#pragma once #include #include @@ -122,5 +121,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/consensus/RCLConsensus.h b/src/xrpld/app/consensus/RCLConsensus.h index 476cb25715..3e1b27cd9c 100644 --- a/src/xrpld/app/consensus/RCLConsensus.h +++ b/src/xrpld/app/consensus/RCLConsensus.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_CONSENSUS_RCLCONSENSUS_H_INCLUDED -#define XRPL_APP_CONSENSUS_RCLCONSENSUS_H_INCLUDED +#pragma once #include #include @@ -524,5 +523,3 @@ public: } }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/consensus/RCLCxLedger.h b/src/xrpld/app/consensus/RCLCxLedger.h index 4413fee7fc..6b96fc8af3 100644 --- a/src/xrpld/app/consensus/RCLCxLedger.h +++ b/src/xrpld/app/consensus/RCLCxLedger.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_CONSENSUS_RCLCXLEDGER_H_INCLUDED -#define XRPL_APP_CONSENSUS_RCLCXLEDGER_H_INCLUDED +#pragma once #include #include @@ -101,4 +100,3 @@ public: std::shared_ptr ledger_; }; } // namespace xrpl -#endif diff --git a/src/xrpld/app/consensus/RCLCxPeerPos.h b/src/xrpld/app/consensus/RCLCxPeerPos.h index 78a8bfde1e..b9ef492aae 100644 --- a/src/xrpld/app/consensus/RCLCxPeerPos.h +++ b/src/xrpld/app/consensus/RCLCxPeerPos.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_CONSENSUS_RCLCXPEERPOS_H_INCLUDED -#define XRPL_APP_CONSENSUS_RCLCXPEERPOS_H_INCLUDED +#pragma once #include @@ -125,5 +124,3 @@ proposalUniqueId( Slice const& signature); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/consensus/RCLCxTx.h b/src/xrpld/app/consensus/RCLCxTx.h index a0cefcf199..b7bde11a3b 100644 --- a/src/xrpld/app/consensus/RCLCxTx.h +++ b/src/xrpld/app/consensus/RCLCxTx.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_CONSENSUS_RCLCXTX_H_INCLUDED -#define XRPL_APP_CONSENSUS_RCLCXTX_H_INCLUDED +#pragma once #include @@ -167,4 +166,3 @@ public: std::shared_ptr map_; }; } // namespace xrpl -#endif diff --git a/src/xrpld/app/consensus/RCLValidations.h b/src/xrpld/app/consensus/RCLValidations.h index 97ccb727fe..35c1686f9e 100644 --- a/src/xrpld/app/consensus/RCLValidations.h +++ b/src/xrpld/app/consensus/RCLValidations.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_CONSENSUSS_VALIDATIONS_H_INCLUDED -#define XRPL_APP_CONSENSUSS_VALIDATIONS_H_INCLUDED +#pragma once #include #include @@ -237,5 +236,3 @@ handleNewValidation( std::optional j = std::nullopt); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/AbstractFetchPackContainer.h b/src/xrpld/app/ledger/AbstractFetchPackContainer.h index d2cdd1e920..3adc435bd6 100644 --- a/src/xrpld/app/ledger/AbstractFetchPackContainer.h +++ b/src/xrpld/app/ledger/AbstractFetchPackContainer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_ABSTRACTFETCHPACKCONTAINER_H_INCLUDED -#define XRPL_APP_LEDGER_ABSTRACTFETCHPACKCONTAINER_H_INCLUDED +#pragma once #include #include @@ -27,5 +26,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/AcceptedLedger.h b/src/xrpld/app/ledger/AcceptedLedger.h index 37e5d01a26..c0f186c781 100644 --- a/src/xrpld/app/ledger/AcceptedLedger.h +++ b/src/xrpld/app/ledger/AcceptedLedger.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_ACCEPTEDLEDGER_H_INCLUDED -#define XRPL_APP_LEDGER_ACCEPTEDLEDGER_H_INCLUDED +#pragma once #include @@ -56,5 +55,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/AcceptedLedgerTx.h b/src/xrpld/app/ledger/AcceptedLedgerTx.h index efea5b9162..6c936bbcf2 100644 --- a/src/xrpld/app/ledger/AcceptedLedgerTx.h +++ b/src/xrpld/app/ledger/AcceptedLedgerTx.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_ACCEPTEDLEDGERTX_H_INCLUDED -#define XRPL_APP_LEDGER_ACCEPTEDLEDGERTX_H_INCLUDED +#pragma once #include @@ -86,5 +85,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/AccountStateSF.h b/src/xrpld/app/ledger/AccountStateSF.h index 40f40ac8a1..fb9da3a616 100644 --- a/src/xrpld/app/ledger/AccountStateSF.h +++ b/src/xrpld/app/ledger/AccountStateSF.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_ACCOUNTSTATESF_H_INCLUDED -#define XRPL_APP_LEDGER_ACCOUNTSTATESF_H_INCLUDED +#pragma once #include @@ -30,5 +29,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/BookListeners.h b/src/xrpld/app/ledger/BookListeners.h index 784172974e..036e988749 100644 --- a/src/xrpld/app/ledger/BookListeners.h +++ b/src/xrpld/app/ledger/BookListeners.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_BOOKLISTENERS_H_INCLUDED -#define XRPL_APP_LEDGER_BOOKLISTENERS_H_INCLUDED +#pragma once #include @@ -51,5 +50,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/BuildLedger.h b/src/xrpld/app/ledger/BuildLedger.h index 24b9e988ff..7b4b85c4aa 100644 --- a/src/xrpld/app/ledger/BuildLedger.h +++ b/src/xrpld/app/ledger/BuildLedger.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_BUILD_LEDGER_H_INCLUDED -#define XRPL_APP_LEDGER_BUILD_LEDGER_H_INCLUDED +#pragma once #include #include @@ -54,4 +53,3 @@ std::shared_ptr buildLedger(LedgerReplay const& replayData, ApplyFlags applyFlags, Application& app, beast::Journal j); } // namespace xrpl -#endif diff --git a/src/xrpld/app/ledger/ConsensusTransSetSF.h b/src/xrpld/app/ledger/ConsensusTransSetSF.h index 1e9acefc38..855577ecee 100644 --- a/src/xrpld/app/ledger/ConsensusTransSetSF.h +++ b/src/xrpld/app/ledger/ConsensusTransSetSF.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_CONSENSUSTRANSSETSF_H_INCLUDED -#define XRPL_APP_LEDGER_CONSENSUSTRANSSETSF_H_INCLUDED +#pragma once #include @@ -35,5 +34,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/InboundLedger.h b/src/xrpld/app/ledger/InboundLedger.h index c062b83143..46a8cf19b5 100644 --- a/src/xrpld/app/ledger/InboundLedger.h +++ b/src/xrpld/app/ledger/InboundLedger.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_INBOUNDLEDGER_H_INCLUDED -#define XRPL_APP_LEDGER_INBOUNDLEDGER_H_INCLUDED +#pragma once #include #include @@ -173,5 +172,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/InboundLedgers.h b/src/xrpld/app/ledger/InboundLedgers.h index 6b4b1a6ef0..30eb69ab7a 100644 --- a/src/xrpld/app/ledger/InboundLedgers.h +++ b/src/xrpld/app/ledger/InboundLedgers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_INBOUNDLEDGERS_H_INCLUDED -#define XRPL_APP_LEDGER_INBOUNDLEDGERS_H_INCLUDED +#pragma once #include @@ -79,5 +78,3 @@ make_InboundLedgers( beast::insight::Collector::ptr const& collector); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/InboundTransactions.h b/src/xrpld/app/ledger/InboundTransactions.h index e905fb1846..7b85f56c5f 100644 --- a/src/xrpld/app/ledger/InboundTransactions.h +++ b/src/xrpld/app/ledger/InboundTransactions.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_INBOUNDTRANSACTIONS_H_INCLUDED -#define XRPL_APP_LEDGER_INBOUNDTRANSACTIONS_H_INCLUDED +#pragma once #include @@ -73,5 +72,3 @@ make_InboundTransactions( std::function const&, bool)> gotSet); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/Ledger.h b/src/xrpld/app/ledger/Ledger.h index a8c9b91342..cbfbc0030f 100644 --- a/src/xrpld/app/ledger/Ledger.h +++ b/src/xrpld/app/ledger/Ledger.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGER_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGER_H_INCLUDED +#pragma once #include #include @@ -444,5 +443,3 @@ uint256 calculateLedgerHash(LedgerHeader const& info); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/LedgerCleaner.h b/src/xrpld/app/ledger/LedgerCleaner.h index 2377485f22..aa8d042c24 100644 --- a/src/xrpld/app/ledger/LedgerCleaner.h +++ b/src/xrpld/app/ledger/LedgerCleaner.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGERCLEANER_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGERCLEANER_H_INCLUDED +#pragma once #include @@ -44,5 +43,3 @@ std::unique_ptr make_LedgerCleaner(Application& app, beast::Journal journal); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/LedgerHistory.h b/src/xrpld/app/ledger/LedgerHistory.h index 68007546b6..e8784eb599 100644 --- a/src/xrpld/app/ledger/LedgerHistory.h +++ b/src/xrpld/app/ledger/LedgerHistory.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGERHISTORY_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGERHISTORY_H_INCLUDED +#pragma once #include #include @@ -129,5 +128,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/LedgerHolder.h b/src/xrpld/app/ledger/LedgerHolder.h index c0a81778ae..8d2ac9f308 100644 --- a/src/xrpld/app/ledger/LedgerHolder.h +++ b/src/xrpld/app/ledger/LedgerHolder.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGERHOLDER_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGERHOLDER_H_INCLUDED +#pragma once #include #include @@ -54,5 +53,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/LedgerMaster.h b/src/xrpld/app/ledger/LedgerMaster.h index 5db8806534..ceb9fa9045 100644 --- a/src/xrpld/app/ledger/LedgerMaster.h +++ b/src/xrpld/app/ledger/LedgerMaster.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGERMASTER_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGERMASTER_H_INCLUDED +#pragma once #include #include @@ -391,5 +390,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/LedgerReplay.h b/src/xrpld/app/ledger/LedgerReplay.h index 9051bb414c..f4cbf9c69e 100644 --- a/src/xrpld/app/ledger/LedgerReplay.h +++ b/src/xrpld/app/ledger/LedgerReplay.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGERREPLAY_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGERREPLAY_H_INCLUDED +#pragma once #include @@ -51,5 +50,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/LedgerReplayTask.h b/src/xrpld/app/ledger/LedgerReplayTask.h index 40995430db..94eeee5f51 100644 --- a/src/xrpld/app/ledger/LedgerReplayTask.h +++ b/src/xrpld/app/ledger/LedgerReplayTask.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGERREPLAYTASK_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGERREPLAYTASK_H_INCLUDED +#pragma once #include #include @@ -152,5 +151,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/LedgerReplayer.h b/src/xrpld/app/ledger/LedgerReplayer.h index ff67a43e87..0d08e5a76f 100644 --- a/src/xrpld/app/ledger/LedgerReplayer.h +++ b/src/xrpld/app/ledger/LedgerReplayer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGERREPLAYER_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGERREPLAYER_H_INCLUDED +#pragma once #include #include @@ -132,5 +131,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/LedgerToJson.h b/src/xrpld/app/ledger/LedgerToJson.h index 1d77c4dc39..8cde134d23 100644 --- a/src/xrpld/app/ledger/LedgerToJson.h +++ b/src/xrpld/app/ledger/LedgerToJson.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGERTOJSON_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGERTOJSON_H_INCLUDED +#pragma once #include #include @@ -44,5 +43,3 @@ void copyFrom(Json::Value& to, Json::Value const& from); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/LocalTxs.h b/src/xrpld/app/ledger/LocalTxs.h index d02e1027a0..34dfede40f 100644 --- a/src/xrpld/app/ledger/LocalTxs.h +++ b/src/xrpld/app/ledger/LocalTxs.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LOCALTXS_H_INCLUDED -#define XRPL_APP_LEDGER_LOCALTXS_H_INCLUDED +#pragma once #include @@ -43,5 +42,3 @@ std::unique_ptr make_LocalTxs(); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/OpenLedger.h b/src/xrpld/app/ledger/OpenLedger.h index 498e140b4b..187086862c 100644 --- a/src/xrpld/app/ledger/OpenLedger.h +++ b/src/xrpld/app/ledger/OpenLedger.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_OPENLEDGER_H_INCLUDED -#define XRPL_APP_LEDGER_OPENLEDGER_H_INCLUDED +#pragma once #include #include @@ -262,5 +261,3 @@ std::string debugTostr(std::shared_ptr const& view); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/OrderBookDB.h b/src/xrpld/app/ledger/OrderBookDB.h index 601b2d38e4..da604d7e22 100644 --- a/src/xrpld/app/ledger/OrderBookDB.h +++ b/src/xrpld/app/ledger/OrderBookDB.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_ORDERBOOKDB_H_INCLUDED -#define XRPL_APP_LEDGER_ORDERBOOKDB_H_INCLUDED +#pragma once #include #include @@ -74,5 +73,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/PendingSaves.h b/src/xrpld/app/ledger/PendingSaves.h index 24eb50e568..76958fc78a 100644 --- a/src/xrpld/app/ledger/PendingSaves.h +++ b/src/xrpld/app/ledger/PendingSaves.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PENDINGSAVES_H_INCLUDED -#define XRPL_APP_PENDINGSAVES_H_INCLUDED +#pragma once #include @@ -125,5 +124,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/TransactionMaster.h b/src/xrpld/app/ledger/TransactionMaster.h index ceba55a85a..039ff5cb99 100644 --- a/src/xrpld/app/ledger/TransactionMaster.h +++ b/src/xrpld/app/ledger/TransactionMaster.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_TRANSACTIONMASTER_H_INCLUDED -#define XRPL_APP_LEDGER_TRANSACTIONMASTER_H_INCLUDED +#pragma once #include @@ -64,5 +63,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/TransactionStateSF.h b/src/xrpld/app/ledger/TransactionStateSF.h index 0ea8d7fb2d..2851884cfd 100644 --- a/src/xrpld/app/ledger/TransactionStateSF.h +++ b/src/xrpld/app/ledger/TransactionStateSF.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_TRANSACTIONSTATESF_H_INCLUDED -#define XRPL_APP_LEDGER_TRANSACTIONSTATESF_H_INCLUDED +#pragma once #include @@ -30,5 +29,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h index 7b4d478c13..66b8f27b85 100644 --- a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h +++ b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGERDELTAACQUIRE_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGERDELTAACQUIRE_H_INCLUDED +#pragma once #include #include @@ -137,5 +136,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h index 7cd231e59a..260f1ff753 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h +++ b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGERREPLAYMSGHANDLER_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGERREPLAYMSGHANDLER_H_INCLUDED +#pragma once #include #include @@ -51,5 +50,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/detail/SkipListAcquire.h b/src/xrpld/app/ledger/detail/SkipListAcquire.h index 587f6c19fd..f3bfb60bee 100644 --- a/src/xrpld/app/ledger/detail/SkipListAcquire.h +++ b/src/xrpld/app/ledger/detail/SkipListAcquire.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_SKIPLISTACQUIRE_H_INCLUDED -#define XRPL_APP_LEDGER_SKIPLISTACQUIRE_H_INCLUDED +#pragma once #include #include @@ -134,5 +133,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/detail/TimeoutCounter.h b/src/xrpld/app/ledger/detail/TimeoutCounter.h index c228d50aac..5f5ccb2f43 100644 --- a/src/xrpld/app/ledger/detail/TimeoutCounter.h +++ b/src/xrpld/app/ledger/detail/TimeoutCounter.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_TIMEOUTCOUNTER_H_INCLUDED -#define XRPL_APP_LEDGER_TIMEOUTCOUNTER_H_INCLUDED +#pragma once #include @@ -131,5 +130,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/ledger/detail/TransactionAcquire.h b/src/xrpld/app/ledger/detail/TransactionAcquire.h index dd12e8afb0..4345c74fc6 100644 --- a/src/xrpld/app/ledger/detail/TransactionAcquire.h +++ b/src/xrpld/app/ledger/detail/TransactionAcquire.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_TRANSACTIONACQUIRE_H_INCLUDED -#define XRPL_APP_LEDGER_TRANSACTIONACQUIRE_H_INCLUDED +#pragma once #include @@ -49,5 +48,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/main/Application.h b/src/xrpld/app/main/Application.h index bb8bac8bbb..53cc264ad4 100644 --- a/src/xrpld/app/main/Application.h +++ b/src/xrpld/app/main/Application.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MAIN_APPLICATION_H_INCLUDED -#define XRPL_APP_MAIN_APPLICATION_H_INCLUDED +#pragma once #include #include @@ -183,5 +182,3 @@ std::unique_ptr make_Application(std::unique_ptr config, std::unique_ptr logs, std::unique_ptr timeKeeper); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/main/BasicApp.h b/src/xrpld/app/main/BasicApp.h index 0d38260e43..278c255af3 100644 --- a/src/xrpld/app/main/BasicApp.h +++ b/src/xrpld/app/main/BasicApp.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_BASICAPP_H_INCLUDED -#define XRPL_APP_BASICAPP_H_INCLUDED +#pragma once #include @@ -25,5 +24,3 @@ public: return io_context_; } }; - -#endif diff --git a/src/xrpld/app/main/CollectorManager.h b/src/xrpld/app/main/CollectorManager.h index d0d202625c..15785ec292 100644 --- a/src/xrpld/app/main/CollectorManager.h +++ b/src/xrpld/app/main/CollectorManager.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MAIN_COLLECTORMANAGER_H_INCLUDED -#define XRPL_APP_MAIN_COLLECTORMANAGER_H_INCLUDED +#pragma once #include #include @@ -23,5 +22,3 @@ std::unique_ptr make_CollectorManager(Section const& params, beast::Journal journal); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/main/DBInit.h b/src/xrpld/app/main/DBInit.h index 60ff4b498b..56bc752343 100644 --- a/src/xrpld/app/main/DBInit.h +++ b/src/xrpld/app/main/DBInit.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_DATA_DBINIT_H_INCLUDED -#define XRPL_APP_DATA_DBINIT_H_INCLUDED +#pragma once #include #include @@ -117,5 +116,3 @@ inline constexpr std::array WalletDBInit{ "END TRANSACTION;"}}; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/main/GRPCServer.h b/src/xrpld/app/main/GRPCServer.h index 67748c359d..fdac2b6484 100644 --- a/src/xrpld/app/main/GRPCServer.h +++ b/src/xrpld/app/main/GRPCServer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_GRPCSERVER_H_INCLUDED -#define XRPL_CORE_GRPCSERVER_H_INCLUDED +#pragma once #include #include @@ -300,4 +299,3 @@ private: bool running_ = false; }; } // namespace xrpl -#endif diff --git a/src/xrpld/app/main/LoadManager.h b/src/xrpld/app/main/LoadManager.h index 15caa9b0f0..c36afb1804 100644 --- a/src/xrpld/app/main/LoadManager.h +++ b/src/xrpld/app/main/LoadManager.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MAIN_LOADMANAGER_H_INCLUDED -#define XRPL_APP_MAIN_LOADMANAGER_H_INCLUDED +#pragma once #include @@ -95,5 +94,3 @@ std::unique_ptr make_LoadManager(Application& app, beast::Journal journal); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/main/NodeIdentity.h b/src/xrpld/app/main/NodeIdentity.h index ca47ae72ae..bebd5c261d 100644 --- a/src/xrpld/app/main/NodeIdentity.h +++ b/src/xrpld/app/main/NodeIdentity.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MAIN_NODEIDENTITY_H_INCLUDED -#define XRPL_APP_MAIN_NODEIDENTITY_H_INCLUDED +#pragma once #include @@ -19,5 +18,3 @@ std::pair getNodeIdentity(Application& app, boost::program_options::variables_map const& cmdline); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/main/NodeStoreScheduler.h b/src/xrpld/app/main/NodeStoreScheduler.h index 0214b76660..19e8d9d212 100644 --- a/src/xrpld/app/main/NodeStoreScheduler.h +++ b/src/xrpld/app/main/NodeStoreScheduler.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MAIN_NODESTORESCHEDULER_H_INCLUDED -#define XRPL_APP_MAIN_NODESTORESCHEDULER_H_INCLUDED +#pragma once #include #include @@ -24,5 +23,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/main/Tuning.h b/src/xrpld/app/main/Tuning.h index 25cc2ef75d..0f612b1b1c 100644 --- a/src/xrpld/app/main/Tuning.h +++ b/src/xrpld/app/main/Tuning.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MAIN_TUNING_H_INCLUDED -#define XRPL_APP_MAIN_TUNING_H_INCLUDED +#pragma once #include @@ -11,5 +10,3 @@ constexpr std::chrono::seconds fullBelowExpiration = std::chrono::minutes{10}; constexpr std::size_t maxPoppedTransactions = 10; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/AMMHelpers.h b/src/xrpld/app/misc/AMMHelpers.h index e54eea2f01..cde485f5dc 100644 --- a/src/xrpld/app/misc/AMMHelpers.h +++ b/src/xrpld/app/misc/AMMHelpers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_AMMHELPERS_H_INCLUDED -#define XRPL_APP_MISC_AMMHELPERS_H_INCLUDED +#pragma once #include #include @@ -688,5 +687,3 @@ Number adjustFracByTokens(Rules const& rules, STAmount const& lptAMMBalance, STAmount const& tokens, Number const& frac); } // namespace xrpl - -#endif // XRPL_APP_MISC_AMMHELPERS_H_INCLUDED diff --git a/src/xrpld/app/misc/AMMUtils.h b/src/xrpld/app/misc/AMMUtils.h index 5ed03d51f7..c97397a141 100644 --- a/src/xrpld/app/misc/AMMUtils.h +++ b/src/xrpld/app/misc/AMMUtils.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_AMMUTILS_H_INCLUDED -#define XRPL_APP_MISC_AMMUTILS_H_INCLUDED +#pragma once #include #include @@ -100,5 +99,3 @@ verifyAndAdjustLPTokenBalance( AccountID const& account); } // namespace xrpl - -#endif // XRPL_APP_MISC_AMMUTILS_H_INCLUDED diff --git a/src/xrpld/app/misc/AmendmentTable.h b/src/xrpld/app/misc/AmendmentTable.h index d6cb3d7bce..94ac9608a7 100644 --- a/src/xrpld/app/misc/AmendmentTable.h +++ b/src/xrpld/app/misc/AmendmentTable.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_AMENDMENTTABLE_H_INCLUDED -#define XRPL_APP_MISC_AMENDMENTTABLE_H_INCLUDED +#pragma once #include #include @@ -172,5 +171,3 @@ make_AmendmentTable( beast::Journal journal); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/CanonicalTXSet.h b/src/xrpld/app/misc/CanonicalTXSet.h index 15fb656403..45f58b5701 100644 --- a/src/xrpld/app/misc/CanonicalTXSet.h +++ b/src/xrpld/app/misc/CanonicalTXSet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_CANONICALTXSET_H_INCLUDED -#define XRPL_APP_MISC_CANONICALTXSET_H_INCLUDED +#pragma once #include #include @@ -156,5 +155,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/DelegateUtils.h b/src/xrpld/app/misc/DelegateUtils.h index 37d9195a82..78ccc46d0b 100644 --- a/src/xrpld/app/misc/DelegateUtils.h +++ b/src/xrpld/app/misc/DelegateUtils.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_DELEGATEUTILS_H_INCLUDED -#define XRPL_APP_MISC_DELEGATEUTILS_H_INCLUDED +#pragma once #include #include @@ -34,5 +33,3 @@ loadGranularPermission( std::unordered_set& granularPermissions); } // namespace xrpl - -#endif // XRPL_APP_MISC_DELEGATEUTILS_H_INCLUDED diff --git a/src/xrpld/app/misc/DeliverMax.h b/src/xrpld/app/misc/DeliverMax.h index e9455354f8..1b4241f091 100644 --- a/src/xrpld/app/misc/DeliverMax.h +++ b/src/xrpld/app/misc/DeliverMax.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_DELIVERMAX_H_INCLUDED -#define XRPL_APP_MISC_DELIVERMAX_H_INCLUDED +#pragma once #include @@ -27,5 +26,3 @@ insertDeliverMax(Json::Value& tx_json, TxType txnType, unsigned int apiVersion); } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/FeeVote.h b/src/xrpld/app/misc/FeeVote.h index 4b7f7f8409..3ecf474867 100644 --- a/src/xrpld/app/misc/FeeVote.h +++ b/src/xrpld/app/misc/FeeVote.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_FEEVOTE_H_INCLUDED -#define XRPL_APP_MISC_FEEVOTE_H_INCLUDED +#pragma once #include #include @@ -42,5 +41,3 @@ std::unique_ptr make_FeeVote(FeeSetup const& setup, beast::Journal journal); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/HashRouter.h b/src/xrpld/app/misc/HashRouter.h index d4ff8629f3..ad6da520bd 100644 --- a/src/xrpld/app/misc/HashRouter.h +++ b/src/xrpld/app/misc/HashRouter.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_HASHROUTER_H_INCLUDED -#define XRPL_APP_MISC_HASHROUTER_H_INCLUDED +#pragma once #include #include @@ -256,5 +255,3 @@ HashRouter::Setup setup_HashRouter(Config const&); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/LendingHelpers.h b/src/xrpld/app/misc/LendingHelpers.h index 0e04f0f793..f8297dfdf7 100644 --- a/src/xrpld/app/misc/LendingHelpers.h +++ b/src/xrpld/app/misc/LendingHelpers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_LENDINGHELPERS_H_INCLUDED -#define XRPL_APP_MISC_LENDINGHELPERS_H_INCLUDED +#pragma once #include #include @@ -466,5 +465,3 @@ loanMakePayment( beast::Journal j); } // namespace xrpl - -#endif // XRPL_APP_MISC_LENDINGHELPERS_H_INCLUDED diff --git a/src/xrpld/app/misc/LoadFeeTrack.h b/src/xrpld/app/misc/LoadFeeTrack.h index 3c6932fa41..8eb53187ce 100644 --- a/src/xrpld/app/misc/LoadFeeTrack.h +++ b/src/xrpld/app/misc/LoadFeeTrack.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_LOADFEETRACK_H_INCLUDED -#define XRPL_CORE_LOADFEETRACK_H_INCLUDED +#pragma once #include #include @@ -136,5 +135,3 @@ XRPAmount scaleFeeLoad(XRPAmount fee, LoadFeeTrack const& feeTrack, Fees const& fees, bool bUnlimited); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/Manifest.h b/src/xrpld/app/misc/Manifest.h index a41e16dbf9..79426a1a46 100644 --- a/src/xrpld/app/misc/Manifest.h +++ b/src/xrpld/app/misc/Manifest.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_MANIFEST_H_INCLUDED -#define XRPL_APP_MISC_MANIFEST_H_INCLUDED +#pragma once #include #include @@ -427,5 +426,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/NegativeUNLVote.h b/src/xrpld/app/misc/NegativeUNLVote.h index 68daa0e57b..4019d32f13 100644 --- a/src/xrpld/app/misc/NegativeUNLVote.h +++ b/src/xrpld/app/misc/NegativeUNLVote.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_NEGATIVEUNLVOTE_H_INCLUDED -#define XRPL_APP_MISC_NEGATIVEUNLVOTE_H_INCLUDED +#pragma once #include @@ -188,5 +187,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/NetworkOPs.h b/src/xrpld/app/misc/NetworkOPs.h index 7e230510a8..66c915008a 100644 --- a/src/xrpld/app/misc/NetworkOPs.h +++ b/src/xrpld/app/misc/NetworkOPs.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_NETWORKOPS_H_INCLUDED -#define XRPL_APP_MISC_NETWORKOPS_H_INCLUDED +#pragma once #include #include @@ -263,5 +262,3 @@ make_NetworkOPs( beast::insight::Collector::ptr const& collector); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/SHAMapStore.h b/src/xrpld/app/misc/SHAMapStore.h index 30253d92a5..67477593cb 100644 --- a/src/xrpld/app/misc/SHAMapStore.h +++ b/src/xrpld/app/misc/SHAMapStore.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_SHAMAPSTORE_H_INCLUDED -#define XRPL_APP_MISC_SHAMAPSTORE_H_INCLUDED +#pragma once #include @@ -86,5 +85,3 @@ public: std::unique_ptr make_SHAMapStore(Application& app, NodeStore::Scheduler& scheduler, beast::Journal journal); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/SHAMapStoreImp.h b/src/xrpld/app/misc/SHAMapStoreImp.h index 05faae5bd4..a0475e80d6 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.h +++ b/src/xrpld/app/misc/SHAMapStoreImp.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_SHAMAPSTOREIMP_H_INCLUDED -#define XRPL_APP_MISC_SHAMAPSTOREIMP_H_INCLUDED +#pragma once #include #include @@ -221,5 +220,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/Transaction.h b/src/xrpld/app/misc/Transaction.h index c902d4a4f3..22f3e9d1fd 100644 --- a/src/xrpld/app/misc/Transaction.h +++ b/src/xrpld/app/misc/Transaction.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_TRANSACTION_H_INCLUDED -#define XRPL_APP_MISC_TRANSACTION_H_INCLUDED +#pragma once #include #include @@ -386,5 +385,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/TxQ.h b/src/xrpld/app/misc/TxQ.h index 004cd085fc..b50ff1a0b5 100644 --- a/src/xrpld/app/misc/TxQ.h +++ b/src/xrpld/app/misc/TxQ.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TXQ_H_INCLUDED -#define XRPL_TXQ_H_INCLUDED +#pragma once #include @@ -825,5 +824,3 @@ toFeeLevel(XRPAmount const& drops, XRPAmount const& baseFee) } } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/ValidatorKeys.h b/src/xrpld/app/misc/ValidatorKeys.h index 3a9aaf6d2c..296c63e09e 100644 --- a/src/xrpld/app/misc/ValidatorKeys.h +++ b/src/xrpld/app/misc/ValidatorKeys.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_VALIDATOR_KEYS_H_INCLUDED -#define XRPL_APP_MISC_VALIDATOR_KEYS_H_INCLUDED +#pragma once #include #include @@ -55,5 +54,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/ValidatorList.h b/src/xrpld/app/misc/ValidatorList.h index 3b15af00dc..4fd610be04 100644 --- a/src/xrpld/app/misc/ValidatorList.h +++ b/src/xrpld/app/misc/ValidatorList.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_VALIDATORLIST_H_INCLUDED -#define XRPL_APP_MISC_VALIDATORLIST_H_INCLUDED +#pragma once #include #include @@ -926,5 +925,3 @@ hash_append(Hasher& h, TMValidatorListCollection const& msg) } } // namespace protocol - -#endif diff --git a/src/xrpld/app/misc/ValidatorSite.h b/src/xrpld/app/misc/ValidatorSite.h index 075722bca6..dc44e28bcb 100644 --- a/src/xrpld/app/misc/ValidatorSite.h +++ b/src/xrpld/app/misc/ValidatorSite.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_VALIDATORSITE_H_INCLUDED -#define XRPL_APP_MISC_VALIDATORSITE_H_INCLUDED +#pragma once #include #include @@ -227,5 +226,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/detail/AccountTxPaging.h b/src/xrpld/app/misc/detail/AccountTxPaging.h index cbfe8c89bb..6dff5c481b 100644 --- a/src/xrpld/app/misc/detail/AccountTxPaging.h +++ b/src/xrpld/app/misc/detail/AccountTxPaging.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_IMPL_ACCOUNTTXPAGING_H_INCLUDED -#define XRPL_APP_MISC_IMPL_ACCOUNTTXPAGING_H_INCLUDED +#pragma once #include @@ -22,5 +21,3 @@ void saveLedgerAsync(Application& app, std::uint32_t seq); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/detail/Work.h b/src/xrpld/app/misc/detail/Work.h index 90e81b7bbf..5261cf3bd7 100644 --- a/src/xrpld/app/misc/detail/Work.h +++ b/src/xrpld/app/misc/detail/Work.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_DETAIL_WORK_H_INCLUDED -#define XRPL_APP_MISC_DETAIL_WORK_H_INCLUDED +#pragma once #include #include @@ -25,5 +24,3 @@ public: } // namespace detail } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/detail/WorkBase.h b/src/xrpld/app/misc/detail/WorkBase.h index 1e519c7b2f..e5fd72f118 100644 --- a/src/xrpld/app/misc/detail/WorkBase.h +++ b/src/xrpld/app/misc/detail/WorkBase.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_DETAIL_WORKBASE_H_INCLUDED -#define XRPL_APP_MISC_DETAIL_WORKBASE_H_INCLUDED +#pragma once #include @@ -258,5 +257,3 @@ WorkBase::close() } // namespace detail } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/detail/WorkFile.h b/src/xrpld/app/misc/detail/WorkFile.h index cce7fd410e..8d2d4edb50 100644 --- a/src/xrpld/app/misc/detail/WorkFile.h +++ b/src/xrpld/app/misc/detail/WorkFile.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_DETAIL_WORKFILE_H_INCLUDED -#define XRPL_APP_MISC_DETAIL_WORKFILE_H_INCLUDED +#pragma once #include @@ -80,5 +79,3 @@ WorkFile::cancel() } // namespace detail } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/detail/WorkPlain.h b/src/xrpld/app/misc/detail/WorkPlain.h index cac6d76a62..d1df5b4b3b 100644 --- a/src/xrpld/app/misc/detail/WorkPlain.h +++ b/src/xrpld/app/misc/detail/WorkPlain.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_DETAIL_WORKPLAIN_H_INCLUDED -#define XRPL_APP_MISC_DETAIL_WORKPLAIN_H_INCLUDED +#pragma once #include @@ -60,5 +59,3 @@ WorkPlain::onConnect(error_code const& ec) } // namespace detail } // namespace xrpl - -#endif diff --git a/src/xrpld/app/misc/detail/WorkSSL.h b/src/xrpld/app/misc/detail/WorkSSL.h index bed963d8ec..b12c774f6e 100644 --- a/src/xrpld/app/misc/detail/WorkSSL.h +++ b/src/xrpld/app/misc/detail/WorkSSL.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_MISC_DETAIL_WORKSSL_H_INCLUDED -#define XRPL_APP_MISC_DETAIL_WORKSSL_H_INCLUDED +#pragma once #include #include @@ -57,5 +56,3 @@ private: } // namespace detail } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/AMMContext.h b/src/xrpld/app/paths/AMMContext.h index 9e82a7394a..b0ff44c5ec 100644 --- a/src/xrpld/app/paths/AMMContext.h +++ b/src/xrpld/app/paths/AMMContext.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_AMMCONTEXT_H_INCLUDED -#define XRPL_APP_PATHS_AMMCONTEXT_H_INCLUDED +#pragma once #include @@ -95,5 +94,3 @@ public: }; } // namespace xrpl - -#endif // XRPL_APP_PATHS_AMMCONTEXT_H_INCLUDED diff --git a/src/xrpld/app/paths/AMMLiquidity.h b/src/xrpld/app/paths/AMMLiquidity.h index c22901b28e..441c3b6e3d 100644 --- a/src/xrpld/app/paths/AMMLiquidity.h +++ b/src/xrpld/app/paths/AMMLiquidity.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_TX_AMMLIQUIDITY_H_INCLUDED -#define XRPL_APP_TX_AMMLIQUIDITY_H_INCLUDED +#pragma once #include #include @@ -131,5 +130,3 @@ private: }; } // namespace xrpl - -#endif // XRPL_APP_TX_AMMLIQUIDITY_H_INCLUDED diff --git a/src/xrpld/app/paths/AMMOffer.h b/src/xrpld/app/paths/AMMOffer.h index 893938f0f2..ebaa7311c0 100644 --- a/src/xrpld/app/paths/AMMOffer.h +++ b/src/xrpld/app/paths/AMMOffer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_AMMOFFER_H_INCLUDED -#define XRPL_APP_AMMOFFER_H_INCLUDED +#pragma once #include #include @@ -124,5 +123,3 @@ public: }; } // namespace xrpl - -#endif // XRPL_APP_AMMOFFER_H_INCLUDED diff --git a/src/xrpld/app/paths/AccountCurrencies.h b/src/xrpld/app/paths/AccountCurrencies.h index f0fa1bc504..eb8cc92aec 100644 --- a/src/xrpld/app/paths/AccountCurrencies.h +++ b/src/xrpld/app/paths/AccountCurrencies.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_ACCOUNTCURRENCIES_H_INCLUDED -#define XRPL_APP_PATHS_ACCOUNTCURRENCIES_H_INCLUDED +#pragma once #include @@ -14,5 +13,3 @@ hash_set accountSourceCurrencies(AccountID const& account, std::shared_ptr const& lrLedger, bool includeXRP); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/Flow.h b/src/xrpld/app/paths/Flow.h index 5fafe294db..1a46ce221a 100644 --- a/src/xrpld/app/paths/Flow.h +++ b/src/xrpld/app/paths/Flow.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_FLOW_H_INCLUDED -#define XRPL_APP_PATHS_FLOW_H_INCLUDED +#pragma once #include #include @@ -52,5 +51,3 @@ flow( path::detail::FlowDebugInfo* flowDebugInfo = nullptr); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/PathRequest.h b/src/xrpld/app/paths/PathRequest.h index edeab4dc88..864d2cb932 100644 --- a/src/xrpld/app/paths/PathRequest.h +++ b/src/xrpld/app/paths/PathRequest.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_PATHREQUEST_H_INCLUDED -#define XRPL_APP_PATHS_PATHREQUEST_H_INCLUDED +#pragma once #include #include @@ -155,5 +154,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/PathRequests.h b/src/xrpld/app/paths/PathRequests.h index 33b817f8c0..f89ca3c4da 100644 --- a/src/xrpld/app/paths/PathRequests.h +++ b/src/xrpld/app/paths/PathRequests.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_PATHREQUESTS_H_INCLUDED -#define XRPL_APP_PATHS_PATHREQUESTS_H_INCLUDED +#pragma once #include #include @@ -96,5 +95,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/Pathfinder.h b/src/xrpld/app/paths/Pathfinder.h index 131e9420c1..03f2d6f038 100644 --- a/src/xrpld/app/paths/Pathfinder.h +++ b/src/xrpld/app/paths/Pathfinder.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_PATHFINDER_H_INCLUDED -#define XRPL_APP_PATHS_PATHFINDER_H_INCLUDED +#pragma once #include #include @@ -211,5 +210,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/RippleCalc.h b/src/xrpld/app/paths/RippleCalc.h index 0ef2641e36..a5cecc18bf 100644 --- a/src/xrpld/app/paths/RippleCalc.h +++ b/src/xrpld/app/paths/RippleCalc.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_RIPPLECALC_H_INCLUDED -#define XRPL_APP_PATHS_RIPPLECALC_H_INCLUDED +#pragma once #include #include @@ -108,5 +107,3 @@ public: } // namespace path } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/RippleLineCache.h b/src/xrpld/app/paths/RippleLineCache.h index 8307fb8b4b..5dbdb414ee 100644 --- a/src/xrpld/app/paths/RippleLineCache.h +++ b/src/xrpld/app/paths/RippleLineCache.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_RIPPLELINECACHE_H_INCLUDED -#define XRPL_APP_PATHS_RIPPLELINECACHE_H_INCLUDED +#pragma once #include #include @@ -99,5 +98,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/TrustLine.h b/src/xrpld/app/paths/TrustLine.h index 45cc797cb4..a0fce8847a 100644 --- a/src/xrpld/app/paths/TrustLine.h +++ b/src/xrpld/app/paths/TrustLine.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_RIPPLESTATE_H_INCLUDED -#define XRPL_APP_PATHS_RIPPLESTATE_H_INCLUDED +#pragma once #include #include @@ -217,5 +216,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/detail/AmountSpec.h b/src/xrpld/app/paths/detail/AmountSpec.h index 3ebe5fde91..690e67ae22 100644 --- a/src/xrpld/app/paths/detail/AmountSpec.h +++ b/src/xrpld/app/paths/detail/AmountSpec.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PATH_IMPL_AMOUNTSPEC_H_INCLUDED -#define XRPL_PATH_IMPL_AMOUNTSPEC_H_INCLUDED +#pragma once #include #include @@ -197,5 +196,3 @@ toAmountSpec(EitherAmount const& ea, std::optional const& c) } } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/detail/FlatSets.h b/src/xrpld/app/paths/detail/FlatSets.h index a14db370fa..a7546cc514 100644 --- a/src/xrpld/app/paths/detail/FlatSets.h +++ b/src/xrpld/app/paths/detail/FlatSets.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_IMPL_FLAT_SETS_H_INCLUDED -#define XRPL_APP_PATHS_IMPL_FLAT_SETS_H_INCLUDED +#pragma once #include @@ -23,5 +22,3 @@ SetUnion(boost::container::flat_set& dst, boost::container::flat_set const } } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/detail/FlowDebugInfo.h b/src/xrpld/app/paths/detail/FlowDebugInfo.h index a38ab7864f..d7b97a49d4 100644 --- a/src/xrpld/app/paths/detail/FlowDebugInfo.h +++ b/src/xrpld/app/paths/detail/FlowDebugInfo.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PATH_IMPL_FLOWDEBUGINFO_H_INCLUDED -#define XRPL_PATH_IMPL_FLOWDEBUGINFO_H_INCLUDED +#pragma once #include @@ -329,4 +328,3 @@ balanceDiffsToString(std::optional const& bd) } // namespace detail } // namespace path } // namespace xrpl -#endif diff --git a/src/xrpld/app/paths/detail/PathfinderUtils.h b/src/xrpld/app/paths/detail/PathfinderUtils.h index 5571cd4732..560deca2d6 100644 --- a/src/xrpld/app/paths/detail/PathfinderUtils.h +++ b/src/xrpld/app/paths/detail/PathfinderUtils.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PATH_IMPL_PATHFINDERUTILS_H_INCLUDED -#define XRPL_PATH_IMPL_PATHFINDERUTILS_H_INCLUDED +#pragma once #include @@ -30,5 +29,3 @@ convertAllCheck(STAmount const& a) } } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/detail/StepChecks.h b/src/xrpld/app/paths/detail/StepChecks.h index b72461fc43..479f1298d3 100644 --- a/src/xrpld/app/paths/detail/StepChecks.h +++ b/src/xrpld/app/paths/detail/StepChecks.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_IMPL_STEP_CHECKS_H_INCLUDED -#define XRPL_APP_PATHS_IMPL_STEP_CHECKS_H_INCLUDED +#pragma once #include #include @@ -84,5 +83,3 @@ checkNoRipple( } } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/detail/Steps.h b/src/xrpld/app/paths/detail/Steps.h index 7fc4d8b3b4..580b8c487e 100644 --- a/src/xrpld/app/paths/detail/Steps.h +++ b/src/xrpld/app/paths/detail/Steps.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_IMPL_PAYSTEPS_H_INCLUDED -#define XRPL_APP_PATHS_IMPL_PAYSTEPS_H_INCLUDED +#pragma once #include @@ -591,5 +590,3 @@ isDirectXrpToXrp(Strand const& strand); /// @endcond } // namespace xrpl - -#endif diff --git a/src/xrpld/app/paths/detail/StrandFlow.h b/src/xrpld/app/paths/detail/StrandFlow.h index ebb9257ed4..aa3d00a822 100644 --- a/src/xrpld/app/paths/detail/StrandFlow.h +++ b/src/xrpld/app/paths/detail/StrandFlow.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PATHS_IMPL_STRANDFLOW_H_INCLUDED -#define XRPL_APP_PATHS_IMPL_STRANDFLOW_H_INCLUDED +#pragma once #include #include @@ -784,5 +783,3 @@ flow( } } // namespace xrpl - -#endif diff --git a/src/xrpld/app/rdb/PeerFinder.h b/src/xrpld/app/rdb/PeerFinder.h index a6dfde1f65..2b4080255f 100644 --- a/src/xrpld/app/rdb/PeerFinder.h +++ b/src/xrpld/app/rdb/PeerFinder.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_RDB_PEERFINDER_H_INCLUDED -#define XRPL_APP_RDB_PEERFINDER_H_INCLUDED +#pragma once #include #include @@ -43,5 +42,3 @@ void savePeerFinderDB(soci::session& session, std::vector const& v); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/rdb/RelationalDatabase.h b/src/xrpld/app/rdb/RelationalDatabase.h index cb43c8c95d..c0cc61f757 100644 --- a/src/xrpld/app/rdb/RelationalDatabase.h +++ b/src/xrpld/app/rdb/RelationalDatabase.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_RDB_RELATIONALDATABASE_H_INCLUDED -#define XRPL_APP_RDB_RELATIONALDATABASE_H_INCLUDED +#pragma once #include #include @@ -225,5 +224,3 @@ rangeCheckedCast(C c) } } // namespace xrpl - -#endif diff --git a/src/xrpld/app/rdb/State.h b/src/xrpld/app/rdb/State.h index 4c68154645..52118b3cf8 100644 --- a/src/xrpld/app/rdb/State.h +++ b/src/xrpld/app/rdb/State.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_RDB_STATE_H_INCLUDED -#define XRPL_APP_RDB_STATE_H_INCLUDED +#pragma once #include #include @@ -72,5 +71,3 @@ void setLastRotated(soci::session& session, LedgerIndex seq); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/rdb/Vacuum.h b/src/xrpld/app/rdb/Vacuum.h index d7ca5f8bce..f592b4537e 100644 --- a/src/xrpld/app/rdb/Vacuum.h +++ b/src/xrpld/app/rdb/Vacuum.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_RDB_VACUUM_H_INCLUDED -#define XRPL_APP_RDB_VACUUM_H_INCLUDED +#pragma once #include @@ -15,5 +14,3 @@ bool doVacuumDB(DatabaseCon::Setup const& setup, beast::Journal j); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/rdb/Wallet.h b/src/xrpld/app/rdb/Wallet.h index 3a967fd339..141ef53f27 100644 --- a/src/xrpld/app/rdb/Wallet.h +++ b/src/xrpld/app/rdb/Wallet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_RDB_WALLET_H_INCLUDED -#define XRPL_APP_RDB_WALLET_H_INCLUDED +#pragma once #include #include @@ -145,5 +144,3 @@ void voteAmendment(soci::session& session, uint256 const& amendment, std::string const& name, AmendmentVote vote); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/rdb/backend/SQLiteDatabase.h b/src/xrpld/app/rdb/backend/SQLiteDatabase.h index 6e3ec7d311..b6dcb2534b 100644 --- a/src/xrpld/app/rdb/backend/SQLiteDatabase.h +++ b/src/xrpld/app/rdb/backend/SQLiteDatabase.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_RDB_BACKEND_SQLITEDATABASE_H_INCLUDED -#define XRPL_APP_RDB_BACKEND_SQLITEDATABASE_H_INCLUDED +#pragma once #include @@ -285,5 +284,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/rdb/backend/detail/Node.h b/src/xrpld/app/rdb/backend/detail/Node.h index a1bfd84567..69c4894bbc 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.h +++ b/src/xrpld/app/rdb/backend/detail/Node.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_RDB_BACKEND_DETAIL_NODE_H_INCLUDED -#define XRPL_APP_RDB_BACKEND_DETAIL_NODE_H_INCLUDED +#pragma once #include #include @@ -404,5 +403,3 @@ dbHasSpace(soci::session& session, Config const& config, beast::Journal j); } // namespace detail } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/apply.h b/src/xrpld/app/tx/apply.h index db60097200..c3ff4f905e 100644 --- a/src/xrpld/app/tx/apply.h +++ b/src/xrpld/app/tx/apply.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_APPLY_H_INCLUDED -#define XRPL_TX_APPLY_H_INCLUDED +#pragma once #include #include @@ -130,5 +129,3 @@ applyTransaction( beast::Journal journal); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/applySteps.h b/src/xrpld/app/tx/applySteps.h index ffb9fda5b5..ef87d352f3 100644 --- a/src/xrpld/app/tx/applySteps.h +++ b/src/xrpld/app/tx/applySteps.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_APPLYSTEPS_H_INCLUDED -#define XRPL_TX_APPLYSTEPS_H_INCLUDED +#pragma once #include #include @@ -337,5 +336,3 @@ ApplyResult doApply(PreclaimResult const& preclaimResult, Application& app, OpenView& view); } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/AMMBid.h b/src/xrpld/app/tx/detail/AMMBid.h index b402e82f9d..83ea6e0729 100644 --- a/src/xrpld/app/tx/detail/AMMBid.h +++ b/src/xrpld/app/tx/detail/AMMBid.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_AMMBID_H_INCLUDED -#define XRPL_TX_AMMBID_H_INCLUDED +#pragma once #include @@ -66,5 +65,3 @@ public: }; } // namespace xrpl - -#endif // XRPL_TX_AMMBID_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/AMMClawback.h b/src/xrpld/app/tx/detail/AMMClawback.h index 0615234ffa..3da3c44605 100644 --- a/src/xrpld/app/tx/detail/AMMClawback.h +++ b/src/xrpld/app/tx/detail/AMMClawback.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_AMMCLAWBACK_H_INCLUDED -#define XRPL_TX_AMMCLAWBACK_H_INCLUDED +#pragma once #include @@ -55,5 +54,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/AMMCreate.h b/src/xrpld/app/tx/detail/AMMCreate.h index da77f79c5e..6f9fd77a2f 100644 --- a/src/xrpld/app/tx/detail/AMMCreate.h +++ b/src/xrpld/app/tx/detail/AMMCreate.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_AMMCREATE_H_INCLUDED -#define XRPL_TX_AMMCREATE_H_INCLUDED +#pragma once #include @@ -62,5 +61,3 @@ public: }; } // namespace xrpl - -#endif // XRPL_TX_AMMCREATE_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/AMMDelete.h b/src/xrpld/app/tx/detail/AMMDelete.h index a09b855c7c..20c8f87262 100644 --- a/src/xrpld/app/tx/detail/AMMDelete.h +++ b/src/xrpld/app/tx/detail/AMMDelete.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_AMMDELETE_H_INCLUDED -#define XRPL_TX_AMMDELETE_H_INCLUDED +#pragma once #include @@ -34,5 +33,3 @@ public: }; } // namespace xrpl - -#endif // XRPL_TX_AMMDELETE_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/AMMDeposit.h b/src/xrpld/app/tx/detail/AMMDeposit.h index 7fd50c4c4d..45c7995438 100644 --- a/src/xrpld/app/tx/detail/AMMDeposit.h +++ b/src/xrpld/app/tx/detail/AMMDeposit.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_AMMDEPOSIT_H_INCLUDED -#define XRPL_TX_AMMDEPOSIT_H_INCLUDED +#pragma once #include @@ -230,5 +229,3 @@ private: }; } // namespace xrpl - -#endif // XRPL_TX_AMMDEPOSIT_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/AMMVote.h b/src/xrpld/app/tx/detail/AMMVote.h index 1dec046c29..2bc3da2301 100644 --- a/src/xrpld/app/tx/detail/AMMVote.h +++ b/src/xrpld/app/tx/detail/AMMVote.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_AMMVOTE_H_INCLUDED -#define XRPL_TX_AMMVOTE_H_INCLUDED +#pragma once #include @@ -51,5 +50,3 @@ public: }; } // namespace xrpl - -#endif // XRPL_TX_AMMVOTE_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/AMMWithdraw.h b/src/xrpld/app/tx/detail/AMMWithdraw.h index 916621a5d0..246c66100c 100644 --- a/src/xrpld/app/tx/detail/AMMWithdraw.h +++ b/src/xrpld/app/tx/detail/AMMWithdraw.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_AMMWITHDRAW_H_INCLUDED -#define XRPL_TX_AMMWITHDRAW_H_INCLUDED +#pragma once #include @@ -294,5 +293,3 @@ private: }; } // namespace xrpl - -#endif // XRPL_TX_AMMWITHDRAW_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/ApplyContext.h b/src/xrpld/app/tx/detail/ApplyContext.h index b4e91ff76c..45345df265 100644 --- a/src/xrpld/app/tx/detail/ApplyContext.h +++ b/src/xrpld/app/tx/detail/ApplyContext.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_APPLYCONTEXT_H_INCLUDED -#define XRPL_TX_APPLYCONTEXT_H_INCLUDED +#pragma once #include #include @@ -129,5 +128,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/Batch.h b/src/xrpld/app/tx/detail/Batch.h index a8cfeadc6b..8af8b2e020 100644 --- a/src/xrpld/app/tx/detail/Batch.h +++ b/src/xrpld/app/tx/detail/Batch.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_BATCH_H_INCLUDED -#define XRPL_TX_BATCH_H_INCLUDED +#pragma once #include #include @@ -56,5 +55,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/BookTip.h b/src/xrpld/app/tx/detail/BookTip.h index 51dc252835..69d3ec70d8 100644 --- a/src/xrpld/app/tx/detail/BookTip.h +++ b/src/xrpld/app/tx/detail/BookTip.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_BOOK_BOOKTIP_H_INCLUDED -#define XRPL_APP_BOOK_BOOKTIP_H_INCLUDED +#pragma once #include #include @@ -62,5 +61,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/CancelCheck.h b/src/xrpld/app/tx/detail/CancelCheck.h index 4be696520d..f125b9af5b 100644 --- a/src/xrpld/app/tx/detail/CancelCheck.h +++ b/src/xrpld/app/tx/detail/CancelCheck.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_CANCELCHECK_H_INCLUDED -#define XRPL_TX_CANCELCHECK_H_INCLUDED +#pragma once #include @@ -27,5 +26,3 @@ public: using CheckCancel = CancelCheck; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/CancelOffer.h b/src/xrpld/app/tx/detail/CancelOffer.h index 33af365c4d..30a7129fb4 100644 --- a/src/xrpld/app/tx/detail/CancelOffer.h +++ b/src/xrpld/app/tx/detail/CancelOffer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_CANCELOFFER_H_INCLUDED -#define XRPL_TX_CANCELOFFER_H_INCLUDED +#pragma once #include @@ -29,5 +28,3 @@ public: using OfferCancel = CancelOffer; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/CashCheck.h b/src/xrpld/app/tx/detail/CashCheck.h index f27a45a0c4..50a4f8a63a 100644 --- a/src/xrpld/app/tx/detail/CashCheck.h +++ b/src/xrpld/app/tx/detail/CashCheck.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_CASHCHECK_H_INCLUDED -#define XRPL_TX_CASHCHECK_H_INCLUDED +#pragma once #include @@ -27,5 +26,3 @@ public: using CheckCash = CashCheck; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/Change.h b/src/xrpld/app/tx/detail/Change.h index 4d7b76ed78..683b054ccb 100644 --- a/src/xrpld/app/tx/detail/Change.h +++ b/src/xrpld/app/tx/detail/Change.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_CHANGE_H_INCLUDED -#define XRPL_TX_CHANGE_H_INCLUDED +#pragma once #include @@ -44,5 +43,3 @@ using SetFee = Change; using UNLModify = Change; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/Clawback.h b/src/xrpld/app/tx/detail/Clawback.h index 8db93fcc01..427edb25b4 100644 --- a/src/xrpld/app/tx/detail/Clawback.h +++ b/src/xrpld/app/tx/detail/Clawback.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_CLAWBACK_H_INCLUDED -#define XRPL_TX_CLAWBACK_H_INCLUDED +#pragma once #include @@ -28,5 +27,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/CreateCheck.h b/src/xrpld/app/tx/detail/CreateCheck.h index ac735eecb0..b80536fe02 100644 --- a/src/xrpld/app/tx/detail/CreateCheck.h +++ b/src/xrpld/app/tx/detail/CreateCheck.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_CREATECHECK_H_INCLUDED -#define XRPL_TX_CREATECHECK_H_INCLUDED +#pragma once #include @@ -27,5 +26,3 @@ public: using CheckCreate = CreateCheck; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/CreateOffer.h b/src/xrpld/app/tx/detail/CreateOffer.h index 5aaa60c20e..14f82c501e 100644 --- a/src/xrpld/app/tx/detail/CreateOffer.h +++ b/src/xrpld/app/tx/detail/CreateOffer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_CREATEOFFER_H_INCLUDED -#define XRPL_TX_CREATEOFFER_H_INCLUDED +#pragma once #include @@ -79,5 +78,3 @@ private: using OfferCreate = CreateOffer; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/CreateTicket.h b/src/xrpld/app/tx/detail/CreateTicket.h index a41c7e2b1f..2a6e1bb8cc 100644 --- a/src/xrpld/app/tx/detail/CreateTicket.h +++ b/src/xrpld/app/tx/detail/CreateTicket.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_CREATETICKET_H_INCLUDED -#define XRPL_TX_CREATETICKET_H_INCLUDED +#pragma once #include #include @@ -66,5 +65,3 @@ public: using TicketCreate = CreateTicket; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/Credentials.h b/src/xrpld/app/tx/detail/Credentials.h index 6723a2f0e4..02bccde198 100644 --- a/src/xrpld/app/tx/detail/Credentials.h +++ b/src/xrpld/app/tx/detail/Credentials.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_CREDENTIALS_H_INCLUDED -#define XRPL_TX_CREDENTIALS_H_INCLUDED +#pragma once #include @@ -76,5 +75,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/DID.h b/src/xrpld/app/tx/detail/DID.h index b8d0889add..a00039a999 100644 --- a/src/xrpld/app/tx/detail/DID.h +++ b/src/xrpld/app/tx/detail/DID.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_DID_H_INCLUDED -#define XRPL_TX_DID_H_INCLUDED +#pragma once #include @@ -46,5 +45,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/DelegateSet.h b/src/xrpld/app/tx/detail/DelegateSet.h index 568b16410e..2120674557 100644 --- a/src/xrpld/app/tx/detail/DelegateSet.h +++ b/src/xrpld/app/tx/detail/DelegateSet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_DELEGATESET_H_INCLUDED -#define XRPL_TX_DELEGATESET_H_INCLUDED +#pragma once #include @@ -29,5 +28,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/DeleteAccount.h b/src/xrpld/app/tx/detail/DeleteAccount.h index 357f87d566..742d1f4257 100644 --- a/src/xrpld/app/tx/detail/DeleteAccount.h +++ b/src/xrpld/app/tx/detail/DeleteAccount.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_DELETEACCOUNT_H_INCLUDED -#define XRPL_TX_DELETEACCOUNT_H_INCLUDED +#pragma once #include @@ -33,5 +32,3 @@ public: using AccountDelete = DeleteAccount; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/DeleteOracle.h b/src/xrpld/app/tx/detail/DeleteOracle.h index d59699cdfb..7d7cc340cb 100644 --- a/src/xrpld/app/tx/detail/DeleteOracle.h +++ b/src/xrpld/app/tx/detail/DeleteOracle.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_DELETEORACLE_H_INCLUDED -#define XRPL_TX_DELETEORACLE_H_INCLUDED +#pragma once #include @@ -39,5 +38,3 @@ public: using OracleDelete = DeleteOracle; } // namespace xrpl - -#endif // XRPL_TX_DELETEORACLE_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/DepositPreauth.h b/src/xrpld/app/tx/detail/DepositPreauth.h index 693b321580..f1afac3b18 100644 --- a/src/xrpld/app/tx/detail/DepositPreauth.h +++ b/src/xrpld/app/tx/detail/DepositPreauth.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_DEPOSIT_PREAUTH_H_INCLUDED -#define XRPL_TX_DEPOSIT_PREAUTH_H_INCLUDED +#pragma once #include @@ -32,5 +31,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/Escrow.h b/src/xrpld/app/tx/detail/Escrow.h index 935fb27cd0..cb99dcae06 100644 --- a/src/xrpld/app/tx/detail/Escrow.h +++ b/src/xrpld/app/tx/detail/Escrow.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_ESCROW_H_INCLUDED -#define XRPL_TX_ESCROW_H_INCLUDED +#pragma once #include @@ -79,5 +78,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/InvariantCheck.h b/src/xrpld/app/tx/detail/InvariantCheck.h index e941db4eff..9a20e372ba 100644 --- a/src/xrpld/app/tx/detail/InvariantCheck.h +++ b/src/xrpld/app/tx/detail/InvariantCheck.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_TX_INVARIANTCHECK_H_INCLUDED -#define XRPL_APP_TX_INVARIANTCHECK_H_INCLUDED +#pragma once #include #include @@ -720,5 +719,3 @@ getInvariantChecks() } } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/LedgerStateFix.h b/src/xrpld/app/tx/detail/LedgerStateFix.h index e1a7f85ecc..66fe124cff 100644 --- a/src/xrpld/app/tx/detail/LedgerStateFix.h +++ b/src/xrpld/app/tx/detail/LedgerStateFix.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_LEDGER_STATE_FIX_H_INCLUDED -#define XRPL_TX_LEDGER_STATE_FIX_H_INCLUDED +#pragma once #include @@ -32,5 +31,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.h b/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.h index 3c4f997d95..139d50696a 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.h +++ b/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_LOANBROKERCOVERCLAWBACK_H_INCLUDED -#define XRPL_TX_LOANBROKERCOVERCLAWBACK_H_INCLUDED +#pragma once #include @@ -30,5 +29,3 @@ public: //------------------------------------------------------------------------------ } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.h b/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.h index d2f17b1f1c..3f683c6a62 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.h +++ b/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_LOANBROKERCOVERDEPOSIT_H_INCLUDED -#define XRPL_TX_LOANBROKERCOVERDEPOSIT_H_INCLUDED +#pragma once #include @@ -30,5 +29,3 @@ public: //------------------------------------------------------------------------------ } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.h b/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.h index e0a9a2e51b..50d0b98fa5 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.h +++ b/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_LOANBROKERCOVERWITHDRAW_H_INCLUDED -#define XRPL_TX_LOANBROKERCOVERWITHDRAW_H_INCLUDED +#pragma once #include @@ -30,5 +29,3 @@ public: //------------------------------------------------------------------------------ } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/LoanBrokerDelete.h b/src/xrpld/app/tx/detail/LoanBrokerDelete.h index aaea2af81a..cb44277f55 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerDelete.h +++ b/src/xrpld/app/tx/detail/LoanBrokerDelete.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_LOANBROKERDELETE_H_INCLUDED -#define XRPL_TX_LOANBROKERDELETE_H_INCLUDED +#pragma once #include @@ -30,5 +29,3 @@ public: //------------------------------------------------------------------------------ } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/LoanBrokerSet.h b/src/xrpld/app/tx/detail/LoanBrokerSet.h index 57170b9cb9..cda452bebe 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerSet.h +++ b/src/xrpld/app/tx/detail/LoanBrokerSet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_LOANBROKERSET_H_INCLUDED -#define XRPL_TX_LOANBROKERSET_H_INCLUDED +#pragma once #include @@ -33,5 +32,3 @@ public: //------------------------------------------------------------------------------ } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/LoanDelete.h b/src/xrpld/app/tx/detail/LoanDelete.h index a1ebad340c..37889d31fb 100644 --- a/src/xrpld/app/tx/detail/LoanDelete.h +++ b/src/xrpld/app/tx/detail/LoanDelete.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_LOANDELETE_H_INCLUDED -#define XRPL_TX_LOANDELETE_H_INCLUDED +#pragma once #include @@ -30,5 +29,3 @@ public: //------------------------------------------------------------------------------ } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/LoanManage.h b/src/xrpld/app/tx/detail/LoanManage.h index c55380d869..44b2b62b3d 100644 --- a/src/xrpld/app/tx/detail/LoanManage.h +++ b/src/xrpld/app/tx/detail/LoanManage.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_LOANMANAGE_H_INCLUDED -#define XRPL_TX_LOANMANAGE_H_INCLUDED +#pragma once #include @@ -54,5 +53,3 @@ public: //------------------------------------------------------------------------------ } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/LoanPay.h b/src/xrpld/app/tx/detail/LoanPay.h index f951fdad5f..c947b1b6f8 100644 --- a/src/xrpld/app/tx/detail/LoanPay.h +++ b/src/xrpld/app/tx/detail/LoanPay.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_LOANPAY_H_INCLUDED -#define XRPL_TX_LOANPAY_H_INCLUDED +#pragma once #include @@ -36,5 +35,3 @@ public: //------------------------------------------------------------------------------ } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/LoanSet.h b/src/xrpld/app/tx/detail/LoanSet.h index d3853fbbdd..e4bb79a36d 100644 --- a/src/xrpld/app/tx/detail/LoanSet.h +++ b/src/xrpld/app/tx/detail/LoanSet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_LOANSET_H_INCLUDED -#define XRPL_TX_LOANSET_H_INCLUDED +#pragma once #include #include @@ -55,5 +54,3 @@ public: //------------------------------------------------------------------------------ } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/MPTokenAuthorize.h b/src/xrpld/app/tx/detail/MPTokenAuthorize.h index bf9a384743..c887b70fa8 100644 --- a/src/xrpld/app/tx/detail/MPTokenAuthorize.h +++ b/src/xrpld/app/tx/detail/MPTokenAuthorize.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_MPTOKENAUTHORIZE_H_INCLUDED -#define XRPL_TX_MPTOKENAUTHORIZE_H_INCLUDED +#pragma once #include @@ -40,5 +39,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.h b/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.h index 5b5268265c..56c20ed551 100644 --- a/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.h +++ b/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_MPTOKENISSUANCECREATE_H_INCLUDED -#define XRPL_TX_MPTOKENISSUANCECREATE_H_INCLUDED +#pragma once #include @@ -48,5 +47,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.h b/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.h index 5f59c9b1bd..89243944d0 100644 --- a/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.h +++ b/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_MPTOKENISSUANCEDESTROY_H_INCLUDED -#define XRPL_TX_MPTOKENISSUANCEDESTROY_H_INCLUDED +#pragma once #include @@ -28,5 +27,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/MPTokenIssuanceSet.h b/src/xrpld/app/tx/detail/MPTokenIssuanceSet.h index a687a37b47..68794ca48c 100644 --- a/src/xrpld/app/tx/detail/MPTokenIssuanceSet.h +++ b/src/xrpld/app/tx/detail/MPTokenIssuanceSet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_MPTOKENISSUANCESET_H_INCLUDED -#define XRPL_TX_MPTOKENISSUANCESET_H_INCLUDED +#pragma once #include @@ -34,5 +33,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/NFTokenAcceptOffer.h b/src/xrpld/app/tx/detail/NFTokenAcceptOffer.h index 8eeede3d95..549c38d33b 100644 --- a/src/xrpld/app/tx/detail/NFTokenAcceptOffer.h +++ b/src/xrpld/app/tx/detail/NFTokenAcceptOffer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_NFTOKENACCEPTOFFER_H_INCLUDED -#define XRPL_TX_NFTOKENACCEPTOFFER_H_INCLUDED +#pragma once #include @@ -41,5 +40,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/NFTokenBurn.h b/src/xrpld/app/tx/detail/NFTokenBurn.h index 5425f0902d..c2bc300ab8 100644 --- a/src/xrpld/app/tx/detail/NFTokenBurn.h +++ b/src/xrpld/app/tx/detail/NFTokenBurn.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_BURNNFT_H_INCLUDED -#define XRPL_TX_BURNNFT_H_INCLUDED +#pragma once #include @@ -25,5 +24,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/NFTokenCancelOffer.h b/src/xrpld/app/tx/detail/NFTokenCancelOffer.h index 13a6ecc065..b1801ede25 100644 --- a/src/xrpld/app/tx/detail/NFTokenCancelOffer.h +++ b/src/xrpld/app/tx/detail/NFTokenCancelOffer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_NFTOKENCANCELOFFER_H_INCLUDED -#define XRPL_TX_NFTOKENCANCELOFFER_H_INCLUDED +#pragma once #include @@ -28,5 +27,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/NFTokenCreateOffer.h b/src/xrpld/app/tx/detail/NFTokenCreateOffer.h index 704b253924..ed54338f49 100644 --- a/src/xrpld/app/tx/detail/NFTokenCreateOffer.h +++ b/src/xrpld/app/tx/detail/NFTokenCreateOffer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_NFTOKENOFFERCREATE_H_INCLUDED -#define XRPL_TX_NFTOKENOFFERCREATE_H_INCLUDED +#pragma once #include @@ -28,5 +27,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/NFTokenMint.h b/src/xrpld/app/tx/detail/NFTokenMint.h index a3b43b8269..52981ef467 100644 --- a/src/xrpld/app/tx/detail/NFTokenMint.h +++ b/src/xrpld/app/tx/detail/NFTokenMint.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_NFTTOKENMINT_H_INCLUDED -#define XRPL_TX_NFTTOKENMINT_H_INCLUDED +#pragma once #include #include @@ -43,5 +42,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/NFTokenModify.h b/src/xrpld/app/tx/detail/NFTokenModify.h index 4353c3d58b..f755746f1f 100644 --- a/src/xrpld/app/tx/detail/NFTokenModify.h +++ b/src/xrpld/app/tx/detail/NFTokenModify.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_NFTOKENMODIFY_H_INCLUDED -#define XRPL_TX_NFTOKENMODIFY_H_INCLUDED +#pragma once #include @@ -25,5 +24,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/NFTokenUtils.h b/src/xrpld/app/tx/detail/NFTokenUtils.h index 97ff744d71..44d3cfb956 100644 --- a/src/xrpld/app/tx/detail/NFTokenUtils.h +++ b/src/xrpld/app/tx/detail/NFTokenUtils.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_IMPL_DETAILS_NFTOKENUTILS_H_INCLUDED -#define XRPL_TX_IMPL_DETAILS_NFTOKENUTILS_H_INCLUDED +#pragma once #include @@ -128,5 +127,3 @@ checkTrustlineDeepFrozen(ReadView const& view, AccountID const id, beast::Journa } // namespace nft } // namespace xrpl - -#endif // XRPL_TX_IMPL_DETAILS_NFTOKENUTILS_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/Offer.h b/src/xrpld/app/tx/detail/Offer.h index 7972d5dcca..7c783233f1 100644 --- a/src/xrpld/app/tx/detail/Offer.h +++ b/src/xrpld/app/tx/detail/Offer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_BOOK_OFFER_H_INCLUDED -#define XRPL_APP_BOOK_OFFER_H_INCLUDED +#pragma once #include #include @@ -301,5 +300,3 @@ operator<<(std::ostream& os, TOffer const& offer) } } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/OfferStream.h b/src/xrpld/app/tx/detail/OfferStream.h index d7e30f018c..2f6bda3fab 100644 --- a/src/xrpld/app/tx/detail/OfferStream.h +++ b/src/xrpld/app/tx/detail/OfferStream.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_BOOK_OFFERSTREAM_H_INCLUDED -#define XRPL_APP_BOOK_OFFERSTREAM_H_INCLUDED +#pragma once #include #include @@ -174,5 +173,3 @@ public: } }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/PayChan.h b/src/xrpld/app/tx/detail/PayChan.h index f42e9549b3..8748ec9383 100644 --- a/src/xrpld/app/tx/detail/PayChan.h +++ b/src/xrpld/app/tx/detail/PayChan.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_PAYCHAN_H_INCLUDED -#define XRPL_TX_PAYCHAN_H_INCLUDED +#pragma once #include @@ -82,5 +81,3 @@ public: using PaymentChannelClaim = PayChanClaim; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/Payment.h b/src/xrpld/app/tx/detail/Payment.h index 30c9a9e326..192f2b0edb 100644 --- a/src/xrpld/app/tx/detail/Payment.h +++ b/src/xrpld/app/tx/detail/Payment.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_PAYMENT_H_INCLUDED -#define XRPL_TX_PAYMENT_H_INCLUDED +#pragma once #include @@ -43,5 +42,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/PermissionedDomainDelete.h b/src/xrpld/app/tx/detail/PermissionedDomainDelete.h index 3ae10a739f..294fb794ae 100644 --- a/src/xrpld/app/tx/detail/PermissionedDomainDelete.h +++ b/src/xrpld/app/tx/detail/PermissionedDomainDelete.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_PERMISSIONEDDOMAINDELETE_H_INCLUDED -#define XRPL_TX_PERMISSIONEDDOMAINDELETE_H_INCLUDED +#pragma once #include @@ -26,5 +25,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/PermissionedDomainSet.h b/src/xrpld/app/tx/detail/PermissionedDomainSet.h index fde06232a5..824104e50d 100644 --- a/src/xrpld/app/tx/detail/PermissionedDomainSet.h +++ b/src/xrpld/app/tx/detail/PermissionedDomainSet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_PERMISSIONEDDOMAINSET_H_INCLUDED -#define XRPL_TX_PERMISSIONEDDOMAINSET_H_INCLUDED +#pragma once #include @@ -29,5 +28,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/SetAccount.h b/src/xrpld/app/tx/detail/SetAccount.h index fb8b4a0ccd..db59826347 100644 --- a/src/xrpld/app/tx/detail/SetAccount.h +++ b/src/xrpld/app/tx/detail/SetAccount.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_SETACCOUNT_H_INCLUDED -#define XRPL_TX_SETACCOUNT_H_INCLUDED +#pragma once #include @@ -38,5 +37,3 @@ public: using AccountSet = SetAccount; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/SetOracle.h b/src/xrpld/app/tx/detail/SetOracle.h index c1c9a3d3fb..6b47a5397e 100644 --- a/src/xrpld/app/tx/detail/SetOracle.h +++ b/src/xrpld/app/tx/detail/SetOracle.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_SETORACLE_H_INCLUDED -#define XRPL_TX_SETORACLE_H_INCLUDED +#pragma once #include @@ -36,5 +35,3 @@ public: using OracleSet = SetOracle; } // namespace xrpl - -#endif // XRPL_TX_SETORACLE_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/SetRegularKey.h b/src/xrpld/app/tx/detail/SetRegularKey.h index 735ac522fd..bc712b319a 100644 --- a/src/xrpld/app/tx/detail/SetRegularKey.h +++ b/src/xrpld/app/tx/detail/SetRegularKey.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_SETREGULARKEY_H_INCLUDED -#define XRPL_TX_SETREGULARKEY_H_INCLUDED +#pragma once #include @@ -25,5 +24,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/SetSignerList.h b/src/xrpld/app/tx/detail/SetSignerList.h index 9fbf459728..efd8e508f9 100644 --- a/src/xrpld/app/tx/detail/SetSignerList.h +++ b/src/xrpld/app/tx/detail/SetSignerList.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_SETSIGNERLIST_H_INCLUDED -#define XRPL_TX_SETSIGNERLIST_H_INCLUDED +#pragma once #include #include @@ -71,5 +70,3 @@ private: using SignerListSet = SetSignerList; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/SetTrust.h b/src/xrpld/app/tx/detail/SetTrust.h index b5776c6d33..1081567a66 100644 --- a/src/xrpld/app/tx/detail/SetTrust.h +++ b/src/xrpld/app/tx/detail/SetTrust.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_SETTRUST_H_INCLUDED -#define XRPL_TX_SETTRUST_H_INCLUDED +#pragma once #include @@ -35,5 +34,3 @@ public: using TrustSet = SetTrust; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/SignerEntries.h b/src/xrpld/app/tx/detail/SignerEntries.h index d4b8382ab6..fe01d6b1ee 100644 --- a/src/xrpld/app/tx/detail/SignerEntries.h +++ b/src/xrpld/app/tx/detail/SignerEntries.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_IMPL_SIGNER_ENTRIES_H_INCLUDED -#define XRPL_TX_IMPL_SIGNER_ENTRIES_H_INCLUDED +#pragma once #include // NotTEC @@ -64,5 +63,3 @@ public: }; } // namespace xrpl - -#endif // XRPL_TX_IMPL_SIGNER_ENTRIES_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/Transactor.h b/src/xrpld/app/tx/detail/Transactor.h index 13c0a39201..e06086a55d 100644 --- a/src/xrpld/app/tx/detail/Transactor.h +++ b/src/xrpld/app/tx/detail/Transactor.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_TX_TRANSACTOR_H_INCLUDED -#define XRPL_APP_TX_TRANSACTOR_H_INCLUDED +#pragma once #include #include @@ -419,5 +418,3 @@ Transactor::validNumericMinimum(std::optional value, unit::ValueUnit } } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/VaultClawback.h b/src/xrpld/app/tx/detail/VaultClawback.h index d05f280e75..c93289e641 100644 --- a/src/xrpld/app/tx/detail/VaultClawback.h +++ b/src/xrpld/app/tx/detail/VaultClawback.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_VAULTCLAWBACK_H_INCLUDED -#define XRPL_TX_VAULTCLAWBACK_H_INCLUDED +#pragma once #include @@ -33,5 +32,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/VaultCreate.h b/src/xrpld/app/tx/detail/VaultCreate.h index 78593eb491..20b18f5cc2 100644 --- a/src/xrpld/app/tx/detail/VaultCreate.h +++ b/src/xrpld/app/tx/detail/VaultCreate.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_VAULTCREATE_H_INCLUDED -#define XRPL_TX_VAULTCREATE_H_INCLUDED +#pragma once #include @@ -31,5 +30,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/VaultDelete.h b/src/xrpld/app/tx/detail/VaultDelete.h index e7c71b408c..8d1f214885 100644 --- a/src/xrpld/app/tx/detail/VaultDelete.h +++ b/src/xrpld/app/tx/detail/VaultDelete.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_VAULTDELETE_H_INCLUDED -#define XRPL_TX_VAULTDELETE_H_INCLUDED +#pragma once #include @@ -25,5 +24,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/VaultDeposit.h b/src/xrpld/app/tx/detail/VaultDeposit.h index 1fd62b95ff..6c63308407 100644 --- a/src/xrpld/app/tx/detail/VaultDeposit.h +++ b/src/xrpld/app/tx/detail/VaultDeposit.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_VAULTDEPOSIT_H_INCLUDED -#define XRPL_TX_VAULTDEPOSIT_H_INCLUDED +#pragma once #include @@ -25,5 +24,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/VaultSet.h b/src/xrpld/app/tx/detail/VaultSet.h index bfa38e5284..1e8a15291e 100644 --- a/src/xrpld/app/tx/detail/VaultSet.h +++ b/src/xrpld/app/tx/detail/VaultSet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_VAULTSET_H_INCLUDED -#define XRPL_TX_VAULTSET_H_INCLUDED +#pragma once #include @@ -28,5 +27,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/VaultWithdraw.h b/src/xrpld/app/tx/detail/VaultWithdraw.h index 33463831e5..f832c206f8 100644 --- a/src/xrpld/app/tx/detail/VaultWithdraw.h +++ b/src/xrpld/app/tx/detail/VaultWithdraw.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_VAULTWITHDRAW_H_INCLUDED -#define XRPL_TX_VAULTWITHDRAW_H_INCLUDED +#pragma once #include @@ -25,5 +24,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/app/tx/detail/XChainBridge.h b/src/xrpld/app/tx/detail/XChainBridge.h index 0c39cbb690..3d0c250f24 100644 --- a/src/xrpld/app/tx/detail/XChainBridge.h +++ b/src/xrpld/app/tx/detail/XChainBridge.h @@ -1,5 +1,4 @@ -#ifndef XRPL_TX_XCHAINBRIDGE_H_INCLUDED -#define XRPL_TX_XCHAINBRIDGE_H_INCLUDED +#pragma once #include @@ -239,5 +238,3 @@ using XChainAccountCreateCommit = XChainCreateAccountCommit; //------------------------------------------------------------------------------ } // namespace xrpl - -#endif diff --git a/src/xrpld/conditions/Condition.h b/src/xrpld/conditions/Condition.h index 55a6fc1e7c..50872e75ef 100644 --- a/src/xrpld/conditions/Condition.h +++ b/src/xrpld/conditions/Condition.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CONDITIONS_CONDITION_H -#define XRPL_CONDITIONS_CONDITION_H +#pragma once #include @@ -93,5 +92,3 @@ operator!=(Condition const& lhs, Condition const& rhs) } // namespace cryptoconditions } // namespace xrpl - -#endif diff --git a/src/xrpld/conditions/Fulfillment.h b/src/xrpld/conditions/Fulfillment.h index 5d31fd64ac..840e9f9993 100644 --- a/src/xrpld/conditions/Fulfillment.h +++ b/src/xrpld/conditions/Fulfillment.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CONDITIONS_FULFILLMENT_H -#define XRPL_CONDITIONS_FULFILLMENT_H +#pragma once #include @@ -122,5 +121,3 @@ validate(Fulfillment const& f, Condition const& c); } // namespace cryptoconditions } // namespace xrpl - -#endif diff --git a/src/xrpld/conditions/detail/PreimageSha256.h b/src/xrpld/conditions/detail/PreimageSha256.h index f495885794..f3ce1a03e0 100644 --- a/src/xrpld/conditions/detail/PreimageSha256.h +++ b/src/xrpld/conditions/detail/PreimageSha256.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CONDITIONS_PREIMAGE_SHA256_H -#define XRPL_CONDITIONS_PREIMAGE_SHA256_H +#pragma once #include #include @@ -131,5 +130,3 @@ public: } // namespace cryptoconditions } // namespace xrpl - -#endif diff --git a/src/xrpld/conditions/detail/error.h b/src/xrpld/conditions/detail/error.h index 65584e974a..fdeed3d9ac 100644 --- a/src/xrpld/conditions/detail/error.h +++ b/src/xrpld/conditions/detail/error.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CONDITIONS_ERROR_H -#define XRPL_CONDITIONS_ERROR_H +#pragma once #include @@ -43,5 +42,3 @@ struct is_error_code_enum }; } // namespace std - -#endif diff --git a/src/xrpld/conditions/detail/utils.h b/src/xrpld/conditions/detail/utils.h index b07b7b29e0..2a4187718b 100644 --- a/src/xrpld/conditions/detail/utils.h +++ b/src/xrpld/conditions/detail/utils.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CONDITIONS_UTILS_H -#define XRPL_CONDITIONS_UTILS_H +#pragma once #include @@ -209,5 +208,3 @@ parseInteger(Slice& s, std::size_t count, std::error_code& ec) } // namespace der } // namespace cryptoconditions } // namespace xrpl - -#endif diff --git a/src/xrpld/consensus/Consensus.h b/src/xrpld/consensus/Consensus.h index cdff9aa5ac..e02ec927a4 100644 --- a/src/xrpld/consensus/Consensus.h +++ b/src/xrpld/consensus/Consensus.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CONSENSUS_CONSENSUS_H_INCLUDED -#define XRPL_CONSENSUS_CONSENSUS_H_INCLUDED +#pragma once #include #include @@ -1774,5 +1773,3 @@ Consensus::asCloseTime(NetClock::time_point raw) const } } // namespace xrpl - -#endif diff --git a/src/xrpld/consensus/ConsensusParms.h b/src/xrpld/consensus/ConsensusParms.h index 94e0d16f27..8839b95c8b 100644 --- a/src/xrpld/consensus/ConsensusParms.h +++ b/src/xrpld/consensus/ConsensusParms.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CONSENSUS_CONSENSUS_PARMS_H_INCLUDED -#define XRPL_CONSENSUS_CONSENSUS_PARMS_H_INCLUDED +#pragma once #include @@ -174,4 +173,3 @@ getNeededWeight( } } // namespace xrpl -#endif diff --git a/src/xrpld/consensus/ConsensusProposal.h b/src/xrpld/consensus/ConsensusProposal.h index b91af6832a..f2b891cdd6 100644 --- a/src/xrpld/consensus/ConsensusProposal.h +++ b/src/xrpld/consensus/ConsensusProposal.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CONSENSUS_CONSENSUSPROPOSAL_H_INCLUDED -#define XRPL_CONSENSUS_CONSENSUSPROPOSAL_H_INCLUDED +#pragma once #include #include @@ -256,4 +255,3 @@ operator==( a.position() == b.position() && a.closeTime() == b.closeTime() && a.seenTime() == b.seenTime(); } } // namespace xrpl -#endif diff --git a/src/xrpld/consensus/ConsensusTypes.h b/src/xrpld/consensus/ConsensusTypes.h index f54e11228b..2331c9dfbf 100644 --- a/src/xrpld/consensus/ConsensusTypes.h +++ b/src/xrpld/consensus/ConsensusTypes.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CONSENSUS_CONSENSUS_TYPES_H_INCLUDED -#define XRPL_CONSENSUS_CONSENSUS_TYPES_H_INCLUDED +#pragma once #include #include @@ -220,5 +219,3 @@ struct ConsensusResult std::size_t proposers = 0; }; } // namespace xrpl - -#endif diff --git a/src/xrpld/consensus/DisputedTx.h b/src/xrpld/consensus/DisputedTx.h index 44e9f94793..a1e8d84fa3 100644 --- a/src/xrpld/consensus/DisputedTx.h +++ b/src/xrpld/consensus/DisputedTx.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_CONSENSUS_IMPL_DISPUTEDTX_H_INCLUDED -#define XRPL_APP_CONSENSUS_IMPL_DISPUTEDTX_H_INCLUDED +#pragma once #include @@ -327,5 +326,3 @@ DisputedTx::getJson() const } } // namespace xrpl - -#endif diff --git a/src/xrpld/consensus/LedgerTiming.h b/src/xrpld/consensus/LedgerTiming.h index 7bca012460..416c3bc165 100644 --- a/src/xrpld/consensus/LedgerTiming.h +++ b/src/xrpld/consensus/LedgerTiming.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_LEDGER_LEDGERTIMING_H_INCLUDED -#define XRPL_APP_LEDGER_LEDGERTIMING_H_INCLUDED +#pragma once #include #include @@ -137,4 +136,3 @@ effCloseTime( } } // namespace xrpl -#endif diff --git a/src/xrpld/consensus/LedgerTrie.h b/src/xrpld/consensus/LedgerTrie.h index b823079a8b..e5f9f1ce2d 100644 --- a/src/xrpld/consensus/LedgerTrie.h +++ b/src/xrpld/consensus/LedgerTrie.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_CONSENSUS_LEDGERS_TRIE_H_INCLUDED -#define XRPL_APP_CONSENSUS_LEDGERS_TRIE_H_INCLUDED +#pragma once #include #include @@ -809,4 +808,3 @@ public: }; } // namespace xrpl -#endif diff --git a/src/xrpld/consensus/Validations.h b/src/xrpld/consensus/Validations.h index 6de74b4f4d..92892ff1f6 100644 --- a/src/xrpld/consensus/Validations.h +++ b/src/xrpld/consensus/Validations.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CONSENSUS_VALIDATIONS_H_INCLUDED -#define XRPL_CONSENSUS_VALIDATIONS_H_INCLUDED +#pragma once #include @@ -1093,4 +1092,3 @@ public: }; } // namespace xrpl -#endif diff --git a/src/xrpld/core/Config.h b/src/xrpld/core/Config.h index e2e16bcd98..86b663a212 100644 --- a/src/xrpld/core/Config.h +++ b/src/xrpld/core/Config.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_CONFIG_H_INCLUDED -#define XRPL_CORE_CONFIG_H_INCLUDED +#pragma once #include #include @@ -357,5 +356,3 @@ FeeSetup setup_FeeVote(Section const& section); } // namespace xrpl - -#endif diff --git a/src/xrpld/core/ConfigSections.h b/src/xrpld/core/ConfigSections.h index 6f8a13a145..7f22dd59c1 100644 --- a/src/xrpld/core/ConfigSections.h +++ b/src/xrpld/core/ConfigSections.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_CONFIGSECTIONS_H_INCLUDED -#define XRPL_CORE_CONFIGSECTIONS_H_INCLUDED +#pragma once #include @@ -79,5 +78,3 @@ struct ConfigSection #define SECTION_WORKERS "workers" } // namespace xrpl - -#endif diff --git a/src/xrpld/core/DatabaseCon.h b/src/xrpld/core/DatabaseCon.h index 854cfc827f..89d582257b 100644 --- a/src/xrpld/core/DatabaseCon.h +++ b/src/xrpld/core/DatabaseCon.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_DATA_DATABASECON_H_INCLUDED -#define XRPL_APP_DATA_DATABASECON_H_INCLUDED +#pragma once #include #include @@ -234,5 +233,3 @@ DatabaseCon::Setup setup_DatabaseCon(Config const& c, std::optional j = std::nullopt); } // namespace xrpl - -#endif diff --git a/src/xrpld/core/SociDB.h b/src/xrpld/core/SociDB.h index b5b6db92bc..acfc183076 100644 --- a/src/xrpld/core/SociDB.h +++ b/src/xrpld/core/SociDB.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SOCIDB_H_INCLUDED -#define XRPL_SOCIDB_H_INCLUDED +#pragma once /** An embedded database wrapper with an intuitive, type-safe interface. @@ -119,5 +118,3 @@ makeCheckpointer(std::uintptr_t id, std::weak_ptr, JobQueue&, Log #if defined(__clang__) #pragma clang diagnostic pop #endif - -#endif diff --git a/src/xrpld/core/TimeKeeper.h b/src/xrpld/core/TimeKeeper.h index 8c04d0a625..bb6ab3ec23 100644 --- a/src/xrpld/core/TimeKeeper.h +++ b/src/xrpld/core/TimeKeeper.h @@ -1,5 +1,4 @@ -#ifndef XRPL_CORE_TIMEKEEPER_H_INCLUDED -#define XRPL_CORE_TIMEKEEPER_H_INCLUDED +#pragma once #include #include @@ -97,5 +96,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/Cluster.h b/src/xrpld/overlay/Cluster.h index 30627f90ae..7783d96100 100644 --- a/src/xrpld/overlay/Cluster.h +++ b/src/xrpld/overlay/Cluster.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_CLUSTER_H_INCLUDED -#define XRPL_OVERLAY_CLUSTER_H_INCLUDED +#pragma once #include @@ -95,5 +94,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/ClusterNode.h b/src/xrpld/overlay/ClusterNode.h index 03c294c736..c6ab208383 100644 --- a/src/xrpld/overlay/ClusterNode.h +++ b/src/xrpld/overlay/ClusterNode.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PEERS_CLUSTERNODESTATUS_H_INCLUDED -#define XRPL_APP_PEERS_CLUSTERNODESTATUS_H_INCLUDED +#pragma once #include #include @@ -55,5 +54,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/Compression.h b/src/xrpld/overlay/Compression.h index b13a0a8661..2bfc366e30 100644 --- a/src/xrpld/overlay/Compression.h +++ b/src/xrpld/overlay/Compression.h @@ -1,5 +1,4 @@ -#ifndef XRPL_COMPRESSION_H_INCLUDED -#define XRPL_COMPRESSION_H_INCLUDED +#pragma once #include #include @@ -89,5 +88,3 @@ compress(void const* in, std::size_t inSize, BufferFactory&& bf, Algorithm algor } // namespace compression } // namespace xrpl - -#endif // XRPL_COMPRESSION_H_INCLUDED diff --git a/src/xrpld/overlay/Message.h b/src/xrpld/overlay/Message.h index 550c24eef3..30650d384c 100644 --- a/src/xrpld/overlay/Message.h +++ b/src/xrpld/overlay/Message.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_MESSAGE_H_INCLUDED -#define XRPL_OVERLAY_MESSAGE_H_INCLUDED +#pragma once #include @@ -118,5 +117,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/Overlay.h b/src/xrpld/overlay/Overlay.h index 7642614232..f1d1104d4e 100644 --- a/src/xrpld/overlay/Overlay.h +++ b/src/xrpld/overlay/Overlay.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_OVERLAY_H_INCLUDED -#define XRPL_OVERLAY_OVERLAY_H_INCLUDED +#pragma once #include @@ -210,5 +209,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/Peer.h b/src/xrpld/overlay/Peer.h index 35feb05271..a0e4c040fd 100644 --- a/src/xrpld/overlay/Peer.h +++ b/src/xrpld/overlay/Peer.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_PEER_H_INCLUDED -#define XRPL_OVERLAY_PEER_H_INCLUDED +#pragma once #include @@ -120,5 +119,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/PeerReservationTable.h b/src/xrpld/overlay/PeerReservationTable.h index 7c66ad6e2d..8f187bf324 100644 --- a/src/xrpld/overlay/PeerReservationTable.h +++ b/src/xrpld/overlay/PeerReservationTable.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_PEER_RESERVATION_TABLE_H_INCLUDED -#define XRPL_OVERLAY_PEER_RESERVATION_TABLE_H_INCLUDED +#pragma once #include #include @@ -97,5 +96,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/PeerSet.h b/src/xrpld/overlay/PeerSet.h index 850ba21c53..b69d139b4f 100644 --- a/src/xrpld/overlay/PeerSet.h +++ b/src/xrpld/overlay/PeerSet.h @@ -1,5 +1,4 @@ -#ifndef XRPL_APP_PEERS_PEERSET_H_INCLUDED -#define XRPL_APP_PEERS_PEERSET_H_INCLUDED +#pragma once #include #include @@ -74,5 +73,3 @@ std::unique_ptr make_DummyPeerSet(Application& app); } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/ReduceRelayCommon.h b/src/xrpld/overlay/ReduceRelayCommon.h index 990e4b51d2..9ddde335e6 100644 --- a/src/xrpld/overlay/ReduceRelayCommon.h +++ b/src/xrpld/overlay/ReduceRelayCommon.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_REDUCERELAYCOMMON_H_INCLUDED -#define XRPL_OVERLAY_REDUCERELAYCOMMON_H_INCLUDED +#pragma once #include @@ -42,5 +41,3 @@ static constexpr std::size_t MAX_TX_QUEUE_SIZE = 10000; } // namespace reduce_relay } // namespace xrpl - -#endif // XRPL_REDUCERELAYCOMMON_H_INCLUDED diff --git a/src/xrpld/overlay/Slot.h b/src/xrpld/overlay/Slot.h index db2ff69910..f3fd919648 100644 --- a/src/xrpld/overlay/Slot.h +++ b/src/xrpld/overlay/Slot.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_SLOT_H_INCLUDED -#define XRPL_OVERLAY_SLOT_H_INCLUDED +#pragma once #include #include @@ -765,5 +764,3 @@ Slots::deleteIdlePeers() } // namespace reduce_relay } // namespace xrpl - -#endif // XRPL_OVERLAY_SLOT_H_INCLUDED diff --git a/src/xrpld/overlay/Squelch.h b/src/xrpld/overlay/Squelch.h index a225f39998..cca5dfeff1 100644 --- a/src/xrpld/overlay/Squelch.h +++ b/src/xrpld/overlay/Squelch.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_SQUELCH_H_INCLUDED -#define XRPL_OVERLAY_SQUELCH_H_INCLUDED +#pragma once #include @@ -100,5 +99,3 @@ Squelch::expireSquelch(PublicKey const& validator) } // namespace reduce_relay } // namespace xrpl - -#endif // XRPL_SQUELCH_H diff --git a/src/xrpld/overlay/detail/ConnectAttempt.h b/src/xrpld/overlay/detail/ConnectAttempt.h index e750541561..4cd8c357db 100644 --- a/src/xrpld/overlay/detail/ConnectAttempt.h +++ b/src/xrpld/overlay/detail/ConnectAttempt.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_CONNECTATTEMPT_H_INCLUDED -#define XRPL_OVERLAY_CONNECTATTEMPT_H_INCLUDED +#pragma once #include @@ -270,5 +269,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/detail/Handshake.h b/src/xrpld/overlay/detail/Handshake.h index 7e1ba07fca..4a8e81d6f9 100644 --- a/src/xrpld/overlay/detail/Handshake.h +++ b/src/xrpld/overlay/detail/Handshake.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_HANDSHAKE_H_INCLUDED -#define XRPL_OVERLAY_HANDSHAKE_H_INCLUDED +#pragma once #include #include @@ -217,5 +216,3 @@ makeFeaturesResponseHeader( bool vpReduceRelayEnabled); } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/detail/OverlayImpl.h b/src/xrpld/overlay/detail/OverlayImpl.h index 03b3b31da0..19fff6a29a 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.h +++ b/src/xrpld/overlay/detail/OverlayImpl.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_OVERLAYIMPL_H_INCLUDED -#define XRPL_OVERLAY_OVERLAYIMPL_H_INCLUDED +#pragma once #include #include @@ -592,5 +591,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/detail/PeerImp.h b/src/xrpld/overlay/detail/PeerImp.h index 3b6cfe4b4b..65a6112159 100644 --- a/src/xrpld/overlay/detail/PeerImp.h +++ b/src/xrpld/overlay/detail/PeerImp.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_PEERIMP_H_INCLUDED -#define XRPL_OVERLAY_PEERIMP_H_INCLUDED +#pragma once #include #include @@ -864,5 +863,3 @@ PeerImp::sendEndpoints(FwdIt first, FwdIt last) } } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/detail/ProtocolMessage.h b/src/xrpld/overlay/detail/ProtocolMessage.h index 03514b6d60..9a0e63744d 100644 --- a/src/xrpld/overlay/detail/ProtocolMessage.h +++ b/src/xrpld/overlay/detail/ProtocolMessage.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_PROTOCOLMESSAGE_H_INCLUDED -#define XRPL_OVERLAY_PROTOCOLMESSAGE_H_INCLUDED +#pragma once #include #include @@ -424,5 +423,3 @@ invokeProtocolMessage(Buffers const& buffers, Handler& handler, std::size_t& hin } } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/detail/ProtocolVersion.h b/src/xrpld/overlay/detail/ProtocolVersion.h index 9499cd1c1b..5b3a1b3302 100644 --- a/src/xrpld/overlay/detail/ProtocolVersion.h +++ b/src/xrpld/overlay/detail/ProtocolVersion.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_PROTOCOLVERSION_H_INCLUDED -#define XRPL_OVERLAY_PROTOCOLVERSION_H_INCLUDED +#pragma once #include @@ -59,5 +58,3 @@ bool isProtocolSupported(ProtocolVersion const& v); } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/detail/TrafficCount.h b/src/xrpld/overlay/detail/TrafficCount.h index f760c6076e..bb9f5686e6 100644 --- a/src/xrpld/overlay/detail/TrafficCount.h +++ b/src/xrpld/overlay/detail/TrafficCount.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_TRAFFIC_H_INCLUDED -#define XRPL_OVERLAY_TRAFFIC_H_INCLUDED +#pragma once #include #include @@ -350,4 +349,3 @@ protected: }; } // namespace xrpl -#endif diff --git a/src/xrpld/overlay/detail/Tuning.h b/src/xrpld/overlay/detail/Tuning.h index c18d17c359..bd62cd2a03 100644 --- a/src/xrpld/overlay/detail/Tuning.h +++ b/src/xrpld/overlay/detail/Tuning.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_TUNING_H_INCLUDED -#define XRPL_OVERLAY_TUNING_H_INCLUDED +#pragma once #include @@ -48,5 +47,3 @@ std::size_t constexpr readBufferBytes = 16384; } // namespace Tuning } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/detail/TxMetrics.h b/src/xrpld/overlay/detail/TxMetrics.h index 5bbf1a9731..37194c34e3 100644 --- a/src/xrpld/overlay/detail/TxMetrics.h +++ b/src/xrpld/overlay/detail/TxMetrics.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_TXMETRICS_H_INCLUDED -#define XRPL_OVERLAY_TXMETRICS_H_INCLUDED +#pragma once #include #include @@ -115,5 +114,3 @@ struct TxMetrics } // namespace metrics } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/detail/ZeroCopyStream.h b/src/xrpld/overlay/detail/ZeroCopyStream.h index ac814ebbad..112217b737 100644 --- a/src/xrpld/overlay/detail/ZeroCopyStream.h +++ b/src/xrpld/overlay/detail/ZeroCopyStream.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_ZEROCOPYSTREAM_H_INCLUDED -#define XRPL_OVERLAY_ZEROCOPYSTREAM_H_INCLUDED +#pragma once #include @@ -188,5 +187,3 @@ ZeroCopyOutputStream::BackUp(int count) } } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/make_Overlay.h b/src/xrpld/overlay/make_Overlay.h index 6c37c1c825..936d3abc0f 100644 --- a/src/xrpld/overlay/make_Overlay.h +++ b/src/xrpld/overlay/make_Overlay.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_MAKE_OVERLAY_H_INCLUDED -#define XRPL_OVERLAY_MAKE_OVERLAY_H_INCLUDED +#pragma once #include #include @@ -26,5 +25,3 @@ make_Overlay( beast::insight::Collector::ptr const& collector); } // namespace xrpl - -#endif diff --git a/src/xrpld/overlay/predicates.h b/src/xrpld/overlay/predicates.h index 7b7baa0a8a..3adecf7c6a 100644 --- a/src/xrpld/overlay/predicates.h +++ b/src/xrpld/overlay/predicates.h @@ -1,5 +1,4 @@ -#ifndef XRPL_OVERLAY_PREDICATES_H_INCLUDED -#define XRPL_OVERLAY_PREDICATES_H_INCLUDED +#pragma once #include #include @@ -155,5 +154,3 @@ struct peer_in_set }; } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/PeerfinderManager.h b/src/xrpld/peerfinder/PeerfinderManager.h index 098702d2d3..ca82c0bdf9 100644 --- a/src/xrpld/peerfinder/PeerfinderManager.h +++ b/src/xrpld/peerfinder/PeerfinderManager.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_MANAGER_H_INCLUDED -#define XRPL_PEERFINDER_MANAGER_H_INCLUDED +#pragma once #include #include @@ -281,5 +280,3 @@ public: } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/Slot.h b/src/xrpld/peerfinder/Slot.h index 1d5d58884a..d0fce0626d 100644 --- a/src/xrpld/peerfinder/Slot.h +++ b/src/xrpld/peerfinder/Slot.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_SLOT_H_INCLUDED -#define XRPL_PEERFINDER_SLOT_H_INCLUDED +#pragma once #include #include @@ -61,5 +60,3 @@ public: } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/Bootcache.h b/src/xrpld/peerfinder/detail/Bootcache.h index 8aa2feaf88..8517bde049 100644 --- a/src/xrpld/peerfinder/detail/Bootcache.h +++ b/src/xrpld/peerfinder/detail/Bootcache.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_BOOTCACHE_H_INCLUDED -#define XRPL_PEERFINDER_BOOTCACHE_H_INCLUDED +#pragma once #include #include @@ -172,5 +171,3 @@ private: } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/Checker.h b/src/xrpld/peerfinder/detail/Checker.h index b0c38693ed..42987f3ec0 100644 --- a/src/xrpld/peerfinder/detail/Checker.h +++ b/src/xrpld/peerfinder/detail/Checker.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_CHECKER_H_INCLUDED -#define XRPL_PEERFINDER_CHECKER_H_INCLUDED +#pragma once #include @@ -196,5 +195,3 @@ Checker::remove(basic_async_op& op) } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/Counts.h b/src/xrpld/peerfinder/detail/Counts.h index 15ae42fcbb..3d687711d1 100644 --- a/src/xrpld/peerfinder/detail/Counts.h +++ b/src/xrpld/peerfinder/detail/Counts.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_COUNTS_H_INCLUDED -#define XRPL_PEERFINDER_COUNTS_H_INCLUDED +#pragma once #include #include @@ -319,5 +318,3 @@ private: } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/Fixed.h b/src/xrpld/peerfinder/detail/Fixed.h index 007ee1698d..75b5ed9062 100644 --- a/src/xrpld/peerfinder/detail/Fixed.h +++ b/src/xrpld/peerfinder/detail/Fixed.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_FIXED_H_INCLUDED -#define XRPL_PEERFINDER_FIXED_H_INCLUDED +#pragma once #include @@ -46,5 +45,3 @@ private: } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/Handouts.h b/src/xrpld/peerfinder/detail/Handouts.h index 85cce2fef3..afc2bddb40 100644 --- a/src/xrpld/peerfinder/detail/Handouts.h +++ b/src/xrpld/peerfinder/detail/Handouts.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_HANDOUTS_H_INCLUDED -#define XRPL_PEERFINDER_HANDOUTS_H_INCLUDED +#pragma once #include #include @@ -331,5 +330,3 @@ ConnectHandouts::try_insert(beast::IP::Endpoint const& endpoint) } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/Livecache.h b/src/xrpld/peerfinder/detail/Livecache.h index c4052967ab..548db4e34e 100644 --- a/src/xrpld/peerfinder/detail/Livecache.h +++ b/src/xrpld/peerfinder/detail/Livecache.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_LIVECACHE_H_INCLUDED -#define XRPL_PEERFINDER_LIVECACHE_H_INCLUDED +#pragma once #include #include @@ -513,5 +512,3 @@ Livecache::hops_t::remove(Element& e) } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/Logic.h b/src/xrpld/peerfinder/detail/Logic.h index f437a7c3a7..7e2b4f0015 100644 --- a/src/xrpld/peerfinder/detail/Logic.h +++ b/src/xrpld/peerfinder/detail/Logic.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_LOGIC_H_INCLUDED -#define XRPL_PEERFINDER_LOGIC_H_INCLUDED +#pragma once #include #include @@ -1168,5 +1167,3 @@ Logic::onRedirects(FwdIter first, FwdIter last, boost::asio::ip::tcp::e } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/SlotImp.h b/src/xrpld/peerfinder/detail/SlotImp.h index bcfd968228..f18410d214 100644 --- a/src/xrpld/peerfinder/detail/SlotImp.h +++ b/src/xrpld/peerfinder/detail/SlotImp.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_SLOTIMP_H_INCLUDED -#define XRPL_PEERFINDER_SLOTIMP_H_INCLUDED +#pragma once #include #include @@ -193,5 +192,3 @@ public: } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/Source.h b/src/xrpld/peerfinder/detail/Source.h index 1fe33e053a..8fc97b639f 100644 --- a/src/xrpld/peerfinder/detail/Source.h +++ b/src/xrpld/peerfinder/detail/Source.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_SOURCE_H_INCLUDED -#define XRPL_PEERFINDER_SOURCE_H_INCLUDED +#pragma once #include @@ -46,5 +45,3 @@ public: } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/SourceStrings.h b/src/xrpld/peerfinder/detail/SourceStrings.h index 2babe1d616..1cf6d81040 100644 --- a/src/xrpld/peerfinder/detail/SourceStrings.h +++ b/src/xrpld/peerfinder/detail/SourceStrings.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_SOURCESTRINGS_H_INCLUDED -#define XRPL_PEERFINDER_SOURCESTRINGS_H_INCLUDED +#pragma once #include @@ -22,5 +21,3 @@ public: } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/Store.h b/src/xrpld/peerfinder/detail/Store.h index d3b283eabf..dab50b3ce0 100644 --- a/src/xrpld/peerfinder/detail/Store.h +++ b/src/xrpld/peerfinder/detail/Store.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_STORE_H_INCLUDED -#define XRPL_PEERFINDER_STORE_H_INCLUDED +#pragma once namespace xrpl { namespace PeerFinder { @@ -31,5 +30,3 @@ public: } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/StoreSqdb.h b/src/xrpld/peerfinder/detail/StoreSqdb.h index 63ba03e913..f5461d489a 100644 --- a/src/xrpld/peerfinder/detail/StoreSqdb.h +++ b/src/xrpld/peerfinder/detail/StoreSqdb.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_STORESQDB_H_INCLUDED -#define XRPL_PEERFINDER_STORESQDB_H_INCLUDED +#pragma once #include #include @@ -86,5 +85,3 @@ private: } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/Tuning.h b/src/xrpld/peerfinder/detail/Tuning.h index ff93e5ee76..910d251dff 100644 --- a/src/xrpld/peerfinder/detail/Tuning.h +++ b/src/xrpld/peerfinder/detail/Tuning.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_TUNING_H_INCLUDED -#define XRPL_PEERFINDER_TUNING_H_INCLUDED +#pragma once #include @@ -115,5 +114,3 @@ std::chrono::seconds constexpr recentAttemptDuration(60); } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/peerfinder/detail/iosformat.h b/src/xrpld/peerfinder/detail/iosformat.h index 0a0b18fba0..d05db42d23 100644 --- a/src/xrpld/peerfinder/detail/iosformat.h +++ b/src/xrpld/peerfinder/detail/iosformat.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_IOSFORMAT_H_INCLUDED -#define XRPL_PEERFINDER_IOSFORMAT_H_INCLUDED +#pragma once #include #include @@ -174,5 +173,3 @@ rField(T const& t, int width = 8, int pad = 0) /** @} */ } // namespace beast - -#endif diff --git a/src/xrpld/peerfinder/make_Manager.h b/src/xrpld/peerfinder/make_Manager.h index a86e6d4ccb..846907e08c 100644 --- a/src/xrpld/peerfinder/make_Manager.h +++ b/src/xrpld/peerfinder/make_Manager.h @@ -1,5 +1,4 @@ -#ifndef XRPL_PEERFINDER_MAKE_MANAGER_H_INCLUDED -#define XRPL_PEERFINDER_MAKE_MANAGER_H_INCLUDED +#pragma once #include @@ -21,5 +20,3 @@ make_Manager( } // namespace PeerFinder } // namespace xrpl - -#endif diff --git a/src/xrpld/perflog/detail/PerfLogImp.h b/src/xrpld/perflog/detail/PerfLogImp.h index 598f711cda..6e58aeb16e 100644 --- a/src/xrpld/perflog/detail/PerfLogImp.h +++ b/src/xrpld/perflog/detail/PerfLogImp.h @@ -1,5 +1,4 @@ -#ifndef XRPL_BASICS_PERFLOGIMP_H -#define XRPL_BASICS_PERFLOGIMP_H +#pragma once #include @@ -175,5 +174,3 @@ public: } // namespace perf } // namespace xrpl - -#endif // XRPL_BASICS_PERFLOGIMP_H diff --git a/src/xrpld/rpc/BookChanges.h b/src/xrpld/rpc/BookChanges.h index 68ad094dc9..a2ea9cabf7 100644 --- a/src/xrpld/rpc/BookChanges.h +++ b/src/xrpld/rpc/BookChanges.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_BOOKCHANGES_H_INCLUDED -#define XRPL_RPC_BOOKCHANGES_H_INCLUDED +#pragma once #include #include @@ -193,5 +192,3 @@ computeBookChanges(std::shared_ptr const& lpAccepted) } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/CTID.h b/src/xrpld/rpc/CTID.h index aad8c0f5c1..ba96236a7f 100644 --- a/src/xrpld/rpc/CTID.h +++ b/src/xrpld/rpc/CTID.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_CTID_H_INCLUDED -#define XRPL_RPC_CTID_H_INCLUDED +#pragma once #include @@ -111,5 +110,3 @@ decodeCTID(T const ctid) noexcept } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/Context.h b/src/xrpld/rpc/Context.h index 8bb0bd3cbc..7ff02a9e8b 100644 --- a/src/xrpld/rpc/Context.h +++ b/src/xrpld/rpc/Context.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_CONTEXT_H_INCLUDED -#define XRPL_RPC_CONTEXT_H_INCLUDED +#pragma once #include #include @@ -54,5 +53,3 @@ struct GRPCContext : public Context } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/DeliveredAmount.h b/src/xrpld/rpc/DeliveredAmount.h index f201d4b6cc..54e3476683 100644 --- a/src/xrpld/rpc/DeliveredAmount.h +++ b/src/xrpld/rpc/DeliveredAmount.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_DELIVEREDAMOUNT_H_INCLUDED -#define XRPL_RPC_DELIVEREDAMOUNT_H_INCLUDED +#pragma once #include #include @@ -55,5 +54,3 @@ getDeliveredAmount( } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/GRPCHandlers.h b/src/xrpld/rpc/GRPCHandlers.h index 603d26c055..ac419c18ee 100644 --- a/src/xrpld/rpc/GRPCHandlers.h +++ b/src/xrpld/rpc/GRPCHandlers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_GRPCHANDLER_H_INCLUDED -#define XRPL_RPC_GRPCHANDLER_H_INCLUDED +#pragma once #include @@ -30,5 +29,3 @@ std::pair doLedgerDiffGrpc(RPC::GRPCContext& context); } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/InfoSub.h b/src/xrpld/rpc/InfoSub.h index 2816a1637c..7d4d4f06c8 100644 --- a/src/xrpld/rpc/InfoSub.h +++ b/src/xrpld/rpc/InfoSub.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NET_INFOSUB_H_INCLUDED -#define XRPL_NET_INFOSUB_H_INCLUDED +#pragma once #include @@ -223,5 +222,3 @@ private: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/MPTokenIssuanceID.h b/src/xrpld/rpc/MPTokenIssuanceID.h index 1cd1e173f4..2b2eef3b38 100644 --- a/src/xrpld/rpc/MPTokenIssuanceID.h +++ b/src/xrpld/rpc/MPTokenIssuanceID.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_MPTOKENISSUANCEID_H_INCLUDED -#define XRPL_RPC_MPTOKENISSUANCEID_H_INCLUDED +#pragma once #include #include @@ -36,5 +35,3 @@ insertMPTokenIssuanceID( } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/Output.h b/src/xrpld/rpc/Output.h index 431cbb6bbf..1c74562842 100644 --- a/src/xrpld/rpc/Output.h +++ b/src/xrpld/rpc/Output.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_OUTPUT_H_INCLUDED -#define XRPL_RPC_OUTPUT_H_INCLUDED +#pragma once #include @@ -16,5 +15,3 @@ stringOutput(std::string& s) } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/RPCCall.h b/src/xrpld/rpc/RPCCall.h index e54816a749..30f50f8f72 100644 --- a/src/xrpld/rpc/RPCCall.h +++ b/src/xrpld/rpc/RPCCall.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NET_RPCCALL_H_INCLUDED -#define XRPL_NET_RPCCALL_H_INCLUDED +#pragma once #include @@ -59,5 +58,3 @@ rpcClient( std::unordered_map const& headers = {}); } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/RPCHandler.h b/src/xrpld/rpc/RPCHandler.h index 0b91528605..519740b75d 100644 --- a/src/xrpld/rpc/RPCHandler.h +++ b/src/xrpld/rpc/RPCHandler.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_RPCHANDLER_H_INCLUDED -#define XRPL_RPC_RPCHANDLER_H_INCLUDED +#pragma once #include #include @@ -18,5 +17,3 @@ roleRequired(unsigned int version, bool betaEnabled, std::string const& method); } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/RPCSub.h b/src/xrpld/rpc/RPCSub.h index b6bb32aaf3..53c46139cb 100644 --- a/src/xrpld/rpc/RPCSub.h +++ b/src/xrpld/rpc/RPCSub.h @@ -1,5 +1,4 @@ -#ifndef XRPL_NET_RPCSUB_H_INCLUDED -#define XRPL_NET_RPCSUB_H_INCLUDED +#pragma once #include @@ -34,5 +33,3 @@ make_RPCSub( Logs& logs); } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/Request.h b/src/xrpld/rpc/Request.h index 80e83802b5..233f45185b 100644 --- a/src/xrpld/rpc/Request.h +++ b/src/xrpld/rpc/Request.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_REQUEST_H_INCLUDED -#define XRPL_RPC_REQUEST_H_INCLUDED +#pragma once #include #include @@ -44,5 +43,3 @@ private: } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/Role.h b/src/xrpld/rpc/Role.h index 04b288600a..554f9c1765 100644 --- a/src/xrpld/rpc/Role.h +++ b/src/xrpld/rpc/Role.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SERVER_ROLE_H_INCLUDED -#define XRPL_SERVER_ROLE_H_INCLUDED +#pragma once #include #include @@ -71,5 +70,3 @@ std::string_view forwardedFor(http_request_type const& request); } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/ServerHandler.h b/src/xrpld/rpc/ServerHandler.h index 59ef9444c1..0810b303e9 100644 --- a/src/xrpld/rpc/ServerHandler.h +++ b/src/xrpld/rpc/ServerHandler.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_SERVERHANDLER_H_INCLUDED -#define XRPL_RPC_SERVERHANDLER_H_INCLUDED +#pragma once #include #include @@ -200,5 +199,3 @@ make_ServerHandler( CollectorManager& cm); } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/Status.h b/src/xrpld/rpc/Status.h index 8ff969181d..34d621a3bb 100644 --- a/src/xrpld/rpc/Status.h +++ b/src/xrpld/rpc/Status.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_STATUS_H_INCLUDED -#define XRPL_RPC_STATUS_H_INCLUDED +#pragma once #include #include @@ -130,5 +129,3 @@ private: } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/detail/Handler.h b/src/xrpld/rpc/detail/Handler.h index 504b447774..f6fadd9cbd 100644 --- a/src/xrpld/rpc/detail/Handler.h +++ b/src/xrpld/rpc/detail/Handler.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_HANDLER_H_INCLUDED -#define XRPL_RPC_HANDLER_H_INCLUDED +#pragma once #include #include @@ -112,5 +111,3 @@ conditionMet(Condition condition_required, T& context) } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/detail/LegacyPathFind.h b/src/xrpld/rpc/detail/LegacyPathFind.h index d175e7c532..139075b53d 100644 --- a/src/xrpld/rpc/detail/LegacyPathFind.h +++ b/src/xrpld/rpc/detail/LegacyPathFind.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_LEGACYPATHFIND_H_INCLUDED -#define XRPL_RPC_LEGACYPATHFIND_H_INCLUDED +#pragma once #include @@ -29,5 +28,3 @@ private: } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/detail/RPCHelpers.h b/src/xrpld/rpc/detail/RPCHelpers.h index 65cec14925..1b5e06ce42 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.h +++ b/src/xrpld/rpc/detail/RPCHelpers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_RPCHELPERS_H_INCLUDED -#define XRPL_RPC_RPCHELPERS_H_INCLUDED +#pragma once #include #include @@ -152,5 +151,3 @@ keypairForSignature(Json::Value const& params, Json::Value& error, unsigned int } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.h b/src/xrpld/rpc/detail/RPCLedgerHelpers.h index 37ec66b584..6ea6e3cb78 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.h +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_RPCLEDGERHELPERS_H_INCLUDED -#define XRPL_RPC_RPCLEDGERHELPERS_H_INCLUDED +#pragma once #include #include @@ -171,5 +170,3 @@ getOrAcquireLedger(RPC::JsonContext const& context); } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/detail/TransactionSign.h b/src/xrpld/rpc/detail/TransactionSign.h index 2e3c21651e..cc85d67815 100644 --- a/src/xrpld/rpc/detail/TransactionSign.h +++ b/src/xrpld/rpc/detail/TransactionSign.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_TRANSACTIONSIGN_H_INCLUDED -#define XRPL_RPC_TRANSACTIONSIGN_H_INCLUDED +#pragma once #include #include @@ -121,5 +120,3 @@ transactionSubmitMultiSigned( } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/detail/Tuning.h b/src/xrpld/rpc/detail/Tuning.h index c0b939a4fe..e9dd2c37d7 100644 --- a/src/xrpld/rpc/detail/Tuning.h +++ b/src/xrpld/rpc/detail/Tuning.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_TUNING_H_INCLUDED -#define XRPL_RPC_TUNING_H_INCLUDED +#pragma once namespace xrpl { namespace RPC { @@ -72,5 +71,3 @@ static int constexpr max_auto_src_cur = 88; } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/detail/WSInfoSub.h b/src/xrpld/rpc/detail/WSInfoSub.h index fd791cbce7..8ed5ff8d6d 100644 --- a/src/xrpld/rpc/detail/WSInfoSub.h +++ b/src/xrpld/rpc/detail/WSInfoSub.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_WSINFOSUB_H -#define XRPL_RPC_WSINFOSUB_H +#pragma once #include #include @@ -63,5 +62,3 @@ public: }; } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/handlers/GetCounts.h b/src/xrpld/rpc/handlers/GetCounts.h index de2c4f2f96..60c7a3b693 100644 --- a/src/xrpld/rpc/handlers/GetCounts.h +++ b/src/xrpld/rpc/handlers/GetCounts.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_HANDLERS_GETCOUNTS_H_INCLUDED -#define XRPL_RPC_HANDLERS_GETCOUNTS_H_INCLUDED +#pragma once #include @@ -9,5 +8,3 @@ Json::Value getCountsJson(Application& app, int minObjectCount); } - -#endif diff --git a/src/xrpld/rpc/handlers/Handlers.h b/src/xrpld/rpc/handlers/Handlers.h index 773186237b..a5a96baa31 100644 --- a/src/xrpld/rpc/handlers/Handlers.h +++ b/src/xrpld/rpc/handlers/Handlers.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_HANDLERS_HANDLERS_H_INCLUDED -#define XRPL_RPC_HANDLERS_HANDLERS_H_INCLUDED +#pragma once #include @@ -150,5 +149,3 @@ doValidatorInfo(RPC::JsonContext&); Json::Value doVaultInfo(RPC::JsonContext&); } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/handlers/LedgerHandler.h b/src/xrpld/rpc/handlers/LedgerHandler.h index 3285118d11..418958e9f1 100644 --- a/src/xrpld/rpc/handlers/LedgerHandler.h +++ b/src/xrpld/rpc/handlers/LedgerHandler.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_HANDLERS_LEDGER_H_INCLUDED -#define XRPL_RPC_HANDLERS_LEDGER_H_INCLUDED +#pragma once #include #include @@ -59,5 +58,3 @@ private: } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/handlers/Version.h b/src/xrpld/rpc/handlers/Version.h index b1383511ed..ed80bf3729 100644 --- a/src/xrpld/rpc/handlers/Version.h +++ b/src/xrpld/rpc/handlers/Version.h @@ -1,5 +1,4 @@ -#ifndef XRPL_XRPL_RPC_HANDLERS_VERSION_H -#define XRPL_XRPL_RPC_HANDLERS_VERSION_H +#pragma once #include @@ -42,5 +41,3 @@ private: } // namespace RPC } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/handlers/WalletPropose.h b/src/xrpld/rpc/handlers/WalletPropose.h index 42c7973055..4eb72c7e46 100644 --- a/src/xrpld/rpc/handlers/WalletPropose.h +++ b/src/xrpld/rpc/handlers/WalletPropose.h @@ -1,5 +1,4 @@ -#ifndef XRPL_XRPL_RPC_HANDLERS_WALLETPROPOSE_H -#define XRPL_XRPL_RPC_HANDLERS_WALLETPROPOSE_H +#pragma once #include @@ -9,5 +8,3 @@ Json::Value walletPropose(Json::Value const& params); } // namespace xrpl - -#endif diff --git a/src/xrpld/rpc/json_body.h b/src/xrpld/rpc/json_body.h index cadae1c024..6f8025d876 100644 --- a/src/xrpld/rpc/json_body.h +++ b/src/xrpld/rpc/json_body.h @@ -1,5 +1,4 @@ -#ifndef XRPL_RPC_JSON_BODY_H -#define XRPL_RPC_JSON_BODY_H +#pragma once #include #include @@ -85,5 +84,3 @@ struct json_body }; } // namespace xrpl - -#endif diff --git a/src/xrpld/shamap/NodeFamily.h b/src/xrpld/shamap/NodeFamily.h index 14c2ebb093..ab555919ac 100644 --- a/src/xrpld/shamap/NodeFamily.h +++ b/src/xrpld/shamap/NodeFamily.h @@ -1,5 +1,4 @@ -#ifndef XRPL_SHAMAP_NODEFAMILY_H_INCLUDED -#define XRPL_SHAMAP_NODEFAMILY_H_INCLUDED +#pragma once #include @@ -84,5 +83,3 @@ private: }; } // namespace xrpl - -#endif From b449a6ee84f002f77f414ef9317c937f3de78a0b Mon Sep 17 00:00:00 2001 From: Bart Date: Wed, 4 Feb 2026 11:30:16 -0500 Subject: [PATCH 11/26] chore: Remove unnecessary script (#6326) --- convert_include_guards.py | 139 -------------------------------------- 1 file changed, 139 deletions(-) delete mode 100644 convert_include_guards.py diff --git a/convert_include_guards.py b/convert_include_guards.py deleted file mode 100644 index c4f06ecc54..0000000000 --- a/convert_include_guards.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python3 -""" -Script to replace include guards with #pragma once -Handles guards starting with XRPL_, BEAST_, or TEST_ -""" - -import sys -from pathlib import Path - - -def convert_file(file_path, prefixes=None): - """ - Convert a file from include guards to #pragma once - - Args: - file_path: Path to the file to convert - prefixes: List of prefixes to match (e.g., ['XRPL_', 'BEAST_', 'TEST_']) - If None, defaults to ['XRPL_', 'BEAST_', 'TEST_'] - - Returns True if the file was modified, False otherwise - """ - if prefixes is None: - prefixes = ["XRPL_", "BEAST_", "TEST_"] - - try: - with open(file_path, "r", encoding="utf-8") as f: - lines = f.readlines() - except Exception as e: - print(f"Error reading {file_path}: {e}", file=sys.stderr) - return False - - if len(lines) < 3: - print(f"Skipping {file_path}: too few lines", file=sys.stderr) - return False - - # Find the #ifndef with any of the specified prefixes - ifndef_idx = -1 - define_idx = -1 - found_prefix = None - - for i, line in enumerate(lines): - stripped = line.strip() - for prefix in prefixes: - if stripped.startswith(f"#ifndef {prefix}"): - ifndef_idx = i - found_prefix = prefix - # The #define should be the next line - if i + 1 < len(lines) and lines[i + 1].strip().startswith( - f"#define {prefix}" - ): - define_idx = i + 1 - break - if ifndef_idx != -1: - break - - if ifndef_idx == -1 or define_idx == -1: - print( - f"No include guard with prefixes {prefixes} found in {file_path}", - file=sys.stderr, - ) - return False - - # Find the last #endif line - endif_idx = -1 - for i in range(len(lines) - 1, -1, -1): - stripped = lines[i].strip() - if stripped.startswith("#endif"): - endif_idx = i - break - - if endif_idx == -1: - print(f"No closing #endif found in {file_path}", file=sys.stderr) - return False - - # Build the new content - new_lines = [] - - # Add everything before the #ifndef - new_lines.extend(lines[:ifndef_idx]) - - # Add #pragma once with exactly one empty line after it - new_lines.append("#pragma once\n") - new_lines.append("\n") - - # Add everything between #define and #endif, but skip leading empty lines - content_lines = lines[define_idx + 1 : endif_idx] - # Skip leading empty lines - start_idx = 0 - while start_idx < len(content_lines) and content_lines[start_idx].strip() == "": - start_idx += 1 - new_lines.extend(content_lines[start_idx:]) - - # Add everything after #endif (usually just empty lines, but include it) - new_lines.extend(lines[endif_idx + 1 :]) - - # Remove trailing empty lines at the end, then ensure exactly one newline at end - while new_lines and new_lines[-1].strip() == "": - new_lines.pop() - - if new_lines and not new_lines[-1].endswith("\n"): - new_lines[-1] += "\n" - else: - new_lines.append("\n") - - # Write the file - try: - with open(file_path, "w", encoding="utf-8") as f: - f.writelines(new_lines) - print(f"Converted: {file_path}") - return True - except Exception as e: - print(f"Error writing {file_path}: {e}", file=sys.stderr) - return False - - -def main(): - if len(sys.argv) < 2: - print("Usage: python convert_include_guards.py [file2 ...]") - sys.exit(1) - - files = sys.argv[1:] - success_count = 0 - fail_count = 0 - - for file_path in files: - if convert_file(file_path): - success_count += 1 - else: - fail_count += 1 - - print( - f"\nSummary: {success_count} files converted, {fail_count} files failed/unchanged" - ) - - return 0 if fail_count == 0 else 1 - - -if __name__ == "__main__": - sys.exit(main()) From 7f41012e599fde6d8c3985c954db57181c720a53 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Wed, 4 Feb 2026 18:27:10 +0000 Subject: [PATCH 12/26] chore: Update secp256k1 and openssl (#6327) --- conan.lock | 8 ++++---- conanfile.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conan.lock b/conan.lock index 64def2e916..3b4d835564 100644 --- a/conan.lock +++ b/conan.lock @@ -6,11 +6,11 @@ "sqlite3/3.49.1#8631739a4c9b93bd3d6b753bac548a63%1765850149.926", "soci/4.0.3#a9f8d773cd33e356b5879a4b0564f287%1765850149.46", "snappy/1.1.10#968fef506ff261592ec30c574d4a7809%1765850147.878", - "secp256k1/0.7.0#9c4ab67bdc3860c16ea5b36aed8f74ea%1765850147.928", + "secp256k1/0.7.0#0fda78daa3b864deb8a2fbc083398356%1770226294.524", "rocksdb/10.5.1#4a197eca381a3e5ae8adf8cffa5aacd0%1765850186.86", "re2/20230301#ca3b241baec15bd31ea9187150e0b333%1765850148.103", "protobuf/6.32.1#f481fd276fc23a33b85a3ed1e898b693%1765850161.038", - "openssl/3.5.4#1b986e61b38fdfda3b40bebc1b234393%1768312656.257", + "openssl/3.5.5#05a4ac5b7323f7a329b2db1391d9941f%1769599205.414", "nudb/2.0.9#0432758a24204da08fee953ec9ea03cb%1769436073.32", "lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504%1765850143.914", "libiconv/1.17#1e65319e945f2d31941a9d28cc13c058%1765842973.492", @@ -23,7 +23,7 @@ "date/3.0.4#862e11e80030356b53c2c38599ceb32b%1765850143.772", "c-ares/1.34.5#5581c2b62a608b40bb85d965ab3ec7c8%1765850144.336", "bzip2/1.0.8#c470882369c2d95c5c77e970c0c7e321%1765850143.837", - "boost/1.90.0#d5e8defe7355494953be18524a7f135b%1765955095.179", + "boost/1.90.0#d5e8defe7355494953be18524a7f135b%1769454080.269", "abseil/20250127.0#99262a368bd01c0ccca8790dfced9719%1766517936.993" ], "build_requires": [ @@ -31,7 +31,7 @@ "strawberryperl/5.32.1.1#707032463aa0620fa17ec0d887f5fe41%1765850165.196", "protobuf/6.32.1#f481fd276fc23a33b85a3ed1e898b693%1765850161.038", "nasm/2.16.01#31e26f2ee3c4346ecd347911bd126904%1765850144.707", - "msys2/cci.latest#1996656c3c98e5765b25b60ff5cf77b4%1764840888.758", + "msys2/cci.latest#eea83308ad7e9023f7318c60d5a9e6cb%1770199879.083", "m4/1.4.19#70dc8bbb33e981d119d2acc0175cf381%1763158052.846", "cmake/4.2.0#ae0a44f44a1ef9ab68fd4b3e9a1f8671%1765850153.937", "cmake/3.31.10#313d16a1aa16bbdb2ca0792467214b76%1765850153.479", diff --git a/conanfile.py b/conanfile.py index 35a461cec7..4fb2deeec8 100644 --- a/conanfile.py +++ b/conanfile.py @@ -31,7 +31,7 @@ class Xrpl(ConanFile): "grpc/1.72.0", "libarchive/3.8.1", "nudb/2.0.9", - "openssl/3.5.4", + "openssl/3.5.5", "secp256k1/0.7.0", "soci/4.0.3", "zlib/1.3.1", From e79673cf40cd4bbdb29e4f56fa2c3fd9e80edea4 Mon Sep 17 00:00:00 2001 From: Vito Tumas <5780819+Tapanito@users.noreply.github.com> Date: Thu, 5 Feb 2026 11:23:44 +0100 Subject: [PATCH 13/26] fix typo in LendingHelpers unit-test (#6215) --- src/test/app/LendingHelpers_test.cpp | 132 ++++++++++++--------------- 1 file changed, 60 insertions(+), 72 deletions(-) diff --git a/src/test/app/LendingHelpers_test.cpp b/src/test/app/LendingHelpers_test.cpp index ee829550e1..58e4c5aaa4 100644 --- a/src/test/app/LendingHelpers_test.cpp +++ b/src/test/app/LendingHelpers_test.cpp @@ -592,20 +592,18 @@ class LendingHelpers_test : public beast::unit_test::suite auto const periodicRate = loanPeriodicRate(loanInterestRate, paymentInterval); Number const overpaymentAmount{50}; - ExtendedPaymentComponents const overpaymentComponents = computeOverpaymentComponents( + auto const overpaymentComponents = computeOverpaymentComponents( asset, loanScale, overpaymentAmount, TenthBips32(0), TenthBips32(0), managementFeeRate); - auto const loanProperites = computeLoanProperties( + auto const loanProperties = computeLoanProperties( asset, loanPrincipal, loanInterestRate, paymentInterval, paymentsRemaining, managementFeeRate, loanScale); - Number const periodicPayment = loanProperites.periodicPayment; - auto const ret = tryOverpayment( asset, loanScale, overpaymentComponents, - loanProperites.loanState, - periodicPayment, + loanProperties.loanState, + loanProperties.periodicPayment, periodicRate, paymentsRemaining, managementFeeRate, @@ -636,20 +634,20 @@ class LendingHelpers_test : public beast::unit_test::suite // =========== VALIDATE STATE CHANGES =========== BEAST_EXPECTS( - loanProperites.loanState.interestDue - newState.interestDue == 0, + loanProperties.loanState.interestDue - newState.interestDue == 0, " interest change mismatch: expected 0, got " + - to_string(loanProperites.loanState.interestDue - newState.interestDue)); + to_string(loanProperties.loanState.interestDue - newState.interestDue)); BEAST_EXPECTS( - loanProperites.loanState.managementFeeDue - newState.managementFeeDue == 0, + loanProperties.loanState.managementFeeDue - newState.managementFeeDue == 0, " management fee change mismatch: expected 0, got " + - to_string(loanProperites.loanState.managementFeeDue - newState.managementFeeDue)); + to_string(loanProperties.loanState.managementFeeDue - newState.managementFeeDue)); BEAST_EXPECTS( actualPaymentParts.principalPaid == - loanProperites.loanState.principalOutstanding - newState.principalOutstanding, + loanProperties.loanState.principalOutstanding - newState.principalOutstanding, " principalPaid mismatch: expected " + - to_string(loanProperites.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + + to_string(loanProperties.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + to_string(actualPaymentParts.principalPaid)); } @@ -672,7 +670,7 @@ class LendingHelpers_test : public beast::unit_test::suite std::uint32_t const paymentsRemaining = 10; auto const periodicRate = loanPeriodicRate(loanInterestRate, paymentInterval); - ExtendedPaymentComponents const overpaymentComponents = computeOverpaymentComponents( + auto const overpaymentComponents = computeOverpaymentComponents( asset, loanScale, Number{50, 0}, @@ -680,17 +678,15 @@ class LendingHelpers_test : public beast::unit_test::suite TenthBips32(10'000), // 10% overpayment fee managementFeeRate); - auto const loanProperites = computeLoanProperties( + auto const loanProperties = computeLoanProperties( asset, loanPrincipal, loanInterestRate, paymentInterval, paymentsRemaining, managementFeeRate, loanScale); - Number const periodicPayment = loanProperites.periodicPayment; - auto const ret = tryOverpayment( asset, loanScale, overpaymentComponents, - loanProperites.loanState, - periodicPayment, + loanProperties.loanState, + loanProperties.periodicPayment, periodicRate, paymentsRemaining, managementFeeRate, @@ -721,21 +717,21 @@ class LendingHelpers_test : public beast::unit_test::suite // =========== VALIDATE STATE CHANGES =========== // With no Loan interest, interest outstanding should not change BEAST_EXPECTS( - loanProperites.loanState.interestDue - newState.interestDue == 0, + loanProperties.loanState.interestDue - newState.interestDue == 0, " interest change mismatch: expected 0, got " + - to_string(loanProperites.loanState.interestDue - newState.interestDue)); + to_string(loanProperties.loanState.interestDue - newState.interestDue)); // With no Loan management fee, management fee due should not change BEAST_EXPECTS( - loanProperites.loanState.managementFeeDue - newState.managementFeeDue == 0, + loanProperties.loanState.managementFeeDue - newState.managementFeeDue == 0, " management fee change mismatch: expected 0, got " + - to_string(loanProperites.loanState.managementFeeDue - newState.managementFeeDue)); + to_string(loanProperties.loanState.managementFeeDue - newState.managementFeeDue)); BEAST_EXPECTS( actualPaymentParts.principalPaid == - loanProperites.loanState.principalOutstanding - newState.principalOutstanding, + loanProperties.loanState.principalOutstanding - newState.principalOutstanding, " principalPaid mismatch: expected " + - to_string(loanProperites.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + + to_string(loanProperties.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + to_string(actualPaymentParts.principalPaid)); } @@ -758,7 +754,7 @@ class LendingHelpers_test : public beast::unit_test::suite std::uint32_t const paymentsRemaining = 10; auto const periodicRate = loanPeriodicRate(loanInterestRate, paymentInterval); - ExtendedPaymentComponents const overpaymentComponents = computeOverpaymentComponents( + auto const overpaymentComponents = computeOverpaymentComponents( asset, loanScale, Number{50, 0}, @@ -766,17 +762,15 @@ class LendingHelpers_test : public beast::unit_test::suite TenthBips32(0), // 0% overpayment fee managementFeeRate); - auto const loanProperites = computeLoanProperties( + auto const loanProperties = computeLoanProperties( asset, loanPrincipal, loanInterestRate, paymentInterval, paymentsRemaining, managementFeeRate, loanScale); - Number const periodicPayment = loanProperites.periodicPayment; - auto const ret = tryOverpayment( asset, loanScale, overpaymentComponents, - loanProperites.loanState, - periodicPayment, + loanProperties.loanState, + loanProperties.periodicPayment, periodicRate, paymentsRemaining, managementFeeRate, @@ -812,22 +806,22 @@ class LendingHelpers_test : public beast::unit_test::suite // =========== VALIDATE STATE CHANGES =========== BEAST_EXPECTS( actualPaymentParts.principalPaid == - loanProperites.loanState.principalOutstanding - newState.principalOutstanding, + loanProperties.loanState.principalOutstanding - newState.principalOutstanding, " principalPaid mismatch: expected " + - to_string(loanProperites.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + + to_string(loanProperties.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + to_string(actualPaymentParts.principalPaid)); BEAST_EXPECTS( - actualPaymentParts.valueChange == newState.interestDue - loanProperites.loanState.interestDue, + actualPaymentParts.valueChange == newState.interestDue - loanProperties.loanState.interestDue, " valueChange mismatch: expected " + - to_string(newState.interestDue - loanProperites.loanState.interestDue) + ", got " + + to_string(newState.interestDue - loanProperties.loanState.interestDue) + ", got " + to_string(actualPaymentParts.valueChange)); // With no Loan management fee, management fee due should not change BEAST_EXPECTS( - loanProperites.loanState.managementFeeDue - newState.managementFeeDue == 0, + loanProperties.loanState.managementFeeDue - newState.managementFeeDue == 0, " management fee change mismatch: expected 0, got " + - to_string(loanProperites.loanState.managementFeeDue - newState.managementFeeDue)); + to_string(loanProperties.loanState.managementFeeDue - newState.managementFeeDue)); } void @@ -849,7 +843,7 @@ class LendingHelpers_test : public beast::unit_test::suite std::uint32_t const paymentsRemaining = 10; auto const periodicRate = loanPeriodicRate(loanInterestRate, paymentInterval); - ExtendedPaymentComponents const overpaymentComponents = computeOverpaymentComponents( + auto const overpaymentComponents = computeOverpaymentComponents( asset, loanScale, Number{50, 0}, @@ -857,17 +851,15 @@ class LendingHelpers_test : public beast::unit_test::suite TenthBips32(0), // 0% overpayment fee managementFeeRate); - auto const loanProperites = computeLoanProperties( + auto const loanProperties = computeLoanProperties( asset, loanPrincipal, loanInterestRate, paymentInterval, paymentsRemaining, managementFeeRate, loanScale); - Number const periodicPayment = loanProperites.periodicPayment; - auto const ret = tryOverpayment( asset, loanScale, overpaymentComponents, - loanProperites.loanState, - periodicPayment, + loanProperties.loanState, + loanProperties.periodicPayment, periodicRate, paymentsRemaining, managementFeeRate, @@ -904,26 +896,26 @@ class LendingHelpers_test : public beast::unit_test::suite // =========== VALIDATE STATE CHANGES =========== BEAST_EXPECTS( actualPaymentParts.principalPaid == - loanProperites.loanState.principalOutstanding - newState.principalOutstanding, + loanProperties.loanState.principalOutstanding - newState.principalOutstanding, " principalPaid mismatch: expected " + - to_string(loanProperites.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + + to_string(loanProperties.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + to_string(actualPaymentParts.principalPaid)); // The change in interest is equal to the value change sans the // overpayment interest BEAST_EXPECTS( actualPaymentParts.valueChange - actualPaymentParts.interestPaid == - newState.interestDue - loanProperites.loanState.interestDue, + newState.interestDue - loanProperties.loanState.interestDue, " valueChange mismatch: expected " + to_string( - newState.interestDue - loanProperites.loanState.interestDue + actualPaymentParts.interestPaid) + + newState.interestDue - loanProperties.loanState.interestDue + actualPaymentParts.interestPaid) + ", got " + to_string(actualPaymentParts.valueChange)); // With no Loan management fee, management fee due should not change BEAST_EXPECTS( - loanProperites.loanState.managementFeeDue - newState.managementFeeDue == 0, + loanProperties.loanState.managementFeeDue - newState.managementFeeDue == 0, " management fee change mismatch: expected 0, got " + - to_string(loanProperites.loanState.managementFeeDue - newState.managementFeeDue)); + to_string(loanProperties.loanState.managementFeeDue - newState.managementFeeDue)); } void @@ -947,7 +939,7 @@ class LendingHelpers_test : public beast::unit_test::suite std::uint32_t const paymentsRemaining = 10; auto const periodicRate = loanPeriodicRate(loanInterestRate, paymentInterval); - ExtendedPaymentComponents const overpaymentComponents = computeOverpaymentComponents( + auto const overpaymentComponents = computeOverpaymentComponents( asset, loanScale, Number{50, 0}, @@ -955,17 +947,15 @@ class LendingHelpers_test : public beast::unit_test::suite TenthBips32(0), // 0% overpayment fee managementFeeRate); - auto const loanProperites = computeLoanProperties( + auto const loanProperties = computeLoanProperties( asset, loanPrincipal, loanInterestRate, paymentInterval, paymentsRemaining, managementFeeRate, loanScale); - Number const periodicPayment = loanProperites.periodicPayment; - auto const ret = tryOverpayment( asset, loanScale, overpaymentComponents, - loanProperites.loanState, - periodicPayment, + loanProperties.loanState, + loanProperties.periodicPayment, periodicRate, paymentsRemaining, managementFeeRate, @@ -1004,23 +994,23 @@ class LendingHelpers_test : public beast::unit_test::suite // =========== VALIDATE STATE CHANGES =========== BEAST_EXPECTS( actualPaymentParts.principalPaid == - loanProperites.loanState.principalOutstanding - newState.principalOutstanding, + loanProperties.loanState.principalOutstanding - newState.principalOutstanding, " principalPaid mismatch: expected " + - to_string(loanProperites.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + + to_string(loanProperties.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + to_string(actualPaymentParts.principalPaid)); // Note that the management fee value change is not captured, as this // value is not needed to correctly update the Vault state. BEAST_EXPECTS( - (newState.managementFeeDue - loanProperites.loanState.managementFeeDue == Number{-20592, -5}), + (newState.managementFeeDue - loanProperties.loanState.managementFeeDue == Number{-20592, -5}), " management fee change mismatch: expected " + to_string(Number{-20592, -5}) + ", got " + - to_string(newState.managementFeeDue - loanProperites.loanState.managementFeeDue)); + to_string(newState.managementFeeDue - loanProperties.loanState.managementFeeDue)); BEAST_EXPECTS( actualPaymentParts.valueChange - actualPaymentParts.interestPaid == - newState.interestDue - loanProperites.loanState.interestDue, + newState.interestDue - loanProperties.loanState.interestDue, " valueChange mismatch: expected " + - to_string(newState.interestDue - loanProperites.loanState.interestDue) + ", got " + + to_string(newState.interestDue - loanProperties.loanState.interestDue) + ", got " + to_string(actualPaymentParts.valueChange - actualPaymentParts.interestPaid)); } @@ -1043,7 +1033,7 @@ class LendingHelpers_test : public beast::unit_test::suite std::uint32_t const paymentsRemaining = 10; auto const periodicRate = loanPeriodicRate(loanInterestRate, paymentInterval); - ExtendedPaymentComponents const overpaymentComponents = computeOverpaymentComponents( + auto const overpaymentComponents = computeOverpaymentComponents( asset, loanScale, Number{50, 0}, @@ -1051,17 +1041,15 @@ class LendingHelpers_test : public beast::unit_test::suite TenthBips32(10'000), // 10% overpayment fee managementFeeRate); - auto const loanProperites = computeLoanProperties( + auto const loanProperties = computeLoanProperties( asset, loanPrincipal, loanInterestRate, paymentInterval, paymentsRemaining, managementFeeRate, loanScale); - Number const periodicPayment = loanProperites.periodicPayment; - auto const ret = tryOverpayment( asset, loanScale, overpaymentComponents, - loanProperites.loanState, - periodicPayment, + loanProperties.loanState, + loanProperties.periodicPayment, periodicRate, paymentsRemaining, managementFeeRate, @@ -1101,23 +1089,23 @@ class LendingHelpers_test : public beast::unit_test::suite BEAST_EXPECTS( actualPaymentParts.principalPaid == - loanProperites.loanState.principalOutstanding - newState.principalOutstanding, + loanProperties.loanState.principalOutstanding - newState.principalOutstanding, " principalPaid mismatch: expected " + - to_string(loanProperites.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + + to_string(loanProperties.loanState.principalOutstanding - newState.principalOutstanding) + ", got " + to_string(actualPaymentParts.principalPaid)); // Note that the management fee value change is not captured, as this // value is not needed to correctly update the Vault state. BEAST_EXPECTS( - (newState.managementFeeDue - loanProperites.loanState.managementFeeDue == Number{-18304, -5}), + (newState.managementFeeDue - loanProperties.loanState.managementFeeDue == Number{-18304, -5}), " management fee change mismatch: expected " + to_string(Number{-18304, -5}) + ", got " + - to_string(newState.managementFeeDue - loanProperites.loanState.managementFeeDue)); + to_string(newState.managementFeeDue - loanProperties.loanState.managementFeeDue)); BEAST_EXPECTS( actualPaymentParts.valueChange - actualPaymentParts.interestPaid == - newState.interestDue - loanProperites.loanState.interestDue, + newState.interestDue - loanProperties.loanState.interestDue, " valueChange mismatch: expected " + - to_string(newState.interestDue - loanProperites.loanState.interestDue) + ", got " + + to_string(newState.interestDue - loanProperties.loanState.interestDue) + ", got " + to_string(actualPaymentParts.valueChange - actualPaymentParts.interestPaid)); } From 6006c281e22b8a907a3e3c993449ad42e598ed32 Mon Sep 17 00:00:00 2001 From: Niq Dudfield Date: Thu, 5 Feb 2026 22:40:27 +0700 Subject: [PATCH 14/26] fix: Increment sequence when accepting new manifests (#6059) The `ManifestCache::applyManifest` function was returning early without incrementing `seq_`. `OverlayImpl `uses this sequence to identify/invalidate a cached `TMManifests` message, which is exchanged with peers on connection. Depending on network size, startup sequencing, and topology, this can cause syncing issues. This change therefore increments `seq_` when a new manifest is accepted. --- src/test/app/Manifest_test.cpp | 5 +++++ src/xrpld/app/misc/detail/Manifest.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/test/app/Manifest_test.cpp b/src/test/app/Manifest_test.cpp index f5004a3200..598949f662 100644 --- a/src/test/app/Manifest_test.cpp +++ b/src/test/app/Manifest_test.cpp @@ -827,8 +827,13 @@ public: // applyManifest should accept new manifests with // higher sequence numbers + auto const seq0 = cache.sequence(); BEAST_EXPECT(cache.applyManifest(clone(s_a0)) == ManifestDisposition::accepted); + BEAST_EXPECT(cache.sequence() > seq0); + + auto const seq1 = cache.sequence(); BEAST_EXPECT(cache.applyManifest(clone(s_a0)) == ManifestDisposition::stale); + BEAST_EXPECT(cache.sequence() == seq1); BEAST_EXPECT(cache.applyManifest(clone(s_a1)) == ManifestDisposition::accepted); BEAST_EXPECT(cache.applyManifest(clone(s_a1)) == ManifestDisposition::stale); diff --git a/src/xrpld/app/misc/detail/Manifest.cpp b/src/xrpld/app/misc/detail/Manifest.cpp index c226407231..952814656b 100644 --- a/src/xrpld/app/misc/detail/Manifest.cpp +++ b/src/xrpld/app/misc/detail/Manifest.cpp @@ -459,6 +459,10 @@ ManifestCache::applyManifest(Manifest m) auto masterKey = m.masterKey; map_.emplace(std::move(masterKey), std::move(m)); + + // Something has changed. Keep track of it. + seq_++; + return ManifestDisposition::accepted; } From 0a626d95f435f603b89ba5bf95fe201c71088e7a Mon Sep 17 00:00:00 2001 From: Bart Date: Thu, 5 Feb 2026 11:45:57 -0500 Subject: [PATCH 15/26] refactor: Update secp256k1 to 0.7.1 (#6331) The latest secp256k1 release, 0.7.1, contains bug fixes that we may benefit from, see https://github.com/bitcoin-core/secp256k1/blob/master/CHANGELOG.md. --- conan.lock | 2 +- conanfile.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conan.lock b/conan.lock index 3b4d835564..900d3526e1 100644 --- a/conan.lock +++ b/conan.lock @@ -6,7 +6,7 @@ "sqlite3/3.49.1#8631739a4c9b93bd3d6b753bac548a63%1765850149.926", "soci/4.0.3#a9f8d773cd33e356b5879a4b0564f287%1765850149.46", "snappy/1.1.10#968fef506ff261592ec30c574d4a7809%1765850147.878", - "secp256k1/0.7.0#0fda78daa3b864deb8a2fbc083398356%1770226294.524", + "secp256k1/0.7.1#3a61e95e220062ef32c48d019e9c81f7%1770306721.686", "rocksdb/10.5.1#4a197eca381a3e5ae8adf8cffa5aacd0%1765850186.86", "re2/20230301#ca3b241baec15bd31ea9187150e0b333%1765850148.103", "protobuf/6.32.1#f481fd276fc23a33b85a3ed1e898b693%1765850161.038", diff --git a/conanfile.py b/conanfile.py index 4fb2deeec8..85406bf570 100644 --- a/conanfile.py +++ b/conanfile.py @@ -32,7 +32,7 @@ class Xrpl(ConanFile): "libarchive/3.8.1", "nudb/2.0.9", "openssl/3.5.5", - "secp256k1/0.7.0", + "secp256k1/0.7.1", "soci/4.0.3", "zlib/1.3.1", ] From 25d7c2c4ec7580db602145c258ff49463a58f14a Mon Sep 17 00:00:00 2001 From: Bart Date: Fri, 6 Feb 2026 09:12:45 -0500 Subject: [PATCH 16/26] chore: Restore unity builds (#6328) In certain cases, such as when modifying headers used by many compilation units, performing a unity build is slower than when performing a regular build with `ccache` enabled. There is also a benefit to a unity build in that it can detect things such as macro redefinitions within the group of files that are compiled together as a unit. This change therefore restores the ability to perform unity builds. However, instead of running every configuration with and without unity enabled, it is now only enabled for a single configuration to maintain lower computational use. As part of restoring the code, it became clear that currently two configurations have coverage enabled, since the check doesn't focus specifically on Debian Bookworm so it also applies to Debian Trixie. This has been fixed too in this change. --- .github/scripts/strategy-matrix/generate.py | 17 +++++++++++++++-- BUILD.md | 7 +++++++ cmake/XrplCore.cmake | 5 +++++ cmake/XrplSettings.cmake | 8 ++++++++ conanfile.py | 3 +++ src/libxrpl/net/RegisterSSLCerts.cpp | 3 +-- 6 files changed, 39 insertions(+), 4 deletions(-) diff --git a/.github/scripts/strategy-matrix/generate.py b/.github/scripts/strategy-matrix/generate.py index 75847b4d9d..27eb60c005 100755 --- a/.github/scripts/strategy-matrix/generate.py +++ b/.github/scripts/strategy-matrix/generate.py @@ -196,11 +196,22 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: # Enable code coverage for Debian Bookworm using GCC 15 in Debug on # linux/amd64 if ( - f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-15" + f"{os['distro_name']}-{os['distro_version']}" == "debian-bookworm" + and f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-15" and build_type == "Debug" and architecture["platform"] == "linux/amd64" ): - cmake_args = f"-Dcoverage=ON -Dcoverage_format=xml -DCODE_COVERAGE_VERBOSE=ON -DCMAKE_C_FLAGS=-O0 -DCMAKE_CXX_FLAGS=-O0 {cmake_args}" + cmake_args = f"{cmake_args} -Dcoverage=ON -Dcoverage_format=xml -DCODE_COVERAGE_VERBOSE=ON -DCMAKE_C_FLAGS=-O0 -DCMAKE_CXX_FLAGS=-O0" + + # Enable unity build for Ubuntu Jammy using GCC 12 in Debug on + # linux/amd64. + if ( + f"{os['distro_name']}-{os['distro_version']}" == "ubuntu-jammy" + and f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-12" + and build_type == "Debug" + and architecture["platform"] == "linux/amd64" + ): + cmake_args = f"{cmake_args} -Dunity=ON" # Generate a unique name for the configuration, e.g. macos-arm64-debug # or debian-bookworm-gcc-12-amd64-release. @@ -217,6 +228,8 @@ def generate_strategy_matrix(all: bool, config: Config) -> list: config_name += f"-{build_type.lower()}" if "-Dcoverage=ON" in cmake_args: config_name += "-coverage" + if "-Dunity=ON" in cmake_args: + config_name += "-unity" # Add the configuration to the list, with the most unique fields first, # so that they are easier to identify in the GitHub Actions UI, as long diff --git a/BUILD.md b/BUILD.md index 35668aeabd..4d01700a61 100644 --- a/BUILD.md +++ b/BUILD.md @@ -575,10 +575,16 @@ See [Sanitizers docs](./docs/build/sanitizers.md) for more details. | `assert` | OFF | Enable assertions. | | `coverage` | OFF | Prepare the coverage report. | | `tests` | OFF | Build tests. | +| `unity` | OFF | Configure a unity build. | | `xrpld` | OFF | Build the xrpld application, and not just the libxrpl library. | | `werr` | OFF | Treat compilation warnings as errors | | `wextra` | OFF | Enable additional compilation warnings | +[Unity builds][5] may be faster for the first build (at the cost of much more +memory) since they concatenate sources into fewer translation units. Non-unity +builds may be faster for incremental builds, and can be helpful for detecting +`#include` omissions. + ## Troubleshooting ### Conan @@ -645,6 +651,7 @@ If you want to experiment with a new package, follow these steps: [1]: https://github.com/conan-io/conan-center-index/issues/13168 [2]: https://en.cppreference.com/w/cpp/compiler_support/20 [3]: https://docs.conan.io/en/latest/getting_started.html +[5]: https://en.wikipedia.org/wiki/Unity_build [6]: https://github.com/boostorg/beast/issues/2648 [7]: https://github.com/boostorg/beast/issues/2661 [gcovr]: https://gcovr.com/en/stable/getting-started.html diff --git a/cmake/XrplCore.cmake b/cmake/XrplCore.cmake index afefa8457d..57d0e83348 100644 --- a/cmake/XrplCore.cmake +++ b/cmake/XrplCore.cmake @@ -4,7 +4,12 @@ include(target_protobuf_sources) +# Protocol buffers cannot participate in a unity build, +# because all the generated sources +# define a bunch of `static const` variables with the same names, +# so we just build them as a separate library. add_library(xrpl.libpb) +set_target_properties(xrpl.libpb PROPERTIES UNITY_BUILD OFF) target_protobuf_sources(xrpl.libpb xrpl/proto LANGUAGE cpp IMPORT_DIRS include/xrpl/proto PROTOS include/xrpl/proto/xrpl.proto) diff --git a/cmake/XrplSettings.cmake b/cmake/XrplSettings.cmake index 0957e41918..6d332be19d 100644 --- a/cmake/XrplSettings.cmake +++ b/cmake/XrplSettings.cmake @@ -30,6 +30,14 @@ if (tests) endif () endif () +option(unity "Creates a build using UNITY support in cmake." OFF) +if (unity) + if (NOT is_ci) + set(CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "") + endif () + set(CMAKE_UNITY_BUILD ON CACHE BOOL "Do a unity build") +endif () + if (is_clang AND is_linux) option(voidstar "Enable Antithesis instrumentation." OFF) endif () diff --git a/conanfile.py b/conanfile.py index 85406bf570..7300b537d9 100644 --- a/conanfile.py +++ b/conanfile.py @@ -23,6 +23,7 @@ class Xrpl(ConanFile): "shared": [True, False], "static": [True, False], "tests": [True, False], + "unity": [True, False], "xrpld": [True, False], } @@ -54,6 +55,7 @@ class Xrpl(ConanFile): "shared": False, "static": True, "tests": False, + "unity": False, "xrpld": False, "date/*:header_only": True, "ed25519/*:shared": False, @@ -166,6 +168,7 @@ class Xrpl(ConanFile): tc.variables["rocksdb"] = self.options.rocksdb tc.variables["BUILD_SHARED_LIBS"] = self.options.shared tc.variables["static"] = self.options.static + tc.variables["unity"] = self.options.unity tc.variables["xrpld"] = self.options.xrpld tc.generate() diff --git a/src/libxrpl/net/RegisterSSLCerts.cpp b/src/libxrpl/net/RegisterSSLCerts.cpp index 1b97a17e5c..a15472969e 100644 --- a/src/libxrpl/net/RegisterSSLCerts.cpp +++ b/src/libxrpl/net/RegisterSSLCerts.cpp @@ -85,8 +85,7 @@ registerSSLCerts(boost::asio::ssl::context& ctx, boost::system::error_code& ec, // There is a very unpleasant interaction between and // openssl x509 types (namely the former has macros that stomp // on the latter), these undefs allow this TU to be safely used in -// unity builds without messing up subsequent TUs. Although we -// no longer use unity builds, leaving the undefs here does no harm. +// unity builds without messing up subsequent TUs. #if BOOST_OS_WINDOWS #undef X509_NAME #undef X509_EXTENSIONS From 677758b1cc9d8afc190582a75160425096708f54 Mon Sep 17 00:00:00 2001 From: Bart Date: Fri, 6 Feb 2026 09:42:35 -0500 Subject: [PATCH 17/26] perf: Remove unnecessary caches (#5439) This change removes the cache in `DatabaseNodeImp` and simplifies the caching logic in `SHAMapStoreImp`. As NuDB and RocksDB internally already use caches, additional caches in the code are not very valuable or may even be unnecessary, as also confirmed during preliminary performance analyses. --- cfg/xrpld-example.cfg | 20 +-- include/xrpl/nodestore/Database.h | 4 - .../xrpl/nodestore/detail/DatabaseNodeImp.h | 32 ---- .../nodestore/detail/DatabaseRotatingImp.h | 3 - src/libxrpl/nodestore/DatabaseNodeImp.cpp | 148 +++++------------- src/libxrpl/nodestore/DatabaseRotatingImp.cpp | 6 - src/test/app/SHAMapStore_test.cpp | 18 +-- src/xrpld/app/main/Application.cpp | 4 - src/xrpld/app/misc/SHAMapStoreImp.cpp | 21 +-- src/xrpld/app/misc/SHAMapStoreImp.h | 2 - 10 files changed, 47 insertions(+), 211 deletions(-) diff --git a/cfg/xrpld-example.cfg b/cfg/xrpld-example.cfg index 93fab4a9ba..995d4e65ff 100644 --- a/cfg/xrpld-example.cfg +++ b/cfg/xrpld-example.cfg @@ -940,23 +940,7 @@ # # path Location to store the database # -# Optional keys -# -# cache_size Size of cache for database records. Default is 16384. -# Setting this value to 0 will use the default value. -# -# cache_age Length of time in minutes to keep database records -# cached. Default is 5 minutes. Setting this value to -# 0 will use the default value. -# -# Note: if neither cache_size nor cache_age is -# specified, the cache for database records will not -# be created. If only one of cache_size or cache_age -# is specified, the cache will be created using the -# default value for the unspecified parameter. -# -# Note: the cache will not be created if online_delete -# is specified. +# Optional keys for NuDB and RocksDB: # # fast_load Boolean. If set, load the last persisted ledger # from disk upon process start before syncing to @@ -964,8 +948,6 @@ # if sufficient IOPS capacity is available. # Default 0. # -# Optional keys for NuDB or RocksDB: -# # earliest_seq The default is 32570 to match the XRP ledger # network's earliest allowed sequence. Alternate # networks may set this value. Minimum value of 1. diff --git a/include/xrpl/nodestore/Database.h b/include/xrpl/nodestore/Database.h index d3dafff85d..d1f5b1bda2 100644 --- a/include/xrpl/nodestore/Database.h +++ b/include/xrpl/nodestore/Database.h @@ -133,10 +133,6 @@ public: std::uint32_t ledgerSeq, std::function const&)>&& callback); - /** Remove expired entries from the positive and negative caches. */ - virtual void - sweep() = 0; - /** Gather statistics pertaining to read and write activities. * * @param obj Json object reference into which to place counters. diff --git a/include/xrpl/nodestore/detail/DatabaseNodeImp.h b/include/xrpl/nodestore/detail/DatabaseNodeImp.h index dd6b8f9ddd..94859c4d22 100644 --- a/include/xrpl/nodestore/detail/DatabaseNodeImp.h +++ b/include/xrpl/nodestore/detail/DatabaseNodeImp.h @@ -23,32 +23,6 @@ public: beast::Journal j) : Database(scheduler, readThreads, config, j), backend_(std::move(backend)) { - std::optional cacheSize, cacheAge; - - if (config.exists("cache_size")) - { - cacheSize = get(config, "cache_size"); - if (cacheSize.value() < 0) - { - Throw("Specified negative value for cache_size"); - } - } - - if (config.exists("cache_age")) - { - cacheAge = get(config, "cache_age"); - if (cacheAge.value() < 0) - { - Throw("Specified negative value for cache_age"); - } - } - - if (cacheSize != 0 || cacheAge != 0) - { - cache_ = std::make_shared>( - "DatabaseNodeImp", cacheSize.value_or(0), std::chrono::minutes(cacheAge.value_or(0)), stopwatch(), j); - } - XRPL_ASSERT( backend_, "xrpl::NodeStore::DatabaseNodeImp::DatabaseNodeImp : non-null " @@ -103,13 +77,7 @@ public: std::uint32_t ledgerSeq, std::function const&)>&& callback) override; - void - sweep() override; - private: - // Cache for database objects. This cache is not always initialized. Check - // for null before using. - std::shared_ptr> cache_; // Persistent key/value storage std::shared_ptr backend_; diff --git a/include/xrpl/nodestore/detail/DatabaseRotatingImp.h b/include/xrpl/nodestore/detail/DatabaseRotatingImp.h index e49c195d67..1a378c54c7 100644 --- a/include/xrpl/nodestore/detail/DatabaseRotatingImp.h +++ b/include/xrpl/nodestore/detail/DatabaseRotatingImp.h @@ -55,9 +55,6 @@ public: void sync() override; - void - sweep() override; - private: std::shared_ptr writableBackend_; std::shared_ptr archiveBackend_; diff --git a/src/libxrpl/nodestore/DatabaseNodeImp.cpp b/src/libxrpl/nodestore/DatabaseNodeImp.cpp index f49867514c..11152a2027 100644 --- a/src/libxrpl/nodestore/DatabaseNodeImp.cpp +++ b/src/libxrpl/nodestore/DatabaseNodeImp.cpp @@ -10,11 +10,6 @@ DatabaseNodeImp::store(NodeObjectType type, Blob&& data, uint256 const& hash, st auto obj = NodeObject::createObject(type, std::move(data), hash); backend_->store(obj); - if (cache_) - { - // After the store, replace a negative cache entry if there is one - cache_->canonicalize(hash, obj, [](std::shared_ptr const& n) { return n->getType() == hotDUMMY; }); - } } void @@ -23,77 +18,36 @@ DatabaseNodeImp::asyncFetch( std::uint32_t ledgerSeq, std::function const&)>&& callback) { - if (cache_) - { - std::shared_ptr obj = cache_->fetch(hash); - if (obj) - { - callback(obj->getType() == hotDUMMY ? nullptr : obj); - return; - } - } Database::asyncFetch(hash, ledgerSeq, std::move(callback)); } -void -DatabaseNodeImp::sweep() -{ - if (cache_) - cache_->sweep(); -} - std::shared_ptr DatabaseNodeImp::fetchNodeObject(uint256 const& hash, std::uint32_t, FetchReport& fetchReport, bool duplicate) { - std::shared_ptr nodeObject = cache_ ? cache_->fetch(hash) : nullptr; + std::shared_ptr nodeObject = nullptr; + Status status; - if (!nodeObject) + try { - JLOG(j_.trace()) << "fetchNodeObject " << hash << ": record not " << (cache_ ? "cached" : "found"); - - Status status; - - try - { - status = backend_->fetch(hash.data(), &nodeObject); - } - catch (std::exception const& e) - { - JLOG(j_.fatal()) << "fetchNodeObject " << hash << ": Exception fetching from backend: " << e.what(); - Rethrow(); - } - - switch (status) - { - case ok: - if (cache_) - { - if (nodeObject) - cache_->canonicalize_replace_client(hash, nodeObject); - else - { - auto notFound = NodeObject::createObject(hotDUMMY, {}, hash); - cache_->canonicalize_replace_client(hash, notFound); - if (notFound->getType() != hotDUMMY) - nodeObject = notFound; - } - } - break; - case notFound: - break; - case dataCorrupt: - JLOG(j_.fatal()) << "fetchNodeObject " << hash << ": nodestore data is corrupted"; - break; - default: - JLOG(j_.warn()) << "fetchNodeObject " << hash << ": backend returns unknown result " << status; - break; - } + status = backend_->fetch(hash.data(), &nodeObject); } - else + catch (std::exception const& e) { - JLOG(j_.trace()) << "fetchNodeObject " << hash << ": record found in cache"; - if (nodeObject->getType() == hotDUMMY) - nodeObject.reset(); + JLOG(j_.fatal()) << "fetchNodeObject " << hash << ": Exception fetching from backend: " << e.what(); + Rethrow(); + } + + switch (status) + { + case ok: + case notFound: + break; + case dataCorrupt: + JLOG(j_.fatal()) << "fetchNodeObject " << hash << ": nodestore data is corrupted"; + break; + default: + JLOG(j_.warn()) << "fetchNodeObject " << hash << ": backend returns unknown result " << status; + break; } if (nodeObject) @@ -105,66 +59,36 @@ DatabaseNodeImp::fetchNodeObject(uint256 const& hash, std::uint32_t, FetchReport std::vector> DatabaseNodeImp::fetchBatch(std::vector const& hashes) { - std::vector> results{hashes.size()}; using namespace std::chrono; auto const before = steady_clock::now(); - std::unordered_map indexMap; - std::vector cacheMisses; - uint64_t hits = 0; - uint64_t fetches = 0; + + std::vector batch{}; + batch.reserve(hashes.size()); for (size_t i = 0; i < hashes.size(); ++i) { auto const& hash = hashes[i]; - // See if the object already exists in the cache - auto nObj = cache_ ? cache_->fetch(hash) : nullptr; - ++fetches; - if (!nObj) - { - // Try the database - indexMap[&hash] = i; - cacheMisses.push_back(&hash); - } - else - { - results[i] = nObj->getType() == hotDUMMY ? nullptr : nObj; - // It was in the cache. - ++hits; - } + batch.push_back(&hash); } - JLOG(j_.debug()) << "fetchBatch - cache hits = " << (hashes.size() - cacheMisses.size()) - << " - cache misses = " << cacheMisses.size(); - auto dbResults = backend_->fetchBatch(cacheMisses).first; - - for (size_t i = 0; i < dbResults.size(); ++i) + // Get the node objects that match the hashes from the backend. To protect + // against the backends returning fewer or more results than expected, the + // container is resized to the number of hashes. + auto results = backend_->fetchBatch(batch).first; + XRPL_ASSERT( + results.size() == hashes.size() || results.empty(), + "number of output objects either matches number of input hashes or is empty"); + results.resize(hashes.size()); + for (size_t i = 0; i < results.size(); ++i) { - auto nObj = std::move(dbResults[i]); - size_t index = indexMap[cacheMisses[i]]; - auto const& hash = hashes[index]; - - if (nObj) - { - // Ensure all threads get the same object - if (cache_) - cache_->canonicalize_replace_client(hash, nObj); - } - else + if (!results[i]) { JLOG(j_.error()) << "fetchBatch - " - << "record not found in db or cache. hash = " << strHex(hash); - if (cache_) - { - auto notFound = NodeObject::createObject(hotDUMMY, {}, hash); - cache_->canonicalize_replace_client(hash, notFound); - if (notFound->getType() != hotDUMMY) - nObj = std::move(notFound); - } + << "record not found in db. hash = " << strHex(hashes[i]); } - results[index] = std::move(nObj); } auto fetchDurationUs = std::chrono::duration_cast(steady_clock::now() - before).count(); - updateFetchMetrics(fetches, hits, fetchDurationUs); + updateFetchMetrics(hashes.size(), 0, fetchDurationUs); return results; } diff --git a/src/libxrpl/nodestore/DatabaseRotatingImp.cpp b/src/libxrpl/nodestore/DatabaseRotatingImp.cpp index 2e72dca969..f25b9d068e 100644 --- a/src/libxrpl/nodestore/DatabaseRotatingImp.cpp +++ b/src/libxrpl/nodestore/DatabaseRotatingImp.cpp @@ -93,12 +93,6 @@ DatabaseRotatingImp::store(NodeObjectType type, Blob&& data, uint256 const& hash storeStats(1, nObj->getData().size()); } -void -DatabaseRotatingImp::sweep() -{ - // nothing to do -} - std::shared_ptr DatabaseRotatingImp::fetchNodeObject(uint256 const& hash, std::uint32_t, FetchReport& fetchReport, bool duplicate) { diff --git a/src/test/app/SHAMapStore_test.cpp b/src/test/app/SHAMapStore_test.cpp index 91845709c5..7951da26d1 100644 --- a/src/test/app/SHAMapStore_test.cpp +++ b/src/test/app/SHAMapStore_test.cpp @@ -490,19 +490,8 @@ public: Env env(*this, envconfig(onlineDelete)); ///////////////////////////////////////////////////////////// - // Create the backend. Normally, SHAMapStoreImp handles all these - // details - auto nscfg = env.app().config().section(ConfigSection::nodeDatabase()); - - // Provide default values: - if (!nscfg.exists("cache_size")) - nscfg.set( - "cache_size", std::to_string(env.app().config().getValueFor(SizedItem::treeCacheSize, std::nullopt))); - - if (!nscfg.exists("cache_age")) - nscfg.set( - "cache_age", std::to_string(env.app().config().getValueFor(SizedItem::treeCacheAge, std::nullopt))); - + // Create NodeStore with two backends to allow online deletion of data. + // Normally, SHAMapStoreImp handles all these details. NodeStoreScheduler scheduler(env.app().getJobQueue()); std::string const writableDb = "write"; @@ -510,9 +499,8 @@ public: auto writableBackend = makeBackendRotating(env, scheduler, writableDb); auto archiveBackend = makeBackendRotating(env, scheduler, archiveDb); - // Create NodeStore with two backends to allow online deletion of - // data constexpr int readThreads = 4; + auto nscfg = env.app().config().section(ConfigSection::nodeDatabase()); auto dbr = std::make_unique( scheduler, readThreads, diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 3045097e4a..2c0d3c2b82 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -908,10 +908,6 @@ public: JLOG(m_journal.debug()) << "MasterTransaction sweep. Size before: " << oldMasterTxSize << "; size after: " << masterTxCache.size(); } - { - // Does not appear to have an associated cache. - getNodeStore().sweep(); - } { std::size_t const oldLedgerMasterCacheSize = getLedgerMaster().getFetchPackCacheSize(); diff --git a/src/xrpld/app/misc/SHAMapStoreImp.cpp b/src/xrpld/app/misc/SHAMapStoreImp.cpp index 0ed3b8a3fc..dbdd682ef8 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.cpp +++ b/src/xrpld/app/misc/SHAMapStoreImp.cpp @@ -130,14 +130,6 @@ std::unique_ptr SHAMapStoreImp::makeNodeStore(int readThreads) { auto nscfg = app_.config().section(ConfigSection::nodeDatabase()); - - // Provide default values: - if (!nscfg.exists("cache_size")) - nscfg.set("cache_size", std::to_string(app_.config().getValueFor(SizedItem::treeCacheSize, std::nullopt))); - - if (!nscfg.exists("cache_age")) - nscfg.set("cache_age", std::to_string(app_.config().getValueFor(SizedItem::treeCacheAge, std::nullopt))); - std::unique_ptr db; if (deleteInterval_) @@ -226,8 +218,6 @@ SHAMapStoreImp::run() LedgerIndex lastRotated = state_db_.getState().lastRotated; netOPs_ = &app_.getOPs(); ledgerMaster_ = &app_.getLedgerMaster(); - fullBelowCache_ = &(*app_.getNodeFamily().getFullBelowCache()); - treeNodeCache_ = &(*app_.getNodeFamily().getTreeNodeCache()); if (advisoryDelete_) canDelete_ = state_db_.getCanDelete(); @@ -490,16 +480,19 @@ void SHAMapStoreImp::clearCaches(LedgerIndex validatedSeq) { ledgerMaster_->clearLedgerCachePrior(validatedSeq); - fullBelowCache_->clear(); + // Also clear the FullBelowCache so its generation counter is bumped. + // This prevents stale "full below" markers from persisting across + // backend rotation/online deletion and interfering with SHAMap sync. + app_.getNodeFamily().getFullBelowCache()->clear(); } void SHAMapStoreImp::freshenCaches() { - if (freshenCache(*treeNodeCache_)) - return; - if (freshenCache(app_.getMasterTransaction().getCache())) + if (freshenCache(*app_.getNodeFamily().getTreeNodeCache())) return; + + freshenCache(app_.getMasterTransaction().getCache()); } void diff --git a/src/xrpld/app/misc/SHAMapStoreImp.h b/src/xrpld/app/misc/SHAMapStoreImp.h index a0475e80d6..b046a78979 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.h +++ b/src/xrpld/app/misc/SHAMapStoreImp.h @@ -93,8 +93,6 @@ private: // as of run() or before NetworkOPs* netOPs_ = nullptr; LedgerMaster* ledgerMaster_ = nullptr; - FullBelowCache* fullBelowCache_ = nullptr; - TreeNodeCache* treeNodeCache_ = nullptr; static constexpr auto nodeStoreName_ = "NodeStore"; From 2305bc98a4c51550504060460d14aa43046379a1 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 6 Feb 2026 16:39:23 +0000 Subject: [PATCH 18/26] chore: Remove CODEOWNERS (#6337) --- .github/CODEOWNERS | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index bc4fe2febd..0000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# Allow anyone to review any change by default. -* - -# Require the rpc-reviewers team to review changes to the rpc code. -include/xrpl/protocol/ @xrplf/rpc-reviewers -src/libxrpl/protocol/ @xrplf/rpc-reviewers -src/xrpld/rpc/ @xrplf/rpc-reviewers -src/xrpld/app/misc/ @xrplf/rpc-reviewers From f5208fc85020eb96de6a2b625ccb7f53c744d07a Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 6 Feb 2026 13:37:01 -0500 Subject: [PATCH 19/26] test: Add file and line location to Env (#6276) This change uses `std::source_location` to output the file and line location of the call that triggered a failed transaction. --- src/test/app/LedgerReplay_test.cpp | 3 +- src/test/jtx/Env.h | 62 +++++++++++++++++++++++++----- src/test/jtx/Env_ss.h | 21 +++++++--- src/test/jtx/impl/Env.cpp | 33 ++++++++-------- src/test/rpc/Subscribe_test.cpp | 3 +- 5 files changed, 88 insertions(+), 34 deletions(-) diff --git a/src/test/app/LedgerReplay_test.cpp b/src/test/app/LedgerReplay_test.cpp index 8bf1a8f668..229cad21c9 100644 --- a/src/test/app/LedgerReplay_test.cpp +++ b/src/test/app/LedgerReplay_test.cpp @@ -491,8 +491,7 @@ struct LedgerServer for (int i = 0; i < newTxes; ++i) { updateIdx(); - env.apply( - pay(accounts[fromIdx], + env(pay(accounts[fromIdx], accounts[toIdx], jtx::drops(ledgerMaster.getClosedLedger()->fees().base) + jtx::XRP(param.txAmount)), jtx::seq(jtx::autofill), diff --git a/src/test/jtx/Env.h b/src/test/jtx/Env.h index ef6240d48a..7d7dcd2cb8 100644 --- a/src/test/jtx/Env.h +++ b/src/test/jtx/Env.h @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -42,6 +43,27 @@ namespace xrpl { namespace test { namespace jtx { +/** Wrapper that captures std::source_location when implicitly constructed. + This solves the problem of combining std::source_location with variadic + templates. The std::source_location default argument is evaluated at the + call site when the wrapper is constructed via implicit conversion. + + This is a template struct that holds the value directly, allowing implicit + conversion without template argument deduction issues via CTAD. +*/ +template +struct WithSourceLocation +{ + T value; + std::source_location loc; + + // Non-explicit constructor allows implicit conversion. + // The default argument for loc is evaluated at the call site. + WithSourceLocation(T v, std::source_location l = std::source_location::current()) : value(std::move(v)), loc(l) + { + } +}; + /** Designate accounts as no-ripple in Env::fund */ template std::array @@ -522,35 +544,57 @@ public: This calls postconditions. */ virtual void - submit(JTx const& jt); + submit(JTx const& jt, std::source_location const& loc = std::source_location::current()); /** Use the submit RPC command with a provided JTx object. This calls postconditions. */ void - sign_and_submit(JTx const& jt, Json::Value params = Json::nullValue); + sign_and_submit( + JTx const& jt, + Json::Value params = Json::nullValue, + std::source_location const& loc = std::source_location::current()); /** Check expected postconditions of JTx submission. */ void - postconditions(JTx const& jt, ParsedResult const& parsed, Json::Value const& jr = Json::Value()); + postconditions( + JTx const& jt, + ParsedResult const& parsed, + Json::Value const& jr = Json::Value(), + std::source_location const& loc = std::source_location::current()); /** Apply funclets and submit. */ /** @{ */ - template + template Env& - apply(JsonValue&& jv, FN const&... fN) + apply(WithSourceLocation jv, FN const&... fN) { - submit(jt(std::forward(jv), fN...)); + submit(jt(std::move(jv.value), fN...), jv.loc); return *this; } - template + template Env& - operator()(JsonValue&& jv, FN const&... fN) + apply(WithSourceLocation jv, FN const&... fN) { - return apply(std::forward(jv), fN...); + submit(jt(std::move(jv.value), fN...), jv.loc); + return *this; + } + + template + Env& + operator()(WithSourceLocation jv, FN const&... fN) + { + return apply(std::move(jv), fN...); + } + + template + Env& + operator()(WithSourceLocation jv, FN const&... fN) + { + return apply(std::move(jv), fN...); } /** @} */ diff --git a/src/test/jtx/Env_ss.h b/src/test/jtx/Env_ss.h index 78146a04a4..9c178a1c13 100644 --- a/src/test/jtx/Env_ss.h +++ b/src/test/jtx/Env_ss.h @@ -23,19 +23,20 @@ private: SignSubmitRunner& operator=(SignSubmitRunner&&) = delete; - SignSubmitRunner(Env& env, JTx&& jt) : env_(env), jt_(jt) + SignSubmitRunner(Env& env, JTx&& jt, std::source_location loc) : env_(env), jt_(jt), loc_(loc) { } void operator()(Json::Value const& params = Json::nullValue) { - env_.sign_and_submit(jt_, params); + env_.sign_and_submit(jt_, params, loc_); } private: Env& env_; JTx const jt_; + std::source_location const loc_; }; public: @@ -47,12 +48,20 @@ public: { } - template + template SignSubmitRunner - operator()(JsonValue&& jv, FN const&... fN) + operator()(WithSourceLocation jv, FN const&... fN) { - auto jtx = env_.jt(std::forward(jv), fN...); - return SignSubmitRunner(env_, std::move(jtx)); + auto jtx = env_.jt(std::move(jv.value), fN...); + return SignSubmitRunner(env_, std::move(jtx), jv.loc); + } + + template + SignSubmitRunner + operator()(WithSourceLocation jv, FN const&... fN) + { + auto jtx = env_.jt(std::move(jv.value), fN...); + return SignSubmitRunner(env_, std::move(jtx), jv.loc); } }; diff --git a/src/test/jtx/impl/Env.cpp b/src/test/jtx/impl/Env.cpp index 9971da05c4..d8bcec84ee 100644 --- a/src/test/jtx/impl/Env.cpp +++ b/src/test/jtx/impl/Env.cpp @@ -27,6 +27,7 @@ #include #include +#include namespace xrpl { namespace test { @@ -330,7 +331,7 @@ Env::parseResult(Json::Value const& jr) } void -Env::submit(JTx const& jt) +Env::submit(JTx const& jt, std::source_location const& loc) { ParsedResult parsedResult; auto const jr = [&]() { @@ -356,11 +357,11 @@ Env::submit(JTx const& jt) return Json::Value(); } }(); - return postconditions(jt, parsedResult, jr); + return postconditions(jt, parsedResult, jr, loc); } void -Env::sign_and_submit(JTx const& jt, Json::Value params) +Env::sign_and_submit(JTx const& jt, Json::Value params, std::source_location const& loc) { auto const account = lookup(jt.jv[jss::Account].asString()); auto const& passphrase = account.name(); @@ -393,25 +394,26 @@ Env::sign_and_submit(JTx const& jt, Json::Value params) test.expect(parsedResult.ter, "ter uninitialized!"); ter_ = parsedResult.ter.value_or(telENV_RPC_FAILED); - return postconditions(jt, parsedResult, jr); + return postconditions(jt, parsedResult, jr, loc); } void -Env::postconditions(JTx const& jt, ParsedResult const& parsed, Json::Value const& jr) +Env::postconditions(JTx const& jt, ParsedResult const& parsed, Json::Value const& jr, std::source_location const& loc) { auto const line = jt.testLine ? " (" + to_string(*jt.testLine) + ")" : ""; - bool bad = !test.expect(parsed.ter, "apply: No ter result!" + line); + auto const locStr = std::string("(") + loc.file_name() + ":" + to_string(loc.line()) + ")"; + bool bad = !test.expect(parsed.ter, "apply " + locStr + ": No ter result!" + line); bad = (jt.ter && parsed.ter && !test.expect( *parsed.ter == *jt.ter, - "apply: Got " + transToken(*parsed.ter) + " (" + transHuman(*parsed.ter) + "); Expected " + + "apply " + locStr + ": Got " + transToken(*parsed.ter) + " (" + transHuman(*parsed.ter) + "); Expected " + transToken(*jt.ter) + " (" + transHuman(*jt.ter) + ")" + line)); using namespace std::string_literals; bad = (jt.rpcCode && !test.expect( parsed.rpcCode == jt.rpcCode->first && parsed.rpcMessage == jt.rpcCode->second, - "apply: Got RPC result "s + + "apply " + locStr + ": Got RPC result "s + (parsed.rpcCode ? RPC::get_error_info(*parsed.rpcCode).token.c_str() : "NO RESULT") + " (" + parsed.rpcMessage + "); Expected " + RPC::get_error_info(jt.rpcCode->first).token.c_str() + " (" + jt.rpcCode->second + ")" + line)) || @@ -419,13 +421,14 @@ Env::postconditions(JTx const& jt, ParsedResult const& parsed, Json::Value const // If we have an rpcCode (just checked), then the rpcException check is // optional - the 'error' field may not be defined, but if it is, it must // match rpcError. - bad = (jt.rpcException && - !test.expect( - (jt.rpcCode && parsed.rpcError.empty()) || - (parsed.rpcError == jt.rpcException->first && - (!jt.rpcException->second || parsed.rpcException == *jt.rpcException->second)), - "apply: Got RPC result "s + parsed.rpcError + " (" + parsed.rpcException + "); Expected " + - jt.rpcException->first + " (" + jt.rpcException->second.value_or("n/a") + ")" + line)) || + bad = + (jt.rpcException && + !test.expect( + (jt.rpcCode && parsed.rpcError.empty()) || + (parsed.rpcError == jt.rpcException->first && + (!jt.rpcException->second || parsed.rpcException == *jt.rpcException->second)), + "apply " + locStr + ": Got RPC result "s + parsed.rpcError + " (" + parsed.rpcException + "); Expected " + + jt.rpcException->first + " (" + jt.rpcException->second.value_or("n/a") + ")" + line)) || bad; if (bad) { diff --git a/src/test/rpc/Subscribe_test.cpp b/src/test/rpc/Subscribe_test.cpp index 4f83f81da5..cce45fb4ef 100644 --- a/src/test/rpc/Subscribe_test.cpp +++ b/src/test/rpc/Subscribe_test.cpp @@ -835,8 +835,7 @@ public: { auto& from = (i % 2 == 0) ? a : b; auto& to = (i % 2 == 0) ? b : a; - env.apply( - pay(from, to, jtx::XRP(numXRP)), + env(pay(from, to, jtx::XRP(numXRP)), jtx::seq(jtx::autofill), jtx::fee(jtx::autofill), jtx::sig(jtx::autofill)); From bf4674f42b0515f0fe81d4b523c98d68fd7269b3 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 6 Feb 2026 15:30:22 -0500 Subject: [PATCH 20/26] refactor: Fix spelling issues in tests (#6199) This change removes the `src/tests` exception from the `cspell` config and fixes all the issues that arise as a result. No functionality/test change. --- .../cspell.config.yaml => cspell.config.yaml | 35 +++++--- include/xrpl/proto/xrpl.proto | 6 +- src/test/app/AMMCalc_test.cpp | 30 +++---- src/test/app/AMMExtended_test.cpp | 8 +- src/test/app/AMM_test.cpp | 32 +++---- src/test/app/Batch_test.cpp | 2 +- src/test/app/CrossingLimits_test.cpp | 22 ++--- src/test/app/DepositAuth_test.cpp | 6 +- src/test/app/EscrowToken_test.cpp | 12 +-- src/test/app/FixNFTokenPageLinks_test.cpp | 2 +- src/test/app/LPTokenTransfer_test.cpp | 2 +- src/test/app/LoanBroker_test.cpp | 2 +- src/test/app/Loan_test.cpp | 1 + src/test/app/MPToken_test.cpp | 2 +- src/test/app/NFToken_test.cpp | 18 ++-- src/test/app/Offer_test.cpp | 86 +++++++++---------- src/test/app/PayStrand_test.cpp | 6 +- src/test/app/ReducedOffer_test.cpp | 36 ++++---- src/test/app/SHAMapStore_test.cpp | 6 +- src/test/app/TrustAndBalance_test.cpp | 10 +-- src/test/app/Vault_test.cpp | 2 +- src/test/app/XChain_test.cpp | 5 +- src/test/core/Config_test.cpp | 36 ++++---- src/test/jtx/TestHelpers.h | 2 +- src/test/jtx/impl/AMM.cpp | 42 ++++----- src/test/jtx/impl/TestHelpers.cpp | 2 +- src/test/jtx/impl/mpt.cpp | 28 +++--- src/test/jtx/mpt.h | 8 +- src/test/ledger/Directory_test.cpp | 2 +- src/test/ledger/View_test.cpp | 10 +-- src/test/overlay/compression_test.cpp | 10 +-- src/test/protocol/STAmount_test.cpp | 4 +- src/test/rpc/AccountLines_test.cpp | 2 +- src/test/rpc/AccountObjects_test.cpp | 4 +- src/test/rpc/Handler_test.cpp | 1 + src/test/rpc/LedgerEntry_test.cpp | 4 +- src/test/rpc/NoRipple_test.cpp | 4 +- src/test/rpc/Transaction_test.cpp | 4 +- 38 files changed, 256 insertions(+), 238 deletions(-) rename .config/cspell.config.yaml => cspell.config.yaml (79%) diff --git a/.config/cspell.config.yaml b/cspell.config.yaml similarity index 79% rename from .config/cspell.config.yaml rename to cspell.config.yaml index a9c621f567..b2f4a33769 100644 --- a/.config/cspell.config.yaml +++ b/cspell.config.yaml @@ -1,14 +1,13 @@ ignorePaths: - build/** - src/libxrpl/crypto - - src/test/** # Will be removed in the future - CMakeUserPresets.json - Doxyfile - docs/**/*.puml - cmake/** - LICENSE.md language: en -allowCompoundWords: true +allowCompoundWords: true # TODO (#6334) ignoreRandomStrings: true minWordLength: 5 dictionaries: @@ -16,20 +15,29 @@ dictionaries: - en_US - en_GB ignoreRegExpList: - - /[rs][1-9A-HJ-NP-Za-km-z]{25,34}/g # addresses and seeds - - /(XRPL|BEAST)_[A-Z_0-9]+_H_INCLUDED+/g # include guards - - /(XRPL|BEAST)_[A-Z_0-9]+_H+/g # include guards + - /\b[rs][1-9A-HJ-NP-Za-km-z]{25,34}/g # addresses and seeds + - /\bC[A-Z0-9]{15}/g # CTIDs + - /\b(XRPL|BEAST)_[A-Z_0-9]+_H_INCLUDED+/g # include guards + - /\b(XRPL|BEAST)_[A-Z_0-9]+_H+/g # include guards - /::[a-z:_]+/g # things from other namespaces - - /lib[a-z]+/g # libraries - - /[0-9]{4}-[0-9]{2}-[0-9]{2}[,:][A-Za-zÀ-ÖØ-öø-ÿ.\s]+/g # copyright dates - - /[0-9]{4}[,:]?\s*[A-Za-zÀ-ÖØ-öø-ÿ.\s]+/g # copyright years + - /\blib[a-z]+/g # libraries + - /\b[0-9]{4}-[0-9]{2}-[0-9]{2}[,:][A-Za-zÀ-ÖØ-öø-ÿ.\s]+/g # copyright dates + - /\b[0-9]{4}[,:]?\s*[A-Za-zÀ-ÖØ-öø-ÿ.\s]+/g # copyright years - /\[[A-Za-z0-9-]+\]\(https:\/\/github.com\/[A-Za-z0-9-]+\)/g # Github usernames - /-[DWw][a-zA-Z0-9_-]+=/g # compile flags - /[\['"`]-[DWw][a-zA-Z0-9_-]+['"`\]]/g # compile flags + - ABCDEFGHIJKLMNOPQRSTUVWXYZ + - ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +overrides: + - filename: "**/*_test.cpp" # all test files + ignoreRegExpList: + - /"[^"]*"/g # double-quoted strings + - /'[^']*'/g # single-quoted strings + - /`[^`]*`/g # backtick strings suggestWords: - xprl->xrpl - - xprld->xrpld - - unsynched->unsynced + - xprld->xrpld # cspell: disable-line not sure what this problem is.... + - unsynched->unsynced # cspell: disable-line not sure what this problem is.... - synched->synced - synch->sync words: @@ -51,6 +59,7 @@ words: - Britto - Btrfs - canonicality + - changespq - checkme - choco - chrono @@ -106,12 +115,14 @@ words: - inequation - insuf - insuff + - invasively - iou - ious - isrdc - itype - jemalloc - jlog + - jtnofill - keylet - keylets - keyvadb @@ -138,6 +149,7 @@ words: - Metafuncton - misprediction - mptbalance + - MPTDEX - mptflags - mptid - mptissuance @@ -147,6 +159,7 @@ words: - mptokenissuance - mptokens - mpts + - mtgox - multisig - multisign - multisigned @@ -174,6 +187,7 @@ words: - perminute - permissioned - pointee + - populator - preauth - preauthorization - preauthorize @@ -182,6 +196,7 @@ words: - protobuf - protos - ptrs + - pushd - pyenv - qalloc - queuable diff --git a/include/xrpl/proto/xrpl.proto b/include/xrpl/proto/xrpl.proto index 613ef70a1f..0af7deb35d 100644 --- a/include/xrpl/proto/xrpl.proto +++ b/include/xrpl/proto/xrpl.proto @@ -86,9 +86,9 @@ message TMPublicKey { // you must first combine coins from one address to another. enum TransactionStatus { - tsNEW = 1; // origin node did/could not validate - tsCURRENT = 2; // scheduled to go in this ledger - tsCOMMITED = 3; // in a closed ledger + tsNEW = 1; // origin node did/could not validate + tsCURRENT = 2; // scheduled to go in this ledger + tsCOMMITTED = 3; // in a closed ledger tsREJECT_CONFLICT = 4; tsREJECT_INVALID = 5; tsREJECT_FUNDS = 6; diff --git a/src/test/app/AMMCalc_test.cpp b/src/test/app/AMMCalc_test.cpp index 7d735c2575..bc50f02d3d 100644 --- a/src/test/app/AMMCalc_test.cpp +++ b/src/test/app/AMMCalc_test.cpp @@ -23,8 +23,8 @@ class AMMCalc_test : public beast::unit_test::suite { using token_iter = boost::sregex_token_iterator; using steps = std::vector>; - using trates = std::map; - using swapargs = std::tuple; + using transfer_rates = std::map; + using swapargs = std::tuple; jtx::Account const gw{jtx::Account("gw")}; token_iter const end_; @@ -101,10 +101,10 @@ class AMMCalc_test : public beast::unit_test::suite return {{{*a1, *a2}, amm}}; } - std::optional + std::optional getTransferRate(token_iter& p) { - trates rates{}; + transfer_rates rates{}; if (p == end_) return rates; std::string str = *p; @@ -115,8 +115,8 @@ class AMMCalc_test : public beast::unit_test::suite { if (auto const rate = getRate(p++)) { - auto const [currency, trate, delimited] = *rate; - rates[currency] = trate; + auto const [currency, transferRate, delimited] = *rate; + rates[currency] = transferRate; if (delimited) break; } @@ -180,13 +180,13 @@ class AMMCalc_test : public beast::unit_test::suite auto const vp = std::get(args); STAmount sout = std::get(args); auto const fee = std::get(args); - auto const rates = std::get(args); + auto const rates = std::get(args); STAmount resultOut = sout; STAmount resultIn{}; STAmount sin{}; int limitingStep = vp.size(); STAmount limitStepOut{}; - auto trate = [&](auto const& amt) { + auto transferRate = [&](auto const& amt) { auto const currency = to_string(amt.issue().currency); return rates.find(currency) != rates.end() ? rates.at(currency) : QUALITY_ONE; }; @@ -194,7 +194,7 @@ class AMMCalc_test : public beast::unit_test::suite sin = sout; for (auto it = vp.rbegin(); it != vp.rend(); ++it) { - sout = mulratio(sin, trate(sin), QUALITY_ONE, true); + sout = mulratio(sin, transferRate(sin), QUALITY_ONE, true); auto const [amts, amm] = *it; // assume no amm limit if (amm) @@ -221,7 +221,7 @@ class AMMCalc_test : public beast::unit_test::suite for (int i = limitingStep + 1; i < vp.size(); ++i) { auto const [amts, amm] = vp[i]; - sin = mulratio(sin, QUALITY_ONE, trate(sin), false); + sin = mulratio(sin, QUALITY_ONE, transferRate(sin), false); if (amm) { sout = swapAssetIn(amts, sin, fee); @@ -243,13 +243,13 @@ class AMMCalc_test : public beast::unit_test::suite auto const vp = std::get(args); STAmount sin = std::get(args); auto const fee = std::get(args); - auto const rates = std::get(args); + auto const rates = std::get(args); STAmount resultIn = sin; STAmount resultOut{}; STAmount sout{}; int limitingStep = 0; STAmount limitStepIn{}; - auto trate = [&](auto const& amt) { + auto transferRate = [&](auto const& amt) { auto const currency = to_string(amt.issue().currency); return rates.find(currency) != rates.end() ? rates.at(currency) : QUALITY_ONE; }; @@ -257,7 +257,7 @@ class AMMCalc_test : public beast::unit_test::suite for (auto it = vp.begin(); it != vp.end(); ++it) { auto const [amts, amm] = *it; - sin = mulratio(sin, QUALITY_ONE, trate(sin), + sin = mulratio(sin, QUALITY_ONE, transferRate(sin), false); // out of the next step // assume no amm limit if (amm) @@ -283,7 +283,7 @@ class AMMCalc_test : public beast::unit_test::suite // swap out if limiting step for (int i = limitingStep - 1; i >= 0; --i) { - sout = mulratio(sin, trate(sin), QUALITY_ONE, false); + sout = mulratio(sin, transferRate(sin), QUALITY_ONE, false); auto const [amts, amm] = vp[i]; if (amm) { @@ -296,7 +296,7 @@ class AMMCalc_test : public beast::unit_test::suite } resultIn = sin; } - resultOut = mulratio(resultOut, QUALITY_ONE, trate(resultOut), true); + resultOut = mulratio(resultOut, QUALITY_ONE, transferRate(resultOut), true); std::cout << "in: " << toString(resultIn) << " out: " << toString(resultOut) << std::endl; } diff --git a/src/test/app/AMMExtended_test.cpp b/src/test/app/AMMExtended_test.cpp index 3cc48787d5..4eecb05905 100644 --- a/src/test/app/AMMExtended_test.cpp +++ b/src/test/app/AMMExtended_test.cpp @@ -1701,8 +1701,8 @@ private: // This removes no ripple for carol, // different from the original test fund(env, gw, {carol}, XRP(10'000), {}, Fund::Acct); - auto const AMMXRPPool = env.current()->fees().increment * 2; - env.fund(reserve(env, 5) + ammCrtFee(env) + AMMXRPPool, bob); + auto const ammXrpPool = env.current()->fees().increment * 2; + env.fund(reserve(env, 5) + ammCrtFee(env) + ammXrpPool, bob); env.close(); env.trust(USD(1'000), alice, bob, carol); env.trust(EUR(1'000), alice, bob, carol); @@ -1718,7 +1718,7 @@ private: // tecPATH_DRY, but the entire path should not be marked as dry. // This is the second error case to test (when flowV1 is used). env(offer(bob, EUR(50), XRP(50))); - AMM ammBob(env, bob, AMMXRPPool, USD(150)); + AMM ammBob(env, bob, ammXrpPool, USD(150)); env(pay(alice, carol, USD(1'000'000)), path(~XRP, ~USD), @@ -3248,7 +3248,7 @@ private: Path const p = [&] { Path result; - result.push_back(allpe(gw, BobUSD)); + result.push_back(allPathElements(gw, BobUSD)); result.push_back(cpe(EUR.currency)); return result; }(); diff --git a/src/test/app/AMM_test.cpp b/src/test/app/AMM_test.cpp index 14b97f30f1..8a60e5f667 100644 --- a/src/test/app/AMM_test.cpp +++ b/src/test/app/AMM_test.cpp @@ -975,7 +975,7 @@ private: .tokens = IOUAmount{1, -10}, .asset1In = STAmount{USD, 1, -15}, .err = ter(tecAMM_INVALID_TOKENS)}); }); - // Single deposit with eprice, tokens rounded to 0 + // Single deposit with EPrice, tokens rounded to 0 testAMM([&](AMM& amm, Env& env) { amm.deposit(DepositArg{ .asset1In = STAmount{USD, 1, -15}, .maxEP = STAmount{USD, 1, -1}, .err = ter(tecAMM_INVALID_TOKENS)}); @@ -4204,8 +4204,8 @@ private: Account const chris("chris"); Account const simon("simon"); Account const ben("ben"); - Account const nataly("nataly"); - fund(env, gw, {bob, ed, paul, dan, chris, simon, ben, nataly}, {USD(1'500'000)}, Fund::Acct); + Account const natalie("natalie"); + fund(env, gw, {bob, ed, paul, dan, chris, simon, ben, natalie}, {USD(1'500'000)}, Fund::Acct); for (int i = 0; i < 10; ++i) { ammAlice.deposit(ben, STAmount{USD, 1, -10}); @@ -4224,8 +4224,8 @@ private: ammAlice.withdrawAll(ed, USD(0)); ammAlice.deposit(paul, USD(100'000)); ammAlice.withdrawAll(paul, USD(0)); - ammAlice.deposit(nataly, USD(1'000'000)); - ammAlice.withdrawAll(nataly, USD(0)); + ammAlice.deposit(natalie, USD(1'000'000)); + ammAlice.withdrawAll(natalie, USD(0)); } // Due to round off some accounts have a tiny gain, while // other have a tiny loss. The last account to withdraw @@ -4251,11 +4251,11 @@ private: BEAST_EXPECT(expectHolding(env, ed, USD(1'500'000))); BEAST_EXPECT(expectHolding(env, paul, USD(1'500'000))); if (!features[fixAMMv1_1] && !features[fixAMMv1_3]) - BEAST_EXPECT(expectHolding(env, nataly, STAmount{USD, UINT64_C(1'500'000'000000002), -9})); + BEAST_EXPECT(expectHolding(env, natalie, STAmount{USD, UINT64_C(1'500'000'000000002), -9})); else if (features[fixAMMv1_1] && !features[fixAMMv1_3]) - BEAST_EXPECT(expectHolding(env, nataly, STAmount{USD, UINT64_C(1'500'000'000000005), -9})); + BEAST_EXPECT(expectHolding(env, natalie, STAmount{USD, UINT64_C(1'500'000'000000005), -9})); else - BEAST_EXPECT(expectHolding(env, nataly, USD(1'500'000))); + BEAST_EXPECT(expectHolding(env, natalie, USD(1'500'000))); ammAlice.withdrawAll(alice); BEAST_EXPECT(!ammAlice.ammExists()); if (!features[fixAMMv1_1]) @@ -4264,7 +4264,7 @@ private: BEAST_EXPECT(expectHolding(env, alice, STAmount{USD, UINT64_C(30'000'0000000003), -10})); else BEAST_EXPECT(expectHolding(env, alice, USD(30'000))); - // alice XRP balance is 30,000initial - 50 ammcreate fee - + // alice XRP balance is 30,000 initial - 50 AMMCreate fee - // 10drops fee BEAST_EXPECT( accountBalance(env, alice) == std::to_string(29950000000 - env.current()->fees().base.drops())); @@ -4284,8 +4284,8 @@ private: Account const chris("chris"); Account const simon("simon"); Account const ben("ben"); - Account const nataly("nataly"); - fund(env, gw, {bob, ed, paul, dan, chris, simon, ben, nataly}, XRP(2'000'000), {}, Fund::Acct); + Account const natalie("natalie"); + fund(env, gw, {bob, ed, paul, dan, chris, simon, ben, natalie}, XRP(2'000'000), {}, Fund::Acct); for (int i = 0; i < 10; ++i) { ammAlice.deposit(ben, XRPAmount{1}); @@ -4304,8 +4304,8 @@ private: ammAlice.withdrawAll(ed, XRP(0)); ammAlice.deposit(paul, XRP(100'000)); ammAlice.withdrawAll(paul, XRP(0)); - ammAlice.deposit(nataly, XRP(1'000'000)); - ammAlice.withdrawAll(nataly, XRP(0)); + ammAlice.deposit(natalie, XRP(1'000'000)); + ammAlice.withdrawAll(natalie, XRP(0)); } auto const baseFee = env.current()->fees().base.drops(); if (!features[fixAMMv1_3]) @@ -4325,8 +4325,8 @@ private: BEAST_EXPECT(accountBalance(env, carol) == std::to_string(30'000'000'000 - 20 * baseFee)); BEAST_EXPECT(accountBalance(env, ed) == xrpBalance); BEAST_EXPECT(accountBalance(env, paul) == xrpBalance); - BEAST_EXPECT(accountBalance(env, nataly) == xrpBalance); - // 30,000 initial - 50 ammcreate fee - 10drops withdraw fee + BEAST_EXPECT(accountBalance(env, natalie) == xrpBalance); + // 30,000 initial - 50 AMMCreate fee - 10drops withdraw fee BEAST_EXPECT(accountBalance(env, alice) == std::to_string(29'950'000'000 - baseFee)); } else @@ -4346,7 +4346,7 @@ private: BEAST_EXPECT(accountBalance(env, carol) == std::to_string(30'000'000'000 - 20 * baseFee - 10)); BEAST_EXPECT(accountBalance(env, ed) == (xrpBalance + drops(2)).getText()); BEAST_EXPECT(accountBalance(env, paul) == (xrpBalance + drops(3)).getText()); - BEAST_EXPECT(accountBalance(env, nataly) == (xrpBalance + drops(5)).getText()); + BEAST_EXPECT(accountBalance(env, natalie) == (xrpBalance + drops(5)).getText()); BEAST_EXPECT(accountBalance(env, alice) == std::to_string(29'950'000'000 - baseFee + 80)); } }, diff --git a/src/test/app/Batch_test.cpp b/src/test/app/Batch_test.cpp index 035a1f8a6f..72f3677e3b 100644 --- a/src/test/app/Batch_test.cpp +++ b/src/test/app/Batch_test.cpp @@ -3618,7 +3618,7 @@ class Batch_test : public beast::unit_test::suite // another transaction is part of the batch, the batch might fail // because the sequence is out of order. This is because the canonical // order of transactions is determined by the account first. So in this - // case, alice's batch comes after bobs self submitted transaction even + // case, alice's batch comes after bob's self submitted transaction even // though the payment was submitted after the batch. using namespace test::jtx; diff --git a/src/test/app/CrossingLimits_test.cpp b/src/test/app/CrossingLimits_test.cpp index e1974adee1..0451822492 100644 --- a/src/test/app/CrossingLimits_test.cpp +++ b/src/test/app/CrossingLimits_test.cpp @@ -64,15 +64,15 @@ public: int const maxConsumed = 1000; env.fund(XRP(100000000), gw, "alice", "bob", "carol"); - int const bobsOfferCount = maxConsumed + 150; - env.trust(USD(bobsOfferCount), "bob"); - env(pay(gw, "bob", USD(bobsOfferCount))); + int const bobOfferCount = maxConsumed + 150; + env.trust(USD(bobOfferCount), "bob"); + env(pay(gw, "bob", USD(bobOfferCount))); env.close(); - n_offers(env, bobsOfferCount, "bob", XRP(1), USD(1)); + n_offers(env, bobOfferCount, "bob", XRP(1), USD(1)); // Alice offers to buy Bob's offers. However she hits the offer // crossing limit, so she can't buy them all at once. - env(offer("alice", USD(bobsOfferCount), XRP(bobsOfferCount))); + env(offer("alice", USD(bobOfferCount), XRP(bobOfferCount))); env.close(); env.require(balance("alice", USD(maxConsumed))); env.require(balance("bob", USD(150))); @@ -103,19 +103,19 @@ public: // The payment engine allows 1000 offers to cross. int const maxConsumed = 1000; - int const evitasOfferCount{maxConsumed + 49}; + int const evitaOfferCount{maxConsumed + 49}; env.trust(USD(1000), "alice"); env(pay(gw, "alice", USD(1000))); env.trust(USD(1000), "carol"); env(pay(gw, "carol", USD(1))); - env.trust(USD(evitasOfferCount + 1), "evita"); - env(pay(gw, "evita", USD(evitasOfferCount + 1))); + env.trust(USD(evitaOfferCount + 1), "evita"); + env(pay(gw, "evita", USD(evitaOfferCount + 1))); // The payment engine has a limit of 1000 funded or unfunded offers. int const carolsOfferCount{700}; n_offers(env, 400, "alice", XRP(1), USD(1)); n_offers(env, carolsOfferCount, "carol", XRP(1), USD(1)); - n_offers(env, evitasOfferCount, "evita", XRP(1), USD(1)); + n_offers(env, evitaOfferCount, "evita", XRP(1), USD(1)); // Bob offers to buy 1000 XRP for 1000 USD. He takes all 400 USD from // Alice's offers, 1 USD from Carol's and then removes 599 of Carol's @@ -126,8 +126,8 @@ public: env.require(owners("alice", 1)); env.require(balance("carol", USD(0))); env.require(owners("carol", carolsOfferCount - 599)); - env.require(balance("evita", USD(evitasOfferCount + 1))); - env.require(owners("evita", evitasOfferCount + 1)); + env.require(balance("evita", USD(evitaOfferCount + 1))); + env.require(owners("evita", evitaOfferCount + 1)); // Dan offers to buy maxConsumed + 50 XRP USD. He removes all of // Carol's remaining offers as unfunded, then takes diff --git a/src/test/app/DepositAuth_test.cpp b/src/test/app/DepositAuth_test.cpp index 535abc6af8..0cd7e7449c 100644 --- a/src/test/app/DepositAuth_test.cpp +++ b/src/test/app/DepositAuth_test.cpp @@ -1237,17 +1237,17 @@ struct DepositPreauth_test : public beast::unit_test::suite auto const dp = ledgerEntryDepositPreauth(env, stock, credentials); auto const& authCred(dp[jss::result][jss::node]["AuthorizeCredentials"]); BEAST_EXPECT(authCred.isArray() && authCred.size() == credentials.size()); - std::vector> readedCreds; + std::vector> readCreds; for (auto const& o : authCred) { auto const& c(o[jss::Credential]); auto issuer = c[jss::Issuer].asString(); if (BEAST_EXPECT(pubKey2Acc.contains(issuer))) - readedCreds.emplace_back(pubKey2Acc.at(issuer), c["CredentialType"].asString()); + readCreds.emplace_back(pubKey2Acc.at(issuer), c["CredentialType"].asString()); } - BEAST_EXPECT(std::ranges::is_sorted(readedCreds)); + BEAST_EXPECT(std::ranges::is_sorted(readCreds)); env(deposit::unauthCredentials(stock, credentials)); env.close(); diff --git a/src/test/app/EscrowToken_test.cpp b/src/test/app/EscrowToken_test.cpp index b5088f247a..1f3b3bab70 100644 --- a/src/test/app/EscrowToken_test.cpp +++ b/src/test/app/EscrowToken_test.cpp @@ -752,7 +752,7 @@ struct EscrowToken_test : public beast::unit_test::suite env.trust(USD(1), bob); env.close(); - // alice cannot finish because bobs limit is too low + // alice cannot finish because bob's limit is too low env(escrow::finish(alice, alice, seq1), escrow::condition(escrow::cb1), escrow::fulfillment(escrow::fb1), @@ -789,7 +789,7 @@ struct EscrowToken_test : public beast::unit_test::suite env.trust(USD(1), bob); env.close(); - // bob can finish even if bobs limit is too low + // bob can finish even if bob's limit is too low auto const bobPreLimit = env.limit(bob, USD); env(escrow::finish(bob, alice, seq1), @@ -799,7 +799,7 @@ struct EscrowToken_test : public beast::unit_test::suite ter(tesSUCCESS)); env.close(); - // bobs limit is not changed + // bob's limit is not changed BEAST_EXPECT(env.limit(bob, USD) == bobPreLimit); } } @@ -1606,7 +1606,7 @@ struct EscrowToken_test : public beast::unit_test::suite fee(baseFee * 150)); env.close(); auto const postBobLimit = env.limit(bob, USD); - // bobs limit is NOT changed + // bob's limit is NOT changed BEAST_EXPECT(postBobLimit == preBobLimit); } } @@ -1912,7 +1912,7 @@ struct EscrowToken_test : public beast::unit_test::suite } } void - testIOUINSF(FeatureBitset features) + testIOUInsufficientFunds(FeatureBitset features) { testcase("IOU Insufficient Funds"); using namespace test::jtx; @@ -3671,7 +3671,7 @@ struct EscrowToken_test : public beast::unit_test::suite testIOULimitAmount(features); testIOURequireAuth(features); testIOUFreeze(features); - testIOUINSF(features); + testIOUInsufficientFunds(features); testIOUPrecisionLoss(features); } diff --git a/src/test/app/FixNFTokenPageLinks_test.cpp b/src/test/app/FixNFTokenPageLinks_test.cpp index 8a3b51bbf1..88f368e9cf 100644 --- a/src/test/app/FixNFTokenPageLinks_test.cpp +++ b/src/test/app/FixNFTokenPageLinks_test.cpp @@ -442,7 +442,7 @@ class FixNFTokenPageLinks_test : public beast::unit_test::suite env(ledgerStateFix::nftPageLinks(daria, alice), fee(linkFixFee)); env.close(); - // alices's last page should now be present and include no links. + // alice's last page should now be present and include no links. { auto aliceLastNFTokenPage = env.le(keylet::nftpage_max(alice)); if (!BEAST_EXPECT(aliceLastNFTokenPage)) diff --git a/src/test/app/LPTokenTransfer_test.cpp b/src/test/app/LPTokenTransfer_test.cpp index f9cfc4d5ce..055b72ebe6 100644 --- a/src/test/app/LPTokenTransfer_test.cpp +++ b/src/test/app/LPTokenTransfer_test.cpp @@ -355,7 +355,7 @@ class LPTokenTransfer_test : public jtx::AMMTest env(token::acceptSellOffer(carol, sellOfferIndex)); env.close(); - // gateway freezes bobs's USD + // gateway freezes bob's USD env(trust(gw, bob["USD"](0), tfSetFreeze)); env.close(); diff --git a/src/test/app/LoanBroker_test.cpp b/src/test/app/LoanBroker_test.cpp index 139350a881..58052e3fb1 100644 --- a/src/test/app/LoanBroker_test.cpp +++ b/src/test/app/LoanBroker_test.cpp @@ -905,7 +905,7 @@ class LoanBroker_test : public beast::unit_test::suite if (asset.holds()) { - // preclaim: AllowTrustLineClaback is not set + // preclaim: AllowTrustLineClawback is not set env(coverClawback(issuer), loanBrokerID(brokerKeylet.key), amount(vaultInfo.asset(2)), diff --git a/src/test/app/Loan_test.cpp b/src/test/app/Loan_test.cpp index f02ceddb69..5deb1f179c 100644 --- a/src/test/app/Loan_test.cpp +++ b/src/test/app/Loan_test.cpp @@ -10,6 +10,7 @@ #include #include +// cspell: words LOANTODO #include diff --git a/src/test/app/MPToken_test.cpp b/src/test/app/MPToken_test.cpp index f8d736c257..965dd86475 100644 --- a/src/test/app/MPToken_test.cpp +++ b/src/test/app/MPToken_test.cpp @@ -670,7 +670,7 @@ class MPToken_test : public beast::unit_test::suite mptAlice.set({.account = alice, .holder = bob, .flags = tfMPTLock}); if (!features[featureSingleAssetVault]) { - // Delete bobs' mptoken even though it is locked + // Delete bob's mptoken even though it is locked mptAlice.authorize({.account = bob, .flags = tfMPTUnauthorize}); mptAlice.set({.account = alice, .holder = bob, .flags = tfMPTUnlock, .err = tecOBJECT_NOT_FOUND}); diff --git a/src/test/app/NFToken_test.cpp b/src/test/app/NFToken_test.cpp index 2ab2e2a94c..1b9ce82d4a 100644 --- a/src/test/app/NFToken_test.cpp +++ b/src/test/app/NFToken_test.cpp @@ -1383,28 +1383,28 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite // Set flagOnlyXRP and offers using IOUs are rejected. { - uint256 const nftOnlyXRPID{token::getNextID(env, alice, 0u, tfOnlyXRP | tfTransferable)}; + uint256 const nftOnlyXrpID{token::getNextID(env, alice, 0u, tfOnlyXRP | tfTransferable)}; env(token::mint(alice, 0u), txflags(tfOnlyXRP | tfTransferable)); env.close(); BEAST_EXPECT(ownerCount(env, alice) == 2); - env(token::createOffer(alice, nftOnlyXRPID, gwAUD(50)), txflags(tfSellNFToken), ter(temBAD_AMOUNT)); + env(token::createOffer(alice, nftOnlyXrpID, gwAUD(50)), txflags(tfSellNFToken), ter(temBAD_AMOUNT)); env.close(); BEAST_EXPECT(ownerCount(env, alice) == 2); BEAST_EXPECT(ownerCount(env, buyer) == 1); - env(token::createOffer(buyer, nftOnlyXRPID, gwAUD(50)), token::owner(alice), ter(temBAD_AMOUNT)); + env(token::createOffer(buyer, nftOnlyXrpID, gwAUD(50)), token::owner(alice), ter(temBAD_AMOUNT)); env.close(); BEAST_EXPECT(ownerCount(env, buyer) == 1); // However offers for XRP are okay. BEAST_EXPECT(ownerCount(env, alice) == 2); - env(token::createOffer(alice, nftOnlyXRPID, XRP(60)), txflags(tfSellNFToken)); + env(token::createOffer(alice, nftOnlyXrpID, XRP(60)), txflags(tfSellNFToken)); env.close(); BEAST_EXPECT(ownerCount(env, alice) == 3); BEAST_EXPECT(ownerCount(env, buyer) == 1); - env(token::createOffer(buyer, nftOnlyXRPID, XRP(60)), token::owner(alice)); + env(token::createOffer(buyer, nftOnlyXrpID, XRP(60)), token::owner(alice)); env.close(); BEAST_EXPECT(ownerCount(env, buyer) == 2); } @@ -5155,8 +5155,8 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite // bob now has a buy offer and a sell offer on the books. A broker // spots this and swoops in to make a profit. BEAST_EXPECT(nftCount(env, bob) == 1); - auto const bobsPriorBalance = env.balance(bob); - auto const brokersPriorBalance = env.balance(broker); + auto const bobPriorBalance = env.balance(bob); + auto const brokerPriorBalance = env.balance(broker); env(token::brokerOffers(broker, bobBuyOfferIndex, bobSellOfferIndex), token::brokerFee(XRP(1)), ter(tecCANT_ACCEPT_OWN_NFTOKEN_OFFER)); @@ -5165,8 +5165,8 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite // A tec result was returned, so no state should change other // than the broker burning their transaction fee. BEAST_EXPECT(nftCount(env, bob) == 1); - BEAST_EXPECT(env.balance(bob) == bobsPriorBalance); - BEAST_EXPECT(env.balance(broker) == brokersPriorBalance - baseFee); + BEAST_EXPECT(env.balance(bob) == bobPriorBalance); + BEAST_EXPECT(env.balance(broker) == brokerPriorBalance - baseFee); } void diff --git a/src/test/app/Offer_test.cpp b/src/test/app/Offer_test.cpp index 09d7e41141..4847b7edb0 100644 --- a/src/test/app/Offer_test.cpp +++ b/src/test/app/Offer_test.cpp @@ -1878,14 +1878,14 @@ public: BEAST_EXPECT(jrr[jss::node][sfBalance.fieldName][jss::value] == "49.96666666666667"); jrr = ledgerEntryState(env, bob, gw, "USD"); - Json::Value const bobsUSD = jrr[jss::node][sfBalance.fieldName][jss::value]; + Json::Value const bobUSD = jrr[jss::node][sfBalance.fieldName][jss::value]; if (!NumberSwitchOver) { - BEAST_EXPECT(bobsUSD == "-0.966500000033334"); + BEAST_EXPECT(bobUSD == "-0.966500000033334"); } else { - BEAST_EXPECT(bobsUSD == "-0.9665000000333333"); + BEAST_EXPECT(bobUSD == "-0.9665000000333333"); } } } @@ -2265,8 +2265,8 @@ public: // The scenario: // o alice has USD but wants XRP. // o bob has XRP but wants USD. - auto const alicesXRP = env.balance(alice); - auto const bobsXRP = env.balance(bob); + auto const aliceXRP = env.balance(alice); + auto const bobXRP = env.balance(bob); env(offer(alice, xrpOffer, usdOffer)); env.close(); @@ -2276,8 +2276,8 @@ public: env.require( balance(alice, USD(0)), balance(bob, usdOffer), - balance(alice, alicesXRP + xrpOffer - fee), - balance(bob, bobsXRP - xrpOffer - fee), + balance(alice, aliceXRP + xrpOffer - fee), + balance(bob, bobXRP - xrpOffer - fee), offers(alice, 0), offers(bob, 0)); @@ -2293,13 +2293,13 @@ public: env.require(offers(alice, 0)); verifyDefaultTrustline(env, bob, USD(1)); { - auto const bobsOffers = offersOnAccount(env, bob); - BEAST_EXPECT(bobsOffers.size() == 1); - auto const& bobsOffer = *(bobsOffers.front()); + auto const bobOffers = offersOnAccount(env, bob); + BEAST_EXPECT(bobOffers.size() == 1); + auto const& bobOffer = *(bobOffers.front()); - BEAST_EXPECT(bobsOffer[sfLedgerEntryType] == ltOFFER); - BEAST_EXPECT(bobsOffer[sfTakerGets] == USD(1)); - BEAST_EXPECT(bobsOffer[sfTakerPays] == XRP(1)); + BEAST_EXPECT(bobOffer[sfLedgerEntryType] == ltOFFER); + BEAST_EXPECT(bobOffer[sfTakerGets] == USD(1)); + BEAST_EXPECT(bobOffer[sfTakerPays] == XRP(1)); } } @@ -2375,13 +2375,13 @@ public: env.require(balance(bob, EUR(999))); { - auto bobsOffers = offersOnAccount(env, bob); - if (BEAST_EXPECT(bobsOffers.size() == 1)) + auto bobOffers = offersOnAccount(env, bob); + if (BEAST_EXPECT(bobOffers.size() == 1)) { - auto const& bobsOffer = *(bobsOffers.front()); + auto const& bobOffer = *(bobOffers.front()); - BEAST_EXPECT(bobsOffer[sfTakerGets] == USD(1)); - BEAST_EXPECT(bobsOffer[sfTakerPays] == EUR(1)); + BEAST_EXPECT(bobOffer[sfTakerGets] == USD(1)); + BEAST_EXPECT(bobOffer[sfTakerPays] == EUR(1)); } } @@ -2470,22 +2470,22 @@ public: verifyDefaultTrustline(env, bob, EUR(400)); verifyDefaultTrustline(env, carol, USD(400)); { - auto const alicesOffers = offersOnAccount(env, alice); - BEAST_EXPECT(alicesOffers.size() == 1); - auto const& alicesOffer = *(alicesOffers.front()); + auto const aliceOffers = offersOnAccount(env, alice); + BEAST_EXPECT(aliceOffers.size() == 1); + auto const& aliceOffer = *(aliceOffers.front()); - BEAST_EXPECT(alicesOffer[sfLedgerEntryType] == ltOFFER); - BEAST_EXPECT(alicesOffer[sfTakerGets] == USD(600)); - BEAST_EXPECT(alicesOffer[sfTakerPays] == XRP(600)); + BEAST_EXPECT(aliceOffer[sfLedgerEntryType] == ltOFFER); + BEAST_EXPECT(aliceOffer[sfTakerGets] == USD(600)); + BEAST_EXPECT(aliceOffer[sfTakerPays] == XRP(600)); } { - auto const bobsOffers = offersOnAccount(env, bob); - BEAST_EXPECT(bobsOffers.size() == 1); - auto const& bobsOffer = *(bobsOffers.front()); + auto const bobOffers = offersOnAccount(env, bob); + BEAST_EXPECT(bobOffers.size() == 1); + auto const& bobOffer = *(bobOffers.front()); - BEAST_EXPECT(bobsOffer[sfLedgerEntryType] == ltOFFER); - BEAST_EXPECT(bobsOffer[sfTakerGets] == XRP(600)); - BEAST_EXPECT(bobsOffer[sfTakerPays] == EUR(600)); + BEAST_EXPECT(bobOffer[sfLedgerEntryType] == ltOFFER); + BEAST_EXPECT(bobOffer[sfTakerGets] == XRP(600)); + BEAST_EXPECT(bobOffer[sfTakerPays] == EUR(600)); } // carol makes an offer that exactly consumes alice and bob's offers. @@ -2503,15 +2503,15 @@ public: verifyDefaultTrustline(env, carol, USD(1000)); // In pre-flow code alice's offer is left empty in the ledger. - auto const alicesOffers = offersOnAccount(env, alice); - if (alicesOffers.size() != 0) + auto const aliceOffers = offersOnAccount(env, alice); + if (aliceOffers.size() != 0) { - BEAST_EXPECT(alicesOffers.size() == 1); - auto const& alicesOffer = *(alicesOffers.front()); + BEAST_EXPECT(aliceOffers.size() == 1); + auto const& aliceOffer = *(aliceOffers.front()); - BEAST_EXPECT(alicesOffer[sfLedgerEntryType] == ltOFFER); - BEAST_EXPECT(alicesOffer[sfTakerGets] == USD(0)); - BEAST_EXPECT(alicesOffer[sfTakerPays] == XRP(0)); + BEAST_EXPECT(aliceOffer[sfLedgerEntryType] == ltOFFER); + BEAST_EXPECT(aliceOffer[sfTakerGets] == USD(0)); + BEAST_EXPECT(aliceOffer[sfTakerPays] == XRP(0)); } } @@ -3679,16 +3679,16 @@ public: // Place alice's tiny offer in the book first. Let's see what happens // when a reasonable offer crosses it. - STAmount const alicesCnyOffer{ + STAmount const aliceCnyOffer{ CNY.issue(), std::uint64_t(4926000000000000), -23}; - env(offer(alice, alicesCnyOffer, drops(1), tfPassive)); + env(offer(alice, aliceCnyOffer, drops(1), tfPassive)); env.close(); // bob places an ordinary offer - STAmount const bobsCnyStartBalance{ + STAmount const bobCnyStartBalance{ CNY.issue(), std::uint64_t(3767479960090235), -15}; - env(pay(gw, bob, bobsCnyStartBalance)); + env(pay(gw, bob, bobCnyStartBalance)); env.close(); env(offer( @@ -3697,9 +3697,9 @@ public: STAmount{CNY.issue(), std::uint64_t(1000000000000000), -20})); env.close(); - env.require(balance(alice, alicesCnyOffer)); + env.require(balance(alice, aliceCnyOffer)); env.require(balance(alice, startXrpBalance - fee - drops(1))); - env.require(balance(bob, bobsCnyStartBalance - alicesCnyOffer)); + env.require(balance(bob, bobCnyStartBalance - aliceCnyOffer)); env.require(balance(bob, startXrpBalance - (fee * 2) + drops(1))); } diff --git a/src/test/app/PayStrand_test.cpp b/src/test/app/PayStrand_test.cpp index 2f3b36eae5..9b534d9284 100644 --- a/src/test/app/PayStrand_test.cpp +++ b/src/test/app/PayStrand_test.cpp @@ -73,11 +73,11 @@ equal(std::unique_ptr const& s1, DirectStepInfo const& dsi) } bool -equal(std::unique_ptr const& s1, XRPEndpointStepInfo const& xrpsi) +equal(std::unique_ptr const& s1, XRPEndpointStepInfo const& xrpStepInfo) { if (!s1) return false; - return test::xrpEndpointStepEqual(*s1, xrpsi.acc); + return test::xrpEndpointStepEqual(*s1, xrpStepInfo.acc); } bool @@ -970,7 +970,7 @@ struct PayStrand_test : public beast::unit_test::suite Path const p = [&] { Path result; - result.push_back(allpe(gw, bob["USD"])); + result.push_back(allPathElements(gw, bob["USD"])); result.push_back(cpe(EUR.currency)); return result; }(); diff --git a/src/test/app/ReducedOffer_test.cpp b/src/test/app/ReducedOffer_test.cpp index aa1473d2ee..b967096eb8 100644 --- a/src/test/app/ReducedOffer_test.cpp +++ b/src/test/app/ReducedOffer_test.cpp @@ -79,8 +79,8 @@ public: STAmount const initialRate = Quality(newOffer).rate(); std::uint32_t const bobOfferSeq = env.seq(bob); STAmount const bobInitialBalance = env.balance(bob); - STAmount const bobsFee = env.current()->fees().base; - env(offer(bob, newOffer.in, newOffer.out, tfSell), fee(bobsFee)); + STAmount const bobFee = env.current()->fees().base; + env(offer(bob, newOffer.in, newOffer.out, tfSell), fee(bobFee)); env.close(); STAmount const bobFinalBalance = env.balance(bob); @@ -100,7 +100,7 @@ public: amountFromJson(sfTakerGets, bobOffer[jss::node][sfTakerGets.jsonName]); STAmount const reducedTakerPays = amountFromJson(sfTakerPays, bobOffer[jss::node][sfTakerPays.jsonName]); - STAmount const bobGot = env.balance(bob) + bobsFee - bobInitialBalance; + STAmount const bobGot = env.balance(bob) + bobFee - bobInitialBalance; BEAST_EXPECT(reducedTakerPays < newOffer.in); BEAST_EXPECT(reducedTakerGets < newOffer.out); STAmount const inLedgerRate = Quality(Amounts{reducedTakerPays, reducedTakerGets}).rate(); @@ -141,7 +141,7 @@ public: }; // bob's offer (the new offer) is the same every time: - Amounts const bobsOffer{STAmount(XRP(1)), STAmount(USD.issue(), 1, 0)}; + Amounts const bobOffer{STAmount(XRP(1)), STAmount(USD.issue(), 1, 0)}; // alice's offer has a slightly smaller TakerPays with each // iteration. This should mean that the size of the offer bob @@ -151,10 +151,10 @@ public: mantissaReduce += 20'000'000ull) { STAmount aliceUSD{ - bobsOffer.out.issue(), bobsOffer.out.mantissa() - mantissaReduce, bobsOffer.out.exponent()}; - STAmount aliceXRP{bobsOffer.in.issue(), bobsOffer.in.mantissa() - 1}; - Amounts alicesOffer{aliceUSD, aliceXRP}; - blockedCount += exerciseOfferPair(alicesOffer, bobsOffer); + bobOffer.out.issue(), bobOffer.out.mantissa() - mantissaReduce, bobOffer.out.exponent()}; + STAmount aliceXRP{bobOffer.in.issue(), bobOffer.in.mantissa() - 1}; + Amounts aliceOffer{aliceUSD, aliceXRP}; + blockedCount += exerciseOfferPair(aliceOffer, bobOffer); } // None of the test cases should produce a potentially blocking @@ -279,9 +279,9 @@ public: STAmount bobUSD{ aliceOffer.out.issue(), aliceOffer.out.mantissa() - mantissaReduce, aliceOffer.out.exponent()}; STAmount bobXRP{aliceOffer.in.issue(), aliceOffer.in.mantissa() - 1}; - Amounts bobsOffer{bobUSD, bobXRP}; + Amounts bobOffer{bobUSD, bobXRP}; - blockedCount += exerciseOfferPair(aliceOffer, bobsOffer); + blockedCount += exerciseOfferPair(aliceOffer, bobOffer); } // None of the test cases should produce a potentially blocking @@ -333,7 +333,7 @@ public: // then we use that as evidence that bob's offer blocked the // order book. { - bool const bobsOfferGone = !offerInLedger(env, bob, bobOfferSeq); + bool const bobOfferGone = !offerInLedger(env, bob, bobOfferSeq); STAmount const aliceBalanceUSD = env.balance(alice, USD); // Sanity check the ledger if alice got USD. @@ -341,11 +341,11 @@ public: { BEAST_EXPECT(aliceBalanceUSD == initialBobUSD); BEAST_EXPECT(env.balance(bob, USD) == USD(0)); - BEAST_EXPECT(bobsOfferGone); + BEAST_EXPECT(bobOfferGone); } // Track occurrences of order book blocking. - if (!bobsOfferGone && aliceBalanceUSD.signum() == 0) + if (!bobOfferGone && aliceBalanceUSD.signum() == 0) { ++blockedOrderBookCount; } @@ -423,13 +423,13 @@ public: // Examine the aftermath of alice's offer. { - bool const bobsOfferGone = !offerInLedger(env, bob, bobOfferSeq); + bool const bobOfferGone = !offerInLedger(env, bob, bobOfferSeq); STAmount aliceBalanceUSD = env.balance(alice, USD); #if 0 std::cout - << "bobs initial: " << initialBobUSD + << "bob initial: " << initialBobUSD << "; alice final: " << aliceBalanceUSD - << "; bobs offer: " << bobsOfferJson.toStyledString() + << "; bob offer: " << bobOfferJson.toStyledString() << std::endl; #endif // Sanity check the ledger if alice got USD. @@ -437,11 +437,11 @@ public: { BEAST_EXPECT(aliceBalanceUSD == initialBobUSD); BEAST_EXPECT(env.balance(bob, USD) == USD(0)); - BEAST_EXPECT(bobsOfferGone); + BEAST_EXPECT(bobOfferGone); } // Track occurrences of order book blocking. - if (!bobsOfferGone && aliceBalanceUSD.signum() == 0) + if (!bobOfferGone && aliceBalanceUSD.signum() == 0) { ++blockedOrderBookCount; } diff --git a/src/test/app/SHAMapStore_test.cpp b/src/test/app/SHAMapStore_test.cpp index 7951da26d1..c671d6fc27 100644 --- a/src/test/app/SHAMapStore_test.cpp +++ b/src/test/app/SHAMapStore_test.cpp @@ -44,10 +44,10 @@ class SHAMapStore_test : public beast::unit_test::suite auto const seq = json[jss::result][jss::ledger_index].asUInt(); - std::optional oinfo = env.app().getRelationalDatabase().getLedgerInfoByIndex(seq); - if (!oinfo) + std::optional outInfo = env.app().getRelationalDatabase().getLedgerInfoByIndex(seq); + if (!outInfo) return false; - LedgerHeader const& info = oinfo.value(); + LedgerHeader const& info = outInfo.value(); std::string const outHash = to_string(info.hash); LedgerIndex const outSeq = info.seq; diff --git a/src/test/app/TrustAndBalance_test.cpp b/src/test/app/TrustAndBalance_test.cpp index b695430c7f..aa06ccbdf1 100644 --- a/src/test/app/TrustAndBalance_test.cpp +++ b/src/test/app/TrustAndBalance_test.cpp @@ -383,20 +383,20 @@ class TrustAndBalance_test : public beast::unit_test::suite jvs[jss::streams].append("transactions"); BEAST_EXPECT(wsc->invoke("subscribe", jvs)[jss::status] == "success"); - char const* invoiceid = "243F6A8885A308D313198A2E03707344A4093822299F31D0082EFA98EC4E6C89"; + char const* invoiceId = "243F6A8885A308D313198A2E03707344A4093822299F31D0082EFA98EC4E6C89"; Json::Value jv; - auto tx = env.jt(pay(env.master, alice, XRP(10000)), json(sfInvoiceID.fieldName, invoiceid)); + auto tx = env.jt(pay(env.master, alice, XRP(10000)), json(sfInvoiceID.fieldName, invoiceId)); jv[jss::tx_blob] = strHex(tx.stx->getSerializer().slice()); auto jrr = wsc->invoke("submit", jv)[jss::result]; BEAST_EXPECT(jrr[jss::status] == "success"); - BEAST_EXPECT(jrr[jss::tx_json][sfInvoiceID.fieldName] == invoiceid); + BEAST_EXPECT(jrr[jss::tx_json][sfInvoiceID.fieldName] == invoiceId); env.close(); using namespace std::chrono_literals; - BEAST_EXPECT(wsc->findMsg(2s, [invoiceid](auto const& jval) { + BEAST_EXPECT(wsc->findMsg(2s, [invoiceId](auto const& jval) { auto const& t = jval[jss::transaction]; - return t[jss::TransactionType] == jss::Payment && t[sfInvoiceID.fieldName] == invoiceid; + return t[jss::TransactionType] == jss::Payment && t[sfInvoiceID.fieldName] == invoiceId; })); BEAST_EXPECT(wsc->invoke("unsubscribe", jv)[jss::status] == "success"); diff --git a/src/test/app/Vault_test.cpp b/src/test/app/Vault_test.cpp index e39f665711..5d31c674c0 100644 --- a/src/test/app/Vault_test.cpp +++ b/src/test/app/Vault_test.cpp @@ -4578,7 +4578,7 @@ class Vault_test : public beast::unit_test::suite { testcase("VaultClawback (asset) - " + prefix + " issuer XRP clawback fails"); auto [vault, vaultKeylet] = setupVault(asset, owner, depositor, issuer); - // If the asset is XRP, clawback with amount fails as malfored + // If the asset is XRP, clawback with amount fails as malformed // when asset is specified. env(vault.clawback({ .issuer = issuer, diff --git a/src/test/app/XChain_test.cpp b/src/test/app/XChain_test.cpp index e074e03d97..2921e10ae4 100644 --- a/src/test/app/XChain_test.cpp +++ b/src/test/app/XChain_test.cpp @@ -2149,7 +2149,7 @@ struct XChain_test : public beast::unit_test::suite, public jtx::XChainBridgeObj } void - testXChainAddAccountCreateNonBatchAttestation() + testXChainAddAccountCreateNonBatchAttestation() // cspell: disable-line { using namespace jtx; @@ -3417,7 +3417,7 @@ struct XChain_test : public beast::unit_test::suite, public jtx::XChainBridgeObj testXChainCommit(); testXChainAddAttestation(); testXChainAddClaimNonBatchAttestation(); - testXChainAddAccountCreateNonBatchAttestation(); + testXChainAddAccountCreateNonBatchAttestation(); // cspell: disable-line testXChainClaim(); testXChainCreateAccount(); testFeeDipsIntoReserve(); @@ -3535,6 +3535,7 @@ private: do { callback_called = false; + // cspell: ignore attns for (size_t i = 0; i < signers_attns.size(); ++i) { for (auto& [bridge, claims] : signers_attns[i]) diff --git a/src/test/core/Config_test.cpp b/src/test/core/Config_test.cpp index 1035be6fc0..d5f3bb556c 100644 --- a/src/test/core/Config_test.cpp +++ b/src/test/core/Config_test.cpp @@ -634,8 +634,8 @@ nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8 Config c; std::string toLoad(R"xrpldConfig( [validator_list_sites] -xrplvalidators.com -trustthesevalidators.gov +xrpl-validators.com +trust-these-validators.gov [validator_list_keys] 021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566 @@ -645,8 +645,8 @@ trustthesevalidators.gov )xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2); - BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_SITES).values()[0] == "xrplvalidators.com"); - BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_SITES).values()[1] == "trustthesevalidators.gov"); + BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_SITES).values()[0] == "xrpl-validators.com"); + BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_SITES).values()[1] == "trust-these-validators.gov"); BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 1); BEAST_EXPECT( c.section(SECTION_VALIDATOR_LIST_KEYS).values()[0] == @@ -661,8 +661,8 @@ trustthesevalidators.gov Config c; std::string toLoad(R"xrpldConfig( [validator_list_sites] -xrplvalidators.com -trustthesevalidators.gov +xrpl-validators.com +trust-these-validators.gov [validator_list_keys] 021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566 @@ -672,8 +672,8 @@ trustthesevalidators.gov )xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2); - BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_SITES).values()[0] == "xrplvalidators.com"); - BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_SITES).values()[1] == "trustthesevalidators.gov"); + BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_SITES).values()[0] == "xrpl-validators.com"); + BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_SITES).values()[1] == "trust-these-validators.gov"); BEAST_EXPECT(c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 1); BEAST_EXPECT( c.section(SECTION_VALIDATOR_LIST_KEYS).values()[0] == @@ -689,8 +689,8 @@ trustthesevalidators.gov Config c; std::string toLoad(R"xrpldConfig( [validator_list_sites] -xrplvalidators.com -trustthesevalidators.gov +xrpl-validators.com +trust-these-validators.gov [validator_list_keys] 021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566 @@ -718,8 +718,8 @@ trustthesevalidators.gov Config c; std::string toLoad(R"xrpldConfig( [validator_list_sites] -xrplvalidators.com -trustthesevalidators.gov +xrpl-validators.com +trust-these-validators.gov [validator_list_keys] 021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566 @@ -747,8 +747,8 @@ value = 2 Config c; std::string toLoad(R"xrpldConfig( [validator_list_sites] -xrplvalidators.com -trustthesevalidators.gov +xrpl-validators.com +trust-these-validators.gov [validator_list_keys] 021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566 @@ -774,8 +774,8 @@ trustthesevalidators.gov Config c; std::string toLoad(R"xrpldConfig( [validator_list_sites] -xrplvalidators.com -trustthesevalidators.gov +xrpl-validators.com +trust-these-validators.gov )xrpldConfig"); std::string error; auto const expectedError = "[validator_list_keys] config section is missing"; @@ -887,8 +887,8 @@ nHB1X37qrniVugfQcuBTAjswphC1drx7QjFFojJPZwKHHnt8kU7v nHUkAWDR4cB8AgPg7VXMX6et8xRTQb2KJfgv1aBEXozwrawRKgMB [validator_list_sites] -xrplvalidators.com -trustthesevalidators.gov +xrpl-validators.com +trust-these-validators.gov [validator_list_keys] 021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566 diff --git a/src/test/jtx/TestHelpers.h b/src/test/jtx/TestHelpers.h index aea9edeb93..c0e54900f6 100644 --- a/src/test/jtx/TestHelpers.h +++ b/src/test/jtx/TestHelpers.h @@ -535,7 +535,7 @@ cpe(Currency const& c); // All path element STPathElement -allpe(AccountID const& a, Issue const& iss); +allPathElements(AccountID const& a, Issue const& iss); /***************************************************************/ /* Check */ diff --git a/src/test/jtx/impl/AMM.cpp b/src/test/jtx/impl/AMM.cpp index 4d27ddf740..f920858ea5 100644 --- a/src/test/jtx/impl/AMM.cpp +++ b/src/test/jtx/impl/AMM.cpp @@ -253,12 +253,12 @@ AMM::expectAmmRpcInfo( } bool -AMM::expectAmmInfo(STAmount const& asset1, STAmount const& asset2, IOUAmount const& balance, Json::Value const& jvres) +AMM::expectAmmInfo(STAmount const& asset1, STAmount const& asset2, IOUAmount const& balance, Json::Value const& jvRes) const { - if (!jvres.isMember(jss::amm)) + if (!jvRes.isMember(jss::amm)) return false; - auto const& jv = jvres[jss::amm]; + auto const& jv = jvRes[jss::amm]; if (!jv.isMember(jss::amount) || !jv.isMember(jss::amount2) || !jv.isMember(jss::lp_token)) return false; STAmount asset1Info; @@ -360,26 +360,26 @@ AMM::deposit( maxEP->setJson(jv[jss::EPrice]); if (tfee) jv[jss::TradingFee] = *tfee; - std::uint32_t jvflags = 0; + std::uint32_t jvFlags = 0; if (flags) - jvflags = *flags; + jvFlags = *flags; // If including asset1In and asset2In or tokens as // deposit min amounts then must set the flags // explicitly instead of relying on this logic. - if (!(jvflags & tfDepositSubTx)) + if (!(jvFlags & tfDepositSubTx)) { if (tokens && !asset1In) - jvflags |= tfLPToken; + jvFlags |= tfLPToken; else if (tokens && asset1In) - jvflags |= tfOneAssetLPToken; + jvFlags |= tfOneAssetLPToken; else if (asset1In && asset2In) - jvflags |= tfTwoAsset; + jvFlags |= tfTwoAsset; else if (maxEP && asset1In) - jvflags |= tfLimitLPToken; + jvFlags |= tfLimitLPToken; else if (asset1In) - jvflags |= tfSingleAsset; + jvFlags |= tfSingleAsset; } - jv[jss::Flags] = jvflags; + jv[jss::Flags] = jvFlags; return deposit(account, jv, assets, seq, ter); } @@ -465,23 +465,23 @@ AMM::withdraw( STAmount const saMaxEP{*maxEP, lptIssue_}; saMaxEP.setJson(jv[jss::EPrice]); } - std::uint32_t jvflags = 0; + std::uint32_t jvFlags = 0; if (flags) - jvflags = *flags; - if (!(jvflags & tfWithdrawSubTx)) + jvFlags = *flags; + if (!(jvFlags & tfWithdrawSubTx)) { if (tokens && !asset1Out) - jvflags |= tfLPToken; + jvFlags |= tfLPToken; else if (asset1Out && asset2Out) - jvflags |= tfTwoAsset; + jvFlags |= tfTwoAsset; else if (tokens && asset1Out) - jvflags |= tfOneAssetLPToken; + jvFlags |= tfOneAssetLPToken; else if (asset1Out && maxEP) - jvflags |= tfLimitLPToken; + jvFlags |= tfLimitLPToken; else if (asset1Out) - jvflags |= tfSingleAsset; + jvFlags |= tfSingleAsset; } - jv[jss::Flags] = jvflags; + jv[jss::Flags] = jvFlags; return withdraw(account, jv, seq, assets, ter); } diff --git a/src/test/jtx/impl/TestHelpers.cpp b/src/test/jtx/impl/TestHelpers.cpp index 7155c8fd0a..d89dec456b 100644 --- a/src/test/jtx/impl/TestHelpers.cpp +++ b/src/test/jtx/impl/TestHelpers.cpp @@ -304,7 +304,7 @@ cpe(Currency const& c) // All path element STPathElement -allpe(AccountID const& a, Issue const& iss) +allPathElements(AccountID const& a, Issue const& iss) { return STPathElement( STPathElement::typeAccount | STPathElement::typeCurrency | STPathElement::typeIssuer, diff --git a/src/test/jtx/impl/mpt.cpp b/src/test/jtx/impl/mpt.cpp index 90378fae90..f505bff740 100644 --- a/src/test/jtx/impl/mpt.cpp +++ b/src/test/jtx/impl/mpt.cpp @@ -99,10 +99,10 @@ MPTTester::operator MPT() const } Json::Value -MPTTester::createjv(MPTCreate const& arg) +MPTTester::createJV(MPTCreate const& arg) { if (!arg.issuer) - Throw("MPTTester::createjv: issuer is not set"); + Throw("MPTTester::createJV: issuer is not set"); Json::Value jv; jv[sfAccount] = arg.issuer->human(); if (arg.assetScale) @@ -128,7 +128,7 @@ MPTTester::create(MPTCreate const& arg) if (id_) Throw("MPT can't be reused"); id_ = makeMptID(env_.seq(issuer_), issuer_); - Json::Value jv = createjv( + Json::Value jv = createJV( {.issuer = issuer_, .maxAmt = arg.maxAmt, .assetScale = arg.assetScale, @@ -179,11 +179,11 @@ MPTTester::create(MPTCreate const& arg) } Json::Value -MPTTester::destroyjv(MPTDestroy const& arg) +MPTTester::destroyJV(MPTDestroy const& arg) { Json::Value jv; if (!arg.issuer || !arg.id) - Throw("MPTTester::destroyjv: issuer/id is not set"); + Throw("MPTTester::destroyJV: issuer/id is not set"); jv[sfAccount] = arg.issuer->human(); jv[sfMPTokenIssuanceID] = to_string(*arg.id); jv[sfTransactionType] = jss::MPTokenIssuanceDestroy; @@ -196,7 +196,7 @@ MPTTester::destroy(MPTDestroy const& arg) { if (!arg.id && !id_) Throw("MPT has not been created"); - Json::Value jv = destroyjv({.issuer = arg.issuer ? arg.issuer : issuer_, .id = arg.id ? arg.id : id_}); + Json::Value jv = destroyJV({.issuer = arg.issuer ? arg.issuer : issuer_, .id = arg.id ? arg.id : id_}); submit(arg, jv); } @@ -210,11 +210,11 @@ MPTTester::holder(std::string const& holder_) const } Json::Value -MPTTester::authorizejv(MPTAuthorize const& arg) +MPTTester::authorizeJV(MPTAuthorize const& arg) { Json::Value jv; if (!arg.account || !arg.id) - Throw("MPTTester::authorizejv: issuer/id is not set"); + Throw("MPTTester::authorizeJV: account/id is not set"); jv[sfAccount] = arg.account->human(); jv[sfMPTokenIssuanceID] = to_string(*arg.id); if (arg.holder) @@ -229,7 +229,7 @@ MPTTester::authorize(MPTAuthorize const& arg) { if (!arg.id && !id_) Throw("MPT has not been created"); - Json::Value jv = authorizejv({ + Json::Value jv = authorizeJV({ .account = arg.account ? arg.account : issuer_, .holder = arg.holder, .id = arg.id ? arg.id : id_, @@ -289,11 +289,11 @@ MPTTester::authorizeHolders(Holders const& holders) } Json::Value -MPTTester::setjv(MPTSet const& arg) +MPTTester::setJV(MPTSet const& arg) { Json::Value jv; if (!arg.account || !arg.id) - Throw("MPTTester::setjv: issuer/id is not set"); + Throw("MPTTester::setJV: account and/or id is not set"); jv[sfAccount] = arg.account->human(); jv[sfMPTokenIssuanceID] = to_string(*arg.id); if (arg.holder) @@ -328,7 +328,7 @@ MPTTester::set(MPTSet const& arg) { if (!arg.id && !id_) Throw("MPT has not been created"); - Json::Value jv = setjv( + Json::Value jv = setJV( {.account = arg.account ? arg.account : issuer_, .holder = arg.holder, .id = arg.id ? arg.id : id_, @@ -476,7 +476,7 @@ MPTTester::pay( Throw("MPT has not been created"); auto const srcAmt = getBalance(src); auto const destAmt = getBalance(dest); - auto const outstnAmt = getBalance(issuer_); + auto const outstandingAmt = getBalance(issuer_); if (credentials) env_(jtx::pay(src, dest, mpt(amount)), ter(err.value_or(tesSUCCESS)), credentials::ids(*credentials)); @@ -505,7 +505,7 @@ MPTTester::pay( env_.require(mptbalance(*this, src, srcAmt - actual)); env_.require(mptbalance(*this, dest, destAmt + amount)); // Outstanding amount is reduced by the transfer fee if any - env_.require(mptbalance(*this, issuer_, outstnAmt - (actual - amount))); + env_.require(mptbalance(*this, issuer_, outstandingAmt - (actual - amount))); } } diff --git a/src/test/jtx/mpt.h b/src/test/jtx/mpt.h index 792d43056f..510248240d 100644 --- a/src/test/jtx/mpt.h +++ b/src/test/jtx/mpt.h @@ -177,19 +177,19 @@ public: create(MPTCreate const& arg = MPTCreate{}); static Json::Value - createjv(MPTCreate const& arg = MPTCreate{}); + createJV(MPTCreate const& arg = MPTCreate{}); void destroy(MPTDestroy const& arg = MPTDestroy{}); static Json::Value - destroyjv(MPTDestroy const& arg = MPTDestroy{}); + destroyJV(MPTDestroy const& arg = MPTDestroy{}); void authorize(MPTAuthorize const& arg = MPTAuthorize{}); static Json::Value - authorizejv(MPTAuthorize const& arg = MPTAuthorize{}); + authorizeJV(MPTAuthorize const& arg = MPTAuthorize{}); void authorizeHolders(Holders const& holders); @@ -198,7 +198,7 @@ public: set(MPTSet const& set = {}); static Json::Value - setjv(MPTSet const& set = {}); + setJV(MPTSet const& set = {}); [[nodiscard]] bool checkDomainID(std::optional expected) const; diff --git a/src/test/ledger/Directory_test.cpp b/src/test/ledger/Directory_test.cpp index 16d319671c..0774390490 100644 --- a/src/test/ledger/Directory_test.cpp +++ b/src/test/ledger/Directory_test.cpp @@ -164,7 +164,7 @@ struct Directory_test : public beast::unit_test::suite return c; }(); - // First, Alices creates a lot of trustlines, and then + // First, Alice creates a lot of trustlines, and then // deletes them in a different order: { auto cl = currencies; diff --git a/src/test/ledger/View_test.cpp b/src/test/ledger/View_test.cpp index b2cc8d7057..33813e135e 100644 --- a/src/test/ledger/View_test.cpp +++ b/src/test/ledger/View_test.cpp @@ -982,8 +982,8 @@ class GetAmendments_test : public beast::unit_test::suite BEAST_EXPECT(majorities.size() >= 2); // None of the amendments should be enabled yet. - auto enableds = getEnabledAmendments(*env.closed()); - BEAST_EXPECT(enableds.empty()); + auto enabledAmendments = getEnabledAmendments(*env.closed()); + BEAST_EXPECT(enabledAmendments.empty()); // Now wait 2 weeks modulo 256 ledgers for the amendments to be // enabled. Speed the process by closing ledgers every 80 minutes, @@ -992,12 +992,12 @@ class GetAmendments_test : public beast::unit_test::suite { using namespace std::chrono_literals; env.close(80min); - enableds = getEnabledAmendments(*env.closed()); - if (!enableds.empty()) + enabledAmendments = getEnabledAmendments(*env.closed()); + if (!enabledAmendments.empty()) break; } BEAST_EXPECT(i == 255); - BEAST_EXPECT(enableds.size() >= 2); + BEAST_EXPECT(enabledAmendments.size() >= 2); } void diff --git a/src/test/overlay/compression_test.cpp b/src/test/overlay/compression_test.cpp index 6dffe4e5c9..19876809d2 100644 --- a/src/test/overlay/compression_test.cpp +++ b/src/test/overlay/compression_test.cpp @@ -172,12 +172,12 @@ public: std::string usdTxBlob = ""; auto wsc = makeWSClient(env.app().config()); { - Json::Value jrequestUsd; - jrequestUsd[jss::secret] = toBase58(generateSeed("bob")); - jrequestUsd[jss::tx_json] = pay("bob", "alice", bob["USD"](fund / 2)); - Json::Value jreply_usd = wsc->invoke("sign", jrequestUsd); + Json::Value requestUSD; + requestUSD[jss::secret] = toBase58(generateSeed("bob")); + requestUSD[jss::tx_json] = pay("bob", "alice", bob["USD"](fund / 2)); + Json::Value replyUSD = wsc->invoke("sign", requestUSD); - usdTxBlob = toBinary(jreply_usd[jss::result][jss::tx_blob].asString()); + usdTxBlob = toBinary(replyUSD[jss::result][jss::tx_blob].asString()); } auto transaction = std::make_shared(); diff --git a/src/test/protocol/STAmount_test.cpp b/src/test/protocol/STAmount_test.cpp index 10e159dd8d..98bcc7b1bc 100644 --- a/src/test/protocol/STAmount_test.cpp +++ b/src/test/protocol/STAmount_test.cpp @@ -441,9 +441,9 @@ public: STAmount smallValue(noIssue(), (STAmount::cMinValue + STAmount::cMaxValue) / 2, STAmount::cMinOffset + 1); STAmount zeroSt(noIssue(), 0); - STAmount smallXsmall = multiply(smallValue, smallValue, noIssue()); + STAmount smallXSmall = multiply(smallValue, smallValue, noIssue()); - BEAST_EXPECT(smallXsmall == beast::zero); + BEAST_EXPECT(smallXSmall == beast::zero); STAmount bigDsmall = divide(smallValue, bigValue, noIssue()); diff --git a/src/test/rpc/AccountLines_test.cpp b/src/test/rpc/AccountLines_test.cpp index 337da27ea0..1f5f190cfa 100644 --- a/src/test/rpc/AccountLines_test.cpp +++ b/src/test/rpc/AccountLines_test.cpp @@ -380,7 +380,7 @@ public: BEAST_EXPECT(aliceLines2[jss::result][jss::lines].size() == 1); BEAST_EXPECT(!aliceLines2[jss::result].isMember(jss::marker)); - // Get account lines for beckys account, using alices SignerList as a + // Get account lines for becky's account, using alice's SignerList as a // marker. This should cause an error. Json::Value beckyLinesParams; beckyLinesParams[jss::account] = becky.human(); diff --git a/src/test/rpc/AccountObjects_test.cpp b/src/test/rpc/AccountObjects_test.cpp index e9c877b421..0dec2bde7f 100644 --- a/src/test/rpc/AccountObjects_test.cpp +++ b/src/test/rpc/AccountObjects_test.cpp @@ -17,7 +17,7 @@ namespace xrpl { namespace test { -static char const* bobs_account_objects[] = { +static char const* bob_account_objects[] = { R"json({ "Account" : "rPMh7Pi9ct699iZUTWaytJUoHcJ7cgyziK", "BookDirectory" : "50AD0A9E54D2B381288D535EB724E4275FFBF41580D28A925D038D7EA4C68000", @@ -254,7 +254,7 @@ public: Json::Value bobj[4]; for (int i = 0; i < 4; ++i) - Json::Reader{}.parse(bobs_account_objects[i], bobj[i]); + Json::Reader{}.parse(bob_account_objects[i], bobj[i]); // test 'unstepped' // i.e. request account objects without explicit limit/marker paging diff --git a/src/test/rpc/Handler_test.cpp b/src/test/rpc/Handler_test.cpp index 189949d92c..7aeb059f56 100644 --- a/src/test/rpc/Handler_test.cpp +++ b/src/test/rpc/Handler_test.cpp @@ -8,6 +8,7 @@ #include #include #include +// cspell: words stdev namespace xrpl::test { diff --git a/src/test/rpc/LedgerEntry_test.cpp b/src/test/rpc/LedgerEntry_test.cpp index a7ae547272..aa959629b1 100644 --- a/src/test/rpc/LedgerEntry_test.cpp +++ b/src/test/rpc/LedgerEntry_test.cpp @@ -501,7 +501,7 @@ class LedgerEntry_test : public beast::unit_test::suite accountRootIndex = jrr[jss::index].asString(); } { - constexpr char alicesAcctRootBinary[]{ + constexpr char aliceAcctRootBinary[]{ "1100612200800000240000000425000000032D00000000559CE54C3B934E4" "73A995B477E92EC229F99CED5B62BF4D2ACE4DC42719103AE2F6240000002" "540BE4008114AE123A8556F3CF91154711376AFB0F894F832B3D"}; @@ -513,7 +513,7 @@ class LedgerEntry_test : public beast::unit_test::suite jvParams[jss::ledger_hash] = ledgerHash; Json::Value const jrr = env.rpc("json", "ledger_entry", to_string(jvParams))[jss::result]; BEAST_EXPECT(jrr.isMember(jss::node_binary)); - BEAST_EXPECT(jrr[jss::node_binary] == alicesAcctRootBinary); + BEAST_EXPECT(jrr[jss::node_binary] == aliceAcctRootBinary); } { // Request alice's account root using the index. diff --git a/src/test/rpc/NoRipple_test.cpp b/src/test/rpc/NoRipple_test.cpp index 07b0c95e92..9cfc69ccd5 100644 --- a/src/test/rpc/NoRipple_test.cpp +++ b/src/test/rpc/NoRipple_test.cpp @@ -38,8 +38,8 @@ public: // Check no-ripple flag on sender 'gateway' Json::Value lines{env.rpc("json", "account_lines", to_string(account_gw))}; - auto const& gline0 = lines[jss::result][jss::lines][0u]; - BEAST_EXPECT(gline0[jss::no_ripple].asBool() == SetOrClear); + auto const& gwLine0 = lines[jss::result][jss::lines][0u]; + BEAST_EXPECT(gwLine0[jss::no_ripple].asBool() == SetOrClear); // Check no-ripple peer flag on destination 'alice' lines = env.rpc("json", "account_lines", to_string(account_alice)); diff --git a/src/test/rpc/Transaction_test.cpp b/src/test/rpc/Transaction_test.cpp index 0e212afb21..3b289d73ca 100644 --- a/src/test/rpc/Transaction_test.cpp +++ b/src/test/rpc/Transaction_test.cpp @@ -512,7 +512,7 @@ class Transaction_test : public beast::unit_test::suite } void - testCTIDRPC(FeatureBitset features) + testRPCsForCTID(FeatureBitset features) { testcase("CTID RPC"); @@ -804,7 +804,7 @@ public: testRangeRequest(features); testRangeCTIDRequest(features); testCTIDValidation(features); - testCTIDRPC(features); + testRPCsForCTID(features); forAllApiVersions(std::bind_front(&Transaction_test::testRequest, this, features)); } }; From db2734cbc96329f64c23ea68fadc2fc898696510 Mon Sep 17 00:00:00 2001 From: Valentin Balaschenko <13349202+vlntb@users.noreply.github.com> Date: Fri, 6 Feb 2026 21:33:42 +0000 Subject: [PATCH 21/26] refactor: Change main thread name to `xrpld-main` (#6336) This change builds on the thread-renaming PR (#6212), by renaming the main thread name to reduce ambiguity in performance monitoring tools. --- src/xrpld/app/main/Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xrpld/app/main/Main.cpp b/src/xrpld/app/main/Main.cpp index 031daeb5e9..aaf7af95ab 100644 --- a/src/xrpld/app/main/Main.cpp +++ b/src/xrpld/app/main/Main.cpp @@ -323,7 +323,7 @@ run(int argc, char** argv) { using namespace std; - beast::setCurrentThreadName("main"); + beast::setCurrentThreadName("xrpld-main"); po::variables_map vm; From e11f6190b74599737f9f554da3b141f269e43803 Mon Sep 17 00:00:00 2001 From: Olek <115580134+oleks-rip@users.noreply.github.com> Date: Tue, 10 Feb 2026 14:02:53 -0500 Subject: [PATCH 22/26] fix: Update invariant checks for Permissioned Domains (#6134) --- include/xrpl/protocol/detail/features.macro | 2 +- src/test/app/Invariants_test.cpp | 636 ++++++++++++++------ src/test/app/PermissionedDomains_test.cpp | 32 +- src/test/jtx/impl/balance.cpp | 24 +- src/xrpld/app/tx/detail/InvariantCheck.cpp | 102 +++- src/xrpld/app/tx/detail/InvariantCheck.h | 6 +- 6 files changed, 555 insertions(+), 247 deletions(-) diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index d8498ffa2f..961bc6e44c 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -15,7 +15,7 @@ // Add new amendments to the top of this list. // Keep it sorted in reverse chronological order. - +XRPL_FIX (PermissionedDomainInvariant, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (ExpiredNFTokenOfferRemoval, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (BatchInnerSigs, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(LendingProtocol, Supported::yes, VoteBehavior::DefaultNo) diff --git a/src/test/app/Invariants_test.cpp b/src/test/app/Invariants_test.cpp index b3fa027753..7558c951b0 100644 --- a/src/test/app/Invariants_test.cpp +++ b/src/test/app/Invariants_test.cpp @@ -36,6 +36,12 @@ class Invariants_test : public beast::unit_test::suite // changes that will cause the check to fail. using Precheck = std::function; + static FeatureBitset + defaultAmendments() + { + return xrpl::test::jtx::testable_amendments() | featureInvariantsV1_1 | featureSingleAssetVault; + } + /** Run a specific test case to put the ledger into a state that will be * detected by an invariant. Simulates the actions of a transaction that * would violate an invariant. @@ -62,10 +68,23 @@ class Invariants_test : public beast::unit_test::suite std::initializer_list ters = {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, Preclose const& preclose = {}, TxAccount setTxAccount = TxAccount::None) + { + return doInvariantCheck( + test::jtx::Env(*this, defaultAmendments()), expect_logs, precheck, fee, tx, ters, preclose, setTxAccount); + } + + void + doInvariantCheck( + test::jtx::Env&& env, + std::vector const& expect_logs, + Precheck const& precheck, + XRPAmount fee = XRPAmount{}, + STTx tx = STTx{ttACCOUNT_SET, [](STObject&) {}}, + std::initializer_list ters = {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, + Preclose const& preclose = {}, + TxAccount setTxAccount = TxAccount::None) { using namespace test::jtx; - FeatureBitset amendments = testable_amendments() | featureInvariantsV1_1 | featureSingleAssetVault; - Env env{*this, amendments}; Account const A1{"A1"}; Account const A2{"A2"}; @@ -74,11 +93,28 @@ class Invariants_test : public beast::unit_test::suite BEAST_EXPECT(preclose(A1, A2, env)); env.close(); + if (setTxAccount != TxAccount::None) + tx.setAccountID(sfAccount, setTxAccount == TxAccount::A1 ? A1.id() : A2.id()); + + return doInvariantCheck(std::move(env), A1, A2, expect_logs, precheck, fee, tx, ters); + } + + void + doInvariantCheck( + test::jtx::Env&& env, + test::jtx::Account const& A1, + test::jtx::Account const& A2, + std::vector const& expect_logs, + Precheck const& precheck, + XRPAmount fee = XRPAmount{}, + STTx tx = STTx{ttACCOUNT_SET, [](STObject&) {}}, + std::initializer_list ters = {tecINVARIANT_FAILED, tefINVARIANT_FAILED}) + { + using namespace test::jtx; + OpenView ov{*env.current()}; test::StreamSink sink{beast::severities::kWarning}; beast::Journal jlog{sink}; - if (setTxAccount != TxAccount::None) - tx.setAccountID(sfAccount, setTxAccount == TxAccount::A1 ? A1.id() : A2.id()); ApplyContext ac{env.app(), ov, tx, tesSUCCESS, env.current()->fees().base, tapNONE, jlog}; BEAST_EXPECT(precheck(A1, A2, ac)); @@ -91,19 +127,21 @@ class Invariants_test : public beast::unit_test::suite for (TER const& terExpect : ters) { terActual = ac.checkInvariants(terActual, fee); - BEAST_EXPECT(terExpect == terActual); + BEAST_EXPECTS(terExpect == terActual, std::to_string(TERtoInt(terActual))); auto const messages = sink.messages().str(); - BEAST_EXPECT( - messages.starts_with("Invariant failed:") || messages.starts_with("Transaction caused an exception")); + + if (terActual != tesSUCCESS) + { + BEAST_EXPECTS( + messages.starts_with("Invariant failed:") || + messages.starts_with("Transaction caused an exception"), + messages); + } + // std::cerr << messages << '\n'; for (auto const& m : expect_logs) { - if (messages.find(m) == std::string::npos) - { - // uncomment if you want to log the invariant failure - // std::cerr << " --> " << m << std::endl; - fail(); - } + BEAST_EXPECTS(messages.find(m) != std::string::npos, m); } } } @@ -1119,86 +1157,80 @@ class Invariants_test : public beast::unit_test::suite }); } - void + static std::shared_ptr createPermissionedDomain( ApplyContext& ac, - std::shared_ptr& sle, test::jtx::Account const& A1, - test::jtx::Account const& A2) + test::jtx::Account const& A2, + std::uint32_t numCreds = 2, + std::uint32_t seq = 10) { - sle->setAccountID(sfOwner, A1); - sle->setFieldU32(sfSequence, 10); + Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), seq); + auto sle = std::make_shared(pdKeylet); - STArray credentials(sfAcceptedCredentials, 2); - for (std::size_t n = 0; n < 2; ++n) + sle->setAccountID(sfOwner, A1); + sle->setFieldU32(sfSequence, seq); + + if (numCreds) { - auto cred = STObject::makeInnerObject(sfCredential); - cred.setAccountID(sfIssuer, A2); - auto credType = "cred_type" + std::to_string(n); - cred.setFieldVL(sfCredentialType, Slice(credType.c_str(), credType.size())); - credentials.push_back(std::move(cred)); + // This array is sorted naturally, but if you willing to change this + // behavior don't forget to use credentials::makeSorted + STArray credentials(sfAcceptedCredentials, numCreds); + for (std::size_t n = 0; n < numCreds; ++n) + { + auto cred = STObject::makeInnerObject(sfCredential); + cred.setAccountID(sfIssuer, A2); + auto credType = "cred_type" + std::to_string(n); + cred.setFieldVL(sfCredentialType, Slice(credType.c_str(), credType.size())); + credentials.push_back(std::move(cred)); + } + sle->setFieldArray(sfAcceptedCredentials, credentials); } - sle->setFieldArray(sfAcceptedCredentials, credentials); + ac.view().insert(sle); + return sle; }; void - testPermissionedDomainInvariants() + testPermissionedDomainInvariants(FeatureBitset features) { using namespace test::jtx; - testcase << "PermissionedDomain"; - doInvariantCheck( - {{"permissioned domain with no rules."}}, - [](Account const& A1, Account const&, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - slePd->setAccountID(sfOwner, A1); - slePd->setFieldU32(sfSequence, 10); + bool const fixPDEnabled = features[fixPermissionedDomainInvariant]; + std::initializer_list badTers = {tecINVARIANT_FAILED, tecINVARIANT_FAILED}; + std::initializer_list failTers = {tecINVARIANT_FAILED, tefINVARIANT_FAILED}; - ac.view().insert(slePd); - return true; + testcase << "PermissionedDomain" + std::string(fixPDEnabled ? " fix" : ""); + + doInvariantCheck( + Env(*this, features), + {{"permissioned domain with no rules."}}, + [](Account const& A1, Account const& A2, ApplyContext& ac) { + return createPermissionedDomain(ac, A1, A2, 0).get(); }, XRPAmount{}, - STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject& tx) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject&) {}}, + fixPDEnabled ? failTers : badTers); testcase << "PermissionedDomain 2"; auto constexpr tooBig = maxPermissionedDomainCredentialsArraySize + 1; doInvariantCheck( + Env(*this, features), {{"permissioned domain bad credentials size " + std::to_string(tooBig)}}, [](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - slePd->setAccountID(sfOwner, A1); - slePd->setFieldU32(sfSequence, 10); - - STArray credentials(sfAcceptedCredentials, tooBig); - for (std::size_t n = 0; n < tooBig; ++n) - { - auto cred = STObject::makeInnerObject(sfCredential); - cred.setAccountID(sfIssuer, A2); - auto credType = std::string("cred_type") + std::to_string(n); - cred.setFieldVL(sfCredentialType, Slice(credType.c_str(), credType.size())); - credentials.push_back(std::move(cred)); - } - slePd->setFieldArray(sfAcceptedCredentials, credentials); - ac.view().insert(slePd); - return true; + return !!createPermissionedDomain(ac, A1, A2, tooBig); }, XRPAmount{}, STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject&) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + fixPDEnabled ? failTers : badTers); testcase << "PermissionedDomain 3"; doInvariantCheck( + Env(*this, features), {{"permissioned domain credentials aren't sorted"}}, [](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - slePd->setAccountID(sfOwner, A1); - slePd->setFieldU32(sfSequence, 10); + auto slePd = createPermissionedDomain(ac, A1, A2, 0); STArray credentials(sfAcceptedCredentials, 2); for (std::size_t n = 0; n < 2; ++n) @@ -1210,21 +1242,19 @@ class Invariants_test : public beast::unit_test::suite credentials.push_back(std::move(cred)); } slePd->setFieldArray(sfAcceptedCredentials, credentials); - ac.view().insert(slePd); + ac.view().update(slePd); return true; }, XRPAmount{}, STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject&) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + fixPDEnabled ? failTers : badTers); testcase << "PermissionedDomain 4"; doInvariantCheck( + Env(*this, features), {{"permissioned domain credentials aren't unique"}}, [](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - slePd->setAccountID(sfOwner, A1); - slePd->setFieldU32(sfSequence, 10); + auto slePd = createPermissionedDomain(ac, A1, A2, 0); STArray credentials(sfAcceptedCredentials, 2); for (std::size_t n = 0; n < 2; ++n) @@ -1235,22 +1265,20 @@ class Invariants_test : public beast::unit_test::suite credentials.push_back(std::move(cred)); } slePd->setFieldArray(sfAcceptedCredentials, credentials); - ac.view().insert(slePd); + ac.view().update(slePd); return true; }, XRPAmount{}, - STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject& tx) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject&) {}}, + fixPDEnabled ? failTers : badTers); testcase << "PermissionedDomain Set 1"; doInvariantCheck( + Env(*this, features), {{"permissioned domain with no rules."}}, [&](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - // create PD - createPermissionedDomain(ac, slePd, A1, A2); + auto slePd = createPermissionedDomain(ac, A1, A2); // update PD with empty rules { @@ -1262,18 +1290,16 @@ class Invariants_test : public beast::unit_test::suite return true; }, XRPAmount{}, - STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject& tx) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject&) {}}, + fixPDEnabled ? failTers : badTers); testcase << "PermissionedDomain Set 2"; doInvariantCheck( + Env(*this, features), {{"permissioned domain bad credentials size " + std::to_string(tooBig)}}, [&](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - // create PD - createPermissionedDomain(ac, slePd, A1, A2); + auto slePd = createPermissionedDomain(ac, A1, A2); // update PD { @@ -1295,18 +1321,16 @@ class Invariants_test : public beast::unit_test::suite return true; }, XRPAmount{}, - STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject& tx) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject&) {}}, + fixPDEnabled ? failTers : badTers); testcase << "PermissionedDomain Set 3"; doInvariantCheck( + Env(*this, features), {{"permissioned domain credentials aren't sorted"}}, [&](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - // create PD - createPermissionedDomain(ac, slePd, A1, A2); + auto slePd = createPermissionedDomain(ac, A1, A2); // update PD { @@ -1327,18 +1351,16 @@ class Invariants_test : public beast::unit_test::suite return true; }, XRPAmount{}, - STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject& tx) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject&) {}}, + fixPDEnabled ? failTers : badTers); testcase << "PermissionedDomain Set 4"; doInvariantCheck( + Env(*this, features), {{"permissioned domain credentials aren't unique"}}, [&](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - // create PD - createPermissionedDomain(ac, slePd, A1, A2); + auto slePd = createPermissionedDomain(ac, A1, A2); // update PD { @@ -1357,8 +1379,155 @@ class Invariants_test : public beast::unit_test::suite return true; }, XRPAmount{}, - STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject& tx) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject&) {}}, + fixPDEnabled ? failTers : badTers); + + std::initializer_list goodTers = {tesSUCCESS, tesSUCCESS}; + + std::vector badMoreThan1{{"transaction affected more than 1 permissioned domain entry."}}; + std::vector emptyV; + std::vector badNoDomains{{"no domain objects affected by"}}; + std::vector badNotDeleted{{"domain object modified, but not deleted by "}}; + std::vector badDeleted{{"domain object deleted by"}}; + std::vector badTx{{"domain object(s) affected by an unauthorized transaction."}}; + + { + testcase << "PermissionedDomain set 2 domains "; + doInvariantCheck( + Env(*this, features), + fixPDEnabled ? badMoreThan1 : emptyV, + [](Account const& A1, Account const& A2, ApplyContext& ac) { + createPermissionedDomain(ac, A1, A2); + createPermissionedDomain(ac, A1, A2, 2, 11); + return true; + }, + XRPAmount{}, + STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject&) {}}, + fixPDEnabled ? failTers : goodTers); + } + + { + testcase << "PermissionedDomain del 2 domains"; + + Env env1(*this, features); + + Account const A1{"A1"}; + Account const A2{"A2"}; + env1.fund(XRP(1000), A1, A2); + env1.close(); + + [[maybe_unused]] auto [seq1, pd1] = createPermissionedDomainEnv(env1, A1, A2); + [[maybe_unused]] auto [seq2, pd2] = createPermissionedDomainEnv(env1, A1, A2); + env1.close(); + + doInvariantCheck( + std::move(env1), + A1, + A2, + fixPDEnabled ? badMoreThan1 : emptyV, + [&pd1, &pd2](Account const&, Account const&, ApplyContext& ac) { + auto sle1 = ac.view().peek({ltPERMISSIONED_DOMAIN, pd1}); + auto sle2 = ac.view().peek({ltPERMISSIONED_DOMAIN, pd2}); + ac.view().erase(sle1); + ac.view().erase(sle2); + return true; + }, + XRPAmount{}, + STTx{ttPERMISSIONED_DOMAIN_DELETE, [](STObject&) {}}, + fixPDEnabled ? failTers : goodTers); + } + + { + testcase << "PermissionedDomain set 0 domains "; + doInvariantCheck( + Env(*this, features), + fixPDEnabled ? badNoDomains : emptyV, + [](Account const&, Account const&, ApplyContext&) { return true; }, + XRPAmount{}, + STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject&) {}}, + fixPDEnabled ? badTers : goodTers); + } + + { + testcase << "PermissionedDomain del 0 domains"; + + Env env1(*this, features); + + Account const A1{"A1"}; + Account const A2{"A2"}; + env1.fund(XRP(1000), A1, A2); + env1.close(); + + [[maybe_unused]] auto [seq1, pd1] = createPermissionedDomainEnv(env1, A1, A2); + [[maybe_unused]] auto [seq2, pd2] = createPermissionedDomainEnv(env1, A1, A2); + env1.close(); + + doInvariantCheck( + Env(*this, features), + A1, + A2, + fixPDEnabled ? badNoDomains : emptyV, + [](Account const&, Account const&, ApplyContext&) { return true; }, + XRPAmount{}, + STTx{ttPERMISSIONED_DOMAIN_DELETE, [](STObject&) {}}, + fixPDEnabled ? badTers : goodTers); + } + + { + testcase << "PermissionedDomain set, delete domain"; + + Env env1(*this, features); + + Account const A1{"A1"}; + Account const A2{"A2"}; + env1.fund(XRP(1000), A1, A2); + env1.close(); + + [[maybe_unused]] auto [seq1, pd1] = createPermissionedDomainEnv(env1, A1, A2); + env1.close(); + + doInvariantCheck( + std::move(env1), + A1, + A2, + fixPDEnabled ? badDeleted : emptyV, + [&pd1](Account const&, Account const&, ApplyContext& ac) { + auto sle1 = ac.view().peek({ltPERMISSIONED_DOMAIN, pd1}); + ac.view().erase(sle1); + return true; + }, + XRPAmount{}, + STTx{ttPERMISSIONED_DOMAIN_SET, [](STObject&) {}}, + fixPDEnabled ? failTers : goodTers); + } + + { + testcase << "PermissionedDomain del, create domain "; + doInvariantCheck( + Env(*this, features), + fixPDEnabled ? badNotDeleted : emptyV, + [](Account const& A1, Account const& A2, ApplyContext& ac) { + createPermissionedDomain(ac, A1, A2); + return true; + }, + XRPAmount{}, + STTx{ttPERMISSIONED_DOMAIN_DELETE, [](STObject&) {}}, + fixPDEnabled ? failTers : goodTers); + } + + { + testcase << "PermissionedDomain invalid tx"; + + doInvariantCheck( + fixPDEnabled ? badTx : emptyV, + [&](Account const& A1, Account const& A2, ApplyContext& ac) { + createPermissionedDomain(ac, A1, A2); + return true; + }, + XRPAmount{}, + STTx{ttPAYMENT, [](STObject&) {}}, + failTers); + } } void @@ -1478,13 +1647,43 @@ class Invariants_test : public beast::unit_test::suite }); } - void - testPermissionedDEX() + static std::pair + createPermissionedDomainEnv( + test::jtx::Env& env, + test::jtx::Account const& A1, + test::jtx::Account const& A2, + std::uint32_t numCreds = 2) { using namespace test::jtx; - testcase << "PermissionedDEX"; + + pdomain::Credentials credentials; + + for (std::size_t n = 0; n < numCreds; ++n) + { + auto credType = "cred_type" + std::to_string(n); + credentials.push_back({A2, credType}); + } + + std::uint32_t const seq = env.seq(A1); + env(pdomain::setTx(A1, credentials)); + uint256 key = pdomain::getNewDomain(env.meta()); + + // std::cout << "PD, acc: " << A1.id() << ", seq: " << seq << ", k: " << + // key << std::endl; + return {seq, key}; + } + + void + testPermissionedDEX(FeatureBitset features) + { + using namespace test::jtx; + + bool const fixPDEnabled = features[fixPermissionedDomainInvariant]; + + testcase << "PermissionedDEX" + std::string(fixPDEnabled ? " fix" : ""); doInvariantCheck( + Env(*this, features), {{"domain doesn't exist"}}, [](Account const& A1, Account const&, ApplyContext& ac) { Keylet const offerKey = keylet::offer(A1.id(), 10); @@ -1511,12 +1710,9 @@ class Invariants_test : public beast::unit_test::suite // missing domain ID in offer object doInvariantCheck( + Env(*this, features), {{"hybrid offer is malformed"}}, [&](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - createPermissionedDomain(ac, slePd, A1, A2); - Keylet const offerKey = keylet::offer(A2.id(), 10); auto sleOffer = std::make_shared(offerKey); sleOffer->setAccountID(sfAccount, A2); @@ -1531,116 +1727,154 @@ class Invariants_test : public beast::unit_test::suite return true; }, XRPAmount{}, - STTx{ttOFFER_CREATE, [&](STObject& tx) {}}, + STTx{ttOFFER_CREATE, [&](STObject&) {}}, {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); // more than one entry in sfAdditionalBooks - doInvariantCheck( - {{"hybrid offer is malformed"}}, - [&](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - createPermissionedDomain(ac, slePd, A1, A2); + { + Env env1(*this, features); - Keylet const offerKey = keylet::offer(A2.id(), 10); - auto sleOffer = std::make_shared(offerKey); - sleOffer->setAccountID(sfAccount, A2); - sleOffer->setFieldAmount(sfTakerPays, A1["USD"](10)); - sleOffer->setFieldAmount(sfTakerGets, XRP(1)); - sleOffer->setFlag(lsfHybrid); - sleOffer->setFieldH256(sfDomainID, pdKeylet.key); + Account const A1{"A1"}; + Account const A2{"A2"}; + env1.fund(XRP(1000), A1, A2); + env1.close(); - STArray bookArr; - bookArr.push_back(STObject::makeInnerObject(sfBook)); - bookArr.push_back(STObject::makeInnerObject(sfBook)); - sleOffer->setFieldArray(sfAdditionalBooks, bookArr); - ac.view().insert(sleOffer); - return true; - }, - XRPAmount{}, - STTx{ttOFFER_CREATE, [&](STObject& tx) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + [[maybe_unused]] auto [seq1, pd1] = createPermissionedDomainEnv(env1, A1, A2); + env1.close(); + + doInvariantCheck( + std::move(env1), + A1, + A2, + {{"hybrid offer is malformed"}}, + [&pd1](Account const& A1, Account const& A2, ApplyContext& ac) { + Keylet const offerKey = keylet::offer(A2.id(), 10); + auto sleOffer = std::make_shared(offerKey); + sleOffer->setAccountID(sfAccount, A2); + sleOffer->setFieldAmount(sfTakerPays, A1["USD"](10)); + sleOffer->setFieldAmount(sfTakerGets, XRP(1)); + sleOffer->setFlag(lsfHybrid); + sleOffer->setFieldH256(sfDomainID, pd1); + + STArray bookArr; + bookArr.push_back(STObject::makeInnerObject(sfBook)); + bookArr.push_back(STObject::makeInnerObject(sfBook)); + sleOffer->setFieldArray(sfAdditionalBooks, bookArr); + ac.view().insert(sleOffer); + return true; + }, + XRPAmount{}, + STTx{ttOFFER_CREATE, [&](STObject&) {}}, + {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + } // hybrid offer missing sfAdditionalBooks - doInvariantCheck( - {{"hybrid offer is malformed"}}, - [&](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - createPermissionedDomain(ac, slePd, A1, A2); + { + Env env1(*this, features); - Keylet const offerKey = keylet::offer(A2.id(), 10); - auto sleOffer = std::make_shared(offerKey); - sleOffer->setAccountID(sfAccount, A2); - sleOffer->setFieldAmount(sfTakerPays, A1["USD"](10)); - sleOffer->setFieldAmount(sfTakerGets, XRP(1)); - sleOffer->setFlag(lsfHybrid); - sleOffer->setFieldH256(sfDomainID, pdKeylet.key); - ac.view().insert(sleOffer); - return true; - }, - XRPAmount{}, - STTx{ttOFFER_CREATE, [&](STObject& tx) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + Account const A1{"A1"}; + Account const A2{"A2"}; + env1.fund(XRP(1000), A1, A2); + env1.close(); - doInvariantCheck( - {{"transaction consumed wrong domains"}}, - [&](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - createPermissionedDomain(ac, slePd, A1, A2); + [[maybe_unused]] auto [seq1, pd1] = createPermissionedDomainEnv(env1, A1, A2); + env1.close(); - Keylet const badDomainKeylet = keylet::permissionedDomain(A1.id(), 20); - auto sleBadPd = std::make_shared(badDomainKeylet); - createPermissionedDomain(ac, sleBadPd, A1, A2); + doInvariantCheck( + std::move(env1), + A1, + A2, + {{"hybrid offer is malformed"}}, + [&pd1](Account const& A1, Account const& A2, ApplyContext& ac) { + Keylet const offerKey = keylet::offer(A2.id(), 10); + auto sleOffer = std::make_shared(offerKey); + sleOffer->setAccountID(sfAccount, A2); + sleOffer->setFieldAmount(sfTakerPays, A1["USD"](10)); + sleOffer->setFieldAmount(sfTakerGets, XRP(1)); + sleOffer->setFlag(lsfHybrid); + sleOffer->setFieldH256(sfDomainID, pd1); + ac.view().insert(sleOffer); + return true; + }, + XRPAmount{}, + STTx{ttOFFER_CREATE, [&](STObject&) {}}, + {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + } - Keylet const offerKey = keylet::offer(A2.id(), 10); - auto sleOffer = std::make_shared(offerKey); - sleOffer->setAccountID(sfAccount, A2); - sleOffer->setFieldAmount(sfTakerPays, A1["USD"](10)); - sleOffer->setFieldAmount(sfTakerGets, XRP(1)); - sleOffer->setFieldH256(sfDomainID, pdKeylet.key); - ac.view().insert(sleOffer); - return true; - }, - XRPAmount{}, - STTx{ - ttOFFER_CREATE, - [&](STObject& tx) { - Account const A1{"A1"}; - Keylet const badDomainKey = keylet::permissionedDomain(A1.id(), 20); - tx.setFieldH256(sfDomainID, badDomainKey.key); - tx.setFieldAmount(sfTakerPays, A1["USD"](10)); - tx.setFieldAmount(sfTakerGets, XRP(1)); - }}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + { + Env env1(*this, features); - doInvariantCheck( - {{"domain transaction affected regular offers"}}, - [&](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const pdKeylet = keylet::permissionedDomain(A1.id(), 10); - auto slePd = std::make_shared(pdKeylet); - createPermissionedDomain(ac, slePd, A1, A2); + Account const A1{"A1"}; + Account const A2{"A2"}; + env1.fund(XRP(1000), A1, A2); + env1.close(); - Keylet const offerKey = keylet::offer(A2.id(), 10); - auto sleOffer = std::make_shared(offerKey); - sleOffer->setAccountID(sfAccount, A2); - sleOffer->setFieldAmount(sfTakerPays, A1["USD"](10)); - sleOffer->setFieldAmount(sfTakerGets, XRP(1)); - ac.view().insert(sleOffer); - return true; - }, - XRPAmount{}, - STTx{ - ttOFFER_CREATE, - [&](STObject& tx) { - Account const A1{"A1"}; - Keylet const domainKey = keylet::permissionedDomain(A1.id(), 10); - tx.setFieldH256(sfDomainID, domainKey.key); - tx.setFieldAmount(sfTakerPays, A1["USD"](10)); - tx.setFieldAmount(sfTakerGets, XRP(1)); - }}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + [[maybe_unused]] auto [seq1, pd1] = createPermissionedDomainEnv(env1, A1, A2); + [[maybe_unused]] auto [seq2, pd2] = createPermissionedDomainEnv(env1, A1, A2); + env1.close(); + + doInvariantCheck( + std::move(env1), + A1, + A2, + {{"transaction consumed wrong domains"}}, + [&pd1](Account const& A1, Account const& A2, ApplyContext& ac) { + Keylet const offerKey = keylet::offer(A2.id(), 10); + auto sleOffer = std::make_shared(offerKey); + sleOffer->setAccountID(sfAccount, A2); + sleOffer->setFieldAmount(sfTakerPays, A1["USD"](10)); + sleOffer->setFieldAmount(sfTakerGets, XRP(1)); + sleOffer->setFieldH256(sfDomainID, pd1); + ac.view().insert(sleOffer); + return true; + }, + XRPAmount{}, + STTx{ + ttOFFER_CREATE, + [&pd2, &A1](STObject& tx) { + tx.setFieldH256(sfDomainID, pd2); + tx.setFieldAmount(sfTakerPays, A1["USD"](10)); + tx.setFieldAmount(sfTakerGets, XRP(1)); + }}, + {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + } + + { + Env env1(*this, features); + + Account const A1{"A1"}; + Account const A2{"A2"}; + env1.fund(XRP(1000), A1, A2); + env1.close(); + + [[maybe_unused]] auto [seq1, pd1] = createPermissionedDomainEnv(env1, A1, A2); + env1.close(); + + doInvariantCheck( + std::move(env1), + A1, + A2, + {{"domain transaction affected regular offers"}}, + [&](Account const& A1, Account const& A2, ApplyContext& ac) { + Keylet const offerKey = keylet::offer(A2.id(), 10); + auto sleOffer = std::make_shared(offerKey); + sleOffer->setAccountID(sfAccount, A2); + sleOffer->setFieldAmount(sfTakerPays, A1["USD"](10)); + sleOffer->setFieldAmount(sfTakerGets, XRP(1)); + ac.view().insert(sleOffer); + return true; + }, + XRPAmount{}, + STTx{ + ttOFFER_CREATE, + [&](STObject& tx) { + Account const A1{"A1"}; + tx.setFieldH256(sfDomainID, pd1); + tx.setFieldAmount(sfTakerPays, A1["USD"](10)); + tx.setFieldAmount(sfTakerGets, XRP(1)); + }}, + {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); + } } Keylet @@ -3490,8 +3724,10 @@ public: testNoZeroEscrow(); testValidNewAccountRoot(); testNFTokenPageInvariants(); - testPermissionedDomainInvariants(); - testPermissionedDEX(); + testPermissionedDomainInvariants(defaultAmendments() | fixPermissionedDomainInvariant); + testPermissionedDomainInvariants(defaultAmendments() - fixPermissionedDomainInvariant); + testPermissionedDEX(defaultAmendments() | fixPermissionedDomainInvariant); + testPermissionedDEX(defaultAmendments() - fixPermissionedDomainInvariant); testNoModifiedUnmodifiableFields(); testValidPseudoAccounts(); testValidLoanBroker(); diff --git a/src/test/app/PermissionedDomains_test.cpp b/src/test/app/PermissionedDomains_test.cpp index 1a1fe9a9eb..8485202144 100644 --- a/src/test/app/PermissionedDomains_test.cpp +++ b/src/test/app/PermissionedDomains_test.cpp @@ -38,13 +38,17 @@ class PermissionedDomains_test : public beast::unit_test::suite testable_amendments() // | featurePermissionedDomains | featureCredentials}; + FeatureBitset withFix_{ + testable_amendments() // + | featurePermissionedDomains | featureCredentials}; + // Verify that each tx type can execute if the feature is enabled. void - testEnabled() + testEnabled(FeatureBitset features) { testcase("Enabled"); Account const alice("alice"); - Env env(*this, withFeature_); + Env env(*this, features); env.fund(XRP(1000), alice); pdomain::Credentials credentials{{alice, "first credential"}}; env(pdomain::setTx(alice, credentials)); @@ -237,10 +241,10 @@ class PermissionedDomains_test : public beast::unit_test::suite // Test PermissionedDomainSet void - testSet() + testSet(FeatureBitset features) { testcase("Set"); - Env env(*this, withFeature_); + Env env(*this, features); env.set_parse_failure_expected(true); int const accNum = 12; @@ -395,10 +399,10 @@ class PermissionedDomains_test : public beast::unit_test::suite // Test PermissionedDomainDelete void - testDelete() + testDelete(FeatureBitset features) { testcase("Delete"); - Env env(*this, withFeature_); + Env env(*this, features); Account const alice("alice"); env.fund(XRP(1000), alice); @@ -448,14 +452,14 @@ class PermissionedDomains_test : public beast::unit_test::suite } void - testAccountReserve() + testAccountReserve(FeatureBitset features) { // Verify that the reserve behaves as expected for creating. testcase("Account Reserve"); using namespace test::jtx; - Env env(*this, withFeature_); + Env env(*this, features); Account const alice("alice"); // Fund alice enough to exist, but not enough to meet @@ -500,12 +504,16 @@ public: void run() override { - testEnabled(); + testEnabled(withFeature_); + testEnabled(withFix_); testCredentialsDisabled(); testDisabled(); - testSet(); - testDelete(); - testAccountReserve(); + testSet(withFeature_); + testSet(withFix_); + testDelete(withFeature_); + testDelete(withFix_); + testAccountReserve(withFeature_); + testAccountReserve(withFix_); } }; diff --git a/src/test/jtx/impl/balance.cpp b/src/test/jtx/impl/balance.cpp index 9d6f5c6124..1ebeeed437 100644 --- a/src/test/jtx/impl/balance.cpp +++ b/src/test/jtx/impl/balance.cpp @@ -4,6 +4,10 @@ namespace xrpl { namespace test { namespace jtx { +#define TEST_EXPECT(cond) env.test.expect(cond, __FILE__, __LINE__) +#define TEST_EXPECTS(cond, reason) \ + ((cond) ? (env.test.pass(), true) : (env.test.fail((reason), __FILE__, __LINE__), false)) + void doBalance(Env& env, AccountID const& account, bool none, STAmount const& value, Issue const& issue) { @@ -12,11 +16,13 @@ doBalance(Env& env, AccountID const& account, bool none, STAmount const& value, auto const sle = env.le(keylet::account(account)); if (none) { - env.test.expect(!sle); + TEST_EXPECT(!sle); } - else if (env.test.expect(sle)) + else if (TEST_EXPECT(sle)) { - env.test.expect(sle->getFieldAmount(sfBalance) == value); + TEST_EXPECTS( + sle->getFieldAmount(sfBalance) == value, + sle->getFieldAmount(sfBalance).getText() + " / " + value.getText()); } } else @@ -24,15 +30,15 @@ doBalance(Env& env, AccountID const& account, bool none, STAmount const& value, auto const sle = env.le(keylet::line(account, issue)); if (none) { - env.test.expect(!sle); + TEST_EXPECT(!sle); } - else if (env.test.expect(sle)) + else if (TEST_EXPECT(sle)) { auto amount = sle->getFieldAmount(sfBalance); amount.setIssuer(issue.account); if (account > issue.account) amount.negate(); - env.test.expect(amount == value); + TEST_EXPECTS(amount == value, amount.getText()); } } } @@ -43,12 +49,12 @@ doBalance(Env& env, AccountID const& account, bool none, STAmount const& value, auto const sle = env.le(keylet::mptoken(mptIssue.getMptID(), account)); if (none) { - env.test.expect(!sle); + TEST_EXPECT(!sle); } - else if (env.test.expect(sle)) + else if (TEST_EXPECT(sle)) { STAmount const amount{mptIssue, sle->getFieldU64(sfMPTAmount)}; - env.test.expect(amount == value); + TEST_EXPECT(amount == value); } } diff --git a/src/xrpld/app/tx/detail/InvariantCheck.cpp b/src/xrpld/app/tx/detail/InvariantCheck.cpp index fe47449c36..24a37270ce 100644 --- a/src/xrpld/app/tx/detail/InvariantCheck.cpp +++ b/src/xrpld/app/tx/detail/InvariantCheck.cpp @@ -1507,7 +1507,7 @@ ValidMPTIssuance::finalize( void ValidPermissionedDomain::visitEntry( - bool, + bool isDel, std::shared_ptr const& before, std::shared_ptr const& after) { @@ -1516,39 +1516,29 @@ ValidPermissionedDomain::visitEntry( if (after && after->getType() != ltPERMISSIONED_DOMAIN) return; - auto check = [](SleStatus& sleStatus, std::shared_ptr const& sle) { + auto check = [isDel](std::vector& sleStatus, std::shared_ptr const& sle) { auto const& credentials = sle->getFieldArray(sfAcceptedCredentials); - sleStatus.credentialsSize_ = credentials.size(); auto const sorted = credentials::makeSorted(credentials); - sleStatus.isUnique_ = !sorted.empty(); + + SleStatus ss{credentials.size(), false, !sorted.empty(), isDel}; // If array have duplicates then all the other checks are invalid - sleStatus.isSorted_ = false; - - if (sleStatus.isUnique_) + if (ss.isUnique_) { unsigned i = 0; for (auto const& cred : sorted) { auto const& credTx = credentials[i++]; - sleStatus.isSorted_ = (cred.first == credTx[sfIssuer]) && (cred.second == credTx[sfCredentialType]); - if (!sleStatus.isSorted_) + ss.isSorted_ = (cred.first == credTx[sfIssuer]) && (cred.second == credTx[sfCredentialType]); + if (!ss.isSorted_) break; } } + sleStatus.emplace_back(std::move(ss)); }; - if (before) - { - sleStatus_[0] = SleStatus(); - check(*sleStatus_[0], after); - } - if (after) - { - sleStatus_[1] = SleStatus(); - check(*sleStatus_[1], after); - } + check(sleStatus_, after); } bool @@ -1559,9 +1549,6 @@ ValidPermissionedDomain::finalize( ReadView const& view, beast::Journal const& j) { - if (tx.getTxnType() != ttPERMISSIONED_DOMAIN_SET || result != tesSUCCESS) - return true; - auto check = [](SleStatus const& sleStatus, beast::Journal const& j) { if (!sleStatus.credentialsSize_) { @@ -1595,7 +1582,76 @@ ValidPermissionedDomain::finalize( return true; }; - return (sleStatus_[0] ? check(*sleStatus_[0], j) : true) && (sleStatus_[1] ? check(*sleStatus_[1], j) : true); + if (view.rules().enabled(fixPermissionedDomainInvariant)) + { + // No permissioned domains should be affected if the transaction failed + if (result != tesSUCCESS) + // If nothing changed, all is good. If there were changes, that's + // bad. + return sleStatus_.empty(); + + if (sleStatus_.size() > 1) + { + JLOG(j.fatal()) << "Invariant failed: transaction affected more " + "than 1 permissioned domain entry."; + return false; + } + + switch (tx.getTxnType()) + { + case ttPERMISSIONED_DOMAIN_SET: { + if (sleStatus_.empty()) + { + JLOG(j.fatal()) << "Invariant failed: no domain objects affected by " + "PermissionedDomainSet"; + return false; + } + + auto const& sleStatus = sleStatus_[0]; + if (sleStatus.isDelete_) + { + JLOG(j.fatal()) << "Invariant failed: domain object " + "deleted by PermissionedDomainSet"; + return false; + } + return check(sleStatus, j); + } + case ttPERMISSIONED_DOMAIN_DELETE: { + if (sleStatus_.empty()) + { + JLOG(j.fatal()) << "Invariant failed: no domain objects affected by " + "PermissionedDomainDelete"; + return false; + } + + if (!sleStatus_[0].isDelete_) + { + JLOG(j.fatal()) << "Invariant failed: domain object " + "modified, but not deleted by " + "PermissionedDomainDelete"; + return false; + } + return true; + } + default: { + if (!sleStatus_.empty()) + { + JLOG(j.fatal()) << "Invariant failed: " << sleStatus_.size() + << " domain object(s) affected by an " + "unauthorized transaction. " + << tx.getTxnType(); + return false; + } + return true; + } + } + } + else + { + if (tx.getTxnType() != ttPERMISSIONED_DOMAIN_SET || result != tesSUCCESS || sleStatus_.empty()) + return true; + return check(sleStatus_[0], j); + } } //------------------------------------------------------------------------------ diff --git a/src/xrpld/app/tx/detail/InvariantCheck.h b/src/xrpld/app/tx/detail/InvariantCheck.h index 9a20e372ba..7e9a62d9e2 100644 --- a/src/xrpld/app/tx/detail/InvariantCheck.h +++ b/src/xrpld/app/tx/detail/InvariantCheck.h @@ -449,9 +449,11 @@ class ValidPermissionedDomain struct SleStatus { std::size_t credentialsSize_{0}; - bool isSorted_ = false, isUnique_ = false; + bool isSorted_ = false; + bool isUnique_ = false; + bool isDelete_ = false; }; - std::optional sleStatus_[2]; + std::vector sleStatus_; public: void From ef284692db4588082eac8106b1f5262bf1ad7534 Mon Sep 17 00:00:00 2001 From: Jingchen Date: Wed, 11 Feb 2026 13:42:31 +0000 Subject: [PATCH 23/26] refactor: Modularize WalletDB and Manifest (#6223) 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. --- .../scripts/levelization/results/loops.txt | 5 +- .../scripts/levelization/results/ordering.txt | 18 +- cmake/XrplCore.cmake | 21 +- cmake/XrplInstall.cmake | 1 + .../xrpl/core}/PeerReservationTable.h | 0 include/xrpl/core/ServiceRegistry.h | 24 ++ include/xrpl/core/StartUpType.h | 16 ++ .../app/main => include/xrpl/rdb}/DBInit.h | 0 .../core => include/xrpl/rdb}/DatabaseCon.h | 16 +- {src/xrpld/core => include/xrpl/rdb}/SociDB.h | 0 .../misc => include/xrpl/server}/Manifest.h | 0 .../app/rdb => include/xrpl/server}/State.h | 8 +- .../app/rdb => include/xrpl/server}/Vacuum.h | 2 +- .../app/rdb => include/xrpl/server}/Wallet.h | 7 +- src/libxrpl/rdb/DatabaseCon.cpp | 92 +++++++ .../core/detail => libxrpl/rdb}/SociDB.cpp | 6 +- .../rdb/detail => libxrpl/server}/State.cpp | 2 +- .../rdb/detail => libxrpl/server}/Vacuum.cpp | 4 +- .../rdb/detail => libxrpl/server}/Wallet.cpp | 3 +- src/test/app/LedgerLoad_test.cpp | 22 +- src/test/app/Manifest_test.cpp | 6 +- src/test/app/ValidatorKeys_test.cpp | 2 +- src/test/core/SociDB_test.cpp | 3 +- src/test/nodestore/Database_test.cpp | 3 +- src/test/rpc/LedgerEntry_test.cpp | 4 +- src/xrpld/app/ledger/Ledger.cpp | 1 - src/xrpld/app/main/Application.cpp | 26 +- src/xrpld/app/main/Application.h | 14 +- src/xrpld/app/main/Main.cpp | 16 +- src/xrpld/app/main/NodeIdentity.cpp | 3 +- src/xrpld/app/misc/SHAMapStoreImp.cpp | 2 +- src/xrpld/app/misc/SHAMapStoreImp.h | 4 +- src/xrpld/app/misc/ValidatorList.h | 2 +- src/xrpld/app/misc/detail/AmendmentTable.cpp | 2 +- src/xrpld/app/misc/detail/Manifest.cpp | 7 +- src/xrpld/app/misc/detail/ValidatorKeys.cpp | 2 +- src/xrpld/app/rdb/PeerFinder.h | 3 +- src/xrpld/app/rdb/RelationalDatabase.h | 8 +- src/xrpld/app/rdb/backend/detail/Node.cpp | 8 +- .../app/rdb/backend/detail/SQLiteDatabase.cpp | 48 ++-- .../app/rdb/detail/RelationalDatabase.cpp | 7 +- src/xrpld/core/Config.h | 8 +- src/xrpld/core/detail/Config.cpp | 146 +++++++++++ src/xrpld/core/detail/DatabaseCon.cpp | 242 ------------------ src/xrpld/overlay/detail/OverlayImpl.cpp | 2 +- .../overlay/detail/PeerReservationTable.cpp | 4 +- src/xrpld/peerfinder/detail/StoreSqdb.h | 3 +- src/xrpld/rpc/InfoSub.h | 3 +- 48 files changed, 435 insertions(+), 391 deletions(-) rename {src/xrpld/overlay => include/xrpl/core}/PeerReservationTable.h (100%) create mode 100644 include/xrpl/core/StartUpType.h rename {src/xrpld/app/main => include/xrpl/rdb}/DBInit.h (100%) rename {src/xrpld/core => include/xrpl/rdb}/DatabaseCon.h (93%) rename {src/xrpld/core => include/xrpl/rdb}/SociDB.h (100%) rename {src/xrpld/app/misc => include/xrpl/server}/Manifest.h (100%) rename {src/xrpld/app/rdb => include/xrpl/server}/State.h (91%) rename {src/xrpld/app/rdb => include/xrpl/server}/Vacuum.h (90%) rename {src/xrpld/app/rdb => include/xrpl/server}/Wallet.h (96%) create mode 100644 src/libxrpl/rdb/DatabaseCon.cpp rename src/{xrpld/core/detail => libxrpl/rdb}/SociDB.cpp (98%) rename src/{xrpld/app/rdb/detail => libxrpl/server}/State.cpp (98%) rename src/{xrpld/app/rdb/detail => libxrpl/server}/Vacuum.cpp (96%) rename src/{xrpld/app/rdb/detail => libxrpl/server}/Wallet.cpp (99%) delete mode 100644 src/xrpld/core/detail/DatabaseCon.cpp diff --git a/.github/scripts/levelization/results/loops.txt b/.github/scripts/levelization/results/loops.txt index d15843ceb0..34842d7f48 100644 --- a/.github/scripts/levelization/results/loops.txt +++ b/.github/scripts/levelization/results/loops.txt @@ -4,14 +4,11 @@ Loop: test.jtx test.toplevel Loop: test.jtx test.unit_test test.unit_test == test.jtx -Loop: xrpld.app xrpld.core - xrpld.app > xrpld.core - Loop: xrpld.app xrpld.overlay xrpld.overlay > xrpld.app Loop: xrpld.app xrpld.peerfinder - xrpld.peerfinder ~= xrpld.app + xrpld.peerfinder == xrpld.app Loop: xrpld.app xrpld.rpc xrpld.rpc > xrpld.app diff --git a/.github/scripts/levelization/results/ordering.txt b/.github/scripts/levelization/results/ordering.txt index 88a3441fa1..fabc7b49ca 100644 --- a/.github/scripts/levelization/results/ordering.txt +++ b/.github/scripts/levelization/results/ordering.txt @@ -17,12 +17,15 @@ libxrpl.nodestore > xrpl.protocol libxrpl.protocol > xrpl.basics libxrpl.protocol > xrpl.json libxrpl.protocol > xrpl.protocol +libxrpl.rdb > xrpl.basics +libxrpl.rdb > xrpl.rdb libxrpl.resource > xrpl.basics libxrpl.resource > xrpl.json libxrpl.resource > xrpl.resource libxrpl.server > xrpl.basics libxrpl.server > xrpl.json libxrpl.server > xrpl.protocol +libxrpl.server > xrpl.rdb libxrpl.server > xrpl.server libxrpl.shamap > xrpl.basics libxrpl.shamap > xrpl.protocol @@ -41,7 +44,9 @@ test.app > xrpl.json test.app > xrpl.ledger test.app > xrpl.nodestore test.app > xrpl.protocol +test.app > xrpl.rdb test.app > xrpl.resource +test.app > xrpl.server test.basics > test.jtx test.basics > test.unit_test test.basics > xrpl.basics @@ -67,6 +72,7 @@ test.core > xrpl.basics test.core > xrpl.core test.core > xrpld.core test.core > xrpl.json +test.core > xrpl.rdb test.core > xrpl.server test.csf > xrpl.basics test.csf > xrpld.consensus @@ -95,8 +101,8 @@ test.nodestore > test.jtx test.nodestore > test.toplevel test.nodestore > test.unit_test test.nodestore > xrpl.basics -test.nodestore > xrpld.core test.nodestore > xrpl.nodestore +test.nodestore > xrpl.rdb test.overlay > test.jtx test.overlay > test.toplevel test.overlay > test.unit_test @@ -154,6 +160,7 @@ tests.libxrpl > xrpl.net xrpl.core > xrpl.basics xrpl.core > xrpl.json xrpl.core > xrpl.ledger +xrpl.core > xrpl.protocol xrpl.json > xrpl.basics xrpl.ledger > xrpl.basics xrpl.ledger > xrpl.protocol @@ -162,12 +169,16 @@ xrpl.nodestore > xrpl.basics xrpl.nodestore > xrpl.protocol xrpl.protocol > xrpl.basics xrpl.protocol > xrpl.json +xrpl.rdb > xrpl.basics +xrpl.rdb > xrpl.core xrpl.resource > xrpl.basics xrpl.resource > xrpl.json xrpl.resource > xrpl.protocol xrpl.server > xrpl.basics +xrpl.server > xrpl.core xrpl.server > xrpl.json xrpl.server > xrpl.protocol +xrpl.server > xrpl.rdb xrpl.shamap > xrpl.basics xrpl.shamap > xrpl.nodestore xrpl.shamap > xrpl.protocol @@ -176,12 +187,15 @@ xrpld.app > xrpl.basics xrpld.app > xrpl.core xrpld.app > xrpld.conditions xrpld.app > xrpld.consensus +xrpld.app > xrpld.core xrpld.app > xrpl.json xrpld.app > xrpl.ledger xrpld.app > xrpl.net xrpld.app > xrpl.nodestore xrpld.app > xrpl.protocol +xrpld.app > xrpl.rdb xrpld.app > xrpl.resource +xrpld.app > xrpl.server xrpld.app > xrpl.shamap xrpld.conditions > xrpl.basics xrpld.conditions > xrpl.protocol @@ -193,6 +207,7 @@ xrpld.core > xrpl.core xrpld.core > xrpl.json xrpld.core > xrpl.net xrpld.core > xrpl.protocol +xrpld.core > xrpl.rdb xrpld.overlay > xrpl.basics xrpld.overlay > xrpl.core xrpld.overlay > xrpld.core @@ -204,6 +219,7 @@ xrpld.overlay > xrpl.server xrpld.peerfinder > xrpl.basics xrpld.peerfinder > xrpld.core xrpld.peerfinder > xrpl.protocol +xrpld.peerfinder > xrpl.rdb xrpld.perflog > xrpl.basics xrpld.perflog > xrpl.core xrpld.perflog > xrpld.rpc diff --git a/cmake/XrplCore.cmake b/cmake/XrplCore.cmake index 57d0e83348..cea19db9bc 100644 --- a/cmake/XrplCore.cmake +++ b/cmake/XrplCore.cmake @@ -84,9 +84,6 @@ add_module(xrpl net) target_link_libraries(xrpl.libxrpl.net PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json xrpl.libxrpl.protocol xrpl.libxrpl.resource) -add_module(xrpl server) -target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol) - add_module(xrpl nodestore) target_link_libraries(xrpl.libxrpl.nodestore PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json xrpl.libxrpl.protocol) @@ -94,8 +91,15 @@ add_module(xrpl shamap) target_link_libraries(xrpl.libxrpl.shamap PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.crypto xrpl.libxrpl.protocol xrpl.libxrpl.nodestore) +add_module(xrpl rdb) +target_link_libraries(xrpl.libxrpl.rdb PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.core) + +add_module(xrpl server) +target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol xrpl.libxrpl.core xrpl.libxrpl.rdb) + add_module(xrpl ledger) -target_link_libraries(xrpl.libxrpl.ledger PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json xrpl.libxrpl.protocol) +target_link_libraries(xrpl.libxrpl.ledger PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json xrpl.libxrpl.protocol + xrpl.libxrpl.rdb) add_library(xrpl.libxrpl) set_target_properties(xrpl.libxrpl PROPERTIES OUTPUT_NAME xrpl) @@ -113,13 +117,14 @@ target_link_modules( core crypto json + ledger + net + nodestore protocol + rdb resource server - nodestore - shamap - net - ledger) + shamap) # All headers in libxrpl are in modules. # Uncomment this stanza if you have not yet moved new headers into a module. diff --git a/cmake/XrplInstall.cmake b/cmake/XrplInstall.cmake index 141dc56089..340dca553b 100644 --- a/cmake/XrplInstall.cmake +++ b/cmake/XrplInstall.cmake @@ -23,6 +23,7 @@ install(TARGETS common xrpl.libxrpl.core xrpl.libxrpl.crypto xrpl.libxrpl.json + xrpl.libxrpl.rdb xrpl.libxrpl.ledger xrpl.libxrpl.net xrpl.libxrpl.nodestore diff --git a/src/xrpld/overlay/PeerReservationTable.h b/include/xrpl/core/PeerReservationTable.h similarity index 100% rename from src/xrpld/overlay/PeerReservationTable.h rename to include/xrpl/core/PeerReservationTable.h diff --git a/include/xrpl/core/ServiceRegistry.h b/include/xrpl/core/ServiceRegistry.h index 7147242339..86591a815f 100644 --- a/include/xrpl/core/ServiceRegistry.h +++ b/include/xrpl/core/ServiceRegistry.h @@ -5,6 +5,8 @@ #include #include +#include + namespace xrpl { // Forward declarations @@ -18,6 +20,10 @@ namespace perf { class PerfLog; } +// This is temporary until we migrate all code to use ServiceRegistry. +class Application; + +// Forward declarations class AcceptedLedger; class AmendmentTable; class Cluster; @@ -194,6 +200,24 @@ public: virtual perf::PerfLog& getPerfLog() = 0; + + // Configuration and state + virtual bool + isStopping() const = 0; + + virtual beast::Journal + journal(std::string const& name) = 0; + + virtual boost::asio::io_context& + getIOContext() = 0; + + virtual Logs& + logs() = 0; + + // Temporary: Get the underlying Application for functions that haven't + // been migrated yet. This should be removed once all code is migrated. + virtual Application& + app() = 0; }; } // namespace xrpl diff --git a/include/xrpl/core/StartUpType.h b/include/xrpl/core/StartUpType.h new file mode 100644 index 0000000000..74a1898806 --- /dev/null +++ b/include/xrpl/core/StartUpType.h @@ -0,0 +1,16 @@ +#pragma once + +#include +#include + +namespace xrpl { + +enum class StartUpType { FRESH, NORMAL, LOAD, LOAD_FILE, REPLAY, NETWORK }; + +inline std::ostream& +operator<<(std::ostream& os, StartUpType const& type) +{ + return os << static_cast>(type); +} + +} // namespace xrpl diff --git a/src/xrpld/app/main/DBInit.h b/include/xrpl/rdb/DBInit.h similarity index 100% rename from src/xrpld/app/main/DBInit.h rename to include/xrpl/rdb/DBInit.h diff --git a/src/xrpld/core/DatabaseCon.h b/include/xrpl/rdb/DatabaseCon.h similarity index 93% rename from src/xrpld/core/DatabaseCon.h rename to include/xrpl/rdb/DatabaseCon.h index 89d582257b..37a53044e4 100644 --- a/src/xrpld/core/DatabaseCon.h +++ b/include/xrpl/rdb/DatabaseCon.h @@ -1,10 +1,9 @@ #pragma once -#include -#include -#include - #include +#include +#include +#include #include @@ -68,7 +67,7 @@ public: { explicit Setup() = default; - Config::StartUpType startUp = Config::NORMAL; + StartUpType startUp = StartUpType::NORMAL; bool standAlone = false; boost::filesystem::path dataDir; // Indicates whether or not to return the `globalPragma` @@ -105,8 +104,8 @@ public: beast::Journal journal) // Use temporary files or regular DB files? : DatabaseCon( - setup.standAlone && setup.startUp != Config::LOAD && setup.startUp != Config::LOAD_FILE && - setup.startUp != Config::REPLAY + setup.standAlone && setup.startUp != StartUpType::LOAD && setup.startUp != StartUpType::LOAD_FILE && + setup.startUp != StartUpType::REPLAY ? "" : (setup.dataDir / dbName), setup.commonPragma(), @@ -229,7 +228,4 @@ private: std::shared_ptr checkpointerFromId(std::uintptr_t id); -DatabaseCon::Setup -setup_DatabaseCon(Config const& c, std::optional j = std::nullopt); - } // namespace xrpl diff --git a/src/xrpld/core/SociDB.h b/include/xrpl/rdb/SociDB.h similarity index 100% rename from src/xrpld/core/SociDB.h rename to include/xrpl/rdb/SociDB.h diff --git a/src/xrpld/app/misc/Manifest.h b/include/xrpl/server/Manifest.h similarity index 100% rename from src/xrpld/app/misc/Manifest.h rename to include/xrpl/server/Manifest.h diff --git a/src/xrpld/app/rdb/State.h b/include/xrpl/server/State.h similarity index 91% rename from src/xrpld/app/rdb/State.h rename to include/xrpl/server/State.h index 52118b3cf8..48e11869f4 100644 --- a/src/xrpld/app/rdb/State.h +++ b/include/xrpl/server/State.h @@ -1,10 +1,8 @@ #pragma once -#include -#include -#include -#include -#include +#include +#include +#include #include diff --git a/src/xrpld/app/rdb/Vacuum.h b/include/xrpl/server/Vacuum.h similarity index 90% rename from src/xrpld/app/rdb/Vacuum.h rename to include/xrpl/server/Vacuum.h index f592b4537e..5f80eced87 100644 --- a/src/xrpld/app/rdb/Vacuum.h +++ b/include/xrpl/server/Vacuum.h @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace xrpl { diff --git a/src/xrpld/app/rdb/Wallet.h b/include/xrpl/server/Wallet.h similarity index 96% rename from src/xrpld/app/rdb/Wallet.h rename to include/xrpl/server/Wallet.h index 141ef53f27..dcfbada8eb 100644 --- a/src/xrpld/app/rdb/Wallet.h +++ b/include/xrpl/server/Wallet.h @@ -1,9 +1,8 @@ #pragma once -#include -#include -#include -#include +#include +#include +#include namespace xrpl { diff --git a/src/libxrpl/rdb/DatabaseCon.cpp b/src/libxrpl/rdb/DatabaseCon.cpp new file mode 100644 index 0000000000..344df85b4a --- /dev/null +++ b/src/libxrpl/rdb/DatabaseCon.cpp @@ -0,0 +1,92 @@ +#include +#include +#include +#include + +#include +#include + +#include +#include + +namespace xrpl { + +class CheckpointersCollection +{ + std::uintptr_t nextId_{0}; + // Mutex protects the CheckpointersCollection + std::mutex mutex_; + // Each checkpointer is given a unique id. All the checkpointers that are + // part of a DatabaseCon are part of this collection. When the DatabaseCon + // is destroyed, its checkpointer is removed from the collection + std::unordered_map> checkpointers_; + +public: + std::shared_ptr + fromId(std::uintptr_t id) + { + std::lock_guard l{mutex_}; + auto it = checkpointers_.find(id); + if (it != checkpointers_.end()) + return it->second; + return {}; + } + + void + erase(std::uintptr_t id) + { + std::lock_guard lock{mutex_}; + checkpointers_.erase(id); + } + + std::shared_ptr + create(std::shared_ptr const& session, JobQueue& jobQueue, Logs& logs) + { + std::lock_guard lock{mutex_}; + auto const id = nextId_++; + auto const r = makeCheckpointer(id, session, jobQueue, logs); + checkpointers_[id] = r; + return r; + } +}; + +CheckpointersCollection checkpointers; + +std::shared_ptr +checkpointerFromId(std::uintptr_t id) +{ + return checkpointers.fromId(id); +} + +DatabaseCon::~DatabaseCon() +{ + if (checkpointer_) + { + checkpointers.erase(checkpointer_->id()); + + std::weak_ptr wk(checkpointer_); + checkpointer_.reset(); + + // The references to our Checkpointer held by 'checkpointer_' and + // 'checkpointers' have been removed, so if the use count is nonzero, a + // checkpoint is currently in progress. Wait for it to end, otherwise + // creating a new DatabaseCon to the same database may fail due to the + // database being locked by our (now old) Checkpointer. + while (wk.use_count()) + { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } + } +} + +std::unique_ptr const> DatabaseCon::Setup::globalPragma; + +void +DatabaseCon::setupCheckpointing(JobQueue* q, Logs& l) +{ + if (!q) + Throw("No JobQueue"); + checkpointer_ = checkpointers.create(session_, *q, l); +} + +} // namespace xrpl diff --git a/src/xrpld/core/detail/SociDB.cpp b/src/libxrpl/rdb/SociDB.cpp similarity index 98% rename from src/xrpld/core/detail/SociDB.cpp rename to src/libxrpl/rdb/SociDB.cpp index ff2fa1d9c1..2f8c5f1ac6 100644 --- a/src/xrpld/core/detail/SociDB.cpp +++ b/src/libxrpl/rdb/SociDB.cpp @@ -3,12 +3,10 @@ #pragma clang diagnostic ignored "-Wdeprecated" #endif -#include -#include -#include - #include #include +#include +#include #include diff --git a/src/xrpld/app/rdb/detail/State.cpp b/src/libxrpl/server/State.cpp similarity index 98% rename from src/xrpld/app/rdb/detail/State.cpp rename to src/libxrpl/server/State.cpp index ad8944e54d..4e3a1584c2 100644 --- a/src/xrpld/app/rdb/detail/State.cpp +++ b/src/libxrpl/server/State.cpp @@ -1,4 +1,4 @@ -#include +#include namespace xrpl { diff --git a/src/xrpld/app/rdb/detail/Vacuum.cpp b/src/libxrpl/server/Vacuum.cpp similarity index 96% rename from src/xrpld/app/rdb/detail/Vacuum.cpp rename to src/libxrpl/server/Vacuum.cpp index 5aaa04f040..cb31c6fa7a 100644 --- a/src/xrpld/app/rdb/detail/Vacuum.cpp +++ b/src/libxrpl/server/Vacuum.cpp @@ -1,7 +1,9 @@ -#include +#include #include +#include + namespace xrpl { bool diff --git a/src/xrpld/app/rdb/detail/Wallet.cpp b/src/libxrpl/server/Wallet.cpp similarity index 99% rename from src/xrpld/app/rdb/detail/Wallet.cpp rename to src/libxrpl/server/Wallet.cpp index 88a5dcf985..51f1326674 100644 --- a/src/xrpld/app/rdb/detail/Wallet.cpp +++ b/src/libxrpl/server/Wallet.cpp @@ -1,4 +1,5 @@ -#include +#include +#include #include diff --git a/src/test/app/LedgerLoad_test.cpp b/src/test/app/LedgerLoad_test.cpp index f27edadd58..b4e84a3123 100644 --- a/src/test/app/LedgerLoad_test.cpp +++ b/src/test/app/LedgerLoad_test.cpp @@ -21,7 +21,7 @@ class LedgerLoad_test : public beast::unit_test::suite std::unique_ptr cfg, std::string const& dbPath, std::string const& ledger, - Config::StartUpType type, + StartUpType type, std::optional trapTxHash) { cfg->START_LEDGER = ledger; @@ -105,7 +105,7 @@ class LedgerLoad_test : public beast::unit_test::suite // create a new env with the ledger file specified for startup Env env( *this, - envconfig(ledgerConfig, sd.dbPath, sd.ledgerFile, Config::LOAD_FILE, std::nullopt), + envconfig(ledgerConfig, sd.dbPath, sd.ledgerFile, StartUpType::LOAD_FILE, std::nullopt), nullptr, beast::severities::kDisabled); auto jrb = env.rpc("ledger", "current", "full")[jss::result]; @@ -123,7 +123,7 @@ class LedgerLoad_test : public beast::unit_test::suite except([&] { Env env( *this, - envconfig(ledgerConfig, sd.dbPath, "", Config::LOAD_FILE, std::nullopt), + envconfig(ledgerConfig, sd.dbPath, "", StartUpType::LOAD_FILE, std::nullopt), nullptr, beast::severities::kDisabled); }); @@ -132,7 +132,7 @@ class LedgerLoad_test : public beast::unit_test::suite except([&] { Env env( *this, - envconfig(ledgerConfig, sd.dbPath, "badfile.json", Config::LOAD_FILE, std::nullopt), + envconfig(ledgerConfig, sd.dbPath, "badfile.json", StartUpType::LOAD_FILE, std::nullopt), nullptr, beast::severities::kDisabled); }); @@ -153,7 +153,7 @@ class LedgerLoad_test : public beast::unit_test::suite except([&] { Env env( *this, - envconfig(ledgerConfig, sd.dbPath, ledgerFileCorrupt.string(), Config::LOAD_FILE, std::nullopt), + envconfig(ledgerConfig, sd.dbPath, ledgerFileCorrupt.string(), StartUpType::LOAD_FILE, std::nullopt), nullptr, beast::severities::kDisabled); }); @@ -170,7 +170,7 @@ class LedgerLoad_test : public beast::unit_test::suite boost::erase_all(ledgerHash, "\""); Env env( *this, - envconfig(ledgerConfig, sd.dbPath, ledgerHash, Config::LOAD, std::nullopt), + envconfig(ledgerConfig, sd.dbPath, ledgerHash, StartUpType::LOAD, std::nullopt), nullptr, beast::severities::kDisabled); auto jrb = env.rpc("ledger", "current", "full")[jss::result]; @@ -189,7 +189,7 @@ class LedgerLoad_test : public beast::unit_test::suite boost::erase_all(ledgerHash, "\""); Env env( *this, - envconfig(ledgerConfig, sd.dbPath, ledgerHash, Config::REPLAY, std::nullopt), + envconfig(ledgerConfig, sd.dbPath, ledgerHash, StartUpType::REPLAY, std::nullopt), nullptr, beast::severities::kDisabled); auto const jrb = env.rpc("ledger", "current", "full")[jss::result]; @@ -213,7 +213,7 @@ class LedgerLoad_test : public beast::unit_test::suite boost::erase_all(ledgerHash, "\""); Env env( *this, - envconfig(ledgerConfig, sd.dbPath, ledgerHash, Config::REPLAY, sd.trapTxHash), + envconfig(ledgerConfig, sd.dbPath, ledgerHash, StartUpType::REPLAY, sd.trapTxHash), nullptr, beast::severities::kDisabled); auto const jrb = env.rpc("ledger", "current", "full")[jss::result]; @@ -241,7 +241,7 @@ class LedgerLoad_test : public beast::unit_test::suite // replay when trapTxHash is set to an invalid transaction Env env( *this, - envconfig(ledgerConfig, sd.dbPath, ledgerHash, Config::REPLAY, ~sd.trapTxHash), + envconfig(ledgerConfig, sd.dbPath, ledgerHash, StartUpType::REPLAY, ~sd.trapTxHash), nullptr, beast::severities::kDisabled); BEAST_EXPECT(false); @@ -265,7 +265,7 @@ class LedgerLoad_test : public beast::unit_test::suite // create a new env with the ledger "latest" specified for startup Env env( *this, - envconfig(ledgerConfig, sd.dbPath, "latest", Config::LOAD, std::nullopt), + envconfig(ledgerConfig, sd.dbPath, "latest", StartUpType::LOAD, std::nullopt), nullptr, beast::severities::kDisabled); auto jrb = env.rpc("ledger", "current", "full")[jss::result]; @@ -281,7 +281,7 @@ class LedgerLoad_test : public beast::unit_test::suite // create a new env with specific ledger index at startup Env env( *this, - envconfig(ledgerConfig, sd.dbPath, "43", Config::LOAD, std::nullopt), + envconfig(ledgerConfig, sd.dbPath, "43", StartUpType::LOAD, std::nullopt), nullptr, beast::severities::kDisabled); auto jrb = env.rpc("ledger", "current", "full")[jss::result]; diff --git a/src/test/app/Manifest_test.cpp b/src/test/app/Manifest_test.cpp index 598949f662..5b7e34ad5b 100644 --- a/src/test/app/Manifest_test.cpp +++ b/src/test/app/Manifest_test.cpp @@ -1,15 +1,15 @@ #include -#include -#include #include -#include #include #include #include #include #include +#include +#include +#include #include #include diff --git a/src/test/app/ValidatorKeys_test.cpp b/src/test/app/ValidatorKeys_test.cpp index fac8a4bb7e..c688b2661f 100644 --- a/src/test/app/ValidatorKeys_test.cpp +++ b/src/test/app/ValidatorKeys_test.cpp @@ -1,12 +1,12 @@ #include -#include #include #include #include #include #include +#include #include diff --git a/src/test/core/SociDB_test.cpp b/src/test/core/SociDB_test.cpp index 001022aa95..fe73d42b0a 100644 --- a/src/test/core/SociDB_test.cpp +++ b/src/test/core/SociDB_test.cpp @@ -1,9 +1,8 @@ #include -#include - #include #include +#include #include #include diff --git a/src/test/nodestore/Database_test.cpp b/src/test/nodestore/Database_test.cpp index 03f0c11990..1229923e7d 100644 --- a/src/test/nodestore/Database_test.cpp +++ b/src/test/nodestore/Database_test.cpp @@ -4,11 +4,10 @@ #include #include -#include - #include #include #include +#include namespace xrpl { diff --git a/src/test/rpc/LedgerEntry_test.cpp b/src/test/rpc/LedgerEntry_test.cpp index aa959629b1..5d12e7bb83 100644 --- a/src/test/rpc/LedgerEntry_test.cpp +++ b/src/test/rpc/LedgerEntry_test.cpp @@ -2050,7 +2050,7 @@ class LedgerEntry_test : public beast::unit_test::suite Account const bob{"bob"}; Env env{*this, envconfig([](auto cfg) { - cfg->START_UP = Config::FRESH; + cfg->START_UP = StartUpType::FRESH; return cfg; })}; @@ -2241,7 +2241,7 @@ class LedgerEntry_test : public beast::unit_test::suite Account const bob{"bob"}; Env env{*this, envconfig([](auto cfg) { - cfg->START_UP = Config::FRESH; + cfg->START_UP = StartUpType::FRESH; return cfg; })}; diff --git a/src/xrpld/app/ledger/Ledger.cpp b/src/xrpld/app/ledger/Ledger.cpp index 9ad08f9894..0f1b81d53d 100644 --- a/src/xrpld/app/ledger/Ledger.cpp +++ b/src/xrpld/app/ledger/Ledger.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 2c0d3c2b82..5f7a86e2c2 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -26,11 +25,8 @@ #include #include #include -#include #include -#include #include -#include #include #include #include @@ -40,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +46,9 @@ #include #include #include +#include #include +#include #include #include @@ -1021,6 +1020,12 @@ private: void setMaxDisallowedLedger(); + + Application& + app() override + { + return *this; + } }; //------------------------------------------------------------------------------ @@ -1116,18 +1121,21 @@ ApplicationImp::setup(boost::program_options::variables_map const& cmdline) auto const startUp = config_->START_UP; JLOG(m_journal.debug()) << "startUp: " << startUp; - if (startUp == Config::FRESH) + if (startUp == StartUpType::FRESH) { JLOG(m_journal.info()) << "Starting new Ledger"; startGenesisLedger(); } - else if (startUp == Config::LOAD || startUp == Config::LOAD_FILE || startUp == Config::REPLAY) + else if (startUp == StartUpType::LOAD || startUp == StartUpType::LOAD_FILE || startUp == StartUpType::REPLAY) { JLOG(m_journal.info()) << "Loading specified Ledger"; if (!loadOldLedger( - config_->START_LEDGER, startUp == Config::REPLAY, startUp == Config::LOAD_FILE, config_->TRAP_TX_HASH)) + config_->START_LEDGER, + startUp == StartUpType::REPLAY, + startUp == StartUpType::LOAD_FILE, + config_->TRAP_TX_HASH)) { JLOG(m_journal.error()) << "The specified ledger could not be loaded."; if (config_->FAST_LOAD) @@ -1142,7 +1150,7 @@ ApplicationImp::setup(boost::program_options::variables_map const& cmdline) } } } - else if (startUp == Config::NETWORK) + else if (startUp == StartUpType::NETWORK) { // This should probably become the default once we have a stable // network. @@ -1529,7 +1537,7 @@ void ApplicationImp::startGenesisLedger() { std::vector const initialAmendments = - (config_->START_UP == Config::FRESH) ? m_amendmentTable->getDesired() : std::vector{}; + (config_->START_UP == StartUpType::FRESH) ? m_amendmentTable->getDesired() : std::vector{}; std::shared_ptr const genesis = std::make_shared(create_genesis, *config_, initialAmendments, nodeFamily_); diff --git a/src/xrpld/app/main/Application.h b/src/xrpld/app/main/Application.h index 53cc264ad4..5ecc84c11c 100644 --- a/src/xrpld/app/main/Application.h +++ b/src/xrpld/app/main/Application.h @@ -1,10 +1,10 @@ #pragma once #include -#include #include #include +#include #include #include #include @@ -112,8 +112,6 @@ public: public: Application(); - virtual ~Application() = default; - virtual bool setup(boost::program_options::variables_map const& options) = 0; @@ -127,8 +125,6 @@ public: checkSigs() const = 0; virtual void checkSigs(bool) = 0; - virtual bool - isStopping() const = 0; // // --- @@ -138,14 +134,9 @@ public: virtual std::uint64_t instanceID() const = 0; - virtual Logs& - logs() = 0; virtual Config& config() = 0; - virtual boost::asio::io_context& - getIOContext() = 0; - virtual std::pair const& nodeIdentity() = 0; @@ -158,9 +149,6 @@ public: virtual bool serverOkay(std::string& reason) = 0; - virtual beast::Journal - journal(std::string const& name) = 0; - /* Returns the number of file descriptors the application needs */ virtual int fdRequired() const = 0; diff --git a/src/xrpld/app/main/Main.cpp b/src/xrpld/app/main/Main.cpp index aaf7af95ab..7bdccd12a7 100644 --- a/src/xrpld/app/main/Main.cpp +++ b/src/xrpld/app/main/Main.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -8,6 +7,7 @@ #include #include #include +#include #include #include @@ -601,7 +601,7 @@ run(int argc, char** argv) if (vm.count("start")) { - config->START_UP = Config::FRESH; + config->START_UP = StartUpType::FRESH; } if (vm.count("import")) @@ -612,7 +612,7 @@ run(int argc, char** argv) config->START_LEDGER = vm["ledger"].as(); if (vm.count("replay")) { - config->START_UP = Config::REPLAY; + config->START_UP = StartUpType::REPLAY; if (vm.count("trap_tx_hash")) { uint256 tmp = {}; @@ -631,16 +631,16 @@ run(int argc, char** argv) } } else - config->START_UP = Config::LOAD; + config->START_UP = StartUpType::LOAD; } else if (vm.count("ledgerfile")) { config->START_LEDGER = vm["ledgerfile"].as(); - config->START_UP = Config::LOAD_FILE; + config->START_UP = StartUpType::LOAD_FILE; } else if (vm.count("load") || config->FAST_LOAD) { - config->START_UP = Config::LOAD; + config->START_UP = StartUpType::LOAD; } if (vm.count("trap_tx_hash") && vm.count("replay") == 0) @@ -651,13 +651,13 @@ run(int argc, char** argv) if (vm.count("net") && !config->FAST_LOAD) { - if ((config->START_UP == Config::LOAD) || (config->START_UP == Config::REPLAY)) + if ((config->START_UP == StartUpType::LOAD) || (config->START_UP == StartUpType::REPLAY)) { std::cerr << "Net and load/replay options are incompatible" << std::endl; return -1; } - config->START_UP = Config::NETWORK; + config->START_UP = StartUpType::NETWORK; } if (vm.count("valid")) diff --git a/src/xrpld/app/main/NodeIdentity.cpp b/src/xrpld/app/main/NodeIdentity.cpp index b585b80b5b..3019caeb31 100644 --- a/src/xrpld/app/main/NodeIdentity.cpp +++ b/src/xrpld/app/main/NodeIdentity.cpp @@ -1,9 +1,10 @@ #include #include -#include #include #include +#include + namespace xrpl { std::pair diff --git a/src/xrpld/app/misc/SHAMapStoreImp.cpp b/src/xrpld/app/misc/SHAMapStoreImp.cpp index dbdd682ef8..7f276ca2d8 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.cpp +++ b/src/xrpld/app/misc/SHAMapStoreImp.cpp @@ -1,13 +1,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include diff --git a/src/xrpld/app/misc/SHAMapStoreImp.h b/src/xrpld/app/misc/SHAMapStoreImp.h index b046a78979..df3c16b24f 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.h +++ b/src/xrpld/app/misc/SHAMapStoreImp.h @@ -2,11 +2,11 @@ #include #include -#include -#include #include #include +#include +#include #include #include diff --git a/src/xrpld/app/misc/ValidatorList.h b/src/xrpld/app/misc/ValidatorList.h index 4fd610be04..f93ac8a32f 100644 --- a/src/xrpld/app/misc/ValidatorList.h +++ b/src/xrpld/app/misc/ValidatorList.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include @@ -9,6 +8,7 @@ #include #include #include +#include #include diff --git a/src/xrpld/app/misc/detail/AmendmentTable.cpp b/src/xrpld/app/misc/detail/AmendmentTable.cpp index 2942c8bde6..3addfd2235 100644 --- a/src/xrpld/app/misc/detail/AmendmentTable.cpp +++ b/src/xrpld/app/misc/detail/AmendmentTable.cpp @@ -1,12 +1,12 @@ #include #include -#include #include #include #include #include #include +#include #include #include diff --git a/src/xrpld/app/misc/detail/Manifest.cpp b/src/xrpld/app/misc/detail/Manifest.cpp index 952814656b..dfcbdbb3ad 100644 --- a/src/xrpld/app/misc/detail/Manifest.cpp +++ b/src/xrpld/app/misc/detail/Manifest.cpp @@ -1,13 +1,12 @@ -#include -#include -#include - #include #include #include #include #include #include +#include +#include +#include #include diff --git a/src/xrpld/app/misc/detail/ValidatorKeys.cpp b/src/xrpld/app/misc/detail/ValidatorKeys.cpp index 675ce4ac6f..8f24f14b40 100644 --- a/src/xrpld/app/misc/detail/ValidatorKeys.cpp +++ b/src/xrpld/app/misc/detail/ValidatorKeys.cpp @@ -1,10 +1,10 @@ -#include #include #include #include #include #include +#include namespace xrpl { ValidatorKeys::ValidatorKeys(Config const& config, beast::Journal j) diff --git a/src/xrpld/app/rdb/PeerFinder.h b/src/xrpld/app/rdb/PeerFinder.h index 2b4080255f..e5ac6dda8c 100644 --- a/src/xrpld/app/rdb/PeerFinder.h +++ b/src/xrpld/app/rdb/PeerFinder.h @@ -1,9 +1,10 @@ #pragma once #include -#include #include +#include + namespace xrpl { /** diff --git a/src/xrpld/app/rdb/RelationalDatabase.h b/src/xrpld/app/rdb/RelationalDatabase.h index c0cc61f757..078b8fe8db 100644 --- a/src/xrpld/app/rdb/RelationalDatabase.h +++ b/src/xrpld/app/rdb/RelationalDatabase.h @@ -1,13 +1,13 @@ #pragma once #include -#include #include #include -#include #include #include +#include +#include #include #include @@ -93,13 +93,13 @@ public: /** * @brief init Creates and returns an appropriate RelationalDatabase * instance based on configuration. - * @param app Application object. + * @param registry The service registry. * @param config Config object. * @param jobQueue JobQueue object. * @return Unique pointer to the interface. */ static std::unique_ptr - init(Application& app, Config const& config, JobQueue& jobQueue); + init(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue); virtual ~RelationalDatabase() = default; diff --git a/src/xrpld/app/rdb/backend/detail/Node.cpp b/src/xrpld/app/rdb/backend/detail/Node.cpp index 90c95f3a2d..1e814c3589 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.cpp +++ b/src/xrpld/app/rdb/backend/detail/Node.cpp @@ -5,12 +5,12 @@ #include #include #include -#include -#include #include #include #include +#include +#include #include @@ -64,8 +64,8 @@ makeLedgerDBs( tx->getSession() << boost::str( boost::format("PRAGMA cache_size=-%d;") % kilobytes(config.getValueFor(SizedItem::txnDBCache))); - if (!setup.standAlone || setup.startUp == Config::LOAD || setup.startUp == Config::LOAD_FILE || - setup.startUp == Config::REPLAY) + if (!setup.standAlone || setup.startUp == StartUpType::LOAD || setup.startUp == StartUpType::LOAD_FILE || + setup.startUp == StartUpType::REPLAY) { // Check if AccountTransactions has primary key std::string cid, name, type; diff --git a/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp b/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp index d65b12dc7f..4f1430ee4c 100644 --- a/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp +++ b/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp @@ -3,21 +3,21 @@ #include #include #include -#include -#include #include +#include +#include namespace xrpl { class SQLiteDatabaseImp final : public SQLiteDatabase { public: - SQLiteDatabaseImp(Application& app, Config const& config, JobQueue& jobQueue) - : app_(app), useTxTables_(config.useTxTables()), j_(app_.journal("SQLiteDatabaseImp")) + SQLiteDatabaseImp(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue) + : registry_(registry), useTxTables_(config.useTxTables()), j_(registry.journal("SQLiteDatabaseImp")) { DatabaseCon::Setup const setup = setup_DatabaseCon(config, j_); - if (!makeLedgerDBs(config, setup, DatabaseCon::CheckpointerSetup{&jobQueue, &app_.logs()})) + if (!makeLedgerDBs(config, setup, DatabaseCon::CheckpointerSetup{&jobQueue, ®istry_.logs()})) { std::string_view constexpr error = "Failed to create ledger databases"; @@ -139,7 +139,7 @@ public: closeTransactionDB() override; private: - Application& app_; + ServiceRegistry& registry_; bool const useTxTables_; beast::Journal j_; std::unique_ptr ledgerDb_, txdb_; @@ -370,7 +370,7 @@ SQLiteDatabaseImp::saveValidatedLedger(std::shared_ptr const& ledg { if (existsLedger()) { - if (!detail::saveValidatedLedger(*ledgerDb_, txdb_, app_, ledger, current)) + if (!detail::saveValidatedLedger(*ledgerDb_, txdb_, registry_.app(), ledger, current)) return false; } @@ -506,7 +506,7 @@ SQLiteDatabaseImp::getTxHistory(LedgerIndex startIndex) if (existsTransaction()) { auto db = checkoutTransaction(); - auto const res = detail::getTxHistory(*db, app_, startIndex, 20).first; + auto const res = detail::getTxHistory(*db, registry_.app(), startIndex, 20).first; if (!res.empty()) return res; @@ -521,12 +521,12 @@ SQLiteDatabaseImp::getOldestAccountTxs(AccountTxOptions const& options) if (!useTxTables_) return {}; - LedgerMaster& ledgerMaster = app_.getLedgerMaster(); + LedgerMaster& ledgerMaster = registry_.getLedgerMaster(); if (existsTransaction()) { auto db = checkoutTransaction(); - return detail::getOldestAccountTxs(*db, app_, ledgerMaster, options, j_).first; + return detail::getOldestAccountTxs(*db, registry_.app(), ledgerMaster, options, j_).first; } return {}; @@ -538,12 +538,12 @@ SQLiteDatabaseImp::getNewestAccountTxs(AccountTxOptions const& options) if (!useTxTables_) return {}; - LedgerMaster& ledgerMaster = app_.getLedgerMaster(); + LedgerMaster& ledgerMaster = registry_.getLedgerMaster(); if (existsTransaction()) { auto db = checkoutTransaction(); - return detail::getNewestAccountTxs(*db, app_, ledgerMaster, options, j_).first; + return detail::getNewestAccountTxs(*db, registry_.app(), ledgerMaster, options, j_).first; } return {}; @@ -558,7 +558,7 @@ SQLiteDatabaseImp::getOldestAccountTxsB(AccountTxOptions const& options) if (existsTransaction()) { auto db = checkoutTransaction(); - return detail::getOldestAccountTxsB(*db, app_, options, j_).first; + return detail::getOldestAccountTxsB(*db, registry_.app(), options, j_).first; } return {}; @@ -573,7 +573,7 @@ SQLiteDatabaseImp::getNewestAccountTxsB(AccountTxOptions const& options) if (existsTransaction()) { auto db = checkoutTransaction(); - return detail::getNewestAccountTxsB(*db, app_, options, j_).first; + return detail::getNewestAccountTxsB(*db, registry_.app(), options, j_).first; } return {}; @@ -586,10 +586,9 @@ SQLiteDatabaseImp::oldestAccountTxPage(AccountTxPageOptions const& options) return {}; static std::uint32_t const page_length(200); - auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(app_), std::placeholders::_1); + auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(registry_.app()), std::placeholders::_1); AccountTxs ret; - Application& app = app_; - auto onTransaction = [&ret, &app]( + auto onTransaction = [&ret, &app = registry_.app()]( std::uint32_t ledger_index, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) { convertBlobsToTxResult(ret, ledger_index, status, rawTxn, rawMeta, app); }; @@ -611,10 +610,9 @@ SQLiteDatabaseImp::newestAccountTxPage(AccountTxPageOptions const& options) return {}; static std::uint32_t const page_length(200); - auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(app_), std::placeholders::_1); + auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(registry_.app()), std::placeholders::_1); AccountTxs ret; - Application& app = app_; - auto onTransaction = [&ret, &app]( + auto onTransaction = [&ret, &app = registry_.app()]( std::uint32_t ledger_index, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) { convertBlobsToTxResult(ret, ledger_index, status, rawTxn, rawMeta, app); }; @@ -636,7 +634,7 @@ SQLiteDatabaseImp::oldestAccountTxPageB(AccountTxPageOptions const& options) return {}; static std::uint32_t const page_length(500); - auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(app_), std::placeholders::_1); + auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(registry_.app()), std::placeholders::_1); MetaTxsList ret; auto onTransaction = [&ret](std::uint32_t ledgerIndex, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) { ret.emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex); @@ -659,7 +657,7 @@ SQLiteDatabaseImp::newestAccountTxPageB(AccountTxPageOptions const& options) return {}; static std::uint32_t const page_length(500); - auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(app_), std::placeholders::_1); + auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(registry_.app()), std::placeholders::_1); MetaTxsList ret; auto onTransaction = [&ret](std::uint32_t ledgerIndex, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) { ret.emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex); @@ -687,7 +685,7 @@ SQLiteDatabaseImp::getTransaction( if (existsTransaction()) { auto db = checkoutTransaction(); - return detail::getTransaction(*db, app_, id, range, ec); + return detail::getTransaction(*db, registry_.app(), id, range, ec); } return TxSearched::unknown; @@ -769,9 +767,9 @@ SQLiteDatabaseImp::closeTransactionDB() } std::unique_ptr -getSQLiteDatabase(Application& app, Config const& config, JobQueue& jobQueue) +getSQLiteDatabase(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue) { - return std::make_unique(app, config, jobQueue); + return std::make_unique(registry, config, jobQueue); } } // namespace xrpl diff --git a/src/xrpld/app/rdb/detail/RelationalDatabase.cpp b/src/xrpld/app/rdb/detail/RelationalDatabase.cpp index 2ceb15d1e7..bc65a817a4 100644 --- a/src/xrpld/app/rdb/detail/RelationalDatabase.cpp +++ b/src/xrpld/app/rdb/detail/RelationalDatabase.cpp @@ -1,14 +1,13 @@ -#include #include #include namespace xrpl { extern std::unique_ptr -getSQLiteDatabase(Application& app, Config const& config, JobQueue& jobQueue); +getSQLiteDatabase(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue); std::unique_ptr -RelationalDatabase::init(Application& app, Config const& config, JobQueue& jobQueue) +RelationalDatabase::init(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue) { bool use_sqlite = false; @@ -31,7 +30,7 @@ RelationalDatabase::init(Application& app, Config const& config, JobQueue& jobQu if (use_sqlite) { - return getSQLiteDatabase(app, config, jobQueue); + return getSQLiteDatabase(registry, config, jobQueue); } return std::unique_ptr(); diff --git a/src/xrpld/core/Config.h b/src/xrpld/core/Config.h index 86b663a212..c40d13c83a 100644 --- a/src/xrpld/core/Config.h +++ b/src/xrpld/core/Config.h @@ -4,7 +4,9 @@ #include #include #include +#include #include // VFALCO Breaks levelization +#include #include // VFALCO FIX: This include should not be here @@ -124,8 +126,7 @@ public: // Entries from [ips_fixed] config stanza std::vector IPS_FIXED; - enum StartUpType { FRESH, NORMAL, LOAD, LOAD_FILE, REPLAY, NETWORK }; - StartUpType START_UP = NORMAL; + StartUpType START_UP = StartUpType::NORMAL; bool START_VALID = false; @@ -355,4 +356,7 @@ public: FeeSetup setup_FeeVote(Section const& section); +DatabaseCon::Setup +setup_DatabaseCon(Config const& c, std::optional j = std::nullopt); + } // namespace xrpl diff --git a/src/xrpld/core/detail/Config.cpp b/src/xrpld/core/detail/Config.cpp index 0a60416af7..4a2bae7c27 100644 --- a/src/xrpld/core/detail/Config.cpp +++ b/src/xrpld/core/detail/Config.cpp @@ -1039,4 +1039,150 @@ setup_FeeVote(Section const& section) return setup; } +DatabaseCon::Setup +setup_DatabaseCon(Config const& c, std::optional j) +{ + DatabaseCon::Setup setup; + + setup.startUp = c.START_UP; + setup.standAlone = c.standalone(); + setup.dataDir = c.legacy("database_path"); + if (!setup.standAlone && setup.dataDir.empty()) + { + Throw("database_path must be set."); + } + + if (!setup.globalPragma) + { + auto const& sqlite = c.section("sqlite"); + auto result = std::make_unique>(); + result->reserve(3); + + // defaults + std::string safety_level; + std::string journal_mode = "wal"; + std::string synchronous = "normal"; + std::string temp_store = "file"; + bool showRiskWarning = false; + + if (set(safety_level, "safety_level", sqlite)) + { + if (boost::iequals(safety_level, "low")) + { + // low safety defaults + journal_mode = "memory"; + synchronous = "off"; + temp_store = "memory"; + showRiskWarning = true; + } + else if (!boost::iequals(safety_level, "high")) + { + Throw("Invalid safety_level value: " + safety_level); + } + } + + { + // #journal_mode Valid values : delete, truncate, persist, + // memory, wal, off + if (set(journal_mode, "journal_mode", sqlite) && !safety_level.empty()) + { + Throw( + "Configuration file may not define both " + "\"safety_level\" and \"journal_mode\""); + } + bool higherRisk = boost::iequals(journal_mode, "memory") || boost::iequals(journal_mode, "off"); + showRiskWarning = showRiskWarning || higherRisk; + if (higherRisk || boost::iequals(journal_mode, "delete") || boost::iequals(journal_mode, "truncate") || + boost::iequals(journal_mode, "persist") || boost::iequals(journal_mode, "wal")) + { + result->emplace_back(boost::str(boost::format(CommonDBPragmaJournal) % journal_mode)); + } + else + { + Throw("Invalid journal_mode value: " + journal_mode); + } + } + + { + // #synchronous Valid values : off, normal, full, extra + if (set(synchronous, "synchronous", sqlite) && !safety_level.empty()) + { + Throw( + "Configuration file may not define both " + "\"safety_level\" and \"synchronous\""); + } + bool higherRisk = boost::iequals(synchronous, "off"); + showRiskWarning = showRiskWarning || higherRisk; + if (higherRisk || boost::iequals(synchronous, "normal") || boost::iequals(synchronous, "full") || + boost::iequals(synchronous, "extra")) + { + result->emplace_back(boost::str(boost::format(CommonDBPragmaSync) % synchronous)); + } + else + { + Throw("Invalid synchronous value: " + synchronous); + } + } + + { + // #temp_store Valid values : default, file, memory + if (set(temp_store, "temp_store", sqlite) && !safety_level.empty()) + { + Throw( + "Configuration file may not define both " + "\"safety_level\" and \"temp_store\""); + } + bool higherRisk = boost::iequals(temp_store, "memory"); + showRiskWarning = showRiskWarning || higherRisk; + if (higherRisk || boost::iequals(temp_store, "default") || boost::iequals(temp_store, "file")) + { + result->emplace_back(boost::str(boost::format(CommonDBPragmaTemp) % temp_store)); + } + else + { + Throw("Invalid temp_store value: " + temp_store); + } + } + + if (showRiskWarning && j && c.LEDGER_HISTORY > SQLITE_TUNING_CUTOFF) + { + JLOG(j->warn()) << "reducing the data integrity guarantees from the " + "default [sqlite] behavior is not recommended for " + "nodes storing large amounts of history, because of the " + "difficulty inherent in rebuilding corrupted data."; + } + XRPL_ASSERT(result->size() == 3, "xrpl::setup_DatabaseCon::globalPragma : result size is 3"); + setup.globalPragma = std::move(result); + } + setup.useGlobalPragma = true; + + auto setPragma = [](std::string& pragma, std::string const& key, int64_t value) { + pragma = "PRAGMA " + key + "=" + std::to_string(value) + ";"; + }; + + // Lgr Pragma + setPragma(setup.lgrPragma[0], "journal_size_limit", 1582080); + + // TX Pragma + int64_t page_size = 4096; + int64_t journal_size_limit = 1582080; + if (c.exists("sqlite")) + { + auto& s = c.section("sqlite"); + set(journal_size_limit, "journal_size_limit", s); + set(page_size, "page_size", s); + if (page_size < 512 || page_size > 65536) + Throw("Invalid page_size. Must be between 512 and 65536."); + + if (page_size & (page_size - 1)) + Throw("Invalid page_size. Must be a power of 2."); + } + + setPragma(setup.txPragma[0], "page_size", page_size); + setPragma(setup.txPragma[1], "journal_size_limit", journal_size_limit); + setPragma(setup.txPragma[2], "max_page_count", 4294967294); + setPragma(setup.txPragma[3], "mmap_size", 17179869184); + + return setup; +} } // namespace xrpl diff --git a/src/xrpld/core/detail/DatabaseCon.cpp b/src/xrpld/core/detail/DatabaseCon.cpp deleted file mode 100644 index 64f87f7a39..0000000000 --- a/src/xrpld/core/detail/DatabaseCon.cpp +++ /dev/null @@ -1,242 +0,0 @@ -#include -#include - -#include -#include - -#include -#include - -#include -#include - -namespace xrpl { - -class CheckpointersCollection -{ - std::uintptr_t nextId_{0}; - // Mutex protects the CheckpointersCollection - std::mutex mutex_; - // Each checkpointer is given a unique id. All the checkpointers that are - // part of a DatabaseCon are part of this collection. When the DatabaseCon - // is destroyed, its checkpointer is removed from the collection - std::unordered_map> checkpointers_; - -public: - std::shared_ptr - fromId(std::uintptr_t id) - { - std::lock_guard l{mutex_}; - auto it = checkpointers_.find(id); - if (it != checkpointers_.end()) - return it->second; - return {}; - } - - void - erase(std::uintptr_t id) - { - std::lock_guard lock{mutex_}; - checkpointers_.erase(id); - } - - std::shared_ptr - create(std::shared_ptr const& session, JobQueue& jobQueue, Logs& logs) - { - std::lock_guard lock{mutex_}; - auto const id = nextId_++; - auto const r = makeCheckpointer(id, session, jobQueue, logs); - checkpointers_[id] = r; - return r; - } -}; - -CheckpointersCollection checkpointers; - -std::shared_ptr -checkpointerFromId(std::uintptr_t id) -{ - return checkpointers.fromId(id); -} - -DatabaseCon::~DatabaseCon() -{ - if (checkpointer_) - { - checkpointers.erase(checkpointer_->id()); - - std::weak_ptr wk(checkpointer_); - checkpointer_.reset(); - - // The references to our Checkpointer held by 'checkpointer_' and - // 'checkpointers' have been removed, so if the use count is nonzero, a - // checkpoint is currently in progress. Wait for it to end, otherwise - // creating a new DatabaseCon to the same database may fail due to the - // database being locked by our (now old) Checkpointer. - while (wk.use_count()) - { - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - } - } -} - -DatabaseCon::Setup -setup_DatabaseCon(Config const& c, std::optional j) -{ - DatabaseCon::Setup setup; - - setup.startUp = c.START_UP; - setup.standAlone = c.standalone(); - setup.dataDir = c.legacy("database_path"); - if (!setup.standAlone && setup.dataDir.empty()) - { - Throw("database_path must be set."); - } - - if (!setup.globalPragma) - { - setup.globalPragma = [&c, &j]() { - auto const& sqlite = c.section("sqlite"); - auto result = std::make_unique>(); - result->reserve(3); - - // defaults - std::string safety_level; - std::string journal_mode = "wal"; - std::string synchronous = "normal"; - std::string temp_store = "file"; - bool showRiskWarning = false; - - if (set(safety_level, "safety_level", sqlite)) - { - if (boost::iequals(safety_level, "low")) - { - // low safety defaults - journal_mode = "memory"; - synchronous = "off"; - temp_store = "memory"; - showRiskWarning = true; - } - else if (!boost::iequals(safety_level, "high")) - { - Throw("Invalid safety_level value: " + safety_level); - } - } - - { - // #journal_mode Valid values : delete, truncate, persist, - // memory, wal, off - if (set(journal_mode, "journal_mode", sqlite) && !safety_level.empty()) - { - Throw( - "Configuration file may not define both " - "\"safety_level\" and \"journal_mode\""); - } - bool higherRisk = boost::iequals(journal_mode, "memory") || boost::iequals(journal_mode, "off"); - showRiskWarning = showRiskWarning || higherRisk; - if (higherRisk || boost::iequals(journal_mode, "delete") || boost::iequals(journal_mode, "truncate") || - boost::iequals(journal_mode, "persist") || boost::iequals(journal_mode, "wal")) - { - result->emplace_back(boost::str(boost::format(CommonDBPragmaJournal) % journal_mode)); - } - else - { - Throw("Invalid journal_mode value: " + journal_mode); - } - } - - { - // #synchronous Valid values : off, normal, full, extra - if (set(synchronous, "synchronous", sqlite) && !safety_level.empty()) - { - Throw( - "Configuration file may not define both " - "\"safety_level\" and \"synchronous\""); - } - bool higherRisk = boost::iequals(synchronous, "off"); - showRiskWarning = showRiskWarning || higherRisk; - if (higherRisk || boost::iequals(synchronous, "normal") || boost::iequals(synchronous, "full") || - boost::iequals(synchronous, "extra")) - { - result->emplace_back(boost::str(boost::format(CommonDBPragmaSync) % synchronous)); - } - else - { - Throw("Invalid synchronous value: " + synchronous); - } - } - - { - // #temp_store Valid values : default, file, memory - if (set(temp_store, "temp_store", sqlite) && !safety_level.empty()) - { - Throw( - "Configuration file may not define both " - "\"safety_level\" and \"temp_store\""); - } - bool higherRisk = boost::iequals(temp_store, "memory"); - showRiskWarning = showRiskWarning || higherRisk; - if (higherRisk || boost::iequals(temp_store, "default") || boost::iequals(temp_store, "file")) - { - result->emplace_back(boost::str(boost::format(CommonDBPragmaTemp) % temp_store)); - } - else - { - Throw("Invalid temp_store value: " + temp_store); - } - } - - if (showRiskWarning && j && c.LEDGER_HISTORY > SQLITE_TUNING_CUTOFF) - { - JLOG(j->warn()) << "reducing the data integrity guarantees from the " - "default [sqlite] behavior is not recommended for " - "nodes storing large amounts of history, because of the " - "difficulty inherent in rebuilding corrupted data."; - } - XRPL_ASSERT(result->size() == 3, "xrpl::setup_DatabaseCon::globalPragma : result size is 3"); - return result; - }(); - } - setup.useGlobalPragma = true; - - auto setPragma = [](std::string& pragma, std::string const& key, int64_t value) { - pragma = "PRAGMA " + key + "=" + std::to_string(value) + ";"; - }; - - // Lgr Pragma - setPragma(setup.lgrPragma[0], "journal_size_limit", 1582080); - - // TX Pragma - int64_t page_size = 4096; - int64_t journal_size_limit = 1582080; - if (c.exists("sqlite")) - { - auto& s = c.section("sqlite"); - set(journal_size_limit, "journal_size_limit", s); - set(page_size, "page_size", s); - if (page_size < 512 || page_size > 65536) - Throw("Invalid page_size. Must be between 512 and 65536."); - - if (page_size & (page_size - 1)) - Throw("Invalid page_size. Must be a power of 2."); - } - - setPragma(setup.txPragma[0], "page_size", page_size); - setPragma(setup.txPragma[1], "journal_size_limit", journal_size_limit); - setPragma(setup.txPragma[2], "max_page_count", 4294967294); - setPragma(setup.txPragma[3], "mmap_size", 17179869184); - - return setup; -} - -std::unique_ptr const> DatabaseCon::Setup::globalPragma; - -void -DatabaseCon::setupCheckpointing(JobQueue* q, Logs& l) -{ - if (!q) - Throw("No JobQueue"); - checkpointer_ = checkpointers.create(session_, *q, l); -} - -} // namespace xrpl diff --git a/src/xrpld/overlay/detail/OverlayImpl.cpp b/src/xrpld/overlay/detail/OverlayImpl.cpp index 350631b8e6..6ac6e454d2 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.cpp +++ b/src/xrpld/overlay/detail/OverlayImpl.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -20,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/overlay/detail/PeerReservationTable.cpp b/src/xrpld/overlay/detail/PeerReservationTable.cpp index 1e3452ca17..27d9df1129 100644 --- a/src/xrpld/overlay/detail/PeerReservationTable.cpp +++ b/src/xrpld/overlay/detail/PeerReservationTable.cpp @@ -1,10 +1,10 @@ #include -#include -#include +#include #include #include #include +#include #include #include diff --git a/src/xrpld/peerfinder/detail/StoreSqdb.h b/src/xrpld/peerfinder/detail/StoreSqdb.h index f5461d489a..b945ae970b 100644 --- a/src/xrpld/peerfinder/detail/StoreSqdb.h +++ b/src/xrpld/peerfinder/detail/StoreSqdb.h @@ -1,9 +1,10 @@ #pragma once #include -#include #include +#include + namespace xrpl { namespace PeerFinder { diff --git a/src/xrpld/rpc/InfoSub.h b/src/xrpld/rpc/InfoSub.h index 7d4d4f06c8..d49e401bd3 100644 --- a/src/xrpld/rpc/InfoSub.h +++ b/src/xrpld/rpc/InfoSub.h @@ -1,12 +1,11 @@ #pragma once -#include - #include #include #include #include #include +#include namespace xrpl { From 9f17d103480182c785ee4f76458728cb987f1178 Mon Sep 17 00:00:00 2001 From: Jingchen Date: Wed, 11 Feb 2026 16:22:01 +0000 Subject: [PATCH 24/26] refactor: Modularize RelationalDB (#6224) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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`. --- .../scripts/levelization/results/ordering.txt | 3 + include/xrpl/protocol/LedgerShortcut.h | 22 + include/xrpl/protocol/TxSearched.h | 7 + include/xrpl/rdb/RelationalDatabase.h | 475 ++++++++++++++++++ src/test/app/SHAMapStore_test.cpp | 8 +- src/test/rpc/Transaction_test.cpp | 6 +- src/xrpld/app/ledger/Ledger.cpp | 8 +- src/xrpld/app/ledger/detail/LedgerMaster.cpp | 2 +- src/xrpld/app/main/Application.cpp | 13 +- src/xrpld/app/misc/SHAMapStoreImp.cpp | 17 +- src/xrpld/app/misc/Transaction.h | 3 +- src/xrpld/app/misc/detail/AccountTxPaging.h | 2 +- src/xrpld/app/misc/detail/Transaction.cpp | 11 +- src/xrpld/app/rdb/RelationalDatabase.h | 226 --------- src/xrpld/app/rdb/backend/SQLiteDatabase.h | 298 +++++++++-- src/xrpld/app/rdb/backend/detail/Node.cpp | 2 +- src/xrpld/app/rdb/backend/detail/Node.h | 3 +- .../app/rdb/backend/detail/SQLiteDatabase.cpp | 296 +++-------- .../app/rdb/detail/RelationalDatabase.cpp | 39 -- src/xrpld/overlay/detail/OverlayImpl.cpp | 2 +- .../overlay/detail/PeerReservationTable.cpp | 3 +- src/xrpld/rpc/detail/RPCHelpers.cpp | 2 +- src/xrpld/rpc/detail/RPCLedgerHelpers.h | 3 +- src/xrpld/rpc/handlers/AccountTx.cpp | 16 +- src/xrpld/rpc/handlers/GetCounts.cpp | 11 +- src/xrpld/rpc/handlers/Tx.cpp | 3 +- src/xrpld/rpc/handlers/TxHistory.cpp | 2 +- 27 files changed, 862 insertions(+), 621 deletions(-) create mode 100644 include/xrpl/protocol/LedgerShortcut.h create mode 100644 include/xrpl/protocol/TxSearched.h create mode 100644 include/xrpl/rdb/RelationalDatabase.h delete mode 100644 src/xrpld/app/rdb/RelationalDatabase.h diff --git a/.github/scripts/levelization/results/ordering.txt b/.github/scripts/levelization/results/ordering.txt index fabc7b49ca..85f2457ea3 100644 --- a/.github/scripts/levelization/results/ordering.txt +++ b/.github/scripts/levelization/results/ordering.txt @@ -171,6 +171,7 @@ xrpl.protocol > xrpl.basics xrpl.protocol > xrpl.json xrpl.rdb > xrpl.basics xrpl.rdb > xrpl.core +xrpl.rdb > xrpl.protocol xrpl.resource > xrpl.basics xrpl.resource > xrpl.json xrpl.resource > xrpl.protocol @@ -214,6 +215,7 @@ xrpld.overlay > xrpld.core xrpld.overlay > xrpld.peerfinder xrpld.overlay > xrpl.json xrpld.overlay > xrpl.protocol +xrpld.overlay > xrpl.rdb xrpld.overlay > xrpl.resource xrpld.overlay > xrpl.server xrpld.peerfinder > xrpl.basics @@ -232,6 +234,7 @@ xrpld.rpc > xrpl.ledger xrpld.rpc > xrpl.net xrpld.rpc > xrpl.nodestore xrpld.rpc > xrpl.protocol +xrpld.rpc > xrpl.rdb xrpld.rpc > xrpl.resource xrpld.rpc > xrpl.server xrpld.shamap > xrpl.shamap diff --git a/include/xrpl/protocol/LedgerShortcut.h b/include/xrpl/protocol/LedgerShortcut.h new file mode 100644 index 0000000000..68c31c4c3c --- /dev/null +++ b/include/xrpl/protocol/LedgerShortcut.h @@ -0,0 +1,22 @@ +#pragma once + +namespace xrpl { + +/** + * @brief Enumeration of ledger shortcuts for specifying which ledger to use. + * + * These shortcuts provide a convenient way to reference commonly used ledgers + * without needing to specify their exact hash or sequence number. + */ +enum class LedgerShortcut { + /** The current working ledger (open, not yet closed) */ + Current, + + /** The most recently closed ledger (may not be validated) */ + Closed, + + /** The most recently validated ledger */ + Validated +}; + +} // namespace xrpl diff --git a/include/xrpl/protocol/TxSearched.h b/include/xrpl/protocol/TxSearched.h new file mode 100644 index 0000000000..e085bff315 --- /dev/null +++ b/include/xrpl/protocol/TxSearched.h @@ -0,0 +1,7 @@ +#pragma once + +namespace xrpl { + +enum class TxSearched { all, some, unknown }; + +} diff --git a/include/xrpl/rdb/RelationalDatabase.h b/include/xrpl/rdb/RelationalDatabase.h new file mode 100644 index 0000000000..b80c6c8331 --- /dev/null +++ b/include/xrpl/rdb/RelationalDatabase.h @@ -0,0 +1,475 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace xrpl { + +class Transaction; +class Ledger; + +struct LedgerHashPair +{ + uint256 ledgerHash; + uint256 parentHash; +}; + +struct LedgerRange +{ + uint32_t min; + uint32_t max; +}; + +class RelationalDatabase +{ +public: + struct CountMinMax + { + std::size_t numberOfRows; + LedgerIndex minLedgerSequence; + LedgerIndex maxLedgerSequence; + }; + + struct AccountTxMarker + { + std::uint32_t ledgerSeq = 0; + std::uint32_t txnSeq = 0; + }; + + struct AccountTxOptions + { + AccountID const& account; + std::uint32_t minLedger; + std::uint32_t maxLedger; + std::uint32_t offset; + std::uint32_t limit; + bool bUnlimited; + }; + + struct AccountTxPageOptions + { + AccountID const& account; + std::uint32_t minLedger; + std::uint32_t maxLedger; + std::optional marker; + std::uint32_t limit; + bool bAdmin; + }; + + using AccountTx = std::pair, std::shared_ptr>; + using AccountTxs = std::vector; + using txnMetaLedgerType = std::tuple; + using MetaTxsList = std::vector; + + using LedgerSequence = uint32_t; + using LedgerHash = uint256; + using LedgerSpecifier = std::variant; + + struct AccountTxArgs + { + AccountID account; + std::optional ledger; + bool binary = false; + bool forward = false; + uint32_t limit = 0; + std::optional marker; + }; + + struct AccountTxResult + { + std::variant transactions; + LedgerRange ledgerRange; + uint32_t limit; + std::optional marker; + }; + + virtual ~RelationalDatabase() = default; + + /** + * @brief getMinLedgerSeq Returns the minimum ledger sequence in the Ledgers + * table. + * @return Ledger sequence or no value if no ledgers exist. + */ + virtual std::optional + getMinLedgerSeq() = 0; + + /** + * @brief getMaxLedgerSeq Returns the maximum ledger sequence in the Ledgers + * table. + * @return Ledger sequence or none if no ledgers exist. + */ + virtual std::optional + getMaxLedgerSeq() = 0; + + /** + * @brief getLedgerInfoByIndex Returns a ledger by its sequence. + * @param ledgerSeq Ledger sequence. + * @return The ledger if found, otherwise no value. + */ + virtual std::optional + getLedgerInfoByIndex(LedgerIndex ledgerSeq) = 0; + + /** + * @brief getNewestLedgerInfo Returns the info of the newest saved ledger. + * @return Ledger info if found, otherwise no value. + */ + virtual std::optional + getNewestLedgerInfo() = 0; + + /** + * @brief getLedgerInfoByHash Returns the info of the ledger with given + * hash. + * @param ledgerHash Hash of the ledger. + * @return Ledger if found, otherwise no value. + */ + virtual std::optional + getLedgerInfoByHash(uint256 const& ledgerHash) = 0; + + /** + * @brief getHashByIndex Returns the hash of the ledger with the given + * sequence. + * @param ledgerIndex Ledger sequence. + * @return Hash of the ledger. + */ + virtual uint256 + getHashByIndex(LedgerIndex ledgerIndex) = 0; + + /** + * @brief getHashesByIndex Returns the hashes of the ledger and its parent + * as specified by the ledgerIndex. + * @param ledgerIndex Ledger sequence. + * @return Struct LedgerHashPair which contains hashes of the ledger and + * its parent. + */ + virtual std::optional + getHashesByIndex(LedgerIndex ledgerIndex) = 0; + + /** + * @brief getHashesByIndex Returns hashes of each ledger and its parent for + * all ledgers within the provided range. + * @param minSeq Minimum ledger sequence. + * @param maxSeq Maximum ledger sequence. + * @return Container that maps the sequence number of a found ledger to the + * struct LedgerHashPair which contains the hashes of the ledger and + * its parent. + */ + virtual std::map + getHashesByIndex(LedgerIndex minSeq, LedgerIndex maxSeq) = 0; + + /** + * @brief getTxHistory Returns the 20 most recent transactions starting from + * the given number. + * @param startIndex First number of returned entry. + * @return Vector of shared pointers to transactions sorted in + * descending order by ledger sequence. + */ + virtual std::vector> + getTxHistory(LedgerIndex startIndex) = 0; + + /** + * @brief getTransactionsMinLedgerSeq Returns the minimum ledger sequence + * stored in the Transactions table. + * @return Ledger sequence or no value if no ledgers exist. + */ + virtual std::optional + getTransactionsMinLedgerSeq() = 0; + + /** + * @brief getAccountTransactionsMinLedgerSeq Returns the minimum ledger + * sequence stored in the AccountTransactions table. + * @return Ledger sequence or no value if no ledgers exist. + */ + virtual std::optional + getAccountTransactionsMinLedgerSeq() = 0; + + /** + * @brief deleteTransactionByLedgerSeq Deletes transactions from the ledger + * with the given sequence. + * @param ledgerSeq Ledger sequence. + */ + virtual void + deleteTransactionByLedgerSeq(LedgerIndex ledgerSeq) = 0; + + /** + * @brief deleteBeforeLedgerSeq Deletes all ledgers with a sequence number + * less than or equal to the given ledger sequence. + * @param ledgerSeq Ledger sequence. + */ + virtual void + deleteBeforeLedgerSeq(LedgerIndex ledgerSeq) = 0; + + /** + * @brief deleteTransactionsBeforeLedgerSeq Deletes all transactions with + * a sequence number less than or equal to the given ledger + * sequence. + * @param ledgerSeq Ledger sequence. + */ + virtual void + deleteTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) = 0; + + /** + * @brief deleteAccountTransactionsBeforeLedgerSeq Deletes all account + * transactions with a sequence number less than or equal to the + * given ledger sequence. + * @param ledgerSeq Ledger sequence. + */ + virtual void + deleteAccountTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) = 0; + + /** + * @brief getTransactionCount Returns the number of transactions. + * @return Number of transactions. + */ + virtual std::size_t + getTransactionCount() = 0; + + /** + * @brief getAccountTransactionCount Returns the number of account + * transactions. + * @return Number of account transactions. + */ + virtual std::size_t + getAccountTransactionCount() = 0; + + /** + * @brief getLedgerCountMinMax Returns the minimum ledger sequence, + * maximum ledger sequence and total number of saved ledgers. + * @return Struct CountMinMax which contains the minimum sequence, + * maximum sequence and number of ledgers. + */ + virtual struct CountMinMax + getLedgerCountMinMax() = 0; + + /** + * @brief saveValidatedLedger Saves a ledger into the database. + * @param ledger The ledger. + * @param current True if the ledger is current. + * @return True if saving was successful. + */ + virtual bool + saveValidatedLedger(std::shared_ptr const& ledger, bool current) = 0; + + /** + * @brief getLimitedOldestLedgerInfo Returns the info of the oldest ledger + * whose sequence number is greater than or equal to the given + * sequence number. + * @param ledgerFirstIndex Minimum ledger sequence. + * @return Ledger info if found, otherwise no value. + */ + virtual std::optional + getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) = 0; + + /** + * @brief getLimitedNewestLedgerInfo Returns the info of the newest ledger + * whose sequence number is greater than or equal to the given + * sequence number. + * @param ledgerFirstIndex Minimum ledger sequence. + * @return Ledger info if found, otherwise no value. + */ + virtual std::optional + getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) = 0; + + /** + * @brief getOldestAccountTxs Returns the oldest transactions for the + * account that matches the given criteria starting from the provided + * offset. + * @param options Struct AccountTxOptions which contains the criteria to + * match: the account, ledger search range, the offset of the first + * entry to return, the number of transactions to return, a flag if + * this number is unlimited. + * @return Vector of pairs of found transactions and their metadata + * sorted in ascending order by account sequence. + */ + virtual AccountTxs + getOldestAccountTxs(AccountTxOptions const& options) = 0; + + /** + * @brief getNewestAccountTxs Returns the newest transactions for the + * account that matches the given criteria starting from the provided + * offset. + * @param options Struct AccountTxOptions which contains the criteria to + * match: the account, the ledger search range, the offset of the + * first entry to return, the number of transactions to return, a + * flag if this number unlimited. + * @return Vector of pairs of found transactions and their metadata + * sorted in descending order by account sequence. + */ + virtual AccountTxs + getNewestAccountTxs(AccountTxOptions const& options) = 0; + + /** + * @brief getOldestAccountTxsB Returns the oldest transactions in binary + * form for the account that matches the given criteria starting from + * the provided offset. + * @param options Struct AccountTxOptions which contains the criteria to + * match: the account, the ledger search range, the offset of the + * first entry to return, the number of transactions to return, a + * flag if this number unlimited. + * @return Vector of tuples of found transactions, their metadata and + * account sequences sorted in ascending order by account sequence. + */ + virtual MetaTxsList + getOldestAccountTxsB(AccountTxOptions const& options) = 0; + + /** + * @brief getNewestAccountTxsB Returns the newest transactions in binary + * form for the account that matches the given criteria starting from + * the provided offset. + * @param options Struct AccountTxOptions which contains the criteria to + * match: the account, the ledger search range, the offset of the + * first entry to return, the number of transactions to return, a + * flag if this number is unlimited. + * @return Vector of tuples of found transactions, their metadata and + * account sequences sorted in descending order by account + * sequence. + */ + virtual MetaTxsList + getNewestAccountTxsB(AccountTxOptions const& options) = 0; + + /** + * @brief oldestAccountTxPage Returns the oldest transactions for the + * account that matches the given criteria starting from the + * provided marker. + * @param options Struct AccountTxPageOptions which contains the criteria to + * match: the account, the ledger search range, the marker of first + * returned entry, the number of transactions to return, a flag if + * this number is unlimited. + * @return Vector of pairs of found transactions and their metadata + * sorted in ascending order by account sequence and a marker + * for the next search if the search was not finished. + */ + virtual std::pair> + oldestAccountTxPage(AccountTxPageOptions const& options) = 0; + + /** + * @brief newestAccountTxPage Returns the newest transactions for the + * account that matches the given criteria starting from the provided + * marker. + * @param options Struct AccountTxPageOptions which contains the criteria to + * match: the account, the ledger search range, the marker of the + * first returned entry, the number of transactions to return, a flag + * if this number unlimited. + * @return Vector of pairs of found transactions and their metadata + * sorted in descending order by account sequence and a marker + * for the next search if the search was not finished. + */ + virtual std::pair> + newestAccountTxPage(AccountTxPageOptions const& options) = 0; + + /** + * @brief oldestAccountTxPageB Returns the oldest transactions in binary + * form for the account that matches the given criteria starting from + * the provided marker. + * @param options Struct AccountTxPageOptions which contains criteria to + * match: the account, the ledger search range, the marker of the + * first returned entry, the number of transactions to return, a flag + * if this number unlimited. + * @return Vector of tuples of found transactions, their metadata and + * account sequences sorted in ascending order by account + * sequence and a marker for the next search if the search was not + * finished. + */ + virtual std::pair> + oldestAccountTxPageB(AccountTxPageOptions const& options) = 0; + + /** + * @brief newestAccountTxPageB Returns the newest transactions in binary + * form for the account that matches the given criteria starting from + * the provided marker. + * @param options Struct AccountTxPageOptions which contains the criteria to + * match: the account, the ledger search range, the marker of the + * first returned entry, the number of transactions to return, a flag + * if this number is unlimited. + * @return Vector of tuples of found transactions, their metadata and + * account sequences sorted in descending order by account + * sequence and a marker for the next search if the search was not + * finished. + */ + virtual std::pair> + newestAccountTxPageB(AccountTxPageOptions const& options) = 0; + + /** + * @brief getTransaction Returns the transaction with the given hash. If a + * range is provided but the transaction is not found, then check if + * all ledgers in the range are present in the database. + * @param id Hash of the transaction. + * @param range Range of ledgers to check, if present. + * @param ec Default error code value. + * @return Transaction and its metadata if found, otherwise TxSearched::all + * if a range is provided and all ledgers from the range are present + * in the database, TxSearched::some if a range is provided and not + * all ledgers are present, TxSearched::unknown if the range is not + * provided or a deserializing error occurred. In the last case the + * error code is returned via the ec parameter, in other cases the + * default error code is not changed. + */ + virtual std::variant + getTransaction(uint256 const& id, std::optional> const& range, error_code_i& ec) = 0; + + /** + * @brief getKBUsedAll Returns the amount of space used by all databases. + * @return Space in kilobytes. + */ + virtual uint32_t + getKBUsedAll() = 0; + + /** + * @brief getKBUsedLedger Returns the amount of space space used by the + * ledger database. + * @return Space in kilobytes. + */ + virtual uint32_t + getKBUsedLedger() = 0; + + /** + * @brief getKBUsedTransaction Returns the amount of space used by the + * transaction database. + * @return Space in kilobytes. + */ + virtual uint32_t + getKBUsedTransaction() = 0; + + /** + * @brief Closes the ledger database + */ + virtual void + closeLedgerDB() = 0; + + /** + * @brief Closes the transaction database + */ + virtual void + closeTransactionDB() = 0; +}; + +template +T +rangeCheckedCast(C c) +{ + if ((c > std::numeric_limits::max()) || (!std::numeric_limits::is_signed && c < 0) || + (std::numeric_limits::is_signed && std::numeric_limits::is_signed && + c < std::numeric_limits::lowest())) + { + // This should never happen + // LCOV_EXCL_START + UNREACHABLE("xrpl::rangeCheckedCast : domain error"); + JLOG(debugLog().error()) << "rangeCheckedCast domain error:" + << " value = " << c << " min = " << std::numeric_limits::lowest() + << " max: " << std::numeric_limits::max(); + // LCOV_EXCL_STOP + } + + return static_cast(c); +} + +} // namespace xrpl diff --git a/src/test/app/SHAMapStore_test.cpp b/src/test/app/SHAMapStore_test.cpp index c671d6fc27..9e0a971685 100644 --- a/src/test/app/SHAMapStore_test.cpp +++ b/src/test/app/SHAMapStore_test.cpp @@ -91,8 +91,7 @@ class SHAMapStore_test : public beast::unit_test::suite void ledgerCheck(jtx::Env& env, int const rows, int const first) { - auto const [actualRows, actualFirst, actualLast] = - dynamic_cast(&env.app().getRelationalDatabase())->getLedgerCountMinMax(); + auto const [actualRows, actualFirst, actualLast] = env.app().getRelationalDatabase().getLedgerCountMinMax(); BEAST_EXPECT(actualRows == rows); BEAST_EXPECT(actualFirst == first); @@ -102,14 +101,13 @@ class SHAMapStore_test : public beast::unit_test::suite void transactionCheck(jtx::Env& env, int const rows) { - BEAST_EXPECT(dynamic_cast(&env.app().getRelationalDatabase())->getTransactionCount() == rows); + BEAST_EXPECT(env.app().getRelationalDatabase().getTransactionCount() == rows); } void accountTransactionCheck(jtx::Env& env, int const rows) { - BEAST_EXPECT( - dynamic_cast(&env.app().getRelationalDatabase())->getAccountTransactionCount() == rows); + BEAST_EXPECT(env.app().getRelationalDatabase().getAccountTransactionCount() == rows); } int diff --git a/src/test/rpc/Transaction_test.cpp b/src/test/rpc/Transaction_test.cpp index 3b289d73ca..acc8bccf61 100644 --- a/src/test/rpc/Transaction_test.cpp +++ b/src/test/rpc/Transaction_test.cpp @@ -108,8 +108,7 @@ class Transaction_test : public beast::unit_test::suite auto const deletedLedger = (startLegSeq + endLegSeq) / 2; { // Remove one of the ledgers from the database directly - dynamic_cast(&env.app().getRelationalDatabase()) - ->deleteTransactionByLedgerSeq(deletedLedger); + env.app().getRelationalDatabase().deleteTransactionByLedgerSeq(deletedLedger); } for (int deltaEndSeq = 0; deltaEndSeq < 2; ++deltaEndSeq) @@ -320,8 +319,7 @@ class Transaction_test : public beast::unit_test::suite auto const deletedLedger = (startLegSeq + endLegSeq) / 2; { // Remove one of the ledgers from the database directly - dynamic_cast(&env.app().getRelationalDatabase()) - ->deleteTransactionByLedgerSeq(deletedLedger); + env.app().getRelationalDatabase().deleteTransactionByLedgerSeq(deletedLedger); } for (int deltaEndSeq = 0; deltaEndSeq < 2; ++deltaEndSeq) diff --git a/src/xrpld/app/ledger/Ledger.cpp b/src/xrpld/app/ledger/Ledger.cpp index 0f1b81d53d..0f44601679 100644 --- a/src/xrpld/app/ledger/Ledger.cpp +++ b/src/xrpld/app/ledger/Ledger.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -22,6 +21,7 @@ #include #include #include +#include #include #include @@ -904,11 +904,9 @@ saveValidatedLedger(Application& app, std::shared_ptr const& ledge return true; } - auto const db = dynamic_cast(&app.getRelationalDatabase()); - if (!db) - Throw("Failed to get relational database"); + auto& db = app.getRelationalDatabase(); - auto const res = db->saveValidatedLedger(ledger, current); + auto const res = db.saveValidatedLedger(ledger, current); // Clients can now trust the database for // information about this ledger sequence. diff --git a/src/xrpld/app/ledger/detail/LedgerMaster.cpp b/src/xrpld/app/ledger/detail/LedgerMaster.cpp index c4299c1b63..1fd1a8a8b2 100644 --- a/src/xrpld/app/ledger/detail/LedgerMaster.cpp +++ b/src/xrpld/app/ledger/detail/LedgerMaster.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -29,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 5f7a86e2c2..7a59d586e0 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -191,7 +191,7 @@ public: boost::asio::steady_timer sweepTimer_; boost::asio::steady_timer entropyTimer_; - std::unique_ptr mRelationalDatabase; + std::optional relationalDatabase_; std::unique_ptr mWalletDB; std::unique_ptr overlay_; std::optional trapTxID_; @@ -730,10 +730,10 @@ public: getRelationalDatabase() override { XRPL_ASSERT( - mRelationalDatabase, + relationalDatabase_, "xrpl::ApplicationImp::getRelationalDatabase : non-null " "relational database"); - return *mRelationalDatabase; + return *relationalDatabase_; } DatabaseCon& @@ -761,7 +761,7 @@ public: try { - mRelationalDatabase = RelationalDatabase::init(*this, *config_, *m_jobQueue); + relationalDatabase_.emplace(setup_RelationalDatabase(*this, *config_, *m_jobQueue)); // wallet database auto setup = setup_DatabaseCon(*config_, m_journal); @@ -872,7 +872,8 @@ public: void doSweep() { - if (!config_->standalone() && !getRelationalDatabase().transactionDbHasSpace(*config_)) + XRPL_ASSERT(relationalDatabase_, "xrpl::ApplicationImp::doSweep : non-null relational database"); + if (!config_->standalone() && !relationalDatabase_->transactionDbHasSpace(*config_)) { signalStop("Out of transaction DB space"); } diff --git a/src/xrpld/app/misc/SHAMapStoreImp.cpp b/src/xrpld/app/misc/SHAMapStoreImp.cpp index 7f276ca2d8..c963d18d2c 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.cpp +++ b/src/xrpld/app/misc/SHAMapStoreImp.cpp @@ -507,16 +507,13 @@ SHAMapStoreImp::clearPrior(LedgerIndex lastRotated) if (healthWait() == stopping) return; - SQLiteDatabase* const db = dynamic_cast(&app_.getRelationalDatabase()); - - if (!db) - Throw("Failed to get relational database"); + auto& db = app_.getRelationalDatabase(); clearSql( lastRotated, "Ledgers", - [db]() -> std::optional { return db->getMinLedgerSeq(); }, - [db](LedgerIndex min) -> void { db->deleteBeforeLedgerSeq(min); }); + [&db]() -> std::optional { return db.getMinLedgerSeq(); }, + [&db](LedgerIndex min) -> void { db.deleteBeforeLedgerSeq(min); }); if (healthWait() == stopping) return; @@ -526,16 +523,16 @@ SHAMapStoreImp::clearPrior(LedgerIndex lastRotated) clearSql( lastRotated, "Transactions", - [&db]() -> std::optional { return db->getTransactionsMinLedgerSeq(); }, - [&db](LedgerIndex min) -> void { db->deleteTransactionsBeforeLedgerSeq(min); }); + [&db]() -> std::optional { return db.getTransactionsMinLedgerSeq(); }, + [&db](LedgerIndex min) -> void { db.deleteTransactionsBeforeLedgerSeq(min); }); if (healthWait() == stopping) return; clearSql( lastRotated, "AccountTransactions", - [&db]() -> std::optional { return db->getAccountTransactionsMinLedgerSeq(); }, - [&db](LedgerIndex min) -> void { db->deleteAccountTransactionsBeforeLedgerSeq(min); }); + [&db]() -> std::optional { return db.getAccountTransactionsMinLedgerSeq(); }, + [&db](LedgerIndex min) -> void { db.deleteAccountTransactionsBeforeLedgerSeq(min); }); if (healthWait() == stopping) return; } diff --git a/src/xrpld/app/misc/Transaction.h b/src/xrpld/app/misc/Transaction.h index 22f3e9d1fd..0a51e1c021 100644 --- a/src/xrpld/app/misc/Transaction.h +++ b/src/xrpld/app/misc/Transaction.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -35,8 +36,6 @@ enum TransStatus { INCOMPLETE = 8 // needs more signatures }; -enum class TxSearched { all, some, unknown }; - // This class is for constructing and examining transactions. // Transactions are static so manipulation functions are unnecessary. class Transaction : public std::enable_shared_from_this, public CountedObject diff --git a/src/xrpld/app/misc/detail/AccountTxPaging.h b/src/xrpld/app/misc/detail/AccountTxPaging.h index 6dff5c481b..209ca67ab6 100644 --- a/src/xrpld/app/misc/detail/AccountTxPaging.h +++ b/src/xrpld/app/misc/detail/AccountTxPaging.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include diff --git a/src/xrpld/app/misc/detail/Transaction.cpp b/src/xrpld/app/misc/detail/Transaction.cpp index 61a2a36695..8ffbc47b08 100644 --- a/src/xrpld/app/misc/detail/Transaction.cpp +++ b/src/xrpld/app/misc/detail/Transaction.cpp @@ -2,13 +2,13 @@ #include #include #include -#include #include #include #include #include #include +#include namespace xrpl { @@ -113,14 +113,9 @@ Transaction::load( std::optional> const& range, error_code_i& ec) { - auto const db = dynamic_cast(&app.getRelationalDatabase()); + auto& db = app.getRelationalDatabase(); - if (!db) - { - Throw("Failed to get relational database"); - } - - return db->getTransaction(id, range, ec); + return db.getTransaction(id, range, ec); } // options 1 to include the date of the transaction diff --git a/src/xrpld/app/rdb/RelationalDatabase.h b/src/xrpld/app/rdb/RelationalDatabase.h deleted file mode 100644 index 078b8fe8db..0000000000 --- a/src/xrpld/app/rdb/RelationalDatabase.h +++ /dev/null @@ -1,226 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -namespace xrpl { - -struct LedgerHashPair -{ - uint256 ledgerHash; - uint256 parentHash; -}; - -struct LedgerRange -{ - uint32_t min; - uint32_t max; -}; - -class RelationalDatabase -{ -public: - struct CountMinMax - { - std::size_t numberOfRows; - LedgerIndex minLedgerSequence; - LedgerIndex maxLedgerSequence; - }; - - struct AccountTxMarker - { - std::uint32_t ledgerSeq = 0; - std::uint32_t txnSeq = 0; - }; - - struct AccountTxOptions - { - AccountID const& account; - std::uint32_t minLedger; - std::uint32_t maxLedger; - std::uint32_t offset; - std::uint32_t limit; - bool bUnlimited; - }; - - struct AccountTxPageOptions - { - AccountID const& account; - std::uint32_t minLedger; - std::uint32_t maxLedger; - std::optional marker; - std::uint32_t limit; - bool bAdmin; - }; - - using AccountTx = std::pair, std::shared_ptr>; - using AccountTxs = std::vector; - using txnMetaLedgerType = std::tuple; - using MetaTxsList = std::vector; - - using LedgerSequence = uint32_t; - using LedgerHash = uint256; - using LedgerShortcut = RPC::LedgerShortcut; - using LedgerSpecifier = std::variant; - - struct AccountTxArgs - { - AccountID account; - std::optional ledger; - bool binary = false; - bool forward = false; - uint32_t limit = 0; - std::optional marker; - }; - - struct AccountTxResult - { - std::variant transactions; - LedgerRange ledgerRange; - uint32_t limit; - std::optional marker; - }; - - /** - * @brief init Creates and returns an appropriate RelationalDatabase - * instance based on configuration. - * @param registry The service registry. - * @param config Config object. - * @param jobQueue JobQueue object. - * @return Unique pointer to the interface. - */ - static std::unique_ptr - init(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue); - - virtual ~RelationalDatabase() = default; - - /** - * @brief getMinLedgerSeq Returns the minimum ledger sequence in the Ledgers - * table. - * @return Ledger sequence or no value if no ledgers exist. - */ - virtual std::optional - getMinLedgerSeq() = 0; - - /** - * @brief getMaxLedgerSeq Returns the maximum ledger sequence in the Ledgers - * table. - * @return Ledger sequence or none if no ledgers exist. - */ - virtual std::optional - getMaxLedgerSeq() = 0; - - /** - * @brief getLedgerInfoByIndex Returns a ledger by its sequence. - * @param ledgerSeq Ledger sequence. - * @return The ledger if found, otherwise no value. - */ - virtual std::optional - getLedgerInfoByIndex(LedgerIndex ledgerSeq) = 0; - - /** - * @brief getNewestLedgerInfo Returns the info of the newest saved ledger. - * @return Ledger info if found, otherwise no value. - */ - virtual std::optional - getNewestLedgerInfo() = 0; - - /** - * @brief getLedgerInfoByHash Returns the info of the ledger with given - * hash. - * @param ledgerHash Hash of the ledger. - * @return Ledger if found, otherwise no value. - */ - virtual std::optional - getLedgerInfoByHash(uint256 const& ledgerHash) = 0; - - /** - * @brief getHashByIndex Returns the hash of the ledger with the given - * sequence. - * @param ledgerIndex Ledger sequence. - * @return Hash of the ledger. - */ - virtual uint256 - getHashByIndex(LedgerIndex ledgerIndex) = 0; - - /** - * @brief getHashesByIndex Returns the hashes of the ledger and its parent - * as specified by the ledgerIndex. - * @param ledgerIndex Ledger sequence. - * @return Struct LedgerHashPair which contains hashes of the ledger and - * its parent. - */ - virtual std::optional - getHashesByIndex(LedgerIndex ledgerIndex) = 0; - - /** - * @brief getHashesByIndex Returns hashes of each ledger and its parent for - * all ledgers within the provided range. - * @param minSeq Minimum ledger sequence. - * @param maxSeq Maximum ledger sequence. - * @return Container that maps the sequence number of a found ledger to the - * struct LedgerHashPair which contains the hashes of the ledger and - * its parent. - */ - virtual std::map - getHashesByIndex(LedgerIndex minSeq, LedgerIndex maxSeq) = 0; - - /** - * @brief getTxHistory Returns the 20 most recent transactions starting from - * the given number. - * @param startIndex First number of returned entry. - * @return Vector of shared pointers to transactions sorted in - * descending order by ledger sequence. - */ - virtual std::vector> - getTxHistory(LedgerIndex startIndex) = 0; - - /** - * @brief ledgerDbHasSpace Checks if the ledger database has available - * space. - * @param config Config object. - * @return True if space is available. - */ - virtual bool - ledgerDbHasSpace(Config const& config) = 0; - - /** - * @brief transactionDbHasSpace Checks if the transaction database has - * available space. - * @param config Config object. - * @return True if space is available. - */ - virtual bool - transactionDbHasSpace(Config const& config) = 0; -}; - -template -T -rangeCheckedCast(C c) -{ - if ((c > std::numeric_limits::max()) || (!std::numeric_limits::is_signed && c < 0) || - (std::numeric_limits::is_signed && std::numeric_limits::is_signed && - c < std::numeric_limits::lowest())) - { - // This should never happen - // LCOV_EXCL_START - UNREACHABLE("xrpl::rangeCheckedCast : domain error"); - JLOG(debugLog().error()) << "rangeCheckedCast domain error:" - << " value = " << c << " min = " << std::numeric_limits::lowest() - << " max: " << std::numeric_limits::max(); - // LCOV_EXCL_STOP - } - - return static_cast(c); -} - -} // namespace xrpl diff --git a/src/xrpld/app/rdb/backend/SQLiteDatabase.h b/src/xrpld/app/rdb/backend/SQLiteDatabase.h index b6dcb2534b..b79b66787e 100644 --- a/src/xrpld/app/rdb/backend/SQLiteDatabase.h +++ b/src/xrpld/app/rdb/backend/SQLiteDatabase.h @@ -1,43 +1,130 @@ #pragma once -#include +#include + +#include namespace xrpl { -class SQLiteDatabase : public RelationalDatabase +class Config; +class JobQueue; +class ServiceRegistry; + +class SQLiteDatabase final : public RelationalDatabase { public: + /** + * @brief getMinLedgerSeq Returns the minimum ledger sequence in the Ledgers + * table. + * @return Ledger sequence or no value if no ledgers exist. + */ + std::optional + getMinLedgerSeq() override; + + /** + * @brief getMaxLedgerSeq Returns the maximum ledger sequence in the Ledgers + * table. + * @return Ledger sequence or none if no ledgers exist. + */ + std::optional + getMaxLedgerSeq() override; + + /** + * @brief getLedgerInfoByIndex Returns a ledger by its sequence. + * @param ledgerSeq Ledger sequence. + * @return The ledger if found, otherwise no value. + */ + std::optional + getLedgerInfoByIndex(LedgerIndex ledgerSeq) override; + + /** + * @brief getNewestLedgerInfo Returns the info of the newest saved ledger. + * @return Ledger info if found, otherwise no value. + */ + std::optional + getNewestLedgerInfo() override; + + /** + * @brief getLedgerInfoByHash Returns the info of the ledger with given + * hash. + * @param ledgerHash Hash of the ledger. + * @return Ledger if found, otherwise no value. + */ + std::optional + getLedgerInfoByHash(uint256 const& ledgerHash) override; + + /** + * @brief getHashByIndex Returns the hash of the ledger with the given + * sequence. + * @param ledgerIndex Ledger sequence. + * @return Hash of the ledger. + */ + uint256 + getHashByIndex(LedgerIndex ledgerIndex) override; + + /** + * @brief getHashesByIndex Returns the hashes of the ledger and its parent + * as specified by the ledgerIndex. + * @param ledgerIndex Ledger sequence. + * @return Struct LedgerHashPair which contains hashes of the ledger and + * its parent. + */ + std::optional + getHashesByIndex(LedgerIndex ledgerIndex) override; + + /** + * @brief getHashesByIndex Returns hashes of each ledger and its parent for + * all ledgers within the provided range. + * @param minSeq Minimum ledger sequence. + * @param maxSeq Maximum ledger sequence. + * @return Container that maps the sequence number of a found ledger to the + * struct LedgerHashPair which contains the hashes of the ledger and + * its parent. + */ + std::map + getHashesByIndex(LedgerIndex minSeq, LedgerIndex maxSeq) override; + + /** + * @brief getTxHistory Returns the 20 most recent transactions starting from + * the given number. + * @param startIndex First number of returned entry. + * @return Vector of shared pointers to transactions sorted in + * descending order by ledger sequence. + */ + std::vector> + getTxHistory(LedgerIndex startIndex) override; + /** * @brief getTransactionsMinLedgerSeq Returns the minimum ledger sequence * stored in the Transactions table. * @return Ledger sequence or no value if no ledgers exist. */ - virtual std::optional - getTransactionsMinLedgerSeq() = 0; + std::optional + getTransactionsMinLedgerSeq() override; /** * @brief getAccountTransactionsMinLedgerSeq Returns the minimum ledger * sequence stored in the AccountTransactions table. * @return Ledger sequence or no value if no ledgers exist. */ - virtual std::optional - getAccountTransactionsMinLedgerSeq() = 0; + std::optional + getAccountTransactionsMinLedgerSeq() override; /** * @brief deleteTransactionByLedgerSeq Deletes transactions from the ledger * with the given sequence. * @param ledgerSeq Ledger sequence. */ - virtual void - deleteTransactionByLedgerSeq(LedgerIndex ledgerSeq) = 0; + void + deleteTransactionByLedgerSeq(LedgerIndex ledgerSeq) override; /** * @brief deleteBeforeLedgerSeq Deletes all ledgers with a sequence number * less than or equal to the given ledger sequence. * @param ledgerSeq Ledger sequence. */ - virtual void - deleteBeforeLedgerSeq(LedgerIndex ledgerSeq) = 0; + void + deleteBeforeLedgerSeq(LedgerIndex ledgerSeq) override; /** * @brief deleteTransactionsBeforeLedgerSeq Deletes all transactions with @@ -45,8 +132,8 @@ public: * sequence. * @param ledgerSeq Ledger sequence. */ - virtual void - deleteTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) = 0; + void + deleteTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) override; /** * @brief deleteAccountTransactionsBeforeLedgerSeq Deletes all account @@ -54,23 +141,23 @@ public: * given ledger sequence. * @param ledgerSeq Ledger sequence. */ - virtual void - deleteAccountTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) = 0; + void + deleteAccountTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) override; /** * @brief getTransactionCount Returns the number of transactions. * @return Number of transactions. */ - virtual std::size_t - getTransactionCount() = 0; + std::size_t + getTransactionCount() override; /** * @brief getAccountTransactionCount Returns the number of account * transactions. * @return Number of account transactions. */ - virtual std::size_t - getAccountTransactionCount() = 0; + std::size_t + getAccountTransactionCount() override; /** * @brief getLedgerCountMinMax Returns the minimum ledger sequence, @@ -78,8 +165,8 @@ public: * @return Struct CountMinMax which contains the minimum sequence, * maximum sequence and number of ledgers. */ - virtual struct CountMinMax - getLedgerCountMinMax() = 0; + CountMinMax + getLedgerCountMinMax() override; /** * @brief saveValidatedLedger Saves a ledger into the database. @@ -87,8 +174,8 @@ public: * @param current True if the ledger is current. * @return True if saving was successful. */ - virtual bool - saveValidatedLedger(std::shared_ptr const& ledger, bool current) = 0; + bool + saveValidatedLedger(std::shared_ptr const& ledger, bool current) override; /** * @brief getLimitedOldestLedgerInfo Returns the info of the oldest ledger @@ -97,8 +184,8 @@ public: * @param ledgerFirstIndex Minimum ledger sequence. * @return Ledger info if found, otherwise no value. */ - virtual std::optional - getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) = 0; + std::optional + getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) override; /** * @brief getLimitedNewestLedgerInfo Returns the info of the newest ledger @@ -107,8 +194,8 @@ public: * @param ledgerFirstIndex Minimum ledger sequence. * @return Ledger info if found, otherwise no value. */ - virtual std::optional - getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) = 0; + std::optional + getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) override; /** * @brief getOldestAccountTxs Returns the oldest transactions for the @@ -121,8 +208,8 @@ public: * @return Vector of pairs of found transactions and their metadata * sorted in ascending order by account sequence. */ - virtual AccountTxs - getOldestAccountTxs(AccountTxOptions const& options) = 0; + AccountTxs + getOldestAccountTxs(AccountTxOptions const& options) override; /** * @brief getNewestAccountTxs Returns the newest transactions for the @@ -135,8 +222,8 @@ public: * @return Vector of pairs of found transactions and their metadata * sorted in descending order by account sequence. */ - virtual AccountTxs - getNewestAccountTxs(AccountTxOptions const& options) = 0; + AccountTxs + getNewestAccountTxs(AccountTxOptions const& options) override; /** * @brief getOldestAccountTxsB Returns the oldest transactions in binary @@ -149,8 +236,8 @@ public: * @return Vector of tuples of found transactions, their metadata and * account sequences sorted in ascending order by account sequence. */ - virtual MetaTxsList - getOldestAccountTxsB(AccountTxOptions const& options) = 0; + MetaTxsList + getOldestAccountTxsB(AccountTxOptions const& options) override; /** * @brief getNewestAccountTxsB Returns the newest transactions in binary @@ -164,8 +251,8 @@ public: * account sequences sorted in descending order by account * sequence. */ - virtual MetaTxsList - getNewestAccountTxsB(AccountTxOptions const& options) = 0; + MetaTxsList + getNewestAccountTxsB(AccountTxOptions const& options) override; /** * @brief oldestAccountTxPage Returns the oldest transactions for the @@ -179,8 +266,8 @@ public: * sorted in ascending order by account sequence and a marker * for the next search if the search was not finished. */ - virtual std::pair> - oldestAccountTxPage(AccountTxPageOptions const& options) = 0; + std::pair> + oldestAccountTxPage(AccountTxPageOptions const& options) override; /** * @brief newestAccountTxPage Returns the newest transactions for the @@ -194,8 +281,8 @@ public: * sorted in descending order by account sequence and a marker * for the next search if the search was not finished. */ - virtual std::pair> - newestAccountTxPage(AccountTxPageOptions const& options) = 0; + std::pair> + newestAccountTxPage(AccountTxPageOptions const& options) override; /** * @brief oldestAccountTxPageB Returns the oldest transactions in binary @@ -210,8 +297,8 @@ public: * sequence and a marker for the next search if the search was not * finished. */ - virtual std::pair> - oldestAccountTxPageB(AccountTxPageOptions const& options) = 0; + std::pair> + oldestAccountTxPageB(AccountTxPageOptions const& options) override; /** * @brief newestAccountTxPageB Returns the newest transactions in binary @@ -226,8 +313,8 @@ public: * sequence and a marker for the next search if the search was not * finished. */ - virtual std::pair> - newestAccountTxPageB(AccountTxPageOptions const& options) = 0; + std::pair> + newestAccountTxPageB(AccountTxPageOptions const& options) override; /** * @brief getTransaction Returns the transaction with the given hash. If a @@ -244,43 +331,146 @@ public: * error code is returned via the ec parameter, in other cases the * default error code is not changed. */ - virtual std::variant - getTransaction(uint256 const& id, std::optional> const& range, error_code_i& ec) = 0; + std::variant + getTransaction(uint256 const& id, std::optional> const& range, error_code_i& ec) + override; /** * @brief getKBUsedAll Returns the amount of space used by all databases. * @return Space in kilobytes. */ - virtual uint32_t - getKBUsedAll() = 0; + std::uint32_t + getKBUsedAll() override; /** * @brief getKBUsedLedger Returns the amount of space space used by the * ledger database. * @return Space in kilobytes. */ - virtual uint32_t - getKBUsedLedger() = 0; + std::uint32_t + getKBUsedLedger() override; /** * @brief getKBUsedTransaction Returns the amount of space used by the * transaction database. * @return Space in kilobytes. */ - virtual uint32_t - getKBUsedTransaction() = 0; + std::uint32_t + getKBUsedTransaction() override; /** * @brief Closes the ledger database */ - virtual void - closeLedgerDB() = 0; + void + closeLedgerDB() override; /** * @brief Closes the transaction database */ - virtual void - closeTransactionDB() = 0; + void + closeTransactionDB() override; + + SQLiteDatabase(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue); + + SQLiteDatabase(SQLiteDatabase const&) = delete; + SQLiteDatabase(SQLiteDatabase&& rhs) noexcept; + + SQLiteDatabase& + operator=(SQLiteDatabase const&) = delete; + SQLiteDatabase& + operator=(SQLiteDatabase&& rhs) = delete; + + /** + * @brief ledgerDbHasSpace Checks if the ledger database has available + * space. + * @param config Config object. + * @return True if space is available. + */ + bool + ledgerDbHasSpace(Config const& config); + + /** + * @brief transactionDbHasSpace Checks if the transaction database has + * available space. + * @param config Config object. + * @return True if space is available. + */ + bool + transactionDbHasSpace(Config const& config); + +private: + ServiceRegistry& registry_; + bool const useTxTables_; + beast::Journal j_; + std::unique_ptr ledgerDb_, txdb_; + + /** + * @brief makeLedgerDBs Opens ledger and transaction databases for the node + * store, and stores their descriptors in private member variables. + * @param config Config object. + * @param setup Path to the databases and other opening parameters. + * @param checkpointerSetup Checkpointer parameters. + * @return True if node databases opened successfully. + */ + bool + makeLedgerDBs( + Config const& config, + DatabaseCon::Setup const& setup, + DatabaseCon::CheckpointerSetup const& checkpointerSetup); + + /** + * @brief existsLedger Checks if the node store ledger database exists. + * @return True if the node store ledger database exists. + */ + bool + existsLedger() + { + return static_cast(ledgerDb_); + } + + /** + * @brief existsTransaction Checks if the node store transaction database + * exists. + * @return True if the node store transaction database exists. + */ + bool + existsTransaction() + { + return static_cast(txdb_); + } + + /** + * @brief checkoutTransaction Checks out and returns node store ledger + * database. + * @return Session to the node store ledger database. + */ + auto + checkoutLedger() + { + return ledgerDb_->checkoutDb(); + } + + /** + * @brief checkoutTransaction Checks out and returns the node store + * transaction database. + * @return Session to the node store transaction database. + */ + auto + checkoutTransaction() + { + return txdb_->checkoutDb(); + } }; +/** + * @brief setup_RelationalDatabase Creates and returns a SQLiteDatabase + * instance based on configuration. + * @param registry The service registry. + * @param config Config object. + * @param jobQueue JobQueue object. + * @return SQLiteDatabase instance. + */ +SQLiteDatabase +setup_RelationalDatabase(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue); + } // namespace xrpl diff --git a/src/xrpld/app/rdb/backend/detail/Node.cpp b/src/xrpld/app/rdb/backend/detail/Node.cpp index 1e814c3589..328d07c0ab 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.cpp +++ b/src/xrpld/app/rdb/backend/detail/Node.cpp @@ -3,13 +3,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include diff --git a/src/xrpld/app/rdb/backend/detail/Node.h b/src/xrpld/app/rdb/backend/detail/Node.h index 69c4894bbc..cb49a373bd 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.h +++ b/src/xrpld/app/rdb/backend/detail/Node.h @@ -1,9 +1,10 @@ #pragma once #include -#include #include +#include + namespace xrpl { namespace detail { diff --git a/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp b/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp index 4f1430ee4c..6c3e76a86f 100644 --- a/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp +++ b/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp @@ -10,200 +10,8 @@ namespace xrpl { -class SQLiteDatabaseImp final : public SQLiteDatabase -{ -public: - SQLiteDatabaseImp(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue) - : registry_(registry), useTxTables_(config.useTxTables()), j_(registry.journal("SQLiteDatabaseImp")) - { - DatabaseCon::Setup const setup = setup_DatabaseCon(config, j_); - if (!makeLedgerDBs(config, setup, DatabaseCon::CheckpointerSetup{&jobQueue, ®istry_.logs()})) - { - std::string_view constexpr error = "Failed to create ledger databases"; - - JLOG(j_.fatal()) << error; - Throw(error.data()); - } - } - - std::optional - getMinLedgerSeq() override; - - std::optional - getTransactionsMinLedgerSeq() override; - - std::optional - getAccountTransactionsMinLedgerSeq() override; - - std::optional - getMaxLedgerSeq() override; - - void - deleteTransactionByLedgerSeq(LedgerIndex ledgerSeq) override; - - void - deleteBeforeLedgerSeq(LedgerIndex ledgerSeq) override; - - void - deleteTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) override; - - void - deleteAccountTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) override; - - std::size_t - getTransactionCount() override; - - std::size_t - getAccountTransactionCount() override; - - RelationalDatabase::CountMinMax - getLedgerCountMinMax() override; - - bool - saveValidatedLedger(std::shared_ptr const& ledger, bool current) override; - - std::optional - getLedgerInfoByIndex(LedgerIndex ledgerSeq) override; - - std::optional - getNewestLedgerInfo() override; - - std::optional - getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) override; - - std::optional - getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) override; - - std::optional - getLedgerInfoByHash(uint256 const& ledgerHash) override; - - uint256 - getHashByIndex(LedgerIndex ledgerIndex) override; - - std::optional - getHashesByIndex(LedgerIndex ledgerIndex) override; - - std::map - getHashesByIndex(LedgerIndex minSeq, LedgerIndex maxSeq) override; - - std::vector> - getTxHistory(LedgerIndex startIndex) override; - - AccountTxs - getOldestAccountTxs(AccountTxOptions const& options) override; - - AccountTxs - getNewestAccountTxs(AccountTxOptions const& options) override; - - MetaTxsList - getOldestAccountTxsB(AccountTxOptions const& options) override; - - MetaTxsList - getNewestAccountTxsB(AccountTxOptions const& options) override; - - std::pair> - oldestAccountTxPage(AccountTxPageOptions const& options) override; - - std::pair> - newestAccountTxPage(AccountTxPageOptions const& options) override; - - std::pair> - oldestAccountTxPageB(AccountTxPageOptions const& options) override; - - std::pair> - newestAccountTxPageB(AccountTxPageOptions const& options) override; - - std::variant - getTransaction(uint256 const& id, std::optional> const& range, error_code_i& ec) - override; - - bool - ledgerDbHasSpace(Config const& config) override; - - bool - transactionDbHasSpace(Config const& config) override; - - std::uint32_t - getKBUsedAll() override; - - std::uint32_t - getKBUsedLedger() override; - - std::uint32_t - getKBUsedTransaction() override; - - void - closeLedgerDB() override; - - void - closeTransactionDB() override; - -private: - ServiceRegistry& registry_; - bool const useTxTables_; - beast::Journal j_; - std::unique_ptr ledgerDb_, txdb_; - - /** - * @brief makeLedgerDBs Opens ledger and transaction databases for the node - * store, and stores their descriptors in private member variables. - * @param config Config object. - * @param setup Path to the databases and other opening parameters. - * @param checkpointerSetup Checkpointer parameters. - * @return True if node databases opened successfully. - */ - bool - makeLedgerDBs( - Config const& config, - DatabaseCon::Setup const& setup, - DatabaseCon::CheckpointerSetup const& checkpointerSetup); - - /** - * @brief existsLedger Checks if the node store ledger database exists. - * @return True if the node store ledger database exists. - */ - bool - existsLedger() - { - return static_cast(ledgerDb_); - } - - /** - * @brief existsTransaction Checks if the node store transaction database - * exists. - * @return True if the node store transaction database exists. - */ - bool - existsTransaction() - { - return static_cast(txdb_); - } - - /** - * @brief checkoutTransaction Checks out and returns node store ledger - * database. - * @return Session to the node store ledger database. - */ - auto - checkoutLedger() - { - return ledgerDb_->checkoutDb(); - } - - /** - * @brief checkoutTransaction Checks out and returns the node store - * transaction database. - * @return Session to the node store transaction database. - */ - auto - checkoutTransaction() - { - return txdb_->checkoutDb(); - } -}; - bool -SQLiteDatabaseImp::makeLedgerDBs( +SQLiteDatabase::makeLedgerDBs( Config const& config, DatabaseCon::Setup const& setup, DatabaseCon::CheckpointerSetup const& checkpointerSetup) @@ -215,7 +23,7 @@ SQLiteDatabaseImp::makeLedgerDBs( } std::optional -SQLiteDatabaseImp::getMinLedgerSeq() +SQLiteDatabase::getMinLedgerSeq() { /* if databases exists, use it */ if (existsLedger()) @@ -229,7 +37,7 @@ SQLiteDatabaseImp::getMinLedgerSeq() } std::optional -SQLiteDatabaseImp::getTransactionsMinLedgerSeq() +SQLiteDatabase::getTransactionsMinLedgerSeq() { if (!useTxTables_) return {}; @@ -244,7 +52,7 @@ SQLiteDatabaseImp::getTransactionsMinLedgerSeq() } std::optional -SQLiteDatabaseImp::getAccountTransactionsMinLedgerSeq() +SQLiteDatabase::getAccountTransactionsMinLedgerSeq() { if (!useTxTables_) return {}; @@ -259,7 +67,7 @@ SQLiteDatabaseImp::getAccountTransactionsMinLedgerSeq() } std::optional -SQLiteDatabaseImp::getMaxLedgerSeq() +SQLiteDatabase::getMaxLedgerSeq() { if (existsLedger()) { @@ -271,7 +79,7 @@ SQLiteDatabaseImp::getMaxLedgerSeq() } void -SQLiteDatabaseImp::deleteTransactionByLedgerSeq(LedgerIndex ledgerSeq) +SQLiteDatabase::deleteTransactionByLedgerSeq(LedgerIndex ledgerSeq) { if (!useTxTables_) return; @@ -285,7 +93,7 @@ SQLiteDatabaseImp::deleteTransactionByLedgerSeq(LedgerIndex ledgerSeq) } void -SQLiteDatabaseImp::deleteBeforeLedgerSeq(LedgerIndex ledgerSeq) +SQLiteDatabase::deleteBeforeLedgerSeq(LedgerIndex ledgerSeq) { if (existsLedger()) { @@ -296,7 +104,7 @@ SQLiteDatabaseImp::deleteBeforeLedgerSeq(LedgerIndex ledgerSeq) } void -SQLiteDatabaseImp::deleteTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) +SQLiteDatabase::deleteTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) { if (!useTxTables_) return; @@ -310,7 +118,7 @@ SQLiteDatabaseImp::deleteTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) } void -SQLiteDatabaseImp::deleteAccountTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) +SQLiteDatabase::deleteAccountTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) { if (!useTxTables_) return; @@ -324,7 +132,7 @@ SQLiteDatabaseImp::deleteAccountTransactionsBeforeLedgerSeq(LedgerIndex ledgerSe } std::size_t -SQLiteDatabaseImp::getTransactionCount() +SQLiteDatabase::getTransactionCount() { if (!useTxTables_) return 0; @@ -339,7 +147,7 @@ SQLiteDatabaseImp::getTransactionCount() } std::size_t -SQLiteDatabaseImp::getAccountTransactionCount() +SQLiteDatabase::getAccountTransactionCount() { if (!useTxTables_) return 0; @@ -354,7 +162,7 @@ SQLiteDatabaseImp::getAccountTransactionCount() } RelationalDatabase::CountMinMax -SQLiteDatabaseImp::getLedgerCountMinMax() +SQLiteDatabase::getLedgerCountMinMax() { if (existsLedger()) { @@ -366,7 +174,7 @@ SQLiteDatabaseImp::getLedgerCountMinMax() } bool -SQLiteDatabaseImp::saveValidatedLedger(std::shared_ptr const& ledger, bool current) +SQLiteDatabase::saveValidatedLedger(std::shared_ptr const& ledger, bool current) { if (existsLedger()) { @@ -378,7 +186,7 @@ SQLiteDatabaseImp::saveValidatedLedger(std::shared_ptr const& ledg } std::optional -SQLiteDatabaseImp::getLedgerInfoByIndex(LedgerIndex ledgerSeq) +SQLiteDatabase::getLedgerInfoByIndex(LedgerIndex ledgerSeq) { if (existsLedger()) { @@ -393,7 +201,7 @@ SQLiteDatabaseImp::getLedgerInfoByIndex(LedgerIndex ledgerSeq) } std::optional -SQLiteDatabaseImp::getNewestLedgerInfo() +SQLiteDatabase::getNewestLedgerInfo() { if (existsLedger()) { @@ -408,7 +216,7 @@ SQLiteDatabaseImp::getNewestLedgerInfo() } std::optional -SQLiteDatabaseImp::getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) +SQLiteDatabase::getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) { if (existsLedger()) { @@ -423,7 +231,7 @@ SQLiteDatabaseImp::getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) } std::optional -SQLiteDatabaseImp::getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) +SQLiteDatabase::getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) { if (existsLedger()) { @@ -438,7 +246,7 @@ SQLiteDatabaseImp::getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) } std::optional -SQLiteDatabaseImp::getLedgerInfoByHash(uint256 const& ledgerHash) +SQLiteDatabase::getLedgerInfoByHash(uint256 const& ledgerHash) { if (existsLedger()) { @@ -453,7 +261,7 @@ SQLiteDatabaseImp::getLedgerInfoByHash(uint256 const& ledgerHash) } uint256 -SQLiteDatabaseImp::getHashByIndex(LedgerIndex ledgerIndex) +SQLiteDatabase::getHashByIndex(LedgerIndex ledgerIndex) { if (existsLedger()) { @@ -468,7 +276,7 @@ SQLiteDatabaseImp::getHashByIndex(LedgerIndex ledgerIndex) } std::optional -SQLiteDatabaseImp::getHashesByIndex(LedgerIndex ledgerIndex) +SQLiteDatabase::getHashesByIndex(LedgerIndex ledgerIndex) { if (existsLedger()) { @@ -483,7 +291,7 @@ SQLiteDatabaseImp::getHashesByIndex(LedgerIndex ledgerIndex) } std::map -SQLiteDatabaseImp::getHashesByIndex(LedgerIndex minSeq, LedgerIndex maxSeq) +SQLiteDatabase::getHashesByIndex(LedgerIndex minSeq, LedgerIndex maxSeq) { if (existsLedger()) { @@ -498,7 +306,7 @@ SQLiteDatabaseImp::getHashesByIndex(LedgerIndex minSeq, LedgerIndex maxSeq) } std::vector> -SQLiteDatabaseImp::getTxHistory(LedgerIndex startIndex) +SQLiteDatabase::getTxHistory(LedgerIndex startIndex) { if (!useTxTables_) return {}; @@ -516,7 +324,7 @@ SQLiteDatabaseImp::getTxHistory(LedgerIndex startIndex) } RelationalDatabase::AccountTxs -SQLiteDatabaseImp::getOldestAccountTxs(AccountTxOptions const& options) +SQLiteDatabase::getOldestAccountTxs(AccountTxOptions const& options) { if (!useTxTables_) return {}; @@ -533,7 +341,7 @@ SQLiteDatabaseImp::getOldestAccountTxs(AccountTxOptions const& options) } RelationalDatabase::AccountTxs -SQLiteDatabaseImp::getNewestAccountTxs(AccountTxOptions const& options) +SQLiteDatabase::getNewestAccountTxs(AccountTxOptions const& options) { if (!useTxTables_) return {}; @@ -550,7 +358,7 @@ SQLiteDatabaseImp::getNewestAccountTxs(AccountTxOptions const& options) } RelationalDatabase::MetaTxsList -SQLiteDatabaseImp::getOldestAccountTxsB(AccountTxOptions const& options) +SQLiteDatabase::getOldestAccountTxsB(AccountTxOptions const& options) { if (!useTxTables_) return {}; @@ -565,7 +373,7 @@ SQLiteDatabaseImp::getOldestAccountTxsB(AccountTxOptions const& options) } RelationalDatabase::MetaTxsList -SQLiteDatabaseImp::getNewestAccountTxsB(AccountTxOptions const& options) +SQLiteDatabase::getNewestAccountTxsB(AccountTxOptions const& options) { if (!useTxTables_) return {}; @@ -580,7 +388,7 @@ SQLiteDatabaseImp::getNewestAccountTxsB(AccountTxOptions const& options) } std::pair> -SQLiteDatabaseImp::oldestAccountTxPage(AccountTxPageOptions const& options) +SQLiteDatabase::oldestAccountTxPage(AccountTxPageOptions const& options) { if (!useTxTables_) return {}; @@ -604,7 +412,7 @@ SQLiteDatabaseImp::oldestAccountTxPage(AccountTxPageOptions const& options) } std::pair> -SQLiteDatabaseImp::newestAccountTxPage(AccountTxPageOptions const& options) +SQLiteDatabase::newestAccountTxPage(AccountTxPageOptions const& options) { if (!useTxTables_) return {}; @@ -628,7 +436,7 @@ SQLiteDatabaseImp::newestAccountTxPage(AccountTxPageOptions const& options) } std::pair> -SQLiteDatabaseImp::oldestAccountTxPageB(AccountTxPageOptions const& options) +SQLiteDatabase::oldestAccountTxPageB(AccountTxPageOptions const& options) { if (!useTxTables_) return {}; @@ -651,7 +459,7 @@ SQLiteDatabaseImp::oldestAccountTxPageB(AccountTxPageOptions const& options) } std::pair> -SQLiteDatabaseImp::newestAccountTxPageB(AccountTxPageOptions const& options) +SQLiteDatabase::newestAccountTxPageB(AccountTxPageOptions const& options) { if (!useTxTables_) return {}; @@ -674,7 +482,7 @@ SQLiteDatabaseImp::newestAccountTxPageB(AccountTxPageOptions const& options) } std::variant -SQLiteDatabaseImp::getTransaction( +SQLiteDatabase::getTransaction( uint256 const& id, std::optional> const& range, error_code_i& ec) @@ -692,7 +500,7 @@ SQLiteDatabaseImp::getTransaction( } bool -SQLiteDatabaseImp::ledgerDbHasSpace(Config const& config) +SQLiteDatabase::ledgerDbHasSpace(Config const& config) { if (existsLedger()) { @@ -704,7 +512,7 @@ SQLiteDatabaseImp::ledgerDbHasSpace(Config const& config) } bool -SQLiteDatabaseImp::transactionDbHasSpace(Config const& config) +SQLiteDatabase::transactionDbHasSpace(Config const& config) { if (!useTxTables_) return true; @@ -719,7 +527,7 @@ SQLiteDatabaseImp::transactionDbHasSpace(Config const& config) } std::uint32_t -SQLiteDatabaseImp::getKBUsedAll() +SQLiteDatabase::getKBUsedAll() { if (existsLedger()) { @@ -730,7 +538,7 @@ SQLiteDatabaseImp::getKBUsedAll() } std::uint32_t -SQLiteDatabaseImp::getKBUsedLedger() +SQLiteDatabase::getKBUsedLedger() { if (existsLedger()) { @@ -741,7 +549,7 @@ SQLiteDatabaseImp::getKBUsedLedger() } std::uint32_t -SQLiteDatabaseImp::getKBUsedTransaction() +SQLiteDatabase::getKBUsedTransaction() { if (!useTxTables_) return 0; @@ -755,21 +563,43 @@ SQLiteDatabaseImp::getKBUsedTransaction() } void -SQLiteDatabaseImp::closeLedgerDB() +SQLiteDatabase::closeLedgerDB() { ledgerDb_.reset(); } void -SQLiteDatabaseImp::closeTransactionDB() +SQLiteDatabase::closeTransactionDB() { txdb_.reset(); } -std::unique_ptr -getSQLiteDatabase(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue) +SQLiteDatabase::SQLiteDatabase(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue) + : registry_(registry), useTxTables_(config.useTxTables()), j_(registry.journal("SQLiteDatabase")) { - return std::make_unique(registry, config, jobQueue); + DatabaseCon::Setup const setup = setup_DatabaseCon(config, j_); + if (!makeLedgerDBs(config, setup, DatabaseCon::CheckpointerSetup{&jobQueue, ®istry_.logs()})) + { + std::string_view constexpr error = "Failed to create ledger databases"; + + JLOG(j_.fatal()) << error; + Throw(error.data()); + } +} + +SQLiteDatabase::SQLiteDatabase(SQLiteDatabase&& rhs) noexcept + : registry_(rhs.registry_) + , useTxTables_(rhs.useTxTables_) + , j_(rhs.j_) + , ledgerDb_(std::move(rhs.ledgerDb_)) + , txdb_(std::move(rhs.txdb_)) +{ +} + +SQLiteDatabase +setup_RelationalDatabase(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue) +{ + return {registry, config, jobQueue}; } } // namespace xrpl diff --git a/src/xrpld/app/rdb/detail/RelationalDatabase.cpp b/src/xrpld/app/rdb/detail/RelationalDatabase.cpp index bc65a817a4..e69de29bb2 100644 --- a/src/xrpld/app/rdb/detail/RelationalDatabase.cpp +++ b/src/xrpld/app/rdb/detail/RelationalDatabase.cpp @@ -1,39 +0,0 @@ -#include -#include - -namespace xrpl { - -extern std::unique_ptr -getSQLiteDatabase(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue); - -std::unique_ptr -RelationalDatabase::init(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue) -{ - bool use_sqlite = false; - - Section const& rdb_section{config.section(SECTION_RELATIONAL_DB)}; - if (!rdb_section.empty()) - { - if (boost::iequals(get(rdb_section, "backend"), "sqlite")) - { - use_sqlite = true; - } - else - { - Throw("Invalid rdb_section backend value: " + get(rdb_section, "backend")); - } - } - else - { - use_sqlite = true; - } - - if (use_sqlite) - { - return getSQLiteDatabase(registry, config, jobQueue); - } - - return std::unique_ptr(); -} - -} // namespace xrpl diff --git a/src/xrpld/overlay/detail/OverlayImpl.cpp b/src/xrpld/overlay/detail/OverlayImpl.cpp index 6ac6e454d2..549bff024e 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.cpp +++ b/src/xrpld/overlay/detail/OverlayImpl.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include @@ -18,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/overlay/detail/PeerReservationTable.cpp b/src/xrpld/overlay/detail/PeerReservationTable.cpp index 27d9df1129..78f29ad155 100644 --- a/src/xrpld/overlay/detail/PeerReservationTable.cpp +++ b/src/xrpld/overlay/detail/PeerReservationTable.cpp @@ -1,9 +1,8 @@ -#include - #include #include #include #include +#include #include #include diff --git a/src/xrpld/rpc/detail/RPCHelpers.cpp b/src/xrpld/rpc/detail/RPCHelpers.cpp index 0c4cffd8ac..4a0339b763 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.cpp +++ b/src/xrpld/rpc/detail/RPCHelpers.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include @@ -10,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.h b/src/xrpld/rpc/detail/RPCLedgerHelpers.h index 6ea6e3cb78..b2d9df809f 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.h +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.h @@ -7,6 +7,7 @@ #include #include +#include #include @@ -19,8 +20,6 @@ namespace RPC { struct JsonContext; -enum class LedgerShortcut { Current, Closed, Validated }; - /** * @brief Retrieves a ledger by its hash. * diff --git a/src/xrpld/rpc/handlers/AccountTx.cpp b/src/xrpld/rpc/handlers/AccountTx.cpp index fbd1a4d08d..8fe43433d3 100644 --- a/src/xrpld/rpc/handlers/AccountTx.cpp +++ b/src/xrpld/rpc/handlers/AccountTx.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -26,8 +27,6 @@ using TxnsDataBinary = RelationalDatabase::MetaTxsList; using TxnDataBinary = RelationalDatabase::txnMetaLedgerType; using AccountTxArgs = RelationalDatabase::AccountTxArgs; using AccountTxResult = RelationalDatabase::AccountTxResult; - -using LedgerShortcut = RelationalDatabase::LedgerShortcut; using LedgerSpecifier = RelationalDatabase::LedgerSpecifier; // parses args into a ledger specifier, or returns a Json object on error @@ -208,22 +207,19 @@ doAccountTxHelp(RPC::Context& context, AccountTxArgs const& args) args.limit, isUnlimited(context.role)}; - auto const db = dynamic_cast(&context.app.getRelationalDatabase()); - - if (!db) - Throw("Failed to get relational database"); + auto& db = context.app.getRelationalDatabase(); if (args.binary) { if (args.forward) { - auto [tx, marker] = db->oldestAccountTxPageB(options); + auto [tx, marker] = db.oldestAccountTxPageB(options); result.transactions = tx; result.marker = marker; } else { - auto [tx, marker] = db->newestAccountTxPageB(options); + auto [tx, marker] = db.newestAccountTxPageB(options); result.transactions = tx; result.marker = marker; } @@ -232,13 +228,13 @@ doAccountTxHelp(RPC::Context& context, AccountTxArgs const& args) { if (args.forward) { - auto [tx, marker] = db->oldestAccountTxPage(options); + auto [tx, marker] = db.oldestAccountTxPage(options); result.transactions = tx; result.marker = marker; } else { - auto [tx, marker] = db->newestAccountTxPage(options); + auto [tx, marker] = db.newestAccountTxPage(options); result.transactions = tx; result.marker = marker; } diff --git a/src/xrpld/rpc/handlers/GetCounts.cpp b/src/xrpld/rpc/handlers/GetCounts.cpp index 2a59be2747..360389ba3a 100644 --- a/src/xrpld/rpc/handlers/GetCounts.cpp +++ b/src/xrpld/rpc/handlers/GetCounts.cpp @@ -49,22 +49,19 @@ getCountsJson(Application& app, int minObjectCount) if (app.config().useTxTables()) { - auto const db = dynamic_cast(&app.getRelationalDatabase()); + auto& db = app.getRelationalDatabase(); - if (!db) - Throw("Failed to get relational database"); - - auto dbKB = db->getKBUsedAll(); + auto dbKB = db.getKBUsedAll(); if (dbKB > 0) ret[jss::dbKBTotal] = dbKB; - dbKB = db->getKBUsedLedger(); + dbKB = db.getKBUsedLedger(); if (dbKB > 0) ret[jss::dbKBLedger] = dbKB; - dbKB = db->getKBUsedTransaction(); + dbKB = db.getKBUsedTransaction(); if (dbKB > 0) ret[jss::dbKBTransaction] = dbKB; diff --git a/src/xrpld/rpc/handlers/Tx.cpp b/src/xrpld/rpc/handlers/Tx.cpp index 5d8778d619..2f8d71c2c8 100644 --- a/src/xrpld/rpc/handlers/Tx.cpp +++ b/src/xrpld/rpc/handlers/Tx.cpp @@ -3,18 +3,19 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include #include #include #include +#include #include diff --git a/src/xrpld/rpc/handlers/TxHistory.cpp b/src/xrpld/rpc/handlers/TxHistory.cpp index 00894647eb..02ff6fb43c 100644 --- a/src/xrpld/rpc/handlers/TxHistory.cpp +++ b/src/xrpld/rpc/handlers/TxHistory.cpp @@ -2,13 +2,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include namespace xrpl { From 11e8d1f8a206f0c5379ba78bc3aa044adf5a63d7 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Thu, 12 Feb 2026 11:11:26 +0000 Subject: [PATCH 25/26] chore: Fix `gcov` lib coverage build failure on macOS (#6350) For coverage builds, we try to link against the `gcov` library (specific to the environment). But as macOS doesn't have this library and thus doesn't have the coverage tools to generate reports, the coverage builds on that platform were failing on linking. We actually don't need to explicitly force this linking, as the `CodeCoverage` file already has correct detection logic (currently on lines 177-193), which is invoked when the `--coverage` flag is provided: * AppleClang: Uses `xcrun -f llvm-cov` to set `GCOV_TOOL="llvm-cov gcov"`. * Clang: Finds `llvm-cov` to set `GCOV_TOOL="llvm-cov gcov"`. * GCC: Finds `gcov` to set `GCOV_TOOL="gcov"`. The `GCOV_TOOL` is then passed to `gcovr` on line 416, so the correct tool is used for processing coverage data. This change therefore removes the `gcov` suffix from lines 473 and 475 in the `CodeCoverage.cmake` file. --- cmake/CodeCoverage.cmake | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake index 0178d68cc0..fcc4d44133 100644 --- a/cmake/CodeCoverage.cmake +++ b/cmake/CodeCoverage.cmake @@ -466,11 +466,6 @@ function (add_code_coverage_to_target name scope) target_compile_options(${name} ${scope} $<$:${COVERAGE_CXX_COMPILER_FLAGS}> $<$:${COVERAGE_C_COMPILER_FLAGS}>) - target_link_libraries( - ${name} - ${scope} - $<$:${COVERAGE_CXX_LINKER_FLAGS} - gcov> - $<$:${COVERAGE_C_LINKER_FLAGS} - gcov>) + target_link_libraries(${name} ${scope} $<$:${COVERAGE_CXX_LINKER_FLAGS}> + $<$:${COVERAGE_C_LINKER_FLAGS}>) endfunction () # add_code_coverage_to_target From 90cf86a92081b61cd6f9f5dfd927eb022c7e107f Mon Sep 17 00:00:00 2001 From: Shawn Xie Date: Thu, 12 Feb 2026 11:33:34 -0500 Subject: [PATCH 26/26] remove newline --- include/xrpl/protocol/detail/features.macro | 1 - 1 file changed, 1 deletion(-) diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index 9a92e45d72..caefb3cf68 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -15,7 +15,6 @@ // Add new amendments to the top of this list. // Keep it sorted in reverse chronological order. - XRPL_FEATURE(ConfidentialTransfer, Supported::no, VoteBehavior::DefaultNo) XRPL_FIX (PermissionedDomainInvariant, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (ExpiredNFTokenOfferRemoval, Supported::yes, VoteBehavior::DefaultNo)