Fix build error

This commit is contained in:
JCW
2025-07-11 10:40:17 +01:00
parent 31a127eddc
commit 1bd3d227ff
2 changed files with 11 additions and 8 deletions

View File

@@ -143,10 +143,11 @@ public:
return *array_; return *array_;
} }
template <typename ...TArgs>
ProxyType ProxyType
createItem() createItem(TArgs&&... args)
{ {
return ProxyType::create(); return ProxyType::create(std::forward<TArgs>(args)...);
} }
void void

View File

@@ -28,23 +28,24 @@ struct TypedLedgerEntries_test : public beast::unit_test::suite
void void
testAccessSTArrayProxy() testAccessSTArrayProxy()
{ {
testcase("testAccessSTArrayProxy");
STArray innerArray; STArray innerArray;
STArrayProxy<LedgerObjectType<ltSIGNER_LIST>> array{&innerArray}; STArrayProxy<InnerObjectType<SFieldNames::field_sfSignerEntry>> array{&innerArray};
BEAST_EXPECT(array.empty()); BEAST_EXPECT(array.empty());
auto item = array.createItem(); auto item = array.createItem();
item.fsfOwnerNode() = 1; item.fsfSignerWeight() = 1;
array.push_back(item); 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(std::distance(array.begin(), array.end()) == 1);
BEAST_EXPECT(array.size() == 1); BEAST_EXPECT(array.size() == 1);
BEAST_EXPECT(!array.empty()); 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.at(1).isValid());
BEAST_EXPECT(array.valid()); BEAST_EXPECT(array.valid());
BEAST_EXPECT( BEAST_EXPECT(
@@ -132,6 +133,7 @@ struct TypedLedgerEntries_test : public beast::unit_test::suite
{ {
testGet(); testGet();
testSet(); testSet();
testAccessSTArrayProxy();
} }
}; };