Skip to content

Commit

Permalink
chore: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
therealdannzor committed Jul 29, 2024
1 parent 9ca9ef6 commit eb794f5
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 15 deletions.
12 changes: 9 additions & 3 deletions applications/tari_validator_node/src/consensus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use tari_consensus::{
traits::ConsensusSpec,
};
use tari_dan_app_utilities::{
consensus_constants::ConsensusConstants, template_manager::implementation::TemplateManager,
consensus_constants::ConsensusConstants,
template_manager::implementation::TemplateManager,
transaction_executor::TariDanTransactionProcessor,
};
use tari_dan_common_types::PeerAddress;
Expand All @@ -29,8 +30,13 @@ use crate::{
event_subscription::EventSubscription,
p2p::services::messaging::{ConsensusInboundMessaging, ConsensusOutboundMessaging},
transaction_validators::{
ClaimFeeTransactionValidator, EpochRangeValidator, FeeTransactionValidator, HasInputs, TemplateExistsValidator,
TransactionSignatureValidator, TransactionValidationError,
ClaimFeeTransactionValidator,
EpochRangeValidator,
FeeTransactionValidator,
HasInputs,
TemplateExistsValidator,
TransactionSignatureValidator,
TransactionValidationError,
},
validator::{BoxedValidator, Validator},
ValidatorNodeConfig,
Expand Down
4 changes: 2 additions & 2 deletions applications/tari_validator_node/src/p2p/rpc/service_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ impl ValidatorNodeRpcService for ValidatorNodeRpcServiceImpl {
.get_local_committee_info(prev_epoch)
.await
.optional()
.map_err(RpcStatus::log_internal_error(LOG_TARGET))? else
{
.map_err(RpcStatus::log_internal_error(LOG_TARGET))?
else {
return Err(RpcStatus::bad_request(format!(
"This validator node is not registered for the previous epoch {prev_epoch}"
)));
Expand Down
11 changes: 5 additions & 6 deletions dan_layer/consensus/src/hotstuff/on_receive_local_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,12 +564,11 @@ impl<TConsensusSpec: ConsensusSpec> OnReceiveLocalProposalHandler<TConsensusSpec

let Some(last_dummy) = dummy_blocks.last() else {
warn!(target: LOG_TARGET, "❌ Bad proposal, does not justify parent for candidate block {}", candidate_block);
return Err(
ProposalValidationError::CandidateBlockDoesNotExtendJustify {
justify_block_height: justify_block.height(),
candidate_block_height: candidate_block.height(),
}.into()
);
return Err(ProposalValidationError::CandidateBlockDoesNotExtendJustify {
justify_block_height: justify_block.height(),
candidate_block_height: candidate_block.height(),
}
.into());
};

if candidate_block.parent() != last_dummy.id() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ impl<'a, 'tx, TStore: StateStore + 'a + 'tx> ReadableSubstateStore for PendingSu
}

let Some(substate) = SubstateRecord::get(self.read_transaction(), &id.to_substate_address()).optional()? else {
return Err(SubstateStoreError::SubstateNotFound { address: id.to_substate_address() });
return Err(SubstateStoreError::SubstateNotFound {
address: id.to_substate_address(),
});
};
Ok(substate.into_substate())
}
Expand Down
4 changes: 3 additions & 1 deletion dan_layer/consensus/src/hotstuff/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ use tari_transaction::{Transaction, TransactionId};
use tokio::sync::{broadcast, mpsc};

use super::{
config::HotstuffConfig, on_receive_new_transaction::OnReceiveNewTransaction, proposer::Proposer,
config::HotstuffConfig,
on_receive_new_transaction::OnReceiveNewTransaction,
proposer::Proposer,
ProposalValidationError,
};
use crate::{
Expand Down
6 changes: 5 additions & 1 deletion dan_layer/consensus_tests/src/support/validator/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ use crate::support::{
messaging_impls::{TestInboundMessaging, TestOutboundMessaging},
signing_service::TestVoteSignatureService,
sync::AlwaysSyncedSyncManager,
RoundRobinLeaderStrategy, TestBlockTransactionProcessor, TestConsensusSpec, Validator, ValidatorChannels,
RoundRobinLeaderStrategy,
TestBlockTransactionProcessor,
TestConsensusSpec,
Validator,
ValidatorChannels,
};

pub struct ValidatorBuilder {
Expand Down
2 changes: 1 addition & 1 deletion dan_layer/engine/src/runtime/working_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl WorkingState {
Ok(Some((before, after)))
})?;

let Some((before, after))= maybe_before_and_after else {
let Some((before, after)) = maybe_before_and_after else {
return Ok(());
};

Expand Down

0 comments on commit eb794f5

Please sign in to comment.