From e95edcba4830d020c8da47af3ef1260c47540918 Mon Sep 17 00:00:00 2001 From: tequ Date: Thu, 19 Feb 2026 23:50:12 +0900 Subject: [PATCH] fix for xahaud codebase --- .github/workflows/guard-checker-build.yml | 2 +- BUILD.md | 2 +- CMakeLists.txt | 2 -- build-core.sh | 12 ++++++------ build-full.sh | 8 ++++---- hook/generate_error.sh | 2 +- hook/generate_extern.sh | 2 +- hook/generate_sfcodes.sh | 4 ++-- hook/generate_tts.sh | 2 +- {src/xrpld/app => include/xrpl}/hook/Enum.h | 0 {src/xrpld/app => include/xrpl}/hook/Guard.h | 0 {src/xrpld/app => include/xrpl}/hook/Macro.h | 0 {src/xrpld/app => include/xrpl}/hook/Misc.h | 0 .../app => include/xrpl}/hook/guard_checker.cpp | 0 {src/xrpld/app => include/xrpl}/hook/hook_api.macro | 0 {src/xrpld/app => include/xrpl}/hook/makefile | 0 {src/xrpld/app => include/xrpl}/hook/xahau.h | 0 include/xrpl/protocol/Import.h | 4 ++-- src/libxrpl/protocol/STTx.cpp | 3 +-- src/test/app/SetHookTSH_test.cpp | 2 +- src/test/app/SetHook_test.cpp | 2 +- src/test/app/Touch_test.cpp | 2 +- src/test/jtx/impl/hook.cpp | 2 +- src/test/rpc/AccountObjects_test.cpp | 2 +- src/test/rpc/AccountTx_test.cpp | 2 +- src/test/rpc/LedgerRPC_test.cpp | 2 +- src/test/unit_test/FileDirGuard.h | 2 ++ src/xrpld/app/hook/HookAPI.h | 2 +- src/xrpld/app/hook/applyHook.h | 10 +++++----- src/xrpld/app/tx/detail/Change.cpp | 4 ++-- src/xrpld/app/tx/detail/SetHook.cpp | 4 ++-- src/xrpld/app/tx/detail/SetHook.h | 2 +- src/xrpld/app/tx/detail/Transactor.cpp | 2 +- src/xrpld/app/tx/detail/XahauGenesis.h | 2 +- 34 files changed, 42 insertions(+), 43 deletions(-) rename {src/xrpld/app => include/xrpl}/hook/Enum.h (100%) rename {src/xrpld/app => include/xrpl}/hook/Guard.h (100%) rename {src/xrpld/app => include/xrpl}/hook/Macro.h (100%) rename {src/xrpld/app => include/xrpl}/hook/Misc.h (100%) rename {src/xrpld/app => include/xrpl}/hook/guard_checker.cpp (100%) rename {src/xrpld/app => include/xrpl}/hook/hook_api.macro (100%) rename {src/xrpld/app => include/xrpl}/hook/makefile (100%) rename {src/xrpld/app => include/xrpl}/hook/xahau.h (100%) diff --git a/.github/workflows/guard-checker-build.yml b/.github/workflows/guard-checker-build.yml index e3e7f6cbc..0734f1a96 100644 --- a/.github/workflows/guard-checker-build.yml +++ b/.github/workflows/guard-checker-build.yml @@ -20,5 +20,5 @@ jobs: - name: Build Guard Checker run: | - cd src/ripple/app/hook + cd include/xrpl/hook make guard_checker diff --git a/BUILD.md b/BUILD.md index cee9d396e..6969988c0 100644 --- a/BUILD.md +++ b/BUILD.md @@ -340,7 +340,7 @@ to select only specific tests for the purpose of the coverage report, by setting the `coverage_test` variable in `cmake` The default coverage report format is `html-details`, but the user -can override it to any of the formats listed in `Builds/CMake/CodeCoverage.cmake` +can override it to any of the formats listed in `cmake/CodeCoverage.cmake` by setting the `coverage_format` variable in `cmake`. It is also possible to generate more than one format at a time by setting the `coverage_extra_args` variable in `cmake`. The specific command line used to run the `gcovr` tool will be diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f3a1a530..24c4c12c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,8 +155,6 @@ endif() set(PROJECT_EXPORT_SET RippleExports) include(RippledCore) -include(deps/Protobuf) -include(deps/gRPC) include(RippledInstall) include(RippledDocs) include(RippledValidatorKeys) diff --git a/build-core.sh b/build-core.sh index ce78c7625..e552d210c 100755 --- a/build-core.sh +++ b/build-core.sh @@ -34,7 +34,7 @@ fi BUILD_TYPE=Release -mv Builds/CMake/deps/WasmEdge.cmake Builds/CMake/deps/WasmEdge.old && +mv cmake/deps/WasmEdge.cmake cmake/deps/WasmEdge.old && echo "find_package(LLVM REQUIRED CONFIG) message(STATUS \"Found LLVM \${LLVM_PACKAGE_VERSION}\") message(STATUS \"Using LLVMConfig.cmake in: \${LLVM_DIR}\") @@ -43,12 +43,12 @@ set_target_properties(wasmedge PROPERTIES IMPORTED_LOCATION \${WasmEdge_LIB}) target_link_libraries (ripple_libs INTERFACE wasmedge) add_library (wasmedge::wasmedge ALIAS wasmedge) message(\"WasmEdge DONE\") -" > Builds/CMake/deps/WasmEdge.cmake && +" > cmake/deps/WasmEdge.cmake && export LDFLAGS="-static-libstdc++" git config --global --add safe.directory /io && -git checkout src/ripple/protocol/impl/BuildInfo.cpp && +git checkout src/libxrpl/protocol/BuildInfo.cpp && sed -i s/\"0.0.0\"/\"$(date +%Y).$(date +%-m).$(date +%-d)-$(git rev-parse --abbrev-ref HEAD)$(if [ -n "$4" ]; then echo "+$4"; fi)\"/g src/ripple/protocol/impl/BuildInfo.cpp && conan export external/snappy --version 1.1.10 --user xahaud --channel stable && conan export external/soci --version 4.0.3 --user xahaud --channel stable && @@ -101,9 +101,9 @@ fi cd ..; -mv src/ripple/net/impl/RegisterSSLCerts.cpp.old src/ripple/net/impl/RegisterSSLCerts.cpp; -mv Builds/CMake/deps/WasmEdge.old Builds/CMake/deps/WasmEdge.cmake; +mv src/xrpld/net/detail/RegisterSSLCerts.cpp.old src/xrpld/net/detail/RegisterSSLCerts.cpp; +mv cmake/deps/WasmEdge.old cmake/deps/WasmEdge.cmake; rm src/certs/certbundle.h; -git checkout src/ripple/protocol/impl/BuildInfo.cpp; +git checkout src/libxrpl/protocol/BuildInfo.cpp; echo "END INSIDE CONTAINER - CORE" diff --git a/build-full.sh b/build-full.sh index 9723da654..7c3f2b011 100644 --- a/build-full.sh +++ b/build-full.sh @@ -19,9 +19,9 @@ umask 0000; cd /io; mkdir -p src/certs; curl --silent -k https://raw.githubusercontent.com/RichardAH/rippled-release-builder/main/ca-bundle/certbundle.h -o src/certs/certbundle.h; -if [ "`grep certbundle.h src/ripple/net/impl/RegisterSSLCerts.cpp | wc -l`" -eq "0" ] +if [ "`grep certbundle.h src/xrpld/net/detail/RegisterSSLCerts.cpp | wc -l`" -eq "0" ] then - cp src/ripple/net/impl/RegisterSSLCerts.cpp src/ripple/net/impl/RegisterSSLCerts.cpp.old + cp src/xrpld/net/detail/RegisterSSLCerts.cpp src/xrpld/net/detail/RegisterSSLCerts.cpp.old perl -i -pe "s/^{/{ #ifdef EMBEDDED_CA_BUNDLE BIO *cbio = BIO_new_mem_buf(ca_bundle.data(), ca_bundle.size()); @@ -61,8 +61,8 @@ then BIO_free(cbio); } } - #endif/g" src/ripple/net/impl/RegisterSSLCerts.cpp && - sed -i "s/#include /\0\n#include /g" src/ripple/net/impl/RegisterSSLCerts.cpp + #endif/g" src/xrpld/net/detail/RegisterSSLCerts.cpp && + sed -i "s/#include /\0\n#include /g" src/xrpld/net/detail/RegisterSSLCerts.cpp fi # Environment setup moved to Dockerfile in release-builder.sh source /opt/rh/gcc-toolset-11/enable diff --git a/hook/generate_error.sh b/hook/generate_error.sh index 1e5aaadb2..5aa232f2b 100755 --- a/hook/generate_error.sh +++ b/hook/generate_error.sh @@ -4,7 +4,7 @@ set -eu SCRIPT_DIR=$(dirname "$0") SCRIPT_DIR=$(cd "$SCRIPT_DIR" && pwd) -ENUM_FILE="$SCRIPT_DIR/../src/ripple/app/hook/Enum.h" +ENUM_FILE="$SCRIPT_DIR/../include/xrpl/hook/Enum.h" echo '// For documentation please see: https://xrpl-hooks.readme.io/reference/' echo '// Generated using generate_error.sh' diff --git a/hook/generate_extern.sh b/hook/generate_extern.sh index 0f05dac52..f16647304 100755 --- a/hook/generate_extern.sh +++ b/hook/generate_extern.sh @@ -4,7 +4,7 @@ set -eu SCRIPT_DIR=$(dirname "$0") SCRIPT_DIR=$(cd "$SCRIPT_DIR" && pwd) -APPLY_HOOK="$SCRIPT_DIR/../src/ripple/app/hook/hook_api.macro" +APPLY_HOOK="$SCRIPT_DIR/../include/xrpl/hook/hook_api.macro" { echo '// For documentation please see: https://xrpl-hooks.readme.io/reference/' diff --git a/hook/generate_sfcodes.sh b/hook/generate_sfcodes.sh index 9a7ba99aa..a35cb05ea 100755 --- a/hook/generate_sfcodes.sh +++ b/hook/generate_sfcodes.sh @@ -4,10 +4,10 @@ set -eu SCRIPT_DIR=$(dirname "$0") SCRIPT_DIR=$(cd "$SCRIPT_DIR" && pwd) -RIPPLED_ROOT="$SCRIPT_DIR/../src/ripple" +RIPPLED_ROOT="$SCRIPT_DIR/../src/libxrpl" echo '// For documentation please see: https://xrpl-hooks.readme.io/reference/' echo '// Generated using generate_sfcodes.sh' -cat "$RIPPLED_ROOT/protocol/impl/SField.cpp" | grep -E '^CONSTRUCT_' | +cat "$RIPPLED_ROOT/protocol/SField.cpp" | grep -E '^CONSTRUCT_' | sed 's/UINT16,/1,/g' | sed 's/UINT32,/2,/g' | sed 's/UINT64,/3,/g' | diff --git a/hook/generate_tts.sh b/hook/generate_tts.sh index b27b8237c..f55d254f9 100755 --- a/hook/generate_tts.sh +++ b/hook/generate_tts.sh @@ -4,7 +4,7 @@ set -eu SCRIPT_DIR=$(dirname "$0") SCRIPT_DIR=$(cd "$SCRIPT_DIR" && pwd) -RIPPLED_ROOT="$SCRIPT_DIR/../src/ripple" +RIPPLED_ROOT="$SCRIPT_DIR/../include/xrpl" TX_FORMATS="$RIPPLED_ROOT/protocol/TxFormats.h" echo '// For documentation please see: https://xrpl-hooks.readme.io/reference/' diff --git a/src/xrpld/app/hook/Enum.h b/include/xrpl/hook/Enum.h similarity index 100% rename from src/xrpld/app/hook/Enum.h rename to include/xrpl/hook/Enum.h diff --git a/src/xrpld/app/hook/Guard.h b/include/xrpl/hook/Guard.h similarity index 100% rename from src/xrpld/app/hook/Guard.h rename to include/xrpl/hook/Guard.h diff --git a/src/xrpld/app/hook/Macro.h b/include/xrpl/hook/Macro.h similarity index 100% rename from src/xrpld/app/hook/Macro.h rename to include/xrpl/hook/Macro.h diff --git a/src/xrpld/app/hook/Misc.h b/include/xrpl/hook/Misc.h similarity index 100% rename from src/xrpld/app/hook/Misc.h rename to include/xrpl/hook/Misc.h diff --git a/src/xrpld/app/hook/guard_checker.cpp b/include/xrpl/hook/guard_checker.cpp similarity index 100% rename from src/xrpld/app/hook/guard_checker.cpp rename to include/xrpl/hook/guard_checker.cpp diff --git a/src/xrpld/app/hook/hook_api.macro b/include/xrpl/hook/hook_api.macro similarity index 100% rename from src/xrpld/app/hook/hook_api.macro rename to include/xrpl/hook/hook_api.macro diff --git a/src/xrpld/app/hook/makefile b/include/xrpl/hook/makefile similarity index 100% rename from src/xrpld/app/hook/makefile rename to include/xrpl/hook/makefile diff --git a/src/xrpld/app/hook/xahau.h b/include/xrpl/hook/xahau.h similarity index 100% rename from src/xrpld/app/hook/xahau.h rename to include/xrpl/hook/xahau.h diff --git a/include/xrpl/protocol/Import.h b/include/xrpl/protocol/Import.h index 26f5b7463..b7a0563fa 100644 --- a/include/xrpl/protocol/Import.h +++ b/include/xrpl/protocol/Import.h @@ -20,8 +20,8 @@ #ifndef RIPPLE_PROTOCOL_IMPORT_H_INCLUDED #define RIPPLE_PROTOCOL_IMPORT_H_INCLUDED -// #include -#include +#include +#include #include #include #include diff --git a/src/libxrpl/protocol/STTx.cpp b/src/libxrpl/protocol/STTx.cpp index 8f1ab4ea9..677279197 100644 --- a/src/libxrpl/protocol/STTx.cpp +++ b/src/libxrpl/protocol/STTx.cpp @@ -17,13 +17,12 @@ */ //============================================================================== -#include #include #include #include #include +#include #include -#include #include #include #include diff --git a/src/test/app/SetHookTSH_test.cpp b/src/test/app/SetHookTSH_test.cpp index 112bd97e2..e11281f41 100644 --- a/src/test/app/SetHookTSH_test.cpp +++ b/src/test/app/SetHookTSH_test.cpp @@ -21,11 +21,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/src/test/app/SetHook_test.cpp b/src/test/app/SetHook_test.cpp index 39bb9f783..101af9f33 100644 --- a/src/test/app/SetHook_test.cpp +++ b/src/test/app/SetHook_test.cpp @@ -20,9 +20,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/src/test/app/Touch_test.cpp b/src/test/app/Touch_test.cpp index 0504e53a4..6943e5d37 100644 --- a/src/test/app/Touch_test.cpp +++ b/src/test/app/Touch_test.cpp @@ -21,9 +21,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/src/test/jtx/impl/hook.cpp b/src/test/jtx/impl/hook.cpp index 9ba626bdb..8602e0053 100644 --- a/src/test/jtx/impl/hook.cpp +++ b/src/test/jtx/impl/hook.cpp @@ -18,9 +18,9 @@ //============================================================================== #include -#include #include #include +#include #include #include #include diff --git a/src/test/rpc/AccountObjects_test.cpp b/src/test/rpc/AccountObjects_test.cpp index c9d4ac1c5..25f1ad9fe 100644 --- a/src/test/rpc/AccountObjects_test.cpp +++ b/src/test/rpc/AccountObjects_test.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/test/rpc/AccountTx_test.cpp b/src/test/rpc/AccountTx_test.cpp index 9a4903e65..dd519b433 100644 --- a/src/test/rpc/AccountTx_test.cpp +++ b/src/test/rpc/AccountTx_test.cpp @@ -18,9 +18,9 @@ //============================================================================== #include -#include #include #include +#include #include #include diff --git a/src/test/rpc/LedgerRPC_test.cpp b/src/test/rpc/LedgerRPC_test.cpp index 7ed7901e4..1aba734eb 100644 --- a/src/test/rpc/LedgerRPC_test.cpp +++ b/src/test/rpc/LedgerRPC_test.cpp @@ -23,11 +23,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/src/test/unit_test/FileDirGuard.h b/src/test/unit_test/FileDirGuard.h index 246ac2623..6d64ff912 100644 --- a/src/test/unit_test/FileDirGuard.h +++ b/src/test/unit_test/FileDirGuard.h @@ -24,6 +24,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include +#include + namespace ripple { namespace test { namespace detail { diff --git a/src/xrpld/app/hook/HookAPI.h b/src/xrpld/app/hook/HookAPI.h index ccb769c56..d18cba97b 100644 --- a/src/xrpld/app/hook/HookAPI.h +++ b/src/xrpld/app/hook/HookAPI.h @@ -1,8 +1,8 @@ #ifndef HOOK_API_INCLUDED #define HOOK_API_INCLUDED 1 -#include #include +#include namespace hook { using namespace ripple; diff --git a/src/xrpld/app/hook/applyHook.h b/src/xrpld/app/hook/applyHook.h index 7475ca3e8..cbcd35792 100644 --- a/src/xrpld/app/hook/applyHook.h +++ b/src/xrpld/app/hook/applyHook.h @@ -1,13 +1,13 @@ #ifndef APPLY_HOOK_INCLUDED #define APPLY_HOOK_INCLUDED 1 -#include #include -#include -#include #include #include #include #include +#include +#include +#include #include #include #include @@ -70,7 +70,7 @@ namespace hook_api { DECLARE_HOOK_FUNCTION( \ RETURN_TYPE, FUNCTION_NAME, HOOK_WRAP_PARAMS PARAMS_TUPLE); -#include +#include #undef HOOK_API_DEFINITION #undef HOOK_WRAP_PARAMS @@ -472,7 +472,7 @@ public: #define HOOK_API_DEFINITION(RETURN_TYPE, FUNCTION_NAME, PARAMS_TUPLE, ...) \ ADD_HOOK_FUNCTION(FUNCTION_NAME, ctx); -#include +#include #undef HOOK_API_DEFINITION #undef HOOK_WRAP_PARAMS diff --git a/src/xrpld/app/tx/detail/Change.cpp b/src/xrpld/app/tx/detail/Change.cpp index ceda866dc..ccbc6dbdb 100644 --- a/src/xrpld/app/tx/detail/Change.cpp +++ b/src/xrpld/app/tx/detail/Change.cpp @@ -17,8 +17,6 @@ */ //============================================================================== -#include -#include #include #include #include @@ -30,6 +28,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/src/xrpld/app/tx/detail/SetHook.cpp b/src/xrpld/app/tx/detail/SetHook.cpp index a12a3402d..6b9f6858d 100644 --- a/src/xrpld/app/tx/detail/SetHook.cpp +++ b/src/xrpld/app/tx/detail/SetHook.cpp @@ -19,14 +19,14 @@ #include -#include -#include #include #include #include #include #include #include +#include +#include #include #include #include diff --git a/src/xrpld/app/tx/detail/SetHook.h b/src/xrpld/app/tx/detail/SetHook.h index 382b681f0..8aa53b54c 100644 --- a/src/xrpld/app/tx/detail/SetHook.h +++ b/src/xrpld/app/tx/detail/SetHook.h @@ -20,7 +20,6 @@ #ifndef RIPPLE_TX_SETHOOK_H_INCLUDED #define RIPPLE_TX_SETHOOK_H_INCLUDED -#include #include #include #include @@ -28,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/tx/detail/Transactor.cpp b/src/xrpld/app/tx/detail/Transactor.cpp index 989d6a051..843a296c4 100644 --- a/src/xrpld/app/tx/detail/Transactor.cpp +++ b/src/xrpld/app/tx/detail/Transactor.cpp @@ -17,7 +17,6 @@ */ //============================================================================== -#include #include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/tx/detail/XahauGenesis.h b/src/xrpld/app/tx/detail/XahauGenesis.h index 79973fb67..5ff91ec08 100644 --- a/src/xrpld/app/tx/detail/XahauGenesis.h +++ b/src/xrpld/app/tx/detail/XahauGenesis.h @@ -1,7 +1,7 @@ namespace XahauGenesis { // the wasm bytecode is loaded from this file as vec GovernanceHook and // RewardHook -#include +#include using namespace ripple;