Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: removing unnecessary pointers in context structure #1831

Merged
merged 22 commits into from
Mar 8, 2024

Conversation

skosito
Copy link
Contributor

@skosito skosito commented Mar 4, 2024

Description

2 parts leftovers from discussions in PR: #1774

  • add missing unit tests for zeta_core_context

  • reduce pointers in config/coreContext/appContext

i think pointers should be removed when we want immutability as config, but also considered when there is large struct and mutability (as with core context) so i tried to remove pointers from config struct and also pass config around without pointers (this maybe can be revisited since config might be too big for this?)

Closes: #1807

Type of change

Refactor

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

@skosito skosito changed the title Refactor config context follow up [wip] refactor: config context follow up [wip] Mar 4, 2024
Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 45.11%. Comparing base (9aacfb7) to head (76ac1ef).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1831      +/-   ##
===========================================
+ Coverage    44.80%   45.11%   +0.31%     
===========================================
  Files          218      219       +1     
  Lines        12689    12779      +90     
===========================================
+ Hits          5685     5765      +80     
- Misses        6553     6561       +8     
- Partials       451      453       +2     
Files Coverage Δ
zetaclient/core_context/zeta_core_context.go 88.88% <100.00%> (ø)
zetaclient/keys/keys.go 50.48% <100.00%> (ø)
zetaclient/tss/tss_signer.go 10.42% <0.00%> (ø)

@skosito skosito changed the title refactor: config context follow up [wip] refactor: config context follow up Mar 4, 2024
zetaclient/config/types.go Outdated Show resolved Hide resolved
zetaclient/config/types.go Outdated Show resolved Hide resolved
zetaclient/core_context/zeta_core_context_test.go Outdated Show resolved Hide resolved
@lumtis
Copy link
Member

lumtis commented Mar 5, 2024

It's a good direction, I think it simplify the code not using pointer when unnecessary

@skosito skosito marked this pull request as ready for review March 5, 2024 17:58
@skosito skosito requested a review from ws4charlie as a code owner March 5, 2024 17:58
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Looks good to me, just some comments on the changelogs

changelog.md Outdated Show resolved Hide resolved
changelog.md Outdated Show resolved Hide resolved
@skosito skosito changed the title refactor: config context follow up refactor: removing unnecessary pointers in context structure Mar 6, 2024
@lumtis lumtis merged commit f8e8565 into develop Mar 8, 2024
21 checks passed
@lumtis lumtis deleted the refactor-config-context-follow-up branch March 8, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Follow up on config/params separation in zetaclient
3 participants