refactor: improve deadliner api#434
Conversation
870f751 to
207827d
Compare
|
@claude review the changes |
|
Claude finished @therustmonk's task in 3m 54s —— View job Review: refactor: improve deadliner api
OverallSolid refactor — the API is meaningfully cleaner. Removing the The semantics still mirror Issues1. Broken intra-doc links (likely The
Suggest updating to 2.
if !self.deadliner.add(duty.clone()).await.is_scheduled() {
return Err(Error::ExpiredDuty);
}
3.
Nits4. Pre-existing, not introduced here, but worth flagging: nothing in 5. The DKG exchanger wires a real background task that will only ever serve 6. The early 7. Pre-existing Untouched by this PR; Go has the same Test coverageThe The VerdictLGTM modulo the broken rustdoc links (#1, almost certainly a CI blocker) and the |
emlautarom1
left a comment
There was a problem hiding this comment.
LGTM, removes quite a bit of machinery and potential issues.
| /// Spells out the four distinct cases the previous `bool` return value | ||
| /// conflated, so callers can react specifically (e.g. drop a duty that |
There was a problem hiding this comment.
nit: Prefer to have a separate section documenting the existing bool behavior of Charon with a permalink to the TODOs.
| pub fn is_scheduled(self) -> bool { | ||
| matches!(self, AddOutcome::Scheduled) | ||
| } |
There was a problem hiding this comment.
Usually you want to differentiate all cases. Only usage right now is dutydb, so I suggest exploring if there is an issue there rather than modifying this API.
API changes for #423