-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add market state invariants and fix a mistake in tests. #1520
Conversation
// Other deal clean-up is deferred to per-epoch cron. | ||
// Note there may be some deal states that are not removed here, | ||
// despite deletion of this mapping, e.g. for expired but not-yet-settled deals. | ||
// The sector->deal mapping is no longer needed (the deal state has sector number too). | ||
let all_deal_ids = st.pop_sector_deal_ids( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line removes all provider-sector-deal mappings for the sectors, so the deleted code below was a no-op.
&[id0, id1], | ||
); | ||
assert_deal_deleted(&rt, id0, &deal0, sector_number); | ||
assert_deal_deleted(&rt, id1, &deal1, sector_number); | ||
assert_deal_deleted(&rt, id1, &deal2, sector_number); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mistake (id1
) was introduced when synchronous deal termination was introduced. The test made a lot more sense before that, and just remains relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems reasonable to me
do we add the same invariant checks from here to go-state-types?
@rvagg Yes (if you felt inspired to do that, that would be awesome!). |
Co-authored-by: Rod Vagg <[email protected]>
Adds market-internal state invariants between deal stats and provider-sector-deal mapping.