Skip to content

Move fiddly Relay functionality into a RelayDetails type.

Nick Mathewson requested to merge nickm/arti:504-cleanup-part1 into main

For #504, we want to make it harder to accidentally use lower-level functions in Relay when we should instead be testing Relay via RelaySelector or its friends.

With this MR, I've moved those functions into a new type: struct RelayDetails<'a>(&'a Relay<'a>). This changes our callsites as follows:

// old way
relay.is_flagged_stable()

// new way
relay.low_level_details().is_flagged_stable()

(I've done the same for UncheckedRelay.)

I've tried to structure this for simple diffs, though you may want to use --color-moved for the changes that involve code movement.

Part of #504. After this, I think we can call the remaining cleanup in #504 non-MUST.

Merge request reports