v2 API for compressed account proofs#10
v2 API for compressed account proofs#10SwenSchaeferjohann merged 9 commits intojorrit/feat-add-testfrom
Conversation
sergeytimoshin
commented
Feb 28, 2025
- implement v2 API for compressed account proofs
- refactored TreeAndQueue and tree heights helper
| pub root_seq: u64, | ||
| } | ||
|
|
||
| impl MerkleProofWithContext { |
There was a problem hiding this comment.
its the same original function written by helius https://github.com/Lightprotocol/photon/blob/main/src/ingester/persist/persisted_state_tree.rs#L335-L374
| pub queue: SerializablePubkey, | ||
| pub root_seq: u64, | ||
| pub prove_by_index: bool, | ||
| pub tree_type: u16, |
There was a problem hiding this comment.
would it make sense to use the struct we defined for merkle_tree, queue, and tree_type?
There was a problem hiding this comment.
Hm, depends on what's more convenient for the client @SwenSchaeferjohann wdyt?
There was a problem hiding this comment.
Wrapped into context info
| )); | ||
| }; | ||
|
|
||
| // Enrich with account data if available |
There was a problem hiding this comment.
doesn't the call fail if no data is available?
There was a problem hiding this comment.
| if let Some(account) = account_map.get(&value.hash.to_vec()) { | ||
| value.tree_type = account.tree_type as u16; | ||
| value.queue = SerializablePubkey::try_from(account.queue.clone())?; | ||
| } |
There was a problem hiding this comment.
shouldn't this fail if there is no account?
There was a problem hiding this comment.
| #[derive(Debug, Clone)] | ||
| pub struct TreeInfo { | ||
| pub tree: Pubkey, | ||
| pub queue: Pubkey, |
There was a problem hiding this comment.
Sure, but it always None for now, we can add it later
* refactored TreeAndQueue and tree heights helpers
Co-authored-by: ananas-block <58553958+ananas-block@users.noreply.github.com>
4b9c802 to
14dfd6d
Compare
…structure and update related parsing logic
…moving nested structure