Rust 1.54.0 lints (#2483)

## Issue Addressed

N/A

## Proposed Changes

- Removing a bunch of unnecessary references
- Updated `Error::VariantError` to `Error::Variant`
- There were additional enum variant lints that I ignored, because I thought our variant names were fine
- removed `MonitoredValidator`'s `pubkey` field, because I couldn't find it used anywhere. It looks like we just use the string version of the pubkey (the `id` field) if there is no index

## Additional Info



Co-authored-by: realbigsean <seananderson33@gmail.com>
This commit is contained in:
realbigsean
2021-07-30 01:11:47 +00:00
parent 8efd9fc324
commit 303deb9969
104 changed files with 307 additions and 313 deletions

View File

@@ -316,7 +316,7 @@ impl Eth1GenesisService {
//
// Note: this state is fully valid, some fields have been bypassed to make verification
// faster.
let state = self.cheap_state_at_eth1_block::<E>(block, &spec)?;
let state = self.cheap_state_at_eth1_block::<E>(block, spec)?;
let active_validator_count = state
.get_active_validator_indices(E::genesis_epoch(), spec)
.map_err(|e| format!("Genesis validators error: {:?}", e))?
@@ -328,7 +328,7 @@ impl Eth1GenesisService {
if is_valid_genesis_state(&state, spec) {
let genesis_state = self
.genesis_from_eth1_block(block.clone(), &spec)
.genesis_from_eth1_block(block.clone(), spec)
.map_err(|e| format!("Failed to generate valid genesis state : {}", e))?;
return Ok(Some(genesis_state));
@@ -372,12 +372,12 @@ impl Eth1GenesisService {
let genesis_state = initialize_beacon_state_from_eth1(
eth1_block.hash,
eth1_block.timestamp,
genesis_deposits(deposit_logs, &spec)?,
&spec,
genesis_deposits(deposit_logs, spec)?,
spec,
)
.map_err(|e| format!("Unable to initialize genesis state: {:?}", e))?;
if is_valid_genesis_state(&genesis_state, &spec) {
if is_valid_genesis_state(&genesis_state, spec) {
Ok(genesis_state)
} else {
Err("Generated state was not valid.".to_string())
@@ -406,7 +406,7 @@ impl Eth1GenesisService {
deposit_root: Hash256::zero(),
deposit_count: 0,
},
&spec,
spec,
);
self.deposit_logs_at_block(eth1_block.number)