Skip to content

Commit 1a212f6

Browse files
committed
Fix CI build
1 parent 1af76ea commit 1a212f6

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

beacon/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ byteorder = "1"
1111
helium-proto = { path = "../", features = ["services"] }
1212
prost = { workspace = true }
1313
rand = ">=0.8"
14-
rand_chacha = ">=0.3"
14+
rand_chacha = ">=0.9"
1515
serde = { workspace = true }
1616
sha2 = "0"
1717
rust_decimal = { version = "1", features = ["serde-with-float"] }

beacon/src/entropy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::{Error, Result};
22
use base64::{engine::general_purpose::STANDARD, Engine};
33
use helium_proto::EntropyReportV1;
4-
use rand::{rngs::OsRng, RngCore};
4+
use rand::{rngs::OsRng, TryRngCore};
55
use serde::{Deserialize, Serialize};
66
use sha2::Digest;
77
use std::time::{SystemTime, UNIX_EPOCH};
@@ -22,7 +22,7 @@ impl Entropy {
2222
/// of local entropy is always 0.
2323
pub fn local() -> Result<Self> {
2424
let mut local_entropy = vec![0u8; LOCAL_ENTROPY_SIZE];
25-
OsRng.fill_bytes(&mut local_entropy);
25+
OsRng.try_fill_bytes(&mut local_entropy)?;
2626
Ok(Self {
2727
version: 0,
2828
timestamp: 0,

beacon/src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use rand_chacha::rand_core::OsError;
12
use thiserror::Error;
23

34
pub type Result<T = ()> = std::result::Result<T, Error>;
@@ -24,6 +25,8 @@ pub enum Error {
2425
InvalidVersion,
2526
#[error("no valid datarate found")]
2627
NoDataRate,
28+
#[error("Operation system error")]
29+
OsError(#[from] OsError),
2730
}
2831

2932
impl Error {

beacon/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ fn rand_payload<R>(rng: &mut R, size: usize) -> Vec<u8>
117117
where
118118
R: Rng + ?Sized,
119119
{
120-
rng.sample_iter(rand::distributions::Standard)
120+
rng.sample_iter(rand::distr::StandardUniform)
121121
.take(size)
122122
.collect::<Vec<u8>>()
123123
}

0 commit comments

Comments
 (0)