Skip to content

test: Make the mininode lock a private member #32

@maflcko

Description

@maflcko

Currently the mininode lock is a global, expected to be imported into test scripts and used accordingly. This has several issues:

  • Importing a global is easy to forget
  • Having the symbol in the global namespace might make it easy to use incorrect (in the wrong context)
  • A global might lead to less clear code, compared to code using a member variable

While there is only one python network thread, and thus a single global lock is sufficient, having the lock be a private member variable on the mininode could make code more clear.

It would also clarify test code, because it encourages to write getter/setter helper methods that take the private lock as opposed to inlined logic that might or might not take the lock.

Want to work on this issue?

For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions