From 4f295d48562c8a82583182f2649c5acf5765af69 Mon Sep 17 00:00:00 2001 From: JCW Date: Fri, 11 Jul 2025 10:40:17 +0100 Subject: [PATCH] Fix build error --- include/xrpl/protocol/TypedLedgerEntries.h | 5 +++-- src/test/protocol/TypedLedgerEntries_test.cpp | 14 ++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/xrpl/protocol/TypedLedgerEntries.h b/include/xrpl/protocol/TypedLedgerEntries.h index 7bda35659f..c7ef397f4d 100644 --- a/include/xrpl/protocol/TypedLedgerEntries.h +++ b/include/xrpl/protocol/TypedLedgerEntries.h @@ -143,10 +143,11 @@ public: return *array_; } + template ProxyType - createItem() + createItem(TArgs&&... args) { - return ProxyType::create(); + return ProxyType::create(std::forward(args)...); } void diff --git a/src/test/protocol/TypedLedgerEntries_test.cpp b/src/test/protocol/TypedLedgerEntries_test.cpp index 69d0843530..df436d0c1b 100644 --- a/src/test/protocol/TypedLedgerEntries_test.cpp +++ b/src/test/protocol/TypedLedgerEntries_test.cpp @@ -28,23 +28,24 @@ struct TypedLedgerEntries_test : public beast::unit_test::suite void testAccessSTArrayProxy() { + testcase("testAccessSTArrayProxy"); STArray innerArray; - STArrayProxy> array{&innerArray}; + STArrayProxy> array{&innerArray}; BEAST_EXPECT(array.empty()); auto item = array.createItem(); - item.fsfOwnerNode() = 1; + item.fsfSignerWeight() = 1; array.push_back(item); - BEAST_EXPECT(array.back().fsfOwnerNode() == 1); + BEAST_EXPECT(array.back().fsfSignerWeight() == 1); - BEAST_EXPECT(array.value().back()[sfOwnerNode] == 1); + BEAST_EXPECT(array.value().back()[sfSignerWeight] == 1); - BEAST_EXPECT(array.begin()->fsfOwnerNode() == 1); + BEAST_EXPECT(array.begin()->fsfSignerWeight() == 1); BEAST_EXPECT(std::distance(array.begin(), array.end()) == 1); BEAST_EXPECT(array.size() == 1); BEAST_EXPECT(!array.empty()); - BEAST_EXPECT(array.at(0).fsfOwnerNode() == 1); + BEAST_EXPECT(array.at(0).fsfSignerWeight() == 1); BEAST_EXPECT(!array.at(1).isValid()); BEAST_EXPECT(array.valid()); BEAST_EXPECT( @@ -132,6 +133,7 @@ struct TypedLedgerEntries_test : public beast::unit_test::suite { testGet(); testSet(); + testAccessSTArrayProxy(); } };