From ca3b6ca84d23175d56c433ff1d215bd3fb060ab9 Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Thu, 19 Oct 2023 17:38:34 +0200 Subject: [PATCH] use AccountFetcherDelegate --- bin/service-mango-pnl/src/main.rs | 6 ++++-- bin/settler/src/main.rs | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/service-mango-pnl/src/main.rs b/bin/service-mango-pnl/src/main.rs index 88caab6d8..17091e397 100644 --- a/bin/service-mango-pnl/src/main.rs +++ b/bin/service-mango-pnl/src/main.rs @@ -162,6 +162,8 @@ use jsonrpsee::http_server::HttpServerHandle; use mango_feeds_connector::{ grpc_plugin_source, metrics, EntityFilter, FilterConfig, MetricsConfig, SourceConfig, }; +use mango_feeds_connector::feeds_chain_data_fetcher::FeedsAccountFetcher; +use mango_v4_client::chain_data_fetcher::AccountFetcherDelegate; fn start_jsonrpc_server( config: JsonRpcConfig, @@ -272,8 +274,8 @@ async fn main() -> anyhow::Result<()> { .await?, ); let chain_data = Arc::new(RwLock::new(chain_data::ChainData::new())); - let account_fetcher = Arc::new(chain_data_fetcher::AccountFetcherDelegate { - chain_data: chain_data.clone(), + let account_fetcher = Arc::new(AccountFetcherDelegate { + base_fetcher: FeedsAccountFetcher { chain_data: chain_data.clone() }, rpc: client.rpc_async(), }); diff --git a/bin/settler/src/main.rs b/bin/settler/src/main.rs index dc0e1b5ba..bff8e3846 100644 --- a/bin/settler/src/main.rs +++ b/bin/settler/src/main.rs @@ -15,6 +15,8 @@ use itertools::Itertools; use solana_sdk::commitment_config::CommitmentConfig; use solana_sdk::pubkey::Pubkey; use std::collections::HashSet; +use mango_v4_client::chain_data::FeedsAccountFetcher; +use mango_v4_client::chain_data_fetcher::AccountFetcherDelegate; pub mod metrics; pub mod settle; @@ -110,8 +112,10 @@ async fn main() -> anyhow::Result<()> { // The representation of current on-chain account data let chain_data = Arc::new(RwLock::new(chain_data::ChainData::new())); // Reading accounts from chain_data - let account_fetcher = Arc::new(chain_data_fetcher::AccountFetcherDelegate { - chain_data: chain_data.clone(), + let account_fetcher = Arc::new(AccountFetcherDelegate { + base_fetcher: FeedsAccountFetcher { + chain_data: chain_data.clone() + }, rpc: client.rpc_async(), });