diff --git a/bee-api/bee-rest-api/src/endpoints/routes/api/v1/add_peer.rs b/bee-api/bee-rest-api/src/endpoints/routes/api/v1/add_peer.rs index 1f708b79ed..e23be03471 100644 --- a/bee-api/bee-rest-api/src/endpoints/routes/api/v1/add_peer.rs +++ b/bee-api/bee-rest-api/src/endpoints/routes/api/v1/add_peer.rs @@ -68,7 +68,7 @@ pub(crate) async fn add_peer( return Err(reject::custom(CustomRejection::BadRequest( "Invalid peer descriptor. The multi address did not have a valid peer id as its last segment." .to_string(), - ))) + ))); } }; diff --git a/bee-api/bee-rest-api/src/endpoints/routes/api/v1/milestone_utxo_changes.rs b/bee-api/bee-rest-api/src/endpoints/routes/api/v1/milestone_utxo_changes.rs index 141051bfdd..271507be10 100644 --- a/bee-api/bee-rest-api/src/endpoints/routes/api/v1/milestone_utxo_changes.rs +++ b/bee-api/bee-rest-api/src/endpoints/routes/api/v1/milestone_utxo_changes.rs @@ -53,7 +53,7 @@ pub(crate) async fn milestone_utxo_changes( None => { return Err(reject::custom(CustomRejection::NotFound( "can not find Utxo changes for given milestone index".to_string(), - ))) + ))); } }; Ok(warp::reply::json(&SuccessBody::new(MilestoneUtxoChangesResponse { diff --git a/bee-api/bee-rest-api/src/endpoints/routes/api/v1/submit_message.rs b/bee-api/bee-rest-api/src/endpoints/routes/api/v1/submit_message.rs index 8c041037fc..9c627f015c 100644 --- a/bee-api/bee-rest-api/src/endpoints/routes/api/v1/submit_message.rs +++ b/bee-api/bee-rest-api/src/endpoints/routes/api/v1/submit_message.rs @@ -142,11 +142,7 @@ pub(crate) async fn submit_message( "invalid nonce: expected an u64-string".to_string(), )) })?; - if parsed == 0 { - None - } else { - Some(parsed) - } + if parsed == 0 { None } else { Some(parsed) } }; let message = if let Some(nonce) = nonce { diff --git a/bee-api/bee-rest-api/src/endpoints/routes/api/v1/transaction_included_message.rs b/bee-api/bee-rest-api/src/endpoints/routes/api/v1/transaction_included_message.rs index e32263b40f..1f6bcc073b 100644 --- a/bee-api/bee-rest-api/src/endpoints/routes/api/v1/transaction_included_message.rs +++ b/bee-api/bee-rest-api/src/endpoints/routes/api/v1/transaction_included_message.rs @@ -68,7 +68,7 @@ pub(crate) async fn transaction_included_message( None => { return Err(reject::custom(CustomRejection::NotFound( "Can not find output".to_string(), - ))) + ))); } } } diff --git a/bee-api/bee-rest-api/src/types/dtos.rs b/bee-api/bee-rest-api/src/types/dtos.rs index ac8f0a63f5..cbc33b38f2 100644 --- a/bee-api/bee-rest-api/src/types/dtos.rs +++ b/bee-api/bee-rest-api/src/types/dtos.rs @@ -452,7 +452,7 @@ impl TryFrom<&RegularEssence> for RegularEssenceDto { payload: match value.payload() { Some(Payload::Indexation(i)) => Some(PayloadDto::Indexation(Box::new(i.as_ref().into()))), Some(_) => { - return Err("invalid transaction essence: expected an optional indexation-payload".to_string()) + return Err("invalid transaction essence: expected an optional indexation-payload".to_string()); } None => None, }, @@ -667,13 +667,13 @@ impl TryFrom<&UnlockBlockDto> for UnlockBlock { UnlockBlockDto::Signature(s) => match &s.signature { SignatureDto::Ed25519(ed) => { let mut public_key = [0u8; 32]; - hex::decode_to_slice(&ed.public_key, &mut public_key).map_err(|_| { - "invalid public key in signature unlock block: expected a hex-string of length 64" - })?; // TODO access ED25519_PUBLIC_KEY_LENGTH when available + hex::decode_to_slice(&ed.public_key, &mut public_key).map_err( + |_| "invalid public key in signature unlock block: expected a hex-string of length 64", + )?; // TODO access ED25519_PUBLIC_KEY_LENGTH when available let signature = hex::decode(&ed.signature) - .map_err(|_| { - "invalid signature in signature unlock block: expected a hex-string of length 128" - })? // TODO access ED25519_SIGNATURE_LENGTH when available + .map_err( + |_| "invalid signature in signature unlock block: expected a hex-string of length 128", + )? // TODO access ED25519_SIGNATURE_LENGTH when available .into_boxed_slice(); Ok(UnlockBlock::Signature(SignatureUnlock::Ed25519(Ed25519Signature::new( public_key, signature, diff --git a/bee-message/tests/message.rs b/bee-message/tests/message.rs index 55bdcfd269..94c9254cf1 100644 --- a/bee-message/tests/message.rs +++ b/bee-message/tests/message.rs @@ -60,16 +60,18 @@ fn invalid_length() { #[test] fn unpack_valid_no_remaining_bytes() { - assert!(Message::unpack( - &mut vec![ - 42, 0, 0, 0, 0, 0, 0, 0, 2, 140, 28, 186, 52, 147, 145, 96, 9, 105, 89, 78, 139, 3, 71, 249, 97, 149, 190, - 63, 238, 168, 202, 82, 140, 227, 66, 173, 19, 110, 93, 117, 34, 225, 202, 251, 10, 156, 58, 144, 225, 54, - 79, 62, 38, 20, 121, 95, 90, 112, 109, 6, 166, 126, 145, 13, 62, 52, 68, 248, 135, 223, 119, 137, 13, 0, 0, - 0, 0, 21, 205, 91, 7, 0, 0, 0, 0, - ] - .as_slice() + assert!( + Message::unpack( + &mut vec![ + 42, 0, 0, 0, 0, 0, 0, 0, 2, 140, 28, 186, 52, 147, 145, 96, 9, 105, 89, 78, 139, 3, 71, 249, 97, 149, + 190, 63, 238, 168, 202, 82, 140, 227, 66, 173, 19, 110, 93, 117, 34, 225, 202, 251, 10, 156, 58, 144, + 225, 54, 79, 62, 38, 20, 121, 95, 90, 112, 109, 6, 166, 126, 145, 13, 62, 52, 68, 248, 135, 223, 119, + 137, 13, 0, 0, 0, 0, 21, 205, 91, 7, 0, 0, 0, 0, + ] + .as_slice() + ) + .is_ok() ) - .is_ok()) } #[test] diff --git a/bee-message/tests/milestone_payload_essence.rs b/bee-message/tests/milestone_payload_essence.rs index fa3b418e39..1b4b82b33d 100644 --- a/bee-message/tests/milestone_payload_essence.rs +++ b/bee-message/tests/milestone_payload_essence.rs @@ -36,15 +36,19 @@ fn new_invalid_too_many_public_keys() { #[test] fn new_valid_sorted_unique_public_keys() { - assert!(MilestonePayloadEssence::new( - MilestoneIndex(0), - 0, - rand_parents(), - [0; MILESTONE_MERKLE_PROOF_LENGTH], - vec![[0; 32], [1; 32], [2; 32], [3; 32], [4; 32], [5; 32], [6; 32], [7; 32], [8; 32], [9; 32]], - None, - ) - .is_ok()); + assert!( + MilestonePayloadEssence::new( + MilestoneIndex(0), + 0, + rand_parents(), + [0; MILESTONE_MERKLE_PROOF_LENGTH], + vec![ + [0; 32], [1; 32], [2; 32], [3; 32], [4; 32], [5; 32], [6; 32], [7; 32], [8; 32], [9; 32] + ], + None, + ) + .is_ok() + ); } #[test] @@ -55,7 +59,9 @@ fn new_invalid_sorted_not_unique_public_keys() { 0, rand_parents(), [0; MILESTONE_MERKLE_PROOF_LENGTH], - vec![[0; 32], [1; 32], [2; 32], [3; 32], [4; 32], [4; 32], [6; 32], [7; 32], [8; 32], [9; 32]], + vec![ + [0; 32], [1; 32], [2; 32], [3; 32], [4; 32], [4; 32], [6; 32], [7; 32], [8; 32], [9; 32] + ], None, ), Err(Error::MilestonePublicKeysNotUniqueSorted) @@ -70,7 +76,9 @@ fn new_invalid_not_sorted_unique_public_keys() { 0, rand_parents(), [0; MILESTONE_MERKLE_PROOF_LENGTH], - vec![[0; 32], [1; 32], [3; 32], [2; 32], [4; 32], [5; 32], [6; 32], [7; 32], [8; 32], [9; 32]], + vec![ + [0; 32], [1; 32], [3; 32], [2; 32], [4; 32], [5; 32], [6; 32], [7; 32], [8; 32], [9; 32] + ], None, ), Err(Error::MilestonePublicKeysNotUniqueSorted) diff --git a/bee-message/tests/unlock_blocks.rs b/bee-message/tests/unlock_blocks.rs index 960b68380b..4cbd8be614 100644 --- a/bee-message/tests/unlock_blocks.rs +++ b/bee-message/tests/unlock_blocks.rs @@ -65,21 +65,23 @@ fn new_invalid_duplicate_signature() { #[test] fn new_valid() { - assert!(UnlockBlocks::new(vec![ - SignatureUnlock::from(Ed25519Signature::new([0; 32], Box::new([0; 64]))).into(), - ReferenceUnlock::new(0).unwrap().into(), - ReferenceUnlock::new(0).unwrap().into(), - SignatureUnlock::from(Ed25519Signature::new([1; 32], Box::new([1; 64]))).into(), - SignatureUnlock::from(Ed25519Signature::new([2; 32], Box::new([2; 64]))).into(), - SignatureUnlock::from(Ed25519Signature::new([3; 32], Box::new([3; 64]))).into(), - ReferenceUnlock::new(3).unwrap().into(), - ReferenceUnlock::new(4).unwrap().into(), - ReferenceUnlock::new(3).unwrap().into(), - ReferenceUnlock::new(4).unwrap().into(), - ReferenceUnlock::new(5).unwrap().into(), - SignatureUnlock::from(Ed25519Signature::new([4; 32], Box::new([4; 64]))).into(), - ReferenceUnlock::new(11).unwrap().into(), - SignatureUnlock::from(Ed25519Signature::new([5; 32], Box::new([5; 64]))).into(), - ]) - .is_ok()); + assert!( + UnlockBlocks::new(vec![ + SignatureUnlock::from(Ed25519Signature::new([0; 32], Box::new([0; 64]))).into(), + ReferenceUnlock::new(0).unwrap().into(), + ReferenceUnlock::new(0).unwrap().into(), + SignatureUnlock::from(Ed25519Signature::new([1; 32], Box::new([1; 64]))).into(), + SignatureUnlock::from(Ed25519Signature::new([2; 32], Box::new([2; 64]))).into(), + SignatureUnlock::from(Ed25519Signature::new([3; 32], Box::new([3; 64]))).into(), + ReferenceUnlock::new(3).unwrap().into(), + ReferenceUnlock::new(4).unwrap().into(), + ReferenceUnlock::new(3).unwrap().into(), + ReferenceUnlock::new(4).unwrap().into(), + ReferenceUnlock::new(5).unwrap().into(), + SignatureUnlock::from(Ed25519Signature::new([4; 32], Box::new([4; 64]))).into(), + ReferenceUnlock::new(11).unwrap().into(), + SignatureUnlock::from(Ed25519Signature::new([5; 32], Box::new([5; 64]))).into(), + ]) + .is_ok() + ); } diff --git a/bee-network/src/peer/peerlist.rs b/bee-network/src/peer/peerlist.rs index 180ee88284..dfdab927dd 100644 --- a/bee-network/src/peer/peerlist.rs +++ b/bee-network/src/peer/peerlist.rs @@ -172,11 +172,7 @@ impl PeerList { self.0.read().await.iter().fold( 0, |count, (_, (info, state))| { - if predicate(info, state) { - count + 1 - } else { - count - } + if predicate(info, state) { count + 1 } else { count } }, ) } diff --git a/bee-node/src/node/error.rs b/bee-node/src/node/error.rs index 3cb40abd58..6f16b39e8b 100644 --- a/bee-node/src/node/error.rs +++ b/bee-node/src/node/error.rs @@ -5,7 +5,9 @@ use thiserror::Error; #[derive(Error, Debug)] pub enum Error { - #[error("Invalid or no identity private key provided. Add the newly generated {0} (or generate one with `bee p2p-identity`) to the configuration file and re-run the node.")] + #[error( + "Invalid or no identity private key provided. Add the newly generated {0} (or generate one with `bee p2p-identity`) to the configuration file and re-run the node." + )] InvalidOrNoIdentityPrivateKey(String), #[error("Storage backend operation failed: {0}.")] StorageBackend(Box), diff --git a/bee-snapshot/src/worker.rs b/bee-snapshot/src/worker.rs index 83c5505286..e050e3c609 100644 --- a/bee-snapshot/src/worker.rs +++ b/bee-snapshot/src/worker.rs @@ -216,14 +216,13 @@ async fn import_snapshot( info!( "Imported {} snapshot file from {} with sep index {}, ledger index {}, {} solid entry points{} and {} milestone diffs.", kind_str, - Utc.timestamp(header.timestamp() as i64, 0) - .format("%d-%m-%Y %H:%M:%S"), + Utc.timestamp(header.timestamp() as i64, 0).format("%d-%m-%Y %H:%M:%S"), *header.sep_index(), *header.ledger_index(), header.sep_count(), match header.kind() { - Kind::Full=> format!(", {} outputs", header.output_count()), - Kind::Delta=> "".to_owned() + Kind::Full => format!(", {} outputs", header.output_count()), + Kind::Delta => "".to_owned(), }, header.milestone_diff_count() ); diff --git a/bee-storage/bee-storage-rocksdb/tests/address_to_balance.rs b/bee-storage/bee-storage-rocksdb/tests/address_to_balance.rs index f9edbbb237..1eff36ba49 100644 --- a/bee-storage/bee-storage-rocksdb/tests/address_to_balance.rs +++ b/bee-storage/bee-storage-rocksdb/tests/address_to_balance.rs @@ -27,10 +27,12 @@ async fn access() { let (address, balance) = (rand_address(), rand_balance()); assert!(!Exist::::exist(&storage, &address).await.unwrap()); - assert!(Fetch::::fetch(&storage, &address) - .await - .unwrap() - .is_none()); + assert!( + Fetch::::fetch(&storage, &address) + .await + .unwrap() + .is_none() + ); Insert::::insert(&storage, &address, &balance) .await @@ -49,10 +51,12 @@ async fn access() { Delete::::delete(&storage, &address).await.unwrap(); assert!(!Exist::::exist(&storage, &address).await.unwrap()); - assert!(Fetch::::fetch(&storage, &address) - .await - .unwrap() - .is_none()); + assert!( + Fetch::::fetch(&storage, &address) + .await + .unwrap() + .is_none() + ); let mut batch = Storage::batch_begin(); diff --git a/bee-storage/bee-storage-rocksdb/tests/index_to_message_id.rs b/bee-storage/bee-storage-rocksdb/tests/index_to_message_id.rs index d5dc547e16..db2c9f9226 100644 --- a/bee-storage/bee-storage-rocksdb/tests/index_to_message_id.rs +++ b/bee-storage/bee-storage-rocksdb/tests/index_to_message_id.rs @@ -29,11 +29,13 @@ async fn access() { .await .unwrap() ); - assert!(Fetch::>::fetch(&storage, &index) - .await - .unwrap() - .unwrap() - .is_empty()); + assert!( + Fetch::>::fetch(&storage, &index) + .await + .unwrap() + .unwrap() + .is_empty() + ); Insert::<(HashedIndex, MessageId), ()>::insert(&storage, &(index, message_id), &()) .await @@ -61,11 +63,13 @@ async fn access() { .await .unwrap() ); - assert!(Fetch::>::fetch(&storage, &index) - .await - .unwrap() - .unwrap() - .is_empty()); + assert!( + Fetch::>::fetch(&storage, &index) + .await + .unwrap() + .unwrap() + .is_empty() + ); let mut batch = Storage::batch_begin(); diff --git a/bee-storage/bee-storage-rocksdb/tests/message_id_to_message.rs b/bee-storage/bee-storage-rocksdb/tests/message_id_to_message.rs index d22b4631a0..4156abd88c 100644 --- a/bee-storage/bee-storage-rocksdb/tests/message_id_to_message.rs +++ b/bee-storage/bee-storage-rocksdb/tests/message_id_to_message.rs @@ -26,10 +26,12 @@ async fn access() { let (message_id, message) = (rand_message_id(), rand_message()); assert!(!Exist::::exist(&storage, &message_id).await.unwrap()); - assert!(Fetch::::fetch(&storage, &message_id) - .await - .unwrap() - .is_none()); + assert!( + Fetch::::fetch(&storage, &message_id) + .await + .unwrap() + .is_none() + ); Insert::::insert(&storage, &message_id, &message) .await @@ -50,10 +52,12 @@ async fn access() { .unwrap(); assert!(!Exist::::exist(&storage, &message_id).await.unwrap()); - assert!(Fetch::::fetch(&storage, &message_id) - .await - .unwrap() - .is_none()); + assert!( + Fetch::::fetch(&storage, &message_id) + .await + .unwrap() + .is_none() + ); let mut batch = Storage::batch_begin(); diff --git a/bee-storage/bee-storage-rocksdb/tests/message_id_to_message_id.rs b/bee-storage/bee-storage-rocksdb/tests/message_id_to_message_id.rs index dbf8547f1d..8a64d5d403 100644 --- a/bee-storage/bee-storage-rocksdb/tests/message_id_to_message_id.rs +++ b/bee-storage/bee-storage-rocksdb/tests/message_id_to_message_id.rs @@ -24,22 +24,28 @@ async fn access() { let (parent, child) = (rand_message_id(), rand_message_id()); - assert!(!Exist::<(MessageId, MessageId), ()>::exist(&storage, &(parent, child)) - .await - .unwrap()); - assert!(Fetch::>::fetch(&storage, &parent) - .await - .unwrap() - .unwrap() - .is_empty()); + assert!( + !Exist::<(MessageId, MessageId), ()>::exist(&storage, &(parent, child)) + .await + .unwrap() + ); + assert!( + Fetch::>::fetch(&storage, &parent) + .await + .unwrap() + .unwrap() + .is_empty() + ); Insert::<(MessageId, MessageId), ()>::insert(&storage, &(parent, child), &()) .await .unwrap(); - assert!(Exist::<(MessageId, MessageId), ()>::exist(&storage, &(parent, child)) - .await - .unwrap()); + assert!( + Exist::<(MessageId, MessageId), ()>::exist(&storage, &(parent, child)) + .await + .unwrap() + ); assert_eq!( Fetch::>::fetch(&storage, &parent) .await @@ -52,14 +58,18 @@ async fn access() { .await .unwrap(); - assert!(!Exist::<(MessageId, MessageId), ()>::exist(&storage, &(parent, child)) - .await - .unwrap()); - assert!(Fetch::>::fetch(&storage, &parent) - .await - .unwrap() - .unwrap() - .is_empty()); + assert!( + !Exist::<(MessageId, MessageId), ()>::exist(&storage, &(parent, child)) + .await + .unwrap() + ); + assert!( + Fetch::>::fetch(&storage, &parent) + .await + .unwrap() + .unwrap() + .is_empty() + ); let mut batch = Storage::batch_begin(); diff --git a/bee-storage/bee-storage-rocksdb/tests/message_id_to_metadata.rs b/bee-storage/bee-storage-rocksdb/tests/message_id_to_metadata.rs index add1c11cf1..f8d5629807 100644 --- a/bee-storage/bee-storage-rocksdb/tests/message_id_to_metadata.rs +++ b/bee-storage/bee-storage-rocksdb/tests/message_id_to_metadata.rs @@ -26,21 +26,27 @@ async fn access() { let (message_id, metadata) = (rand_message_id(), rand_metadata()); - assert!(!Exist::::exist(&storage, &message_id) - .await - .unwrap()); - assert!(Fetch::::fetch(&storage, &message_id) - .await - .unwrap() - .is_none()); + assert!( + !Exist::::exist(&storage, &message_id) + .await + .unwrap() + ); + assert!( + Fetch::::fetch(&storage, &message_id) + .await + .unwrap() + .is_none() + ); Insert::::insert(&storage, &message_id, &metadata) .await .unwrap(); - assert!(Exist::::exist(&storage, &message_id) - .await - .unwrap()); + assert!( + Exist::::exist(&storage, &message_id) + .await + .unwrap() + ); assert_eq!( Fetch::::fetch(&storage, &message_id) .await @@ -54,13 +60,17 @@ async fn access() { .await .unwrap(); - assert!(!Exist::::exist(&storage, &message_id) - .await - .unwrap()); - assert!(Fetch::::fetch(&storage, &message_id) - .await - .unwrap() - .is_none()); + assert!( + !Exist::::exist(&storage, &message_id) + .await + .unwrap() + ); + assert!( + Fetch::::fetch(&storage, &message_id) + .await + .unwrap() + .is_none() + ); let mut batch = Storage::batch_begin(); diff --git a/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_milestone.rs b/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_milestone.rs index 7893cf7827..54e35af9c3 100644 --- a/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_milestone.rs +++ b/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_milestone.rs @@ -24,21 +24,27 @@ async fn access() { let (index, milestone) = (rand_milestone_index(), rand_milestone()); - assert!(!Exist::::exist(&storage, &index) - .await - .unwrap()); - assert!(Fetch::::fetch(&storage, &index) - .await - .unwrap() - .is_none()); + assert!( + !Exist::::exist(&storage, &index) + .await + .unwrap() + ); + assert!( + Fetch::::fetch(&storage, &index) + .await + .unwrap() + .is_none() + ); Insert::::insert(&storage, &index, &milestone) .await .unwrap(); - assert!(Exist::::exist(&storage, &index) - .await - .unwrap()); + assert!( + Exist::::exist(&storage, &index) + .await + .unwrap() + ); assert_eq!( Fetch::::fetch(&storage, &index) .await @@ -51,13 +57,17 @@ async fn access() { .await .unwrap(); - assert!(!Exist::::exist(&storage, &index) - .await - .unwrap()); - assert!(Fetch::::fetch(&storage, &index) - .await - .unwrap() - .is_none()); + assert!( + !Exist::::exist(&storage, &index) + .await + .unwrap() + ); + assert!( + Fetch::::fetch(&storage, &index) + .await + .unwrap() + .is_none() + ); let mut batch = Storage::batch_begin(); diff --git a/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_output_diff.rs b/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_output_diff.rs index f4f7f2cb4f..a9d6c2f64a 100644 --- a/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_output_diff.rs +++ b/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_output_diff.rs @@ -26,21 +26,27 @@ async fn access() { let (index, output_diff) = (rand_milestone_index(), rand_output_diff()); - assert!(!Exist::::exist(&storage, &index) - .await - .unwrap()); - assert!(Fetch::::fetch(&storage, &index) - .await - .unwrap() - .is_none()); + assert!( + !Exist::::exist(&storage, &index) + .await + .unwrap() + ); + assert!( + Fetch::::fetch(&storage, &index) + .await + .unwrap() + .is_none() + ); Insert::::insert(&storage, &index, &output_diff) .await .unwrap(); - assert!(Exist::::exist(&storage, &index) - .await - .unwrap()); + assert!( + Exist::::exist(&storage, &index) + .await + .unwrap() + ); assert_eq!( Fetch::::fetch(&storage, &index) .await @@ -54,13 +60,17 @@ async fn access() { .await .unwrap(); - assert!(!Exist::::exist(&storage, &index) - .await - .unwrap()); - assert!(Fetch::::fetch(&storage, &index) - .await - .unwrap() - .is_none()); + assert!( + !Exist::::exist(&storage, &index) + .await + .unwrap() + ); + assert!( + Fetch::::fetch(&storage, &index) + .await + .unwrap() + .is_none() + ); let mut batch = Storage::batch_begin(); diff --git a/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_receipt.rs b/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_receipt.rs index 30e5a69b01..f97d96e7e7 100644 --- a/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_receipt.rs +++ b/bee-storage/bee-storage-rocksdb/tests/milestone_index_to_receipt.rs @@ -30,11 +30,13 @@ async fn access() { .await .unwrap() ); - assert!(Fetch::>::fetch(&storage, &index) - .await - .unwrap() - .unwrap() - .is_empty()); + assert!( + Fetch::>::fetch(&storage, &index) + .await + .unwrap() + .unwrap() + .is_empty() + ); Insert::<(MilestoneIndex, Receipt), ()>::insert(&storage, &(index, receipt.clone()), &()) .await @@ -62,11 +64,13 @@ async fn access() { .await .unwrap() ); - assert!(Fetch::>::fetch(&storage, &index) - .await - .unwrap() - .unwrap() - .is_empty()); + assert!( + Fetch::>::fetch(&storage, &index) + .await + .unwrap() + .unwrap() + .is_empty() + ); let mut batch = Storage::batch_begin(); diff --git a/bee-storage/bee-storage-rocksdb/tests/solid_entry_point_to_milestone_index.rs b/bee-storage/bee-storage-rocksdb/tests/solid_entry_point_to_milestone_index.rs index 42dff8f02f..5d61043238 100644 --- a/bee-storage/bee-storage-rocksdb/tests/solid_entry_point_to_milestone_index.rs +++ b/bee-storage/bee-storage-rocksdb/tests/solid_entry_point_to_milestone_index.rs @@ -24,21 +24,27 @@ async fn access() { let (sep, index) = (rand_solid_entry_point(), rand_milestone_index()); - assert!(!Exist::::exist(&storage, &sep) - .await - .unwrap()); - assert!(Fetch::::fetch(&storage, &sep) - .await - .unwrap() - .is_none()); + assert!( + !Exist::::exist(&storage, &sep) + .await + .unwrap() + ); + assert!( + Fetch::::fetch(&storage, &sep) + .await + .unwrap() + .is_none() + ); Insert::::insert(&storage, &sep, &index) .await .unwrap(); - assert!(Exist::::exist(&storage, &sep) - .await - .unwrap()); + assert!( + Exist::::exist(&storage, &sep) + .await + .unwrap() + ); assert_eq!( Fetch::::fetch(&storage, &sep) .await @@ -51,13 +57,17 @@ async fn access() { .await .unwrap(); - assert!(!Exist::::exist(&storage, &sep) - .await - .unwrap()); - assert!(Fetch::::fetch(&storage, &sep) - .await - .unwrap() - .is_none()); + assert!( + !Exist::::exist(&storage, &sep) + .await + .unwrap() + ); + assert!( + Fetch::::fetch(&storage, &sep) + .await + .unwrap() + .is_none() + ); let mut batch = Storage::batch_begin(); diff --git a/bee-storage/bee-storage-rocksdb/tests/spent_to_treasury_output.rs b/bee-storage/bee-storage-rocksdb/tests/spent_to_treasury_output.rs index 2bccf3e198..15bf3abaad 100644 --- a/bee-storage/bee-storage-rocksdb/tests/spent_to_treasury_output.rs +++ b/bee-storage/bee-storage-rocksdb/tests/spent_to_treasury_output.rs @@ -29,11 +29,13 @@ async fn access() { .await .unwrap() ); - assert!(Fetch::>::fetch(&storage, &spent) - .await - .unwrap() - .unwrap() - .is_empty()); + assert!( + Fetch::>::fetch(&storage, &spent) + .await + .unwrap() + .unwrap() + .is_empty() + ); Insert::<(bool, TreasuryOutput), ()>::insert(&storage, &(spent, treasury_output.clone()), &()) .await @@ -61,11 +63,13 @@ async fn access() { .await .unwrap() ); - assert!(Fetch::>::fetch(&storage, &spent) - .await - .unwrap() - .unwrap() - .is_empty()); + assert!( + Fetch::>::fetch(&storage, &spent) + .await + .unwrap() + .unwrap() + .is_empty() + ); let mut batch = Storage::batch_begin(); diff --git a/rustfmt.toml b/rustfmt.toml index 11640e5e7d..3660969847 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,3 +1,4 @@ +version = "Two" comment_width = 120 format_code_in_doc_comments = true license_template_path = ".license_template"