These types implement Ord so that we could derive Ord on Terminal (which in turn is used to order descriptors, but the ordering on descriptors is supposed to be lexicographic since descriptors are strings).
Upstream's locktimes avoid implementing this since it's rarely meaningful to compare locktimes that mix times and heights. In #537, when upgrading to rust-bitcoin 0.30, we just bodged our own Ord impls onto our locktime types, since we had them anyway, since Miniscript enforces locktimes to be nonzero. Indeed, our use of Ord on locktimes has caused some pathological behavior. See the regression_895 unit test which demonstrates this. (Despite the name, this "regression test" does not test that any bug has been fixed; it only documents the particular form of bug that exists.)
Since #722 we no longer derive Ord on Terminal. Instead we have a manual implementation which uses our display logic to get a lexicographic order without using recursive functions.
So the original motivation for having Ord on locktimes no longer applies, and we should attempt to eliminate it as a way of shaking out any ordering-related locktime bugs.
These types implement
Ordso that we couldderiveOrdonTerminal(which in turn is used to order descriptors, but the ordering on descriptors is supposed to be lexicographic since descriptors are strings).Upstream's locktimes avoid implementing this since it's rarely meaningful to compare locktimes that mix times and heights. In #537, when upgrading to rust-bitcoin 0.30, we just bodged our own
Ordimpls onto our locktime types, since we had them anyway, since Miniscript enforces locktimes to be nonzero. Indeed, our use ofOrdon locktimes has caused some pathological behavior. See theregression_895unit test which demonstrates this. (Despite the name, this "regression test" does not test that any bug has been fixed; it only documents the particular form of bug that exists.)Since #722 we no longer derive
OrdonTerminal. Instead we have a manual implementation which uses our display logic to get a lexicographic order without using recursive functions.So the original motivation for having
Ordon locktimes no longer applies, and we should attempt to eliminate it as a way of shaking out any ordering-related locktime bugs.