@dashevo/dapi-grpc 3.1.0-dev.1 → 3.1.0-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -167,5 +167,3 @@
167
167
  * add more methods to Core service ([41f3ad0](https://github.com/dashevo/dapi-grpc/commit/41f3ad0ad6aee3acf4b1760949cde36d8df7d6f2))
168
168
  * fetchIdentity endpoint ([75d32d8](https://github.com/dashevo/dapi-grpc/commit/75d32d883be4d7a113fe34f1d008e1d9bcc3c7e1))
169
169
  * introduce Platform service ([c88b891](https://github.com/dashevo/dapi-grpc/commit/c88b891ecfac8987cd76c773b2f783ad7a155540))
170
-
171
-
package/Cargo.toml CHANGED
@@ -39,7 +39,7 @@ serde = ["dep:serde", "dep:serde_bytes", "tenderdash-proto/serde"]
39
39
  mocks = ["serde", "dep:serde_json"]
40
40
 
41
41
  [dependencies]
42
- tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", tag = "v1.5.0", default-features = false }
42
+ tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", tag = "v1.5.1", default-features = false }
43
43
 
44
44
  prost = { version = "0.14" }
45
45
  futures-core = "0.3.30"
package/README.md CHANGED
@@ -140,4 +140,3 @@ Feel free to dive in! [Open an issue](https://github.com/dashpay/platform/issues
140
140
  ## License
141
141
 
142
142
  [MIT](LICENSE) © Dash Core Group, Inc.
143
-
package/build.rs CHANGED
@@ -84,7 +84,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
84
84
  // Derive features for versioned messages
85
85
  //
86
86
  // "GetConsensusParamsRequest" is excluded as this message does not support proofs
87
- const VERSIONED_REQUESTS: [&str; 48] = [
87
+ const VERSIONED_REQUESTS: [&str; 56] = [
88
88
  "GetDataContractHistoryRequest",
89
89
  "GetDataContractRequest",
90
90
  "GetDataContractsRequest",
@@ -123,6 +123,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
123
123
  "GetTokenDirectPurchasePricesRequest",
124
124
  "GetTokenContractInfoRequest",
125
125
  "GetTokenStatusesRequest",
126
+ "GetTokenPreProgrammedDistributionsRequest",
126
127
  "GetTokenTotalSupplyRequest",
127
128
  "GetGroupInfoRequest",
128
129
  "GetGroupInfosRequest",
@@ -133,11 +134,24 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
133
134
  "GetAddressesInfosRequest",
134
135
  "GetRecentAddressBalanceChangesRequest",
135
136
  "GetRecentCompactedAddressBalanceChangesRequest",
137
+ "GetShieldedEncryptedNotesRequest",
138
+ "GetShieldedAnchorsRequest",
139
+ "GetMostRecentShieldedAnchorRequest",
140
+ "GetShieldedPoolStateRequest",
141
+ "GetShieldedNullifiersRequest",
142
+ "GetRecentNullifierChangesRequest",
143
+ "GetRecentCompactedNullifierChangesRequest",
136
144
  ];
137
145
 
138
- const PROOF_ONLY_VERSIONED_REQUESTS: [&str; 1] = ["GetAddressesTrunkStateRequest"];
146
+ const PROOF_ONLY_VERSIONED_REQUESTS: [&str; 2] = [
147
+ "GetAddressesTrunkStateRequest",
148
+ "GetNullifiersTrunkStateRequest",
149
+ ];
139
150
 
140
- const MERK_PROOF_VERSIONED_REQUESTS: [&str; 1] = ["GetAddressesBranchStateRequest"];
151
+ const MERK_PROOF_VERSIONED_REQUESTS: [&str; 2] = [
152
+ "GetAddressesBranchStateRequest",
153
+ "GetNullifiersBranchStateRequest",
154
+ ];
141
155
 
142
156
  // The following responses are excluded as they don't support proofs:
143
157
  // - "GetConsensusParamsResponse"
@@ -147,7 +161,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
147
161
  // - "GetIdentityByNonUniquePublicKeyHashResponse"
148
162
  //
149
163
  // "GetEvonodesProposedEpochBlocksResponse" is used for 2 Requests
150
- const VERSIONED_RESPONSES: [&str; 46] = [
164
+ const VERSIONED_RESPONSES: [&str; 54] = [
151
165
  "GetDataContractHistoryResponse",
152
166
  "GetDataContractResponse",
153
167
  "GetDataContractsResponse",
@@ -184,6 +198,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
184
198
  "GetTokenDirectPurchasePricesResponse",
185
199
  "GetTokenContractInfoResponse",
186
200
  "GetTokenStatusesResponse",
201
+ "GetTokenPreProgrammedDistributionsResponse",
187
202
  "GetTokenTotalSupplyResponse",
188
203
  "GetGroupInfoResponse",
189
204
  "GetGroupInfosResponse",
@@ -194,11 +209,24 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
194
209
  "GetAddressesInfosResponse",
195
210
  "GetRecentAddressBalanceChangesResponse",
196
211
  "GetRecentCompactedAddressBalanceChangesResponse",
212
+ "GetShieldedEncryptedNotesResponse",
213
+ "GetShieldedAnchorsResponse",
214
+ "GetMostRecentShieldedAnchorResponse",
215
+ "GetShieldedPoolStateResponse",
216
+ "GetShieldedNullifiersResponse",
217
+ "GetRecentNullifierChangesResponse",
218
+ "GetRecentCompactedNullifierChangesResponse",
197
219
  ];
198
220
 
199
- const PROOF_ONLY_VERSIONED_RESPONSES: [&str; 1] = ["GetAddressesTrunkStateResponse"];
221
+ const PROOF_ONLY_VERSIONED_RESPONSES: [&str; 2] = [
222
+ "GetAddressesTrunkStateResponse",
223
+ "GetNullifiersTrunkStateResponse",
224
+ ];
200
225
 
201
- const MERK_PROOF_VERSIONED_RESPONSES: [&str; 1] = ["GetAddressesBranchStateResponse"];
226
+ const MERK_PROOF_VERSIONED_RESPONSES: [&str; 2] = [
227
+ "GetAddressesBranchStateResponse",
228
+ "GetNullifiersBranchStateResponse",
229
+ ];
202
230
 
203
231
  check_unique(&VERSIONED_REQUESTS).expect("VERSIONED_REQUESTS");
204
232
  check_unique(&VERSIONED_RESPONSES).expect("VERSIONED_RESPONSES");
@@ -207,8 +235,24 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
207
235
  check_unique(&MERK_PROOF_VERSIONED_REQUESTS).expect("MERK_PROOF_VERSIONED_REQUESTS");
208
236
  check_unique(&MERK_PROOF_VERSIONED_RESPONSES).expect("MERK_PROOF_VERSIONED_RESPONSES");
209
237
 
238
+ // Messages whose latest version is v1 — the macro needs to know
239
+ // to generate match arms for both V0 and V1. Listed separately
240
+ // so the default `grpc_versions(0)` loop below skips them.
241
+ //
242
+ // Adding a message here is the proto-side companion of:
243
+ // - Adding a `GetXxxRequestV1` / `GetXxxResponseV1` to the
244
+ // oneof in `platform.proto`.
245
+ // - Bumping the matching `FeatureVersionBounds.max_version`
246
+ // to 1 in `rs-platform-version`.
247
+ // - Implementing the v1 dispatch arm in `drive-abci`.
248
+ const VERSIONED_AT_V1_REQUESTS: [&str; 1] = ["GetDocumentsRequest"];
249
+ const VERSIONED_AT_V1_RESPONSES: [&str; 1] = ["GetDocumentsResponse"];
250
+
210
251
  // Derive VersionedGrpcMessage on requests
211
252
  for msg in VERSIONED_REQUESTS {
253
+ if VERSIONED_AT_V1_REQUESTS.contains(&msg) {
254
+ continue;
255
+ }
212
256
  platform = platform
213
257
  .message_attribute(
214
258
  msg,
@@ -216,6 +260,14 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
216
260
  )
217
261
  .message_attribute(msg, r#"#[grpc_versions(0)]"#);
218
262
  }
263
+ for msg in VERSIONED_AT_V1_REQUESTS {
264
+ platform = platform
265
+ .message_attribute(
266
+ msg,
267
+ r#"#[derive(::dash_platform_macros::VersionedGrpcMessage)]"#,
268
+ )
269
+ .message_attribute(msg, r#"#[grpc_versions(1)]"#);
270
+ }
219
271
 
220
272
  // Derive ProofOnlyVersionedGrpcMessage on requests
221
273
  for msg in PROOF_ONLY_VERSIONED_REQUESTS {
@@ -229,6 +281,9 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
229
281
 
230
282
  // Derive VersionedGrpcMessage and VersionedGrpcResponse on responses
231
283
  for msg in VERSIONED_RESPONSES {
284
+ if VERSIONED_AT_V1_RESPONSES.contains(&msg) {
285
+ continue;
286
+ }
232
287
  platform = platform
233
288
  .message_attribute(
234
289
  msg,
@@ -236,6 +291,14 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
236
291
  )
237
292
  .message_attribute(msg, r#"#[grpc_versions(0)]"#);
238
293
  }
294
+ for msg in VERSIONED_AT_V1_RESPONSES {
295
+ platform = platform
296
+ .message_attribute(
297
+ msg,
298
+ r#"#[derive(::dash_platform_macros::VersionedGrpcMessage,::dash_platform_macros::VersionedGrpcResponse)]"#,
299
+ )
300
+ .message_attribute(msg, r#"#[grpc_versions(1)]"#);
301
+ }
239
302
 
240
303
  // Derive VersionedGrpcMessage and ProofOnlyVersionedGrpcResponse on responses
241
304
  for msg in PROOF_ONLY_VERSIONED_RESPONSES {
@@ -288,10 +351,14 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
288
351
  .field_attribute("start_at_ms", SERDE_WITH_STRING)
289
352
  .field_attribute("public_key_hash", SERDE_WITH_BYTES)
290
353
  .field_attribute("public_key_hashes", SERDE_WITH_BASE64)
354
+ .field_attribute("nullifiers", SERDE_WITH_BASE64)
291
355
  // Get documents fields
292
356
  .field_attribute("data_contract_id", SERDE_WITH_BYTES)
293
- .field_attribute("where", SERDE_WITH_BYTES)
294
- .field_attribute("order_by", SERDE_WITH_BYTES)
357
+ // V0 still ships CBOR for `where` / `order_by`; V1 ships
358
+ // typed `repeated WhereClause` / `repeated OrderClause`
359
+ // and doesn't need the `bytes`-shaped serde shim.
360
+ .field_attribute("GetDocumentsRequestV0.where", SERDE_WITH_BYTES)
361
+ .field_attribute("GetDocumentsRequestV0.order_by", SERDE_WITH_BYTES)
295
362
  // Proof fields
296
363
  .field_attribute("Proof.grovedb_proof", SERDE_WITH_BYTES)
297
364
  .field_attribute("Proof.quorum_hash", SERDE_WITH_BYTES)