summaryrefslogtreecommitdiff
path: root/crates/tor-netdir/src/weight.rs
Commit message (Collapse)AuthorAgeFilesLines
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Upgrade to bitflags 2.0Nick Mathewson2023-03-131-1/+2
| | | | | This version of bitflags now requires us to explicitly list the traits that we want to derive for our bit-flags structs.
* tor-netdir: Provide ConsensusRelays extension traitIan Jackson2023-02-011-3/+4
| | | | | Call it everywhere instead of the inherent method on MdConsensus. (Verified by ad-hoc temporarily renaming MdConsensus::relays().)
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* Use testing_rng() in tests throughout our crates.Nick Mathewson2022-06-021-1/+2
| | | | | | This only affects uses of thread_rng(), and affects them all more or less indiscriminately. One test does not work with ARTI_TEST_PRNG=deterministic; the next commit will fix it.
* Resolve the new `derive_partial_eq_without_eq` lint.Nick Mathewson2022-05-231-1/+1
| | | | It's a little overzealous sometimes, but it's mostly to the good.
* Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-301-1/+0
|
* use wallclock where possible in teststrinity-1686a2022-02-261-0/+1
|
* tor-netdir: Resolve an XXXX about type uglinessNick Mathewson2021-12-081-4/+5
| | | | | | | | | | | | | | | We had no function to infallibly convert BoundedInt32<{0 or 1},H> into a u32, even though we could have. Because of that, we were treating weight_scale as an i32 when logically it's a u32 or a NonZeroU32. Moreover, it turns out we were using an incorrect minimum for the bwweightscale param, which would in theory have allowed the authorities to make us divide by zero. This patch introduces the necessary From<> implementation and uses it. It corrects the binimum bwweightscale, and prevents a division-by-zero issue in case weight_scale is zero.
* tor-netdir: Use bitflags for WeightKindNeel Chauhan2021-11-301-34/+49
|
* Merge remote-tracking branch 'origin/mr/71'Nick Mathewson2021-09-081-0/+1
|\
| * fix/silence clippy lints in test modulesDaniel Eades2021-09-081-0/+1
| |
* | Add validation function to WeightSetNick Mathewson2021-09-081-1/+18
|/ | | | | Our relay selection code can give wrong answers if we overflow u64::MAX, so let's make sure we never do that.
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+625
This will cause some pain for now, but now is really the best time to do this kind of thing.