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

Reduce logic in cmd/zetaclientd #2019

Closed
Tracked by #1611
lumtis opened this issue Apr 15, 2024 · 3 comments · Fixed by #3122
Closed
Tracked by #1611

Reduce logic in cmd/zetaclientd #2019

lumtis opened this issue Apr 15, 2024 · 3 comments · Fixed by #3122
Labels
code-quality Code quality improvement refactor zetaclient Issues related to ZetaClient

Comments

@lumtis
Copy link
Member

lumtis commented Apr 15, 2024

Describe the Issue
Currently cmd/zetaclientd has to much logic:

  • Initialization of ZetaBridge, Signers, clients
  • TSS generation
  • Initiazation logic in start.go

We should keep the logic in cmd as minimal as possible. Making an interface interaction with packages in zetaclient
We also don't include the logic in cmd for the code coverage scope, which is decreasing coverage of potentially imporant logic.

We should move relevant logic in packages in ZetaClient and keep cmd minimal

@swift1337
Copy link
Contributor

image

Simplify and consolidate files

We have too many of them, that creates distractions e.g.

  • main.go and root.go could be a single file
  • Same for utils and start_utils
  • Make sure there’s ONLY a single init() definition

debug.go

Either refactor or drop debug.go (if not used)

func debugCmd(_ *cobra.Command, args []string) error {

  • Rename debug.go to get_inbound_ballot.go
  • Remove logic for voting as it is supposed to only fetch the ballot
  • Move the logic into the service layer, cmd/ should only initialize the command and not contain business logic

tss commands

Consolidate tss commands into a single tss.go

func GenerateTSS(

  • Move tss generation logic into zetaclient/tss/...

@swift1337 swift1337 added refactor code-quality Code quality improvement labels Nov 6, 2024
@swift1337
Copy link
Contributor

WIP

@swift1337
Copy link
Contributor

start.go will be fixed in this issue #3112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality Code quality improvement refactor zetaclient Issues related to ZetaClient
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants