Closed p0mvn closed 3 months ago
The recent changes introduce new components and mock implementations related to pool extraction, transformation, and GRPC client setup for SQS streaming services. Additionally, a custom error type and new block processing strategies are implemented for better handling of block updates and transformation and loading of data into SQS. Test cases have also been adjusted and new ones added to ensure these functionalities work as expected.
Files | Change Summaries |
---|---|
app/app.go |
Added imports (poolextractor , poolstransformer ), and modified initialization (poolExtractor , poolsTransformer , blockProcessStrategyManager , sqsGRPCClient ). |
ingest/sqs/domain/errors.go |
Added custom error type NodeSyncCheckError with Error() method formatting error message for node sync check. |
ingest/sqs/domain/ingester.go |
Removed Ingester interface, added BlockUpdateProcessUtilsI and its struct implementation BlockUpdateProcessUtils . |
ingest/sqs/domain/mocks/block_updates_process_utils_mock.go |
Added mock implementation BlockUpdateProcessUtilsMock implementing BlockUpdateProcessUtilsI interface. |
ingest/sqs/domain/mocks/grpc_client_mock.go |
Introduced GRPCClientMock that implements SQSGRPClient interface. |
ingest/sqs/domain/mocks/pool_transformer_mock.go |
Added PoolsTransformerMock implementing PoolsTransformer interface. |
ingest/sqs/domain/mocks/pools_extractor_mock.go |
Provided mock implementation for PoolExtractor interface. |
.../ingest/sqs/service/blockprocessor/block_process_sqs_factory.go |
Introduced NewBlockProcessor function for creating block processing strategy based on certain conditions. |
.../ingest/sqs/service/blockprocessor/block_process_sqs_factory_test.go |
Added test cases for NewBlockProcessor function. |
.../ingest/sqs/service/blockprocessor/block_updates_sqs_block_process_strategy.go |
Introduced a new block processing strategy for handling block updates via SQS. |
.../ingest/sqs/service/blockprocessor/export_test.go |
Added new block processing strategies for handling block updates and full blocks through SQS. |
.../ingest/sqs/service/blockprocessor/full_sqs_block_process_strategy.go |
Added fullSQSBlockProcessStrategy struct implementing block processing interfaces for SQS. |
.../ingest/sqs/service/blockprocessor/full_sqs_block_process_strategy_test.go |
Added test suite for ProcessBlock method with various scenarios using mocks and assertions. |
.../ingest/sqs/service/blockprocessor/transform_and_load.go |
Added transformAndLoad function to transform pools and load them into SQS service. |
ingest/sqs/service/sqs_streaming_service.go |
Signature modifications to the New function. |
ingest/sqs/service/sqs_streaming_service_test.go |
Included changes in import statements, test case restructuring, and test data setup adjustments. |
ingest/sqs/sqs_config.go |
Removed imports, renamed a constant, and removed Initialize function. |
Closes: #XXX
What is the purpose of the change
Implements shared abstractions for the SQS ingest. Refactors and tests.
blockUpdatesSQSBlockProcessStrategy
- processes only the updates from a block under normal conditions post initial startfullSQSBlockProcessStrategy
- processes the full block data. This strategy is used at node start-up or if SQS inges returns error. Such mechanism allows for effectively reingesting the data.Testing