]> git.bitcoin.ninja Git - rust-lightning/commit
Drop unnecessary key derivation in route tests 2024-06-real-bench
authorMatt Corallo <git@bluematt.me>
Wed, 12 Jun 2024 14:06:54 +0000 (14:06 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 12 Jun 2024 19:35:06 +0000 (19:35 +0000)
commit7ae311d64ce57a5d376e255706ece5c42b4f37bf
tree91ca92791b86b7bd3d3c09db93d9f8655f25f890
parentd74c143afe2244c39c66adef0dd13e64bdcf6681
Drop unnecessary key derivation in route tests

In our route tests we need some "random" bytes for the router to
randomize amounts using. We generate this by building an actual
`KeysManager` and then deriving some random bytes using the
`EntropySource` trait. However, `get_route` (what we're normally
testing) doesn't actually use the random bytes, and even if it did,
using a `KeysManager` is just a fancy way of creating a constant,
so there's really no reason to do all the fancy crypto.

Instead, here, we change our routing tests and benchmarks to simply
use `[42; 32]` as the "random" bytes.
lightning/src/routing/router.rs