Skip to content

Commit

Permalink
refactor: remove photon_photon client, add missing methods to indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeytimoshin committed Jan 26, 2025
1 parent 8bbb3dd commit 6f94d66
Show file tree
Hide file tree
Showing 30 changed files with 1,259 additions and 1,090 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions forester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ light-program-test = { workspace = true}
solana-transaction-status = { workspace = true }
url = "2.2"
bb8 = { workspace = true }
log = { workspace = true }

serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
Expand Down
5 changes: 3 additions & 2 deletions forester/src/indexer_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ use std::{any::Any, sync::Arc};
use async_trait::async_trait;
use forester_utils::forester_epoch::TreeAccounts;
use light_client::{
indexer::{Indexer, StateMerkleTreeAccounts, StateMerkleTreeBundle},
indexer::{
photon_indexer::PhotonIndexer, Indexer, StateMerkleTreeAccounts, StateMerkleTreeBundle,
},
rpc::RpcConnection,
};
use light_hasher::Poseidon;
Expand All @@ -17,7 +19,6 @@ use tracing::info;

use crate::{
errors::ForesterError,
photon_indexer::PhotonIndexer,
rollover::{perform_address_merkle_tree_rollover, perform_state_merkle_tree_rollover_forester},
ForesterConfig,
};
Expand Down
1 change: 0 additions & 1 deletion forester/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub mod helius_priority_fee_types;
mod indexer_type;
pub mod metrics;
pub mod pagerduty;
pub mod photon_indexer;
pub mod pubsub_client;
pub mod queue_helpers;
pub mod rollover;
Expand Down
6 changes: 4 additions & 2 deletions forester/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ use forester::{
errors::ForesterError,
forester_status,
metrics::register_metrics,
photon_indexer::PhotonIndexer,
run_pipeline,
telemetry::setup_telemetry,
ForesterConfig,
};
use light_client::rpc::{RpcConnection, SolanaRpcConnection};
use light_client::{
indexer::photon_indexer::PhotonIndexer,
rpc::{RpcConnection, SolanaRpcConnection},
};
use tokio::{
signal::ctrl_c,
sync::{mpsc, oneshot},
Expand Down
254 changes: 0 additions & 254 deletions forester/src/photon_indexer.rs

This file was deleted.

7 changes: 0 additions & 7 deletions forester/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ use light_registry::{
};
use tracing::debug;

pub fn decode_hash(account: &str) -> [u8; 32] {
let bytes = bs58::decode(account).into_vec().unwrap();
let mut arr = [0u8; 32];
arr.copy_from_slice(&bytes);
arr
}

pub async fn get_protocol_config<R: RpcConnection>(rpc: &mut R) -> ProtocolConfig {
let authority_pda = get_protocol_config_pda_address();
let protocol_config_account = rpc
Expand Down
Loading

0 comments on commit 6f94d66

Please sign in to comment.