Skip to content

feat: chronik rework#923

Merged
Klakurka merged 20 commits intomasterfrom
feat/chronik-rework
Feb 4, 2025
Merged

feat: chronik rework#923
Klakurka merged 20 commits intomasterfrom
feat/chronik-rework

Conversation

@chedieck
Copy link
Collaborator

Related to #918

Description

Reworks the chronik logic:

  • Removes obsolete abstractions, such as the blockchainService.ts file.
  • Regroups initialization logic into a unique place, instead of having jobs + the chronik initialization competing against each other. The only remaining job is the one that syncs the current price every minute.
  • Moves around some functions for better organization.
  • Eliminates circular imports in chronikService.ts, allowing thus chronik to be tested with jest.
  • Creates a new class MultiBlockchainClient to be used as the interface to access both eCash and Bitcoin Cash blockchains, inferred by the method arguments.

Test plan

Make sure everything chronik related run seamlessly. This PR should not alter the application behavior, except for:

  • Better logs
  • Probably solves some bugs, such as the Missing prices for tx.... which I suppose was caused by the race condition between the jobs and the chronik initialization.

@ScottMcDermid ScottMcDermid self-requested a review January 16, 2025 19:34
ScottMcDermid
ScottMcDermid previously approved these changes Jan 16, 2025
Copy link
Member

@ScottMcDermid ScottMcDermid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a quick PCR, and the actual chronikService -> blockchainService swap looks good.
I skimmed the rest of the refactor, and didn't find any issues, although I'm less familiar with the codebase.

@Klakurka
Copy link
Member

We can merge once the tests are passing.

@chedieck chedieck force-pushed the feat/chronik-rework branch from c947878 to d91fb27 Compare January 20, 2025 15:36
@Klakurka Klakurka merged commit 6a831dd into master Feb 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments