feat: ETLng publisher and service refactoring (#2138)

This commit is contained in:
Alex Kremer
2025-05-23 15:01:50 +01:00
committed by GitHub
parent 8aab33c18c
commit 2a147b9487
40 changed files with 2619 additions and 585 deletions

View File

@@ -18,8 +18,10 @@
//==============================================================================
#include "etlng/Models.hpp"
#include "etlng/impl/CacheUpdater.hpp"
#include "etlng/impl/ext/Cache.hpp"
#include "util/BinaryTestObject.hpp"
#include "util/LoggerFixtures.hpp"
#include "util/MockLedgerCache.hpp"
#include "util/MockPrometheus.hpp"
#include "util/TestObject.hpp"
@@ -27,6 +29,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <memory>
#include <utility>
#include <vector>
@@ -56,10 +59,11 @@ createTestData()
} // namespace
struct CacheExtTests : util::prometheus::WithPrometheus {
struct CacheExtTests : NoLoggerFixture, util::prometheus::WithPrometheus {
protected:
MockLedgerCache cache_;
etlng::impl::CacheExt ext_{cache_};
std::shared_ptr<etlng::impl::CacheUpdater> updater_ = std::make_shared<etlng::impl::CacheUpdater>(cache_);
etlng::impl::CacheExt ext_{updater_};
};
TEST_F(CacheExtTests, OnLedgerDataUpdatesCache)
@@ -89,3 +93,8 @@ TEST_F(CacheExtTests, OnInitialObjectsUpdateCache)
ext_.onInitialObjects(kSEQ, objects, kUNUSED_LAST_KEY);
}
TEST_F(CacheExtTests, AllowInReadonlyReturnsTrue)
{
EXPECT_TRUE(ext_.allowInReadonly());
}