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: fix time-purity by introducing Instant parameters #417

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Oct 22, 2024

In its current implementation, boringtun is impure w.r.t. time because it calls Instant::now and Instant::elapsed internally. To test time-related functionality, the mock-instant dependency is currently used.

This is unnecessary and can also be solved by introducing Instant parameters to all necessary functions.

This PR does that in a fully-backwards compatible way by introducing _at functions for all necessary public functions that require the current time.

Resolves: #391.

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.

Appetite for refactoring to be SANS-IO (including time?)
1 participant