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

docs: improve documentation on halt_epoch #468

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

polvalente
Copy link
Contributor

No description provided.

@polvalente polvalente self-assigned this Jan 25, 2023
Comment on lines +164 to +166
It is important to notice that `:halt_epoch` does the same
as `:continue` if not accompanied by an `:epoch_halted` handler
that also emits a `:halt_epoch` instruction.
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, I don't think this is intended, can you expand?

Copy link
Contributor

Choose a reason for hiding this comment

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

:halt_epoch should do exactly that where it halts the epoch, fires :epoch_halted, and then short circuts, so there may be a bug

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If :halt_epoch is emmited, an :epoch_halted is triggered, but if you don't "catch" it, it's as if you didn't halt. It's due to how the code is structured, that when a :halt_epoch is emitted a raw and stateless :epoch_halted is triggered and its result is passed forward

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah then that is a bug and should be changed, it will be addressed in #461

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. Close this if you feel like this shouldn't be documented/tested in the meantime.

In that case, I'll just restructure the test I edited to reflect the timing assertions that I added.

The current test only asserts on amounts, and not on the order of events.

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.

None yet

2 participants