Skip to content

Commit

Permalink
fix cargofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
godmodegalactus committed Sep 12, 2023
1 parent e6f9317 commit 1fb3954
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions lib/client/src/snapshot_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use serde_json::json;
use solana_account_decoder::{UiAccount, UiAccountEncoding};
use solana_client::{
rpc_config::{RpcAccountInfoConfig, RpcContextConfig, RpcProgramAccountsConfig},
rpc_response::{OptionalContext, Response, RpcKeyedAccount}, rpc_request::RpcRequest,
rpc_request::RpcRequest,
rpc_response::{OptionalContext, Response, RpcKeyedAccount},
};
use solana_rpc::rpc::rpc_minimal::MinimalClient;
use solana_sdk::{commitment_config::CommitmentConfig, pubkey::Pubkey};
Expand Down Expand Up @@ -78,7 +79,8 @@ async fn feed_snapshots(
openbook_oracles: Vec<Pubkey>,
sender: &async_channel::Sender<Message>,
) -> anyhow::Result<()> {
let rpc_client = solana_rpc_client::nonblocking::rpc_client::RpcClient::new(config.rpc_http_url.clone());
let rpc_client =
solana_rpc_client::nonblocking::rpc_client::RpcClient::new(config.rpc_http_url.clone());

// rpc_client.get_program_accounts_with_config(pubkey, config);
// let rpc_client = http::connect::<AccountsDataClient>(&config.rpc_http_url)
Expand All @@ -102,11 +104,12 @@ async fn feed_snapshots(
let mut snapshot = AccountSnapshot::default();

// Get all accounts of the openorders program
let response = rpc_client.send::<OptionalContext<Vec<RpcKeyedAccount>>>(
RpcRequest::GetProgramAccounts,
json!([openbook_v2::id().to_string(), all_accounts_config]),
)
.await?;
let response = rpc_client
.send::<OptionalContext<Vec<RpcKeyedAccount>>>(
RpcRequest::GetProgramAccounts,
json!([openbook_v2::id().to_string(), all_accounts_config]),
)
.await?;
if let OptionalContext::Context(account_snapshot_response) = response {
snapshot.extend_from_gpa_rpc(account_snapshot_response)?;
} else {
Expand All @@ -127,8 +130,11 @@ async fn feed_snapshots(
(
keys,
rpc_client
.send(RpcRequest::GetMultipleAccounts, json!([string_keys, account_info_config]))
.await
.send(
RpcRequest::GetMultipleAccounts,
json!([string_keys, account_info_config]),
)
.await,
)
}
})
Expand Down

0 comments on commit 1fb3954

Please sign in to comment.