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: forester: switch to photon-0.45 #1204

Merged
merged 1 commit into from
Sep 11, 2024
Merged
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
17 changes: 10 additions & 7 deletions forester/src/photon_indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use account_compression::initialize_address_merkle_tree::Pubkey;
use forester_utils::indexer::{Indexer, IndexerError, MerkleProof, NewAddressProofWithContext};
use forester_utils::rpc::RpcConnection;
use photon_api::apis::configuration::{ApiKey, Configuration};
use photon_api::models::GetCompressedAccountsByOwnerPostRequestParams;
use photon_api::models::{AddressWithTree, GetCompressedAccountsByOwnerPostRequestParams};
use solana_sdk::bs58;
use std::fmt::Debug;
use tracing::debug;
Expand Down Expand Up @@ -121,22 +121,25 @@ impl<R: RpcConnection> Indexer<R> for PhotonIndexer<R> {

async fn get_multiple_new_address_proofs(
&self,
_merkle_tree_pubkey: [u8; 32],
merkle_tree_pubkey: [u8; 32],
addresses: Vec<[u8; 32]>,
) -> Result<Vec<NewAddressProofWithContext>, IndexerError> {
let addresses_bs58 = addresses
let params: Vec<AddressWithTree> = addresses
.iter()
.map(|x| bs58::encode(x).into_string())
.map(|x| AddressWithTree {
address: bs58::encode(x).into_string(),
tree: bs58::encode(&merkle_tree_pubkey).into_string(),
})
.collect();

let request = photon_api::models::GetMultipleNewAddressProofsPostRequest {
params: addresses_bs58,
let request = photon_api::models::GetMultipleNewAddressProofsV2PostRequest {
params,
..Default::default()
};

debug!("Request: {:?}", request);

let result = photon_api::apis::default_api::get_multiple_new_address_proofs_post(
let result = photon_api::apis::default_api::get_multiple_new_address_proofs_v2_post(
&self.configuration,
request,
)
Expand Down