Closed mcamou closed 1 week ago
Attention: Patch coverage is 0.55866%
with 178 lines
in your changes missing coverage. Please review.
Project coverage is 8.92%. Comparing base (
b5d1120
) to head (d97c7a4
). Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
Singletons are a bad practice which makes it difficult to write proper tests for the code. This PR (almost) removes the two singletons we have:
AppConfig
singleton, used throughout the codebase to get access to the node configurationKeyManager
singleton, used to get access to private and public keysWe remove both singletons in one go since it is very complicated to remove just
AppConfig
without removingKeyManager
. They are replaced either with functional options, by adding some fields to other objects (i.e.OracleNode
) or, in cases where there are just one or config parameter needed in one place in the code, passing them directly as parameters.This PR removes
config.GetInstance()
from everywhere except the Sentiment-related files, since those will be removed as part of a separate PR (see #626).Notes to reviewers
If the full PR is a bit much, the commit history should be more manageable. If preferred, I could split this into multiple PRs.
Signed commits