@dashevo/dapi-grpc 1.0.0-pr.1545.7 → 1.0.0-pr.1621.0

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/.mocharc.yml CHANGED
@@ -1,3 +1,2 @@
1
- file:
2
- - lib/test/bootstrap.js
1
+ require: lib/test/bootstrap.js
3
2
  recursive: true
package/Cargo.toml CHANGED
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  name = "dapi-grpc"
3
3
  description = "GRPC client for Dash Platform"
4
- version = "0.25.0"
4
+ version = "1.0.0-pr.1621.0"
5
5
  authors = [
6
6
  "Samuel Westrich <sam@dash.org>",
7
7
  "Igor Markin <igor.markin@dash.org>",
@@ -13,26 +13,30 @@ edition = "2021"
13
13
  rust-version = "1.73"
14
14
  license = "MIT"
15
15
 
16
+ [features]
17
+ default = ["core", "platform", "client", "serde"]
18
+ core = []
19
+ platform = []
20
+ # Re-export Dash Platform protobuf types as `dapi_grpc::platform::proto`
21
+ tenderdash-proto = []
22
+ client = ["tonic/channel", "tonic/tls", "tonic/tls-roots", "platform"]
23
+ serde = ["dep:serde", "dep:serde_bytes"]
24
+
16
25
  [dependencies]
17
26
  prost = { version = "0.11.9" }
18
- prost-types = { version = "0.11.9" }
19
27
  tonic = { version = "0.9.2", features = [
20
28
  "codegen",
21
29
  "prost",
22
30
  ], default-features = false }
31
+ serde = { version = "1.0.171", optional = true, features = ["derive"] }
32
+ serde_bytes = { version = "0.11.12", optional = true }
33
+ tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", tag = "v0.14.0-dev.5" }
34
+ dapi-grpc-macros = { path = "../rs-dapi-grpc-macros" }
35
+ platform-version = { path = "../rs-platform-version" }
23
36
 
24
37
  [build-dependencies]
25
38
  tonic-build = { version = "0.9.2" }
26
39
 
27
- [features]
28
- default = ["core", "platform", "client"]
29
- core = ["core_v0"]
30
- platform = ["platform_v0"]
31
- client = ["tonic/channel", "tonic/tls", "tonic/tls-roots", "platform"]
32
-
33
- core_v0 = []
34
- platform_v0 = []
35
-
36
40
  [lib]
37
41
 
38
42
  [[example]]
@@ -43,3 +47,6 @@ path = "clients/core/v0/rust/core_example.rs"
43
47
  [[example]]
44
48
  name = "platform_example"
45
49
  path = "clients/platform/v0/rust/platform_example.rs"
50
+
51
+ [package.metadata.cargo-machete]
52
+ ignored = ["platform-version", "serde_bytes"]
package/build.rs CHANGED
@@ -1,63 +1,200 @@
1
1
  use std::{
2
- collections::HashMap,
3
2
  fs::{create_dir_all, remove_dir_all},
4
3
  path::PathBuf,
5
4
  };
6
5
 
6
+ use tonic_build::Builder;
7
+
7
8
  fn main() {
8
9
  generate().expect("failed to compile protobuf definitions");
9
10
 
10
11
  println!("cargo:rerun-if-changed=./protos");
12
+ println!("cargo:rerun-if-env-changed=CARGO_FEATURE_SERDE");
11
13
  }
12
14
 
15
+ struct MappingConfig {
16
+ protobuf_file: PathBuf,
17
+ out_dir: PathBuf,
18
+ builder: Builder,
19
+ proto_includes: Vec<PathBuf>,
20
+ }
13
21
  /// Generate Rust definitions from Protobuf definitions
14
22
  pub fn generate() -> Result<(), std::io::Error> {
15
- // Mapping between protobuf files => output directory
16
- let mut input = HashMap::<PathBuf, PathBuf>::new();
17
- input.insert(
23
+ let core = MappingConfig::new(
18
24
  PathBuf::from("protos/core/v0/core.proto"),
19
25
  PathBuf::from("src/core/proto"),
20
26
  );
21
- input.insert(
27
+ core.generate().unwrap();
28
+
29
+ let mut platform = MappingConfig::new(
22
30
  PathBuf::from("protos/platform/v0/platform.proto"),
23
31
  PathBuf::from("src/platform/proto"),
24
32
  );
25
33
 
26
- let proto_includes = vec![abs_path(&PathBuf::from("protos"))];
34
+ // Derive features for versioned messages
35
+ //
36
+ // "GetConsensusParamsRequest" is excluded as this message does not support proofs
37
+ const VERSIONED_REQUESTS: [&str; 15] = [
38
+ "GetDataContractHistoryRequest",
39
+ "GetDataContractRequest",
40
+ "GetDataContractsRequest",
41
+ "GetDocumentsRequest",
42
+ "GetIdentitiesByPublicKeyHashesRequest",
43
+ "GetIdentitiesRequest",
44
+ "GetIdentityBalanceAndRevisionRequest",
45
+ "GetIdentityBalanceRequest",
46
+ "GetIdentityByPublicKeyHashRequest",
47
+ "GetIdentityKeysRequest",
48
+ "GetIdentityRequest",
49
+ "GetProofsRequest",
50
+ "WaitForStateTransitionResultRequest",
51
+ "GetProtocolVersionUpgradeStateRequest",
52
+ "GetProtocolVersionUpgradeVoteStatusRequest",
53
+ ];
27
54
 
28
- for (proto, dest) in input {
29
- let proto = abs_path(&proto);
30
- let dest = abs_path(&dest);
31
- // Remove old compiled files; ignore errors
32
- if dest.exists() {
33
- remove_dir_all(&dest)?;
34
- }
35
- create_dir_all(&dest)?;
55
+ // "GetConsensusParamsResponse" is excluded as this message does not support proofs
56
+ const VERSIONED_RESPONSES: [&str; 16] = [
57
+ "GetDataContractHistoryResponse",
58
+ "GetDataContractResponse",
59
+ "GetDataContractsResponse",
60
+ "GetDocumentsResponse",
61
+ "GetIdentitiesByPublicKeyHashesResponse",
62
+ "GetIdentitiesResponse",
63
+ "GetIdentityBalanceAndRevisionResponse",
64
+ "GetIdentityBalanceResponse",
65
+ "GetIdentityByPublicKeyHashResponse",
66
+ "GetIdentityKeysResponse",
67
+ "GetIdentityResponse",
68
+ "GetProofsResponse",
69
+ "WaitForStateTransitionResultResponse",
70
+ "GetEpochsInfoResponse",
71
+ "GetProtocolVersionUpgradeStateResponse",
72
+ "GetProtocolVersionUpgradeVoteStatusResponse",
73
+ ];
74
+
75
+ // Derive VersionedGrpcMessage on requests
76
+ for msg in VERSIONED_REQUESTS {
77
+ platform = platform
78
+ .message_attribute(
79
+ msg,
80
+ r#"#[derive(::dapi_grpc_macros::VersionedGrpcMessage)]"#,
81
+ )
82
+ .message_attribute(msg, r#"#[grpc_versions(0)]"#);
83
+ }
36
84
 
37
- generate1(&[proto], &proto_includes, &dest)?;
85
+ // Derive VersionedGrpcMessage and VersionedGrpcResponse on responses
86
+ for msg in VERSIONED_RESPONSES {
87
+ platform = platform
88
+ .message_attribute(
89
+ msg,
90
+ r#"#[derive(::dapi_grpc_macros::VersionedGrpcMessage,::dapi_grpc_macros::VersionedGrpcResponse)]"#,
91
+ )
92
+ .message_attribute(msg, r#"#[grpc_versions(0)]"#);
38
93
  }
39
94
 
95
+ #[cfg(feature = "serde")]
96
+ let platform = platform
97
+ .type_attribute(
98
+ ".",
99
+ r#"#[derive(::serde::Serialize, ::serde::Deserialize)]"#,
100
+ )
101
+ .type_attribute(".", r#"#[serde(rename_all = "snake_case")]"#)
102
+ .field_attribute("id", r#"#[serde(with = "serde_bytes")]"#)
103
+ .field_attribute("identity_id", r#"#[serde(with = "serde_bytes")]"#)
104
+ .field_attribute(
105
+ "ids",
106
+ r#"#[serde(with = "crate::deserialization::vec_base64string")]"#,
107
+ )
108
+ .field_attribute(
109
+ "ResponseMetadata.height",
110
+ r#"#[serde(with = "crate::deserialization::from_to_string")]"#,
111
+ )
112
+ .field_attribute(
113
+ "ResponseMetadata.time_ms",
114
+ r#"#[serde(with = "crate::deserialization::from_to_string")]"#,
115
+ )
116
+ .field_attribute(
117
+ "start_at_ms",
118
+ r#"#[serde(with = "crate::deserialization::from_to_string")]"#,
119
+ )
120
+ .field_attribute("public_key_hash", r#"#[serde(with = "serde_bytes")]"#)
121
+ .field_attribute(
122
+ "public_key_hashes",
123
+ r#"#[serde(with = "crate::deserialization::vec_base64string")]"#,
124
+ )
125
+ // Get documents fields
126
+ .field_attribute("data_contract_id", r#"#[serde(with = "serde_bytes")]"#)
127
+ .field_attribute("where", r#"#[serde(with = "serde_bytes")]"#)
128
+ .field_attribute("order_by", r#"#[serde(with = "serde_bytes")]"#)
129
+ // Proof fields
130
+ .field_attribute("Proof.grovedb_proof", r#"#[serde(with = "serde_bytes")]"#)
131
+ .field_attribute("Proof.quorum_hash", r#"#[serde(with = "serde_bytes")]"#)
132
+ .field_attribute("Proof.signature", r#"#[serde(with = "serde_bytes")]"#)
133
+ .field_attribute("Proof.block_id_hash", r#"#[serde(with = "serde_bytes")]"#);
134
+
135
+ platform.generate().unwrap();
136
+
40
137
  Ok(())
41
138
  }
42
139
 
43
- /// Run single generation process.
44
- ///
45
- /// All paths must be absolute
46
- fn generate1(
47
- files: &[PathBuf],
48
- proto_includes: &[PathBuf],
49
- out_dir: &PathBuf,
50
- ) -> Result<(), std::io::Error> {
51
- let pb = tonic_build::configure()
52
- .build_server(false)
53
- .out_dir(out_dir)
54
- .protoc_arg("--experimental_allow_proto3_optional");
55
- #[cfg(feature = "client")]
56
- let pb = pb.build_client(true).build_transport(true);
57
- #[cfg(not(feature = "client"))]
58
- let pb = pb.build_client(false).build_transport(false);
59
-
60
- pb.compile(files, proto_includes)
140
+ impl MappingConfig {
141
+ fn new(protobuf_file: PathBuf, out_dir: PathBuf) -> Self {
142
+ let protobuf_file = abs_path(&protobuf_file);
143
+ let out_dir = abs_path(&out_dir);
144
+
145
+ let builder = tonic_build::configure()
146
+ .build_server(false)
147
+ .out_dir(out_dir.clone())
148
+ .protoc_arg("--experimental_allow_proto3_optional");
149
+
150
+ #[cfg(feature = "client")]
151
+ let builder = builder.build_client(true).build_transport(true);
152
+ #[cfg(not(feature = "client"))]
153
+ let builder = builder.build_client(false).build_transport(false);
154
+
155
+ Self {
156
+ protobuf_file,
157
+ out_dir,
158
+ builder,
159
+ proto_includes: vec![abs_path(&PathBuf::from("protos"))],
160
+ }
161
+ }
162
+
163
+ #[allow(unused)]
164
+ fn type_attribute(mut self, path: &str, attribute: &str) -> Self {
165
+ self.builder = self.builder.type_attribute(path, attribute);
166
+ self
167
+ }
168
+
169
+ #[allow(unused)]
170
+ fn field_attribute(mut self, path: &str, attribute: &str) -> Self {
171
+ self.builder = self.builder.field_attribute(path, attribute);
172
+ self
173
+ }
174
+
175
+ #[allow(unused)]
176
+ fn enum_attribute(mut self, path: &str, attribute: &str) -> Self {
177
+ self.builder = self.builder.enum_attribute(path, attribute);
178
+ self
179
+ }
180
+
181
+ #[allow(unused)]
182
+ fn message_attribute(mut self, path: &str, attribute: &str) -> Self {
183
+ self.builder = self.builder.message_attribute(path, attribute);
184
+ self
185
+ }
186
+
187
+ /// Run single generation process.
188
+ fn generate(self) -> Result<(), std::io::Error> {
189
+ // Remove old compiled files; ignore errors
190
+ if self.out_dir.exists() {
191
+ remove_dir_all(&self.out_dir)?;
192
+ }
193
+ create_dir_all(&self.out_dir)?;
194
+
195
+ self.builder
196
+ .compile(&[self.protobuf_file], &self.proto_includes)
197
+ }
61
198
  }
62
199
 
63
200
  fn abs_path(path: &PathBuf) -> PathBuf {
@@ -305,7 +305,9 @@ class PlatformPromiseClient {
305
305
  * @returns {Promise<!GetIdentitiesByPublicKeyHashesResponse>}
306
306
  */
307
307
  getIdentitiesByPublicKeyHashes(
308
- getIdentitiesByPublicKeyHashesRequest, metadata = {}, options = {},
308
+ getIdentitiesByPublicKeyHashesRequest,
309
+ metadata = {},
310
+ options = {},
309
311
  ) {
310
312
  if (!isObject(metadata)) {
311
313
  throw new Error('metadata must be an object');
@@ -337,9 +339,7 @@ class PlatformPromiseClient {
337
339
  * @param {CallOptions} [options={}]
338
340
  * @returns {Promise<!WaitForStateTransitionResultResponse>}
339
341
  */
340
- waitForStateTransitionResult(
341
- waitForStateTransitionResultRequest, metadata = {}, options = {},
342
- ) {
342
+ waitForStateTransitionResult(waitForStateTransitionResultRequest, metadata = {}, options = {}) {
343
343
  if (!isObject(metadata)) {
344
344
  throw new Error('metadata must be an object');
345
345
  }
@@ -370,9 +370,7 @@ class PlatformPromiseClient {
370
370
  * @param {CallOptions} [options={}]
371
371
  * @returns {Promise<!GetConsensusParamsResponse>}
372
372
  */
373
- getConsensusParams(
374
- getConsensusParamsRequest, metadata = {}, options = {},
375
- ) {
373
+ getConsensusParams(getConsensusParamsRequest, metadata = {}, options = {}) {
376
374
  if (!isObject(metadata)) {
377
375
  throw new Error('metadata must be an object');
378
376
  }
@@ -10286,6 +10286,20 @@ $root.org = (function() {
10286
10286
  */
10287
10287
  GetProofsResponseV0.prototype.metadata = null;
10288
10288
 
10289
+ // OneOf field names bound to virtual getters and setters
10290
+ var $oneOfFields;
10291
+
10292
+ /**
10293
+ * GetProofsResponseV0 result.
10294
+ * @member {"proof"|undefined} result
10295
+ * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0
10296
+ * @instance
10297
+ */
10298
+ Object.defineProperty(GetProofsResponseV0.prototype, "result", {
10299
+ get: $util.oneOfGetter($oneOfFields = ["proof"]),
10300
+ set: $util.oneOfSetter($oneOfFields)
10301
+ });
10302
+
10289
10303
  /**
10290
10304
  * Creates a new GetProofsResponseV0 instance using the specified properties.
10291
10305
  * @function create
@@ -10389,10 +10403,14 @@ $root.org = (function() {
10389
10403
  GetProofsResponseV0.verify = function verify(message) {
10390
10404
  if (typeof message !== "object" || message === null)
10391
10405
  return "object expected";
10406
+ var properties = {};
10392
10407
  if (message.proof != null && message.hasOwnProperty("proof")) {
10393
- var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof);
10394
- if (error)
10395
- return "proof." + error;
10408
+ properties.result = 1;
10409
+ {
10410
+ var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof);
10411
+ if (error)
10412
+ return "proof." + error;
10413
+ }
10396
10414
  }
10397
10415
  if (message.metadata != null && message.hasOwnProperty("metadata")) {
10398
10416
  var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata);
@@ -10440,12 +10458,13 @@ $root.org = (function() {
10440
10458
  if (!options)
10441
10459
  options = {};
10442
10460
  var object = {};
10443
- if (options.defaults) {
10444
- object.proof = null;
10461
+ if (options.defaults)
10445
10462
  object.metadata = null;
10446
- }
10447
- if (message.proof != null && message.hasOwnProperty("proof"))
10463
+ if (message.proof != null && message.hasOwnProperty("proof")) {
10448
10464
  object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options);
10465
+ if (options.oneofs)
10466
+ object.result = "proof";
10467
+ }
10449
10468
  if (message.metadata != null && message.hasOwnProperty("metadata"))
10450
10469
  object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options);
10451
10470
  return object;
@@ -140,6 +140,7 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsReq
140
140
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase', null, { proto });
141
141
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse', null, { proto });
142
142
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0', null, { proto });
143
+ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase', null, { proto });
143
144
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase', null, { proto });
144
145
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest', null, { proto });
145
146
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0', null, { proto });
@@ -1047,7 +1048,7 @@ if (goog.DEBUG && !COMPILED) {
1047
1048
  * @constructor
1048
1049
  */
1049
1050
  proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 = function(opt_data) {
1050
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
1051
+ jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_);
1051
1052
  };
1052
1053
  goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0, jspb.Message);
1053
1054
  if (goog.DEBUG && !COMPILED) {
@@ -10562,6 +10563,31 @@ proto.org.dash.platform.dapi.v0.GetProofsResponse.serializeBinaryToWriter = func
10562
10563
 
10563
10564
 
10564
10565
 
10566
+ /**
10567
+ * Oneof group definitions for this message. Each group defines the field
10568
+ * numbers belonging to that group. When of these fields' value is set, all
10569
+ * other fields in the group are cleared. During deserialization, if multiple
10570
+ * fields are encountered for a group, only the last value seen will be kept.
10571
+ * @private {!Array<!Array<number>>}
10572
+ * @const
10573
+ */
10574
+ proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_ = [[1]];
10575
+
10576
+ /**
10577
+ * @enum {number}
10578
+ */
10579
+ proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase = {
10580
+ RESULT_NOT_SET: 0,
10581
+ PROOF: 1
10582
+ };
10583
+
10584
+ /**
10585
+ * @return {proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase}
10586
+ */
10587
+ proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.getResultCase = function() {
10588
+ return /** @type {proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_[0]));
10589
+ };
10590
+
10565
10591
 
10566
10592
 
10567
10593
  if (jspb.Message.GENERATE_TO_OBJECT) {
@@ -10704,7 +10730,7 @@ proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.
10704
10730
  * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} returns this
10705
10731
  */
10706
10732
  proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.setProof = function(value) {
10707
- return jspb.Message.setWrapperField(this, 1, value);
10733
+ return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_[0], value);
10708
10734
  };
10709
10735
 
10710
10736
 
@@ -6,8 +6,8 @@ fn main() {
6
6
  let request = platform::GetConsensusParamsRequest {
7
7
  version: Some(platform::get_consensus_params_request::Version::V0(
8
8
  GetConsensusParamsRequestV0 {
9
- height: 123,
10
9
  prove: true,
10
+ height: 123,
11
11
  },
12
12
  )),
13
13
  };
@@ -1231,6 +1231,7 @@ export namespace GetProofsResponse {
1231
1231
  getMetadata(): ResponseMetadata | undefined;
1232
1232
  setMetadata(value?: ResponseMetadata): void;
1233
1233
 
1234
+ getResultCase(): GetProofsResponseV0.ResultCase;
1234
1235
  serializeBinary(): Uint8Array;
1235
1236
  toObject(includeInstance?: boolean): GetProofsResponseV0.AsObject;
1236
1237
  static toObject(includeInstance: boolean, msg: GetProofsResponseV0): GetProofsResponseV0.AsObject;
@@ -1246,6 +1247,11 @@ export namespace GetProofsResponse {
1246
1247
  proof?: Proof.AsObject,
1247
1248
  metadata?: ResponseMetadata.AsObject,
1248
1249
  }
1250
+
1251
+ export enum ResultCase {
1252
+ RESULT_NOT_SET = 0,
1253
+ PROOF = 1,
1254
+ }
1249
1255
  }
1250
1256
 
1251
1257
  export enum VersionCase {
@@ -140,6 +140,7 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsReq
140
140
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase', null, { proto });
141
141
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse', null, { proto });
142
142
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0', null, { proto });
143
+ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase', null, { proto });
143
144
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase', null, { proto });
144
145
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest', null, { proto });
145
146
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0', null, { proto });
@@ -1047,7 +1048,7 @@ if (goog.DEBUG && !COMPILED) {
1047
1048
  * @constructor
1048
1049
  */
1049
1050
  proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 = function(opt_data) {
1050
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
1051
+ jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_);
1051
1052
  };
1052
1053
  goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0, jspb.Message);
1053
1054
  if (goog.DEBUG && !COMPILED) {
@@ -10562,6 +10563,31 @@ proto.org.dash.platform.dapi.v0.GetProofsResponse.serializeBinaryToWriter = func
10562
10563
 
10563
10564
 
10564
10565
 
10566
+ /**
10567
+ * Oneof group definitions for this message. Each group defines the field
10568
+ * numbers belonging to that group. When of these fields' value is set, all
10569
+ * other fields in the group are cleared. During deserialization, if multiple
10570
+ * fields are encountered for a group, only the last value seen will be kept.
10571
+ * @private {!Array<!Array<number>>}
10572
+ * @const
10573
+ */
10574
+ proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_ = [[1]];
10575
+
10576
+ /**
10577
+ * @enum {number}
10578
+ */
10579
+ proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase = {
10580
+ RESULT_NOT_SET: 0,
10581
+ PROOF: 1
10582
+ };
10583
+
10584
+ /**
10585
+ * @return {proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase}
10586
+ */
10587
+ proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.getResultCase = function() {
10588
+ return /** @type {proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_[0]));
10589
+ };
10590
+
10565
10591
 
10566
10592
 
10567
10593
  if (jspb.Message.GENERATE_TO_OBJECT) {
@@ -10704,7 +10730,7 @@ proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.
10704
10730
  * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} returns this
10705
10731
  */
10706
10732
  proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.setProof = function(value) {
10707
- return jspb.Message.setWrapperField(this, 1, value);
10733
+ return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_[0], value);
10708
10734
  };
10709
10735
 
10710
10736
 
@@ -10,16 +10,18 @@ use(dirtyChai);
10
10
 
11
11
  process.env.NODE_ENV = 'test';
12
12
 
13
- beforeEach(function beforeEach() {
14
- if (!this.sinon) {
15
- this.sinon = sinon.createSandbox();
16
- } else {
17
- this.sinon.restore();
18
- }
19
- });
13
+ exports.mochaHooks = {
14
+ beforeEach() {
15
+ if (!this.sinon) {
16
+ this.sinon = sinon.createSandbox();
17
+ } else {
18
+ this.sinon.restore();
19
+ }
20
+ },
20
21
 
21
- afterEach(function afterEach() {
22
- this.sinon.restore();
23
- });
22
+ afterEach() {
23
+ this.sinon.restore();
24
+ },
25
+ };
24
26
 
25
27
  global.expect = expect;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/dapi-grpc",
3
- "version": "1.0.0-pr.1545.7",
3
+ "version": "1.0.0-pr.1621.0",
4
4
  "description": "DAPI GRPC definition file and generated clients",
5
5
  "browser": "browser.js",
6
6
  "main": "node.js",
@@ -45,23 +45,23 @@
45
45
  },
46
46
  "homepage": "https://github.com/dashevo/dapi-grpc#readme",
47
47
  "dependencies": {
48
- "@dashevo/grpc-common": "1.0.0-pr.1545.7",
48
+ "@dashevo/grpc-common": "1.0.0-pr.1621.0",
49
49
  "@dashevo/protobufjs": "6.10.5",
50
- "@grpc/grpc-js": "^1.3.7",
50
+ "@grpc/grpc-js": "1.4.4",
51
51
  "@improbable-eng/grpc-web": "^0.15.0",
52
52
  "google-protobuf": "^3.12.2",
53
53
  "long": "^5.2.0"
54
54
  },
55
55
  "devDependencies": {
56
- "chai": "^4.3.9",
56
+ "chai": "^4.3.10",
57
57
  "chai-as-promised": "^7.1.1",
58
58
  "dirty-chai": "^2.0.1",
59
- "eslint": "^7.32.0",
60
- "eslint-config-airbnb-base": "^14.2.1",
61
- "eslint-plugin-import": "^2.24.2",
62
- "mocha": "^9.1.2",
59
+ "eslint": "^8.53.0",
60
+ "eslint-config-airbnb-base": "^15.0.0",
61
+ "eslint-plugin-import": "^2.29.0",
62
+ "mocha": "^10.2.0",
63
63
  "mocha-sinon": "^2.1.2",
64
- "sinon": "^11.1.2",
64
+ "sinon": "^17.0.1",
65
65
  "sinon-chai": "^3.7.0"
66
66
  }
67
67
  }