Skip to content

Use a unified Context for ZetaClient #1160

@lumtis

Description

@lumtis

We use context.Background and context.TODO throughout the code.

This might become a problem if a Go routine need to be canceled when another is canceled, or if ZetaClient is incorporated in another package.

It is also in general proper to determine determine a unified context that is used in the package.

Solution:

  • Add a context object Ctx as a field of the different object: CoreObserver, ZetaCoreBridge, Signer, etc...
  • Replace context.Background with these values
  • Initialize with context.Background the root context

Metadata

Metadata

Assignees

Labels

zetaclientIssues related to ZetaClient

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions