Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag-bgh committed Sep 25, 2023
1 parent ad5cc09 commit ab1c293
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mev-rs/src/proposer_scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pub enum Error {
pub struct ProposerScheduler {
api: Client,
state: Mutex<State>,
validator_registry: ValidatorRegistry,
}

#[derive(Default)]
Expand All @@ -34,8 +33,8 @@ struct State {
}

impl ProposerScheduler {
pub fn new(api: Client, registry: ValidatorRegistry) -> Self {
Self { api, state: Mutex::new(State::default()), validator_registry: registry }
pub fn new(api: Client) -> Self {
Self { api, state: Mutex::new(State::default()) }
}

pub async fn dispatch_proposer_preparations(
Expand Down Expand Up @@ -67,15 +66,18 @@ impl ProposerScheduler {
&self,
coordinate: Coordinate,
_context: &Context,
registry: &ValidatorRegistry,
) -> Result<Proposal, Error> {
let (_slot, _parent_hash, public_key) = coordinate;
let summary = self
.api
.get_validator(StateId::Head, PublicKeyOrIndex::PublicKey(public_key.clone()))
.await?;
let validator_index = summary.index;
let state = &self.validator_registry.state.lock();
let registration = state

let registration = registry
.state
.lock()
.validator_preferences
.get(&public_key.clone())
.map(|registration| registration.message.clone())
Expand Down

0 comments on commit ab1c293

Please sign in to comment.