diff --git a/node/src/chain/acceptor.rs b/node/src/chain/acceptor.rs index 33f31052ff..86ba093689 100644 --- a/node/src/chain/acceptor.rs +++ b/node/src/chain/acceptor.rs @@ -17,7 +17,7 @@ use node_data::ledger::{ use node_data::message::AsyncQueue; use node_data::message::Payload; -use dusk_consensus::operations::VoterWithCredits; +use dusk_consensus::operations::Voter; use execution_core::stake::Withdraw; use metrics::{counter, gauge, histogram}; use node_data::message::payload::Vote; @@ -193,7 +193,7 @@ impl Acceptor { &self, provisioners_list: &Provisioners, tip: &Block, - ) -> Vec { + ) -> Vec { if tip.header().height == 0 { return vec![]; }; @@ -1026,7 +1026,7 @@ pub(crate) async fn verify_block_header( prev_header: &ledger::Header, provisioners: &ContextProvisioners, header: &ledger::Header, -) -> anyhow::Result<(u8, Vec, Vec)> { +) -> anyhow::Result<(u8, Vec, Vec)> { let validator = Validator::new(db, prev_header, provisioners); validator.execute_checks(header, false).await } diff --git a/node/src/chain/consensus.rs b/node/src/chain/consensus.rs index a628526740..b4f43247ec 100644 --- a/node/src/chain/consensus.rs +++ b/node/src/chain/consensus.rs @@ -10,8 +10,7 @@ use async_trait::async_trait; use dusk_consensus::commons::{ConsensusError, RoundUpdate, TimeoutSet}; use dusk_consensus::consensus::Consensus; use dusk_consensus::operations::{ - self, CallParams, Error, Operations, Output, VerificationOutput, - VoterWithCredits, + self, CallParams, Error, Operations, Output, VerificationOutput, Voter, }; use dusk_consensus::queue::MsgRegistry; use dusk_consensus::user::provisioners::ContextProvisioners; @@ -87,7 +86,7 @@ impl Task { db: &Arc>, vm: &Arc>, base_timeout: TimeoutSet, - voters: Vec, + voters: Vec, ) { let current = provisioners_list.to_current(); let consensus_task = Consensus::new( @@ -248,7 +247,7 @@ impl Operations for Executor { &self, candidate_header: &Header, disable_winning_att_check: bool, - ) -> Result<(u8, Vec, Vec), Error> { + ) -> Result<(u8, Vec, Vec), Error> { let validator = Validator::new( self.db.clone(), &self.tip_header, @@ -277,7 +276,7 @@ impl Operations for Executor { async fn verify_state_transition( &self, blk: &Block, - voters: &[VoterWithCredits], + voters: &[Voter], ) -> Result { info!("verifying state"); diff --git a/node/src/chain/header_validation.rs b/node/src/chain/header_validation.rs index 20a111b94d..49a7961c6e 100644 --- a/node/src/chain/header_validation.rs +++ b/node/src/chain/header_validation.rs @@ -9,7 +9,7 @@ use crate::database::Ledger; use anyhow::anyhow; use dusk_bytes::Serializable; use dusk_consensus::config::MINIMUM_BLOCK_TIME; -use dusk_consensus::operations::VoterWithCredits; +use dusk_consensus::operations::Voter; use dusk_consensus::quorum::verifiers; use dusk_consensus::quorum::verifiers::QuorumResult; use dusk_consensus::user::committee::{Committee, CommitteeSet}; @@ -63,7 +63,7 @@ impl<'a, DB: database::DB> Validator<'a, DB> { &self, candidate_block: &ledger::Header, disable_winner_att_check: bool, - ) -> anyhow::Result<(u8, Vec, Vec)> + ) -> anyhow::Result<(u8, Vec, Vec)> { self.verify_basic_fields(candidate_block).await?; let prev_block_voters = @@ -162,7 +162,7 @@ impl<'a, DB: database::DB> Validator<'a, DB> { pub async fn verify_prev_block_cert( &self, candidate_block: &'a ledger::Header, - ) -> anyhow::Result> { + ) -> anyhow::Result> { if self.prev_header.height == 0 { return Ok(vec![]); } @@ -246,7 +246,7 @@ impl<'a, DB: database::DB> Validator<'a, DB> { pub async fn verify_success_att( &self, candidate_block: &'a ledger::Header, - ) -> anyhow::Result> { + ) -> anyhow::Result> { let (_, _, voters) = verify_att( &candidate_block.att, candidate_block.get_consensus_header(), @@ -266,7 +266,7 @@ impl<'a, DB: database::DB> Validator<'a, DB> { blk: &'a ledger::Header, provisioners: &Provisioners, prev_block_seed: Seed, - ) -> anyhow::Result> { + ) -> anyhow::Result> { let (_, _, voters) = verify_att( &blk.att, blk.get_consensus_header(), @@ -326,7 +326,7 @@ pub async fn verify_att( consensus_header: ConsensusHeader, curr_seed: Signature, curr_eligible_provisioners: &Provisioners, -) -> anyhow::Result<(QuorumResult, QuorumResult, Vec)> { +) -> anyhow::Result<(QuorumResult, QuorumResult, Vec)> { let committee = RwLock::new(CommitteeSet::new(curr_eligible_provisioners)); let mut result = (QuorumResult::default(), QuorumResult::default()); @@ -396,7 +396,7 @@ pub async fn verify_att( } /// Merges two committees into a vector -fn merge_committees(a: &Committee, b: &Committee) -> Vec { +fn merge_committees(a: &Committee, b: &Committee) -> Vec { let mut members = a.members().clone(); for (key, value) in b.members() { // Keeps track of the number of occurrences for each member. diff --git a/node/src/vm.rs b/node/src/vm.rs index 91dd4f3010..92fa840259 100644 --- a/node/src/vm.rs +++ b/node/src/vm.rs @@ -4,7 +4,7 @@ // // Copyright (c) DUSK NETWORK. All rights reserved. -use dusk_consensus::operations::VoterWithCredits; +use dusk_consensus::operations::Voter; use dusk_consensus::{ operations::{CallParams, VerificationOutput}, user::{provisioners::Provisioners, stake::Stake}, @@ -29,13 +29,13 @@ pub trait VMExecution: Send + Sync + 'static { fn verify_state_transition( &self, blk: &Block, - voters: Option<&[VoterWithCredits]>, + voters: Option<&[Voter]>, ) -> anyhow::Result; fn accept( &self, blk: &Block, - voters: Option<&[VoterWithCredits]>, + voters: Option<&[Voter]>, ) -> anyhow::Result<(Vec, VerificationOutput)>; fn finalize_state(