Skip to content

Commit 6ed927c

Browse files
refactor: resync photon-api with photon (#1789)
* resync photon-api with photon * update photon dependency to helius-labs/photon
1 parent 1432b0e commit 6ed927c

37 files changed

+1108
-1030
lines changed

scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ install_rust() {
103103
export PATH="${PREFIX}/cargo/bin:${PATH}"
104104
rustup component add --toolchain 1.86-x86_64-unknown-linux-gnu clippy
105105
cargo install cargo-expand --locked
106-
cargo install --git https://github.com/Lightprotocol/photon.git --rev 41ac9d0e3607a820ef1dbf4312b288992f792864 --locked
106+
cargo install --git https://github.com/helius-labs/photon.git --rev cf58facb4e0521843e3afd21d09d8e7e7f772140 --locked
107107
log "rust"
108108
fi
109109
}

sdk-libs/client/src/indexer/photon_indexer.rs

Lines changed: 907 additions & 901 deletions
Large diffs are not rendered by default.

sdk-libs/client/src/indexer/types.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,13 @@ pub struct AccountProofInputs {
111111

112112
impl AccountProofInputs {
113113
pub fn from_api_model(
114-
value: &photon_api::models::compressed_proof_with_context_v2::AccountProofInputs,
114+
value: &photon_api::models::AccountProofInputs,
115115
) -> Result<Self, IndexerError> {
116116
let root_index = {
117117
if value.root_index.prove_by_index {
118118
None
119119
} else {
120-
Some(
121-
value
122-
.root_index
123-
.root_index
124-
.try_into()
125-
.map_err(|_| IndexerError::InvalidResponseData)?,
126-
)
120+
Some(value.root_index.root_index)
127121
}
128122
};
129123
Ok(Self {
@@ -146,7 +140,7 @@ pub struct AddressProofInputs {
146140

147141
impl AddressProofInputs {
148142
pub fn from_api_model(
149-
value: &photon_api::models::compressed_proof_with_context_v2::AddressProofInputs,
143+
value: &photon_api::models::AddressProofInputs,
150144
) -> Result<Self, IndexerError> {
151145
Ok(Self {
152146
address: decode_base58_to_fixed_array(&value.address)?,
@@ -384,7 +378,7 @@ impl NextTreeInfo {
384378
}
385379
}
386380
pub fn from_api_model(
387-
value: &photon_api::models::compressed_proof_with_context_v2::TreeContextInfo,
381+
value: &photon_api::models::TreeContextInfo,
388382
) -> Result<Self, IndexerError> {
389383
Ok(Self {
390384
tree_type: TreeType::from(value.tree_type as u64),
@@ -435,7 +429,7 @@ impl TreeInfo {
435429
}
436430

437431
pub fn from_api_model(
438-
value: &photon_api::models::compressed_proof_with_context_v2::MerkleContextV2,
432+
value: &photon_api::models::MerkleContextV2,
439433
) -> Result<Self, IndexerError> {
440434
Ok(Self {
441435
tree_type: TreeType::from(value.tree_type as u64),
@@ -445,7 +439,7 @@ impl TreeInfo {
445439
next_tree_info: value
446440
.next_tree_context
447441
.as_ref()
448-
.map(NextTreeInfo::from_api_model)
442+
.map(|tree_info| NextTreeInfo::from_api_model(tree_info.as_ref()))
449443
.transpose()?,
450444
})
451445
}

sdk-libs/photon-api/.openapi-generator/FILES

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ docs/AccountContext.md
88
docs/AccountData.md
99
docs/AccountList.md
1010
docs/AccountListV2.md
11+
docs/AccountProofInputs.md
1112
docs/AccountState.md
1213
docs/AccountV2.md
1314
docs/AccountWithContext.md
1415
docs/AccountWithOptionalTokenData.md
1516
docs/AccountWithOptionalTokenDataV2.md
16-
docs/AddressSeq.md
17+
docs/AddressProofInputs.md
18+
docs/AddressQueueIndex.md
1719
docs/AddressWithTree.md
1820
docs/ClosedAccountV2.md
1921
docs/ClosedAccountWithOptionalTokenDataV2.md
@@ -286,12 +288,14 @@ src/models/account_context.rs
286288
src/models/account_data.rs
287289
src/models/account_list.rs
288290
src/models/account_list_v2.rs
291+
src/models/account_proof_inputs.rs
289292
src/models/account_state.rs
290293
src/models/account_v2.rs
291294
src/models/account_with_context.rs
292295
src/models/account_with_optional_token_data.rs
293296
src/models/account_with_optional_token_data_v2.rs
294-
src/models/address_seq.rs
297+
src/models/address_proof_inputs.rs
298+
src/models/address_queue_index.rs
295299
src/models/address_with_tree.rs
296300
src/models/closed_account_v2.rs
297301
src/models/closed_account_with_optional_token_data_v2.rs

sdk-libs/photon-api/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ Class | Method | HTTP request | Description
7171
- [AccountData](docs/AccountData.md)
7272
- [AccountList](docs/AccountList.md)
7373
- [AccountListV2](docs/AccountListV2.md)
74+
- [AccountProofInputs](docs/AccountProofInputs.md)
7475
- [AccountState](docs/AccountState.md)
7576
- [AccountV2](docs/AccountV2.md)
7677
- [AccountWithContext](docs/AccountWithContext.md)
7778
- [AccountWithOptionalTokenData](docs/AccountWithOptionalTokenData.md)
7879
- [AccountWithOptionalTokenDataV2](docs/AccountWithOptionalTokenDataV2.md)
79-
- [AddressSeq](docs/AddressSeq.md)
80+
- [AddressProofInputs](docs/AddressProofInputs.md)
81+
- [AddressQueueIndex](docs/AddressQueueIndex.md)
8082
- [AddressWithTree](docs/AddressWithTree.md)
8183
- [ClosedAccountV2](docs/ClosedAccountV2.md)
8284
- [ClosedAccountWithOptionalTokenDataV2](docs/ClosedAccountWithOptionalTokenDataV2.md)

sdk-libs/photon-api/docs/Account.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**address** | Option<**String**> | A Solana public key represented as a base58 string. | [optional][default to 111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj]
7+
**address** | Option<**String**> | A Solana public key represented as a base58 string. | [optional][default to 11157t3sqMV725NVRLrVQbAu98Jjfk1uCKehJnXXQs]
88
**data** | Option<[**models::AccountData**](AccountData.md)> | | [optional]
99
**hash** | **String** | A 32-byte hash represented as a base58 string. |
1010
**lamports** | **i32** | | [default to 100]
1111
**leaf_index** | **i32** | | [default to 100]
12-
**owner** | **String** | A Solana public key represented as a base58 string. | [default to 111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj]
12+
**owner** | **String** | A Solana public key represented as a base58 string. | [default to 11157t3sqMV725NVRLrVQbAu98Jjfk1uCKehJnXXQs]
1313
**seq** | Option<**i32**> | | [optional][default to 100]
1414
**slot_created** | **i32** | | [default to 100]
15-
**tree** | **String** | A Solana public key represented as a base58 string. | [default to 111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj]
15+
**tree** | **String** | A Solana public key represented as a base58 string. | [default to 11157t3sqMV725NVRLrVQbAu98Jjfk1uCKehJnXXQs]
1616

1717
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1818

sdk-libs/photon-api/docs/AccountContext.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
88
**nullified_in_tree** | **bool** | |
99
**nullifier** | Option<**String**> | A 32-byte hash represented as a base58 string. | [optional]
1010
**nullifier_queue_index** | Option<**i32**> | | [optional][default to 100]
11-
**queue** | **String** | A Solana public key represented as a base58 string. | [default to 111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj]
11+
**queue** | **String** | A Solana public key represented as a base58 string. | [default to 11157t3sqMV725NVRLrVQbAu98Jjfk1uCKehJnXXQs]
1212
**spent** | **bool** | |
1313
**tree_type** | **i32** | |
1414
**tx_hash** | Option<**String**> | A 32-byte hash represented as a base58 string. | [optional]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# AccountProofInputs
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**hash** | **String** | |
8+
**leaf_index** | **i32** | |
9+
**merkle_context** | [**models::MerkleContextV2**](MerkleContextV2.md) | |
10+
**root** | **String** | |
11+
**root_index** | [**models::RootIndex**](RootIndex.md) | |
12+
13+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
14+
15+

sdk-libs/photon-api/docs/AccountV2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**address** | Option<**String**> | A Solana public key represented as a base58 string. | [optional][default to 111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj]
7+
**address** | Option<**String**> | A Solana public key represented as a base58 string. | [optional][default to 11157t3sqMV725NVRLrVQbAu98Jjfk1uCKehJnXXQs]
88
**data** | Option<[**models::AccountData**](AccountData.md)> | | [optional]
99
**hash** | **String** | A 32-byte hash represented as a base58 string. |
1010
**lamports** | **i32** | | [default to 100]
1111
**leaf_index** | **i32** | | [default to 100]
1212
**merkle_context** | [**models::MerkleContextV2**](MerkleContextV2.md) | |
13-
**owner** | **String** | A Solana public key represented as a base58 string. | [default to 111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj]
13+
**owner** | **String** | A Solana public key represented as a base58 string. | [default to 11157t3sqMV725NVRLrVQbAu98Jjfk1uCKehJnXXQs]
1414
**prove_by_index** | **bool** | |
1515
**seq** | Option<**i32**> | | [optional][default to 100]
1616
**slot_created** | **i32** | | [default to 100]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# AddressProofInputs
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**address** | **String** | |
8+
**merkle_context** | [**models::MerkleContextV2**](MerkleContextV2.md) | |
9+
**root** | **String** | |
10+
**root_index** | **i32** | |
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
14+

0 commit comments

Comments
 (0)