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.
This commit is contained in:
Mayukha Vadari
2026-09-22 23:39:16 +05:30
parent 20ce5e50ca
commit e270a68e3d
7 changed files with 1 additions and 222 deletions

View File

@@ -1,36 +0,0 @@
#pragma once
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/ApplyView.h>
#include <xrpl/ledger/ReadView.h>
#include <xrpl/ledger/entries/SLEBase.h>
#include <xrpl/protocol/Indexes.h>
#include <xrpl/protocol/LedgerFormats.h>
#include <xrpl/protocol/STXChainBridge.h>
namespace xrpl {
template <typename ViewT>
class BridgeEntry : public SLEBase<ViewT, ltBRIDGE>
{
public:
using Base = SLEBase<ViewT, ltBRIDGE>;
// 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<ReadView>;
using BridgeEntryW = BridgeEntry<ApplyView>;
} // namespace xrpl

View File

@@ -1,38 +0,0 @@
#pragma once
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/ApplyView.h>
#include <xrpl/ledger/ReadView.h>
#include <xrpl/ledger/entries/SLEBase.h>
#include <xrpl/protocol/Indexes.h>
#include <xrpl/protocol/LedgerFormats.h>
#include <xrpl/protocol/STXChainBridge.h>
#include <cstdint>
namespace xrpl {
template <typename ViewT>
class XChainOwnedClaimIDEntry : public SLEBase<ViewT, ltXCHAIN_OWNED_CLAIM_ID>
{
public:
using Base = SLEBase<ViewT, ltXCHAIN_OWNED_CLAIM_ID>;
// 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<ReadView>;
using XChainOwnedClaimIDEntryW = XChainOwnedClaimIDEntry<ApplyView>;
} // namespace xrpl

View File

@@ -1,39 +0,0 @@
#pragma once
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/ApplyView.h>
#include <xrpl/ledger/ReadView.h>
#include <xrpl/ledger/entries/SLEBase.h>
#include <xrpl/protocol/Indexes.h>
#include <xrpl/protocol/LedgerFormats.h>
#include <xrpl/protocol/STXChainBridge.h>
#include <cstdint>
namespace xrpl {
template <typename ViewT>
class XChainOwnedCreateAccountClaimIDEntry
: public SLEBase<ViewT, ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID>
{
public:
using Base = SLEBase<ViewT, ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID>;
// 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<ReadView>;
using XChainOwnedCreateAccountClaimIDEntryW = XChainOwnedCreateAccountClaimIDEntry<ApplyView>;
} // namespace xrpl

View File

@@ -1,41 +0,0 @@
#include <xrpl/ledger/entries/BridgeEntry.h>
#include <xrpl/protocol/Indexes.h>
#include <xrpl/protocol/Issue.h>
#include <xrpl/protocol/Keylet.h>
#include <xrpl/protocol/STXChainBridge.h>
#include <gtest/gtest.h>
#include <helpers/IOU.h>
#include <ledger/EntryTestHelpers.h>
namespace xrpl::test {
TEST(BridgeEntryTests, Constructors)
{
EntryTestEnv e;
STXChainBridge const bridge{e.alice.id(), xrpIssue(), e.bob.id(), IOU("USD", e.bob).issue()};
expectKeylet<BridgeEntry>(
e,
keylet::bridge(bridge, STXChainBridge::ChainType::Locking),
"bridge(bridge, Locking)",
bridge,
STXChainBridge::ChainType::Locking);
expectKeylet<BridgeEntry>(
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

View File

@@ -8,7 +8,6 @@
#include <xrpl/ledger/entries/AMMEntry.h> // IWYU pragma: keep
#include <xrpl/ledger/entries/AccountRootEntry.h>
#include <xrpl/ledger/entries/AmendmentsEntry.h> // IWYU pragma: keep
#include <xrpl/ledger/entries/BridgeEntry.h> // IWYU pragma: keep
#include <xrpl/ledger/entries/CheckEntry.h> // IWYU pragma: keep
#include <xrpl/ledger/entries/CredentialEntry.h> // IWYU pragma: keep
#include <xrpl/ledger/entries/DIDEntry.h> // IWYU pragma: keep
@@ -33,9 +32,7 @@
#include <xrpl/ledger/entries/SignerListEntry.h> // IWYU pragma: keep
#include <xrpl/ledger/entries/SponsorshipEntry.h> // IWYU pragma: keep
#include <xrpl/ledger/entries/TicketEntry.h>
#include <xrpl/ledger/entries/VaultEntry.h> // IWYU pragma: keep
#include <xrpl/ledger/entries/XChainOwnedClaimIDEntry.h> // IWYU pragma: keep
#include <xrpl/ledger/entries/XChainOwnedCreateAccountClaimIDEntry.h> // IWYU pragma: keep
#include <xrpl/ledger/entries/VaultEntry.h> // IWYU pragma: keep
#include <xrpl/protocol/Indexes.h>
#include <xrpl/protocol/LedgerFormats.h>
#include <xrpl/protocol/SField.h>

View File

@@ -1,29 +0,0 @@
#include <xrpl/ledger/entries/XChainOwnedClaimIDEntry.h>
#include <xrpl/protocol/Indexes.h>
#include <xrpl/protocol/Issue.h>
#include <xrpl/protocol/STXChainBridge.h>
#include <gtest/gtest.h>
#include <helpers/IOU.h>
#include <ledger/EntryTestHelpers.h>
#include <cstdint>
namespace xrpl::test {
TEST(XChainOwnedClaimIDEntryTests, Constructors)
{
EntryTestEnv e;
STXChainBridge const bridge{e.alice.id(), xrpIssue(), e.bob.id(), IOU("USD", e.bob).issue()};
expectKeylet<XChainOwnedClaimIDEntry>(
e,
keylet::xChainClaimID(bridge, 5u),
"xChainClaimID(bridge, seq)",
bridge,
std::uint64_t{5});
}
} // namespace xrpl::test

View File

@@ -1,35 +0,0 @@
#include <xrpl/ledger/entries/XChainOwnedCreateAccountClaimIDEntry.h>
#include <xrpl/protocol/Indexes.h>
#include <xrpl/protocol/Issue.h>
#include <xrpl/protocol/Keylet.h>
#include <xrpl/protocol/STXChainBridge.h>
#include <gtest/gtest.h>
#include <helpers/IOU.h>
#include <ledger/EntryTestHelpers.h>
#include <cstdint>
namespace xrpl::test {
TEST(XChainOwnedCreateAccountClaimIDEntryTests, Constructors)
{
EntryTestEnv e;
STXChainBridge const bridge{e.alice.id(), xrpIssue(), e.bob.id(), IOU("USD", e.bob).issue()};
expectKeylet<XChainOwnedCreateAccountClaimIDEntry>(
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