Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay111meher committed Oct 29, 2024
1 parent a801fc3 commit db0d62c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
25 changes: 12 additions & 13 deletions matching_engine/src/jobs/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl LogParser {
if log.address.eq(&proof_marketplace_address) {
log_processor::pm::process_proof_market_place_logs(
log,
self.proof_marketplace.clone(),
&self.proof_marketplace,
&self.shared_local_ask_store,
&self.shared_generator_store,
&self.shared_market_store,
Expand All @@ -207,7 +207,7 @@ impl LogParser {
if log.address.eq(&generator_registry_address) {
log_processor::gr::process_generator_registry_logs(
log,
self.generator_registry.clone(),
&self.generator_registry,
&self.shared_generator_store,
)
.await
Expand All @@ -219,7 +219,7 @@ impl LogParser {
if log.address.eq(&entity_key_registry_address) {
log_processor::er::process_entity_key_registry_logs(
log,
self.entity_registry.clone(),
&self.entity_registry,
&self.shared_key_store,
)
.await
Expand Down Expand Up @@ -395,22 +395,21 @@ impl LogParser {
stash_required
);

if cached_stake_value
.has_more_than_or_eq_in_at_least_one(&stash_required.to_address_token_pair())
{
let selected_token = cached_stake_value
.get_random_less_pair(&stash_required.to_address_token_pair());
if selected_token.is_some() {
let address_token_pairs = stash_required.to_address_token_pair();

if cached_stake_value.has_more_than_or_eq_in_at_least_one(&address_token_pairs) {
if let Some(selected_token) =
cached_stake_value.get_random_less_pair(&address_token_pairs)
{
cached_stake.insert(
idle_generator.address,
cached_stake_value.sub(TokenTracker::from_address_token_pair(
selected_token.unwrap(),
)),
cached_stake_value
.sub(TokenTracker::from_address_token_pair(selected_token)),
);
}
} else {
log::warn!(
"Possible insuff stash if ask: {} is assigned, hence skipping",
"Possible insuff stash if ask: {} is assigned",
random_pending_ask.ask_id
);
}
Expand Down
2 changes: 1 addition & 1 deletion matching_engine/src/log_processor/er.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tokio::sync::RwLock;

pub async fn process_entity_key_registry_logs(
log: &Log,
entity_key_registry: bindings::entity_key_registry::EntityKeyRegistry<
entity_key_registry: &bindings::entity_key_registry::EntityKeyRegistry<
SignerMiddleware<Provider<Http>, Wallet<SigningKey>>,
>,
key_store: &Arc<RwLock<key_store::KeyStore>>,
Expand Down
2 changes: 1 addition & 1 deletion matching_engine/src/log_processor/gr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::utility::{tx_to_string, TokenTracker, TEST_TOKEN_ADDRESS_ONE};

pub async fn process_generator_registry_logs(
log: &Log,
genertor_registry: bindings::generator_registry::GeneratorRegistry<
genertor_registry: &bindings::generator_registry::GeneratorRegistry<
SignerMiddleware<Provider<Http>, Wallet<SigningKey>>,
>,
generator_store: &Arc<RwLock<generator_store::GeneratorStore>>,
Expand Down
4 changes: 3 additions & 1 deletion matching_engine/src/log_processor/pm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ use super::constants;
#[allow(clippy::too_many_arguments)]
pub async fn process_proof_market_place_logs(
log: &Log,
proof_market_place: pmp::ProofMarketplace<SignerMiddleware<Provider<Http>, Wallet<SigningKey>>>,
proof_market_place: &pmp::ProofMarketplace<
SignerMiddleware<Provider<Http>, Wallet<SigningKey>>,
>,
local_ask_store: &Arc<RwLock<LocalAskStore>>,
generator_store: &Arc<RwLock<generator_store::GeneratorStore>>,
market_store: &Arc<RwLock<MarketMetadataStore>>,
Expand Down

0 comments on commit db0d62c

Please sign in to comment.