Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ mod tests {
let token = create_token(
perms_expected.clone(),
key.private_key(),
Duration::try_hours(1).expect("Infallible"),
Duration::hours(1),
)
.unwrap();
let perms = verify_token(&token, key.private_key()).unwrap();
Expand All @@ -98,7 +98,7 @@ mod tests {
let token = create_token(
perms_expected.clone(),
key.private_key(),
-Duration::try_hours(1).expect("Infallible"),
-Duration::hours(1),
)
.unwrap();
assert!(verify_token(&token, key.private_key()).is_err());
Expand All @@ -108,7 +108,7 @@ mod tests {
let token = create_token(
perms_expected.clone(),
key.private_key(),
-Duration::try_seconds(10).expect("Infallible"),
-Duration::seconds(10),
)
.unwrap();
let perms = verify_token(&token, key.private_key()).unwrap();
Expand Down Expand Up @@ -138,7 +138,7 @@ mod tests {
let token = create_token(
perms_expected.clone(),
key.private_key(),
-Duration::try_hours(1).expect("Infallible"),
-Duration::hours(1),
)
.unwrap();
let perms = verify_token(&token, key.private_key()).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/chain/store/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl<DB: Blockstore> ChainIndex<DB> {
SizeTrackingLruCache::new_with_metrics(
"tipset_by_height".into(),
// 20480 * 900 = 18432000 which is sufficient for mainnet
20480.try_into().expect("infallible"),
nonzero!(20480_usize),
)
});

Expand Down
13 changes: 4 additions & 9 deletions src/chain_sync/network_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use crate::{
};
use anyhow::Context as _;
use fvm_ipld_blockstore::Blockstore;
use nonzero_ext::nonzero;
use parking_lot::Mutex;
use std::future::Future;
use tokio::sync::Semaphore;
Expand Down Expand Up @@ -152,13 +153,7 @@ where
ts: &Tipset,
) -> Result<FullTipset, String> {
let mut bundles: Vec<TipsetBundle> = self
.handle_chain_exchange_request(
peer_id,
ts.key(),
NonZeroU64::new(1).expect("Infallible"),
MESSAGES,
|_| true,
)
.handle_chain_exchange_request(peer_id, ts.key(), nonzero!(1_u64), MESSAGES, |_| true)
.await?;

if bundles.len() != 1 {
Expand All @@ -184,7 +179,7 @@ where
.handle_chain_exchange_request(
peer_id,
tsk,
NonZeroU64::new(1).expect("Infallible"),
nonzero!(1_u64),
HEADERS | MESSAGES,
|_| true,
)
Expand All @@ -207,7 +202,7 @@ where
self.handle_chain_exchange_request(
peer_id,
tsk,
NonZeroU64::new(16).expect("Infallible"),
nonzero!(16_u64),
HEADERS | MESSAGES,
|_| true,
)
Expand Down
Loading