From e270a68e3d1660243f0c7b4fe07a423b21714008 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 22 Sep 2026 23:39:16 +0530 Subject: [PATCH] fix: Remove the XChainBridge ledger entry wrappers develop added a typed wrapper per ledger entry after this branch was last updated, including BridgeEntry, XChainOwnedClaimIDEntry and XChainOwnedCreateAccountClaimIDEntry, whose headers include the deleted STXChainBridge.h. Delete those three wrappers and their tests, and drop them from the SLEBase test's include list. --- include/xrpl/ledger/entries/BridgeEntry.h | 36 ---------------- .../ledger/entries/XChainOwnedClaimIDEntry.h | 38 ----------------- .../XChainOwnedCreateAccountClaimIDEntry.h | 39 ------------------ src/tests/libxrpl/ledger/BridgeEntry.cpp | 41 ------------------- src/tests/libxrpl/ledger/SLEBase.cpp | 5 +-- .../ledger/XChainOwnedClaimIDEntry.cpp | 29 ------------- .../XChainOwnedCreateAccountClaimIDEntry.cpp | 35 ---------------- 7 files changed, 1 insertion(+), 222 deletions(-) delete mode 100644 include/xrpl/ledger/entries/BridgeEntry.h delete mode 100644 include/xrpl/ledger/entries/XChainOwnedClaimIDEntry.h delete mode 100644 include/xrpl/ledger/entries/XChainOwnedCreateAccountClaimIDEntry.h delete mode 100644 src/tests/libxrpl/ledger/BridgeEntry.cpp delete mode 100644 src/tests/libxrpl/ledger/XChainOwnedClaimIDEntry.cpp delete mode 100644 src/tests/libxrpl/ledger/XChainOwnedCreateAccountClaimIDEntry.cpp diff --git a/include/xrpl/ledger/entries/BridgeEntry.h b/include/xrpl/ledger/entries/BridgeEntry.h deleted file mode 100644 index a51fbe0c12..0000000000 --- a/include/xrpl/ledger/entries/BridgeEntry.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl { - -template -class BridgeEntry : public SLEBase -{ -public: - using Base = SLEBase; - - // Inherit base constructors: adopt an existing SLE, or resolve one from a - // Keylet against the view. - using Base::Base; - - explicit BridgeEntry( - STXChainBridge const& bridge, - STXChainBridge::ChainType chainType, - Base::ViewRefType view, - beast::Journal j = beast::Journal{beast::Journal::getNullSink()}) - : Base(keylet::bridge(bridge, chainType), view, j) - { - } -}; - -using BridgeEntryR = BridgeEntry; -using BridgeEntryW = BridgeEntry; - -} // namespace xrpl diff --git a/include/xrpl/ledger/entries/XChainOwnedClaimIDEntry.h b/include/xrpl/ledger/entries/XChainOwnedClaimIDEntry.h deleted file mode 100644 index 9cec1fcec9..0000000000 --- a/include/xrpl/ledger/entries/XChainOwnedClaimIDEntry.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace xrpl { - -template -class XChainOwnedClaimIDEntry : public SLEBase -{ -public: - using Base = SLEBase; - - // Inherit base constructors: adopt an existing SLE, or resolve one from a - // Keylet against the view. - using Base::Base; - - explicit XChainOwnedClaimIDEntry( - STXChainBridge const& bridge, - std::uint64_t seq, - Base::ViewRefType view, - beast::Journal j = beast::Journal{beast::Journal::getNullSink()}) - : Base(keylet::xChainClaimID(bridge, seq), view, j) - { - } -}; - -using XChainOwnedClaimIDEntryR = XChainOwnedClaimIDEntry; -using XChainOwnedClaimIDEntryW = XChainOwnedClaimIDEntry; - -} // namespace xrpl diff --git a/include/xrpl/ledger/entries/XChainOwnedCreateAccountClaimIDEntry.h b/include/xrpl/ledger/entries/XChainOwnedCreateAccountClaimIDEntry.h deleted file mode 100644 index e9494e702f..0000000000 --- a/include/xrpl/ledger/entries/XChainOwnedCreateAccountClaimIDEntry.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace xrpl { - -template -class XChainOwnedCreateAccountClaimIDEntry - : public SLEBase -{ -public: - using Base = SLEBase; - - // Inherit base constructors: adopt an existing SLE, or resolve one from a - // Keylet against the view. - using Base::Base; - - explicit XChainOwnedCreateAccountClaimIDEntry( - STXChainBridge const& bridge, - std::uint64_t seq, - Base::ViewRefType view, - beast::Journal j = beast::Journal{beast::Journal::getNullSink()}) - : Base(keylet::xChainCreateAccountClaimID(bridge, seq), view, j) - { - } -}; - -using XChainOwnedCreateAccountClaimIDEntryR = XChainOwnedCreateAccountClaimIDEntry; -using XChainOwnedCreateAccountClaimIDEntryW = XChainOwnedCreateAccountClaimIDEntry; - -} // namespace xrpl diff --git a/src/tests/libxrpl/ledger/BridgeEntry.cpp b/src/tests/libxrpl/ledger/BridgeEntry.cpp deleted file mode 100644 index bae65ea8b5..0000000000 --- a/src/tests/libxrpl/ledger/BridgeEntry.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#include -#include -#include -#include - -#include -#include -#include - -namespace xrpl::test { - -TEST(BridgeEntryTests, Constructors) -{ - EntryTestEnv e; - - STXChainBridge const bridge{e.alice.id(), xrpIssue(), e.bob.id(), IOU("USD", e.bob).issue()}; - - expectKeylet( - e, - keylet::bridge(bridge, STXChainBridge::ChainType::Locking), - "bridge(bridge, Locking)", - bridge, - STXChainBridge::ChainType::Locking); - - expectKeylet( - e, - keylet::bridge(bridge, STXChainBridge::ChainType::Issuing), - "bridge(bridge, Issuing)", - bridge, - STXChainBridge::ChainType::Issuing); - - // The two chain types must not collide, or the assertions above would - // pass with chainType ignored entirely. - EXPECT_NE( - keylet::bridge(bridge, STXChainBridge::ChainType::Locking).key, - keylet::bridge(bridge, STXChainBridge::ChainType::Issuing).key); -} - -} // namespace xrpl::test diff --git a/src/tests/libxrpl/ledger/SLEBase.cpp b/src/tests/libxrpl/ledger/SLEBase.cpp index 910cb27f09..434be6d371 100644 --- a/src/tests/libxrpl/ledger/SLEBase.cpp +++ b/src/tests/libxrpl/ledger/SLEBase.cpp @@ -8,7 +8,6 @@ #include // IWYU pragma: keep #include #include // IWYU pragma: keep -#include // IWYU pragma: keep #include // IWYU pragma: keep #include // IWYU pragma: keep #include // IWYU pragma: keep @@ -33,9 +32,7 @@ #include // IWYU pragma: keep #include // IWYU pragma: keep #include -#include // IWYU pragma: keep -#include // IWYU pragma: keep -#include // IWYU pragma: keep +#include // IWYU pragma: keep #include #include #include diff --git a/src/tests/libxrpl/ledger/XChainOwnedClaimIDEntry.cpp b/src/tests/libxrpl/ledger/XChainOwnedClaimIDEntry.cpp deleted file mode 100644 index 1833c68f79..0000000000 --- a/src/tests/libxrpl/ledger/XChainOwnedClaimIDEntry.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include - -#include -#include -#include - -#include -#include -#include - -#include - -namespace xrpl::test { - -TEST(XChainOwnedClaimIDEntryTests, Constructors) -{ - EntryTestEnv e; - - STXChainBridge const bridge{e.alice.id(), xrpIssue(), e.bob.id(), IOU("USD", e.bob).issue()}; - - expectKeylet( - e, - keylet::xChainClaimID(bridge, 5u), - "xChainClaimID(bridge, seq)", - bridge, - std::uint64_t{5}); -} - -} // namespace xrpl::test diff --git a/src/tests/libxrpl/ledger/XChainOwnedCreateAccountClaimIDEntry.cpp b/src/tests/libxrpl/ledger/XChainOwnedCreateAccountClaimIDEntry.cpp deleted file mode 100644 index d109000f77..0000000000 --- a/src/tests/libxrpl/ledger/XChainOwnedCreateAccountClaimIDEntry.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - -namespace xrpl::test { - -TEST(XChainOwnedCreateAccountClaimIDEntryTests, Constructors) -{ - EntryTestEnv e; - - STXChainBridge const bridge{e.alice.id(), xrpIssue(), e.bob.id(), IOU("USD", e.bob).issue()}; - - expectKeylet( - e, - keylet::xChainCreateAccountClaimID(bridge, 5u), - "xChainCreateAccountClaimID(bridge, seq)", - bridge, - std::uint64_t{5}); - - // Must not collide with the plain claim-ID keylet, which takes the same - // arguments. - EXPECT_NE( - keylet::xChainCreateAccountClaimID(bridge, 5u).key, keylet::xChainClaimID(bridge, 5u).key); -} - -} // namespace xrpl::test