cargo fmt
This commit is contained in:
parent
962b1e0581
commit
17595c8ba9
|
@ -2,8 +2,8 @@
|
|||
|
||||
use clap::Parser;
|
||||
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use mango_feeds_connector::snapshot::get_snapshot_gma;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
#[clap()]
|
||||
|
@ -28,6 +28,5 @@ async fn main() -> anyhow::Result<()> {
|
|||
|
||||
get_snapshot_gma(&rpc_http_url, vec![program_id.to_string()]).await?;
|
||||
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
use clap::Parser;
|
||||
|
||||
use jsonrpc_core_client::transports::http;
|
||||
use mango_feeds_connector::solana_rpc_minimal::rpc_accounts_scan::RpcAccountsScanClient;
|
||||
use solana_account_decoder::UiAccountEncoding;
|
||||
use solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig};
|
||||
use solana_client::rpc_response::OptionalContext;
|
||||
use solana_sdk::commitment_config::CommitmentConfig;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use mango_feeds_connector::solana_rpc_minimal::rpc_accounts_scan::RpcAccountsScanClient;
|
||||
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
#[clap()]
|
||||
|
|
|
@ -3,8 +3,8 @@ pub mod chain_data;
|
|||
pub mod grpc_plugin_source;
|
||||
pub mod metrics;
|
||||
pub mod snapshot;
|
||||
pub mod websocket_source;
|
||||
pub mod solana_rpc_minimal;
|
||||
pub mod websocket_source;
|
||||
|
||||
use itertools::Itertools;
|
||||
use std::str::FromStr;
|
||||
|
|
|
@ -7,8 +7,8 @@ use solana_client::{
|
|||
};
|
||||
use solana_sdk::{commitment_config::CommitmentConfig, slot_history::Slot};
|
||||
|
||||
use crate::AnyhowWrap;
|
||||
use crate::solana_rpc_minimal::rpc_accounts_scan::RpcAccountsScanClient;
|
||||
use crate::AnyhowWrap;
|
||||
|
||||
/// gPA snapshot struct
|
||||
pub struct SnapshotProgramAccounts {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
|
||||
|
||||
pub mod rpc_accounts_scan {
|
||||
use jsonrpc_core::Result;
|
||||
use jsonrpc_derive::rpc;
|
||||
use solana_account_decoder::UiAccount;
|
||||
use solana_rpc_client_api::config::{RpcAccountInfoConfig, RpcProgramAccountsConfig};
|
||||
use solana_rpc_client_api::response::{Response as RpcResponse, RpcKeyedAccount, OptionalContext};
|
||||
use solana_rpc_client_api::response::{
|
||||
OptionalContext, Response as RpcResponse, RpcKeyedAccount,
|
||||
};
|
||||
|
||||
/// this definition is derived from solana-rpc/rpc.rs
|
||||
/// we want to avoid the heavy dependency to solana-rpc
|
||||
|
@ -30,21 +30,18 @@ pub mod rpc_accounts_scan {
|
|||
pubkey_strs: Vec<String>,
|
||||
config: Option<RpcAccountInfoConfig>,
|
||||
) -> Result<RpcResponse<Vec<Option<UiAccount>>>>;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pub mod rpc_pubsub {
|
||||
use std::sync::Arc;
|
||||
use jsonrpc_core::Result;
|
||||
use jsonrpc_derive::rpc;
|
||||
use jsonrpc_pubsub::typed::Subscriber;
|
||||
use jsonrpc_pubsub::SubscriptionId as PubSubSubscriptionId;
|
||||
use solana_account_decoder::UiAccount;
|
||||
use solana_rpc_client_api::config::{RpcAccountInfoConfig, RpcProgramAccountsConfig};
|
||||
use solana_rpc_client_api::response::{Response as RpcResponse, RpcKeyedAccount, SlotUpdate};
|
||||
use jsonrpc_pubsub::SubscriptionId as PubSubSubscriptionId;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[rpc]
|
||||
pub trait RpcSolPubSub {
|
||||
|
@ -98,7 +95,6 @@ pub mod rpc_pubsub {
|
|||
id: PubSubSubscriptionId,
|
||||
) -> Result<bool>;
|
||||
|
||||
|
||||
#[pubsub(
|
||||
subscription = "slotsUpdatesNotification",
|
||||
subscribe,
|
||||
|
@ -120,7 +116,5 @@ pub mod rpc_pubsub {
|
|||
meta: Option<Self::Metadata>,
|
||||
id: PubSubSubscriptionId,
|
||||
) -> Result<bool>;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,11 +23,11 @@ use tokio::time::timeout;
|
|||
use crate::snapshot::{
|
||||
get_snapshot_gma, get_snapshot_gpa, SnapshotMultipleAccounts, SnapshotProgramAccounts,
|
||||
};
|
||||
use crate::solana_rpc_minimal::rpc_pubsub::RpcSolPubSubClient;
|
||||
use crate::{
|
||||
chain_data::SlotStatus, AccountWrite, AnyhowWrap, EntityFilter, FeedMetadata, FilterConfig,
|
||||
SlotUpdate, SourceConfig,
|
||||
};
|
||||
use crate::solana_rpc_minimal::rpc_pubsub::RpcSolPubSubClient;
|
||||
|
||||
const SNAPSHOT_REFRESH_INTERVAL: Duration = Duration::from_secs(300);
|
||||
const WS_CONNECT_TIMEOUT: Duration = Duration::from_millis(5000);
|
||||
|
|
Loading…
Reference in New Issue