Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove photon_photon client, add missing methods to indexer #1515

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
15 changes: 10 additions & 5 deletions forester/tests/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ use forester::{
ForesterConfig,
};
use light_client::{
indexer::{photon_indexer::PhotonIndexer, Indexer, IndexerError, NewAddressProofWithContext},
indexer::{
photon_indexer::PhotonIndexer, Base58Conversions, Hash, Indexer, IndexerError,
NewAddressProofWithContext,
},
rpc::RpcConnection,
};
use light_program_test::{indexer::TestIndexerExtensions, test_env::get_test_env_accounts};
Expand Down Expand Up @@ -225,14 +228,14 @@ pub async fn assert_account_proofs_for_photon_and_test_indexer<
user_pubkey: &Pubkey,
photon_indexer: &PhotonIndexer<R>,
) {
let accs: Result<Vec<String>, IndexerError> =
let accs: Result<Vec<Hash>, IndexerError> =
indexer.get_compressed_accounts_by_owner(user_pubkey).await;
for account_hash in accs.unwrap() {
let photon_result = photon_indexer
.get_multiple_compressed_account_proofs(vec![account_hash.clone()])
.get_multiple_compressed_account_proofs(vec![account_hash.to_base58()])
.await;
let test_indexer_result = indexer
.get_multiple_compressed_account_proofs(vec![account_hash.clone()])
.get_multiple_compressed_account_proofs(vec![account_hash.to_base58()])
.await;

if photon_result.is_err() {
Expand All @@ -247,7 +250,9 @@ pub async fn assert_account_proofs_for_photon_and_test_indexer<
let test_indexer_result = test_indexer_result.unwrap();
debug!(
"assert proofs for account: {} photon result: {:?} test indexer result: {:?}",
account_hash, photon_result, test_indexer_result
account_hash.to_base58(),
photon_result,
test_indexer_result
);

assert_eq!(photon_result.len(), test_indexer_result.len());
Expand Down
Loading