projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace std's unmaintained bench with criterion
[rust-lightning]
/
lightning
/
src
/
offers
/
test_utils.rs
diff --git
a/lightning/src/offers/test_utils.rs
b/lightning/src/offers/test_utils.rs
index 7447b86fb84f3409c758cd485cd291067dad2183..26c0d051223a6c26787055257a187fdfd95f1da7 100644
(file)
--- a/
lightning/src/offers/test_utils.rs
+++ b/
lightning/src/offers/test_utils.rs
@@
-13,10
+13,11
@@
use bitcoin::secp256k1::{KeyPair, Message, PublicKey, Secp256k1, SecretKey};
use bitcoin::secp256k1::schnorr::Signature;
use core::convert::Infallible;
use core::time::Duration;
use bitcoin::secp256k1::schnorr::Signature;
use core::convert::Infallible;
use core::time::Duration;
+use crate::blinded_path::{BlindedHop, BlindedPath};
+use crate::sign::EntropySource;
use crate::ln::PaymentHash;
use crate::ln::features::BlindedHopFeatures;
use crate::offers::invoice::BlindedPayInfo;
use crate::ln::PaymentHash;
use crate::ln::features::BlindedHopFeatures;
use crate::offers::invoice::BlindedPayInfo;
-use crate::onion_message::{BlindedHop, BlindedPath};
pub(super) fn payer_keys() -> KeyPair {
let secp_ctx = Secp256k1::new();
pub(super) fn payer_keys() -> KeyPair {
let secp_ctx = Secp256k1::new();
@@
-108,3
+109,11
@@
pub(super) fn now() -> Duration {
.duration_since(std::time::SystemTime::UNIX_EPOCH)
.expect("SystemTime::now() should come after SystemTime::UNIX_EPOCH")
}
.duration_since(std::time::SystemTime::UNIX_EPOCH)
.expect("SystemTime::now() should come after SystemTime::UNIX_EPOCH")
}
+
+pub(super) struct FixedEntropy;
+
+impl EntropySource for FixedEntropy {
+ fn get_secure_random_bytes(&self) -> [u8; 32] {
+ [42; 32]
+ }
+}