Fix/silence clippy lints

This commit is contained in:
Paul Hauner 2019-03-08 09:23:57 +11:00
parent 1ef2652cac
commit 60098a051d
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6
3 changed files with 18 additions and 12 deletions

View File

@ -73,6 +73,7 @@ where
F: ForkChoice, F: ForkChoice,
{ {
/// Instantiate a new Beacon Chain, from genesis. /// Instantiate a new Beacon Chain, from genesis.
#[allow(clippy::too_many_arguments)] // Will be re-factored in the coming weeks.
pub fn genesis( pub fn genesis(
state_store: Arc<BeaconStateStore<T>>, state_store: Arc<BeaconStateStore<T>>,
block_store: Arc<BeaconBlockStore<T>>, block_store: Arc<BeaconBlockStore<T>>,

View File

@ -69,6 +69,7 @@ impl TestCase {
} }
/// Executes the test case, returning an `ExecutionResult`. /// Executes the test case, returning an `ExecutionResult`.
#[allow(clippy::cyclomatic_complexity)]
pub fn execute(&self) -> ExecutionResult { pub fn execute(&self) -> ExecutionResult {
let spec = self.spec(); let spec = self.spec();
let validator_count = self.config.deposits_for_chain_start; let validator_count = self.config.deposits_for_chain_start;

View File

@ -28,24 +28,28 @@ pub enum AttestationProduceError {
PollError(AttestationPollError), PollError(AttestationPollError),
} }
type TestingBlockProducer = BlockProducer<
TestingSlotClock,
DirectBeaconNode<MemoryDB, TestingSlotClock, BitwiseLMDGhost<MemoryDB>>,
DirectDuties<MemoryDB, TestingSlotClock, BitwiseLMDGhost<MemoryDB>>,
LocalSigner,
>;
type TestingAttester = Attester<
TestingSlotClock,
DirectBeaconNode<MemoryDB, TestingSlotClock, BitwiseLMDGhost<MemoryDB>>,
DirectDuties<MemoryDB, TestingSlotClock, BitwiseLMDGhost<MemoryDB>>,
LocalSigner,
>;
/// A `BlockProducer` and `Attester` which sign using a common keypair. /// A `BlockProducer` and `Attester` which sign using a common keypair.
/// ///
/// The test validator connects directly to a borrowed `BeaconChain` struct. It is useful for /// The test validator connects directly to a borrowed `BeaconChain` struct. It is useful for
/// testing that the core proposer and attester logic is functioning. Also for supporting beacon /// testing that the core proposer and attester logic is functioning. Also for supporting beacon
/// chain tests. /// chain tests.
pub struct ValidatorHarness { pub struct ValidatorHarness {
pub block_producer: BlockProducer< pub block_producer: TestingBlockProducer,
TestingSlotClock, pub attester: TestingAttester,
DirectBeaconNode<MemoryDB, TestingSlotClock, BitwiseLMDGhost<MemoryDB>>,
DirectDuties<MemoryDB, TestingSlotClock, BitwiseLMDGhost<MemoryDB>>,
LocalSigner,
>,
pub attester: Attester<
TestingSlotClock,
DirectBeaconNode<MemoryDB, TestingSlotClock, BitwiseLMDGhost<MemoryDB>>,
DirectDuties<MemoryDB, TestingSlotClock, BitwiseLMDGhost<MemoryDB>>,
LocalSigner,
>,
pub spec: Arc<ChainSpec>, pub spec: Arc<ChainSpec>,
pub epoch_map: Arc<DirectDuties<MemoryDB, TestingSlotClock, BitwiseLMDGhost<MemoryDB>>>, pub epoch_map: Arc<DirectDuties<MemoryDB, TestingSlotClock, BitwiseLMDGhost<MemoryDB>>>,
pub keypair: Keypair, pub keypair: Keypair,