@dashevo/dapi-grpc 5.0.0-beta.4 → 5.0.0-beta.5
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/Cargo.toml +7 -0
- package/build.rs +48 -6
- package/clients/drive/v0/nodejs/drive_pbjs.js +25 -235
- package/clients/platform/v0/nodejs/platform_pbjs.js +25 -235
- package/clients/platform/v0/nodejs/platform_protoc.js +18 -261
- package/clients/platform/v0/web/platform_pb.d.ts +6 -34
- package/clients/platform/v0/web/platform_pb.js +18 -261
- package/package.json +2 -2
- package/protos/platform/v0/platform.proto +21 -8
- package/src/lib.rs +3 -0
- package/src/request_codec.rs +49 -0
- package/test/unit/nonunique-proof.spec.js +42 -0
- package/tests/protobuf_request_errors.rs +372 -0
|
@@ -495,7 +495,6 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicK
|
|
|
495
495
|
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashRequest.VersionCase', null, { proto });
|
|
496
496
|
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse', null, { proto });
|
|
497
497
|
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0', null, { proto });
|
|
498
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse', null, { proto });
|
|
499
498
|
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponse', null, { proto });
|
|
500
499
|
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.ResultCase', null, { proto });
|
|
501
500
|
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.VersionCase', null, { proto });
|
|
@@ -5240,27 +5239,6 @@ if (goog.DEBUG && !COMPILED) {
|
|
|
5240
5239
|
*/
|
|
5241
5240
|
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponse';
|
|
5242
5241
|
}
|
|
5243
|
-
/**
|
|
5244
|
-
* Generated by JsPbCodeGenerator.
|
|
5245
|
-
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
5246
|
-
* server response, or constructed directly in Javascript. The array is used
|
|
5247
|
-
* in place and becomes part of the constructed object. It is not cloned.
|
|
5248
|
-
* If no data is provided, the constructed object will be empty, but still
|
|
5249
|
-
* valid.
|
|
5250
|
-
* @extends {jspb.Message}
|
|
5251
|
-
* @constructor
|
|
5252
|
-
*/
|
|
5253
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse = function(opt_data) {
|
|
5254
|
-
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
5255
|
-
};
|
|
5256
|
-
goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse, jspb.Message);
|
|
5257
|
-
if (goog.DEBUG && !COMPILED) {
|
|
5258
|
-
/**
|
|
5259
|
-
* @public
|
|
5260
|
-
* @override
|
|
5261
|
-
*/
|
|
5262
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse';
|
|
5263
|
-
}
|
|
5264
5242
|
/**
|
|
5265
5243
|
* Generated by JsPbCodeGenerator.
|
|
5266
5244
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
@@ -46142,7 +46120,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator = {
|
|
|
46142
46120
|
IN: 9,
|
|
46143
46121
|
STARTS_WITH: 10,
|
|
46144
46122
|
IN_TIME_RANGE: 11,
|
|
46145
|
-
IN_INTEGER_RANGE: 12
|
|
46123
|
+
IN_INTEGER_RANGE: 12,
|
|
46124
|
+
CONTAINS: 13,
|
|
46125
|
+
CONTAINS_ANY: 14
|
|
46146
46126
|
};
|
|
46147
46127
|
|
|
46148
46128
|
|
|
@@ -59202,7 +59182,7 @@ proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.seri
|
|
|
59202
59182
|
* @private {!Array<!Array<number>>}
|
|
59203
59183
|
* @const
|
|
59204
59184
|
*/
|
|
59205
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.oneofGroups_ = [[1,
|
|
59185
|
+
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.oneofGroups_ = [[1,4]];
|
|
59206
59186
|
|
|
59207
59187
|
/**
|
|
59208
59188
|
* @enum {number}
|
|
@@ -59210,7 +59190,7 @@ proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetI
|
|
|
59210
59190
|
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.ResultCase = {
|
|
59211
59191
|
RESULT_NOT_SET: 0,
|
|
59212
59192
|
IDENTITY: 1,
|
|
59213
|
-
PROOF:
|
|
59193
|
+
PROOF: 4
|
|
59214
59194
|
};
|
|
59215
59195
|
|
|
59216
59196
|
/**
|
|
@@ -59252,7 +59232,7 @@ proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetI
|
|
|
59252
59232
|
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.toObject = function(includeInstance, msg) {
|
|
59253
59233
|
var f, obj = {
|
|
59254
59234
|
identity: (f = msg.getIdentity()) && proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponse.toObject(includeInstance, f),
|
|
59255
|
-
proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.
|
|
59235
|
+
proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f),
|
|
59256
59236
|
metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f)
|
|
59257
59237
|
};
|
|
59258
59238
|
|
|
@@ -59295,9 +59275,9 @@ proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetI
|
|
|
59295
59275
|
reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponse.deserializeBinaryFromReader);
|
|
59296
59276
|
msg.setIdentity(value);
|
|
59297
59277
|
break;
|
|
59298
|
-
case
|
|
59299
|
-
var value = new proto.org.dash.platform.dapi.v0.
|
|
59300
|
-
reader.readMessage(value,proto.org.dash.platform.dapi.v0.
|
|
59278
|
+
case 4:
|
|
59279
|
+
var value = new proto.org.dash.platform.dapi.v0.Proof;
|
|
59280
|
+
reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader);
|
|
59301
59281
|
msg.setProof(value);
|
|
59302
59282
|
break;
|
|
59303
59283
|
case 3:
|
|
@@ -59345,9 +59325,9 @@ proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetI
|
|
|
59345
59325
|
f = message.getProof();
|
|
59346
59326
|
if (f != null) {
|
|
59347
59327
|
writer.writeMessage(
|
|
59348
|
-
|
|
59328
|
+
4,
|
|
59349
59329
|
f,
|
|
59350
|
-
proto.org.dash.platform.dapi.v0.
|
|
59330
|
+
proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter
|
|
59351
59331
|
);
|
|
59352
59332
|
}
|
|
59353
59333
|
f = message.getMetadata();
|
|
@@ -59533,229 +59513,6 @@ proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetI
|
|
|
59533
59513
|
};
|
|
59534
59514
|
|
|
59535
59515
|
|
|
59536
|
-
|
|
59537
|
-
|
|
59538
|
-
|
|
59539
|
-
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
59540
|
-
/**
|
|
59541
|
-
* Creates an object representation of this proto.
|
|
59542
|
-
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
59543
|
-
* Optional fields that are not set will be set to undefined.
|
|
59544
|
-
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
59545
|
-
* For the list of reserved names please see:
|
|
59546
|
-
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
59547
|
-
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
59548
|
-
* JSPB instance for transitional soy proto support:
|
|
59549
|
-
* http://goto/soy-param-migration
|
|
59550
|
-
* @return {!Object}
|
|
59551
|
-
*/
|
|
59552
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.toObject = function(opt_includeInstance) {
|
|
59553
|
-
return proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.toObject(opt_includeInstance, this);
|
|
59554
|
-
};
|
|
59555
|
-
|
|
59556
|
-
|
|
59557
|
-
/**
|
|
59558
|
-
* Static version of the {@see toObject} method.
|
|
59559
|
-
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
59560
|
-
* the JSPB instance for transitional soy proto support:
|
|
59561
|
-
* http://goto/soy-param-migration
|
|
59562
|
-
* @param {!proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse} msg The msg instance to transform.
|
|
59563
|
-
* @return {!Object}
|
|
59564
|
-
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
59565
|
-
*/
|
|
59566
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.toObject = function(includeInstance, msg) {
|
|
59567
|
-
var f, obj = {
|
|
59568
|
-
grovedbIdentityPublicKeyHashProof: (f = msg.getGrovedbIdentityPublicKeyHashProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f),
|
|
59569
|
-
identityProofBytes: msg.getIdentityProofBytes_asB64()
|
|
59570
|
-
};
|
|
59571
|
-
|
|
59572
|
-
if (includeInstance) {
|
|
59573
|
-
obj.$jspbMessageInstance = msg;
|
|
59574
|
-
}
|
|
59575
|
-
return obj;
|
|
59576
|
-
};
|
|
59577
|
-
}
|
|
59578
|
-
|
|
59579
|
-
|
|
59580
|
-
/**
|
|
59581
|
-
* Deserializes binary data (in protobuf wire format).
|
|
59582
|
-
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
59583
|
-
* @return {!proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse}
|
|
59584
|
-
*/
|
|
59585
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.deserializeBinary = function(bytes) {
|
|
59586
|
-
var reader = new jspb.BinaryReader(bytes);
|
|
59587
|
-
var msg = new proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse;
|
|
59588
|
-
return proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.deserializeBinaryFromReader(msg, reader);
|
|
59589
|
-
};
|
|
59590
|
-
|
|
59591
|
-
|
|
59592
|
-
/**
|
|
59593
|
-
* Deserializes binary data (in protobuf wire format) from the
|
|
59594
|
-
* given reader into the given message object.
|
|
59595
|
-
* @param {!proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse} msg The message object to deserialize into.
|
|
59596
|
-
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
59597
|
-
* @return {!proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse}
|
|
59598
|
-
*/
|
|
59599
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
59600
|
-
while (reader.nextField()) {
|
|
59601
|
-
if (reader.isEndGroup()) {
|
|
59602
|
-
break;
|
|
59603
|
-
}
|
|
59604
|
-
var field = reader.getFieldNumber();
|
|
59605
|
-
switch (field) {
|
|
59606
|
-
case 1:
|
|
59607
|
-
var value = new proto.org.dash.platform.dapi.v0.Proof;
|
|
59608
|
-
reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader);
|
|
59609
|
-
msg.setGrovedbIdentityPublicKeyHashProof(value);
|
|
59610
|
-
break;
|
|
59611
|
-
case 2:
|
|
59612
|
-
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
|
59613
|
-
msg.setIdentityProofBytes(value);
|
|
59614
|
-
break;
|
|
59615
|
-
default:
|
|
59616
|
-
reader.skipField();
|
|
59617
|
-
break;
|
|
59618
|
-
}
|
|
59619
|
-
}
|
|
59620
|
-
return msg;
|
|
59621
|
-
};
|
|
59622
|
-
|
|
59623
|
-
|
|
59624
|
-
/**
|
|
59625
|
-
* Serializes the message to binary data (in protobuf wire format).
|
|
59626
|
-
* @return {!Uint8Array}
|
|
59627
|
-
*/
|
|
59628
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.serializeBinary = function() {
|
|
59629
|
-
var writer = new jspb.BinaryWriter();
|
|
59630
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.serializeBinaryToWriter(this, writer);
|
|
59631
|
-
return writer.getResultBuffer();
|
|
59632
|
-
};
|
|
59633
|
-
|
|
59634
|
-
|
|
59635
|
-
/**
|
|
59636
|
-
* Serializes the given message to binary data (in protobuf wire
|
|
59637
|
-
* format), writing to the given BinaryWriter.
|
|
59638
|
-
* @param {!proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse} message
|
|
59639
|
-
* @param {!jspb.BinaryWriter} writer
|
|
59640
|
-
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
59641
|
-
*/
|
|
59642
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.serializeBinaryToWriter = function(message, writer) {
|
|
59643
|
-
var f = undefined;
|
|
59644
|
-
f = message.getGrovedbIdentityPublicKeyHashProof();
|
|
59645
|
-
if (f != null) {
|
|
59646
|
-
writer.writeMessage(
|
|
59647
|
-
1,
|
|
59648
|
-
f,
|
|
59649
|
-
proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter
|
|
59650
|
-
);
|
|
59651
|
-
}
|
|
59652
|
-
f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2));
|
|
59653
|
-
if (f != null) {
|
|
59654
|
-
writer.writeBytes(
|
|
59655
|
-
2,
|
|
59656
|
-
f
|
|
59657
|
-
);
|
|
59658
|
-
}
|
|
59659
|
-
};
|
|
59660
|
-
|
|
59661
|
-
|
|
59662
|
-
/**
|
|
59663
|
-
* optional Proof grovedb_identity_public_key_hash_proof = 1;
|
|
59664
|
-
* @return {?proto.org.dash.platform.dapi.v0.Proof}
|
|
59665
|
-
*/
|
|
59666
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.getGrovedbIdentityPublicKeyHashProof = function() {
|
|
59667
|
-
return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ (
|
|
59668
|
-
jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 1));
|
|
59669
|
-
};
|
|
59670
|
-
|
|
59671
|
-
|
|
59672
|
-
/**
|
|
59673
|
-
* @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value
|
|
59674
|
-
* @return {!proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse} returns this
|
|
59675
|
-
*/
|
|
59676
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.setGrovedbIdentityPublicKeyHashProof = function(value) {
|
|
59677
|
-
return jspb.Message.setWrapperField(this, 1, value);
|
|
59678
|
-
};
|
|
59679
|
-
|
|
59680
|
-
|
|
59681
|
-
/**
|
|
59682
|
-
* Clears the message field making it undefined.
|
|
59683
|
-
* @return {!proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse} returns this
|
|
59684
|
-
*/
|
|
59685
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.clearGrovedbIdentityPublicKeyHashProof = function() {
|
|
59686
|
-
return this.setGrovedbIdentityPublicKeyHashProof(undefined);
|
|
59687
|
-
};
|
|
59688
|
-
|
|
59689
|
-
|
|
59690
|
-
/**
|
|
59691
|
-
* Returns whether this field is set.
|
|
59692
|
-
* @return {boolean}
|
|
59693
|
-
*/
|
|
59694
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.hasGrovedbIdentityPublicKeyHashProof = function() {
|
|
59695
|
-
return jspb.Message.getField(this, 1) != null;
|
|
59696
|
-
};
|
|
59697
|
-
|
|
59698
|
-
|
|
59699
|
-
/**
|
|
59700
|
-
* optional bytes identity_proof_bytes = 2;
|
|
59701
|
-
* @return {string}
|
|
59702
|
-
*/
|
|
59703
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.getIdentityProofBytes = function() {
|
|
59704
|
-
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
59705
|
-
};
|
|
59706
|
-
|
|
59707
|
-
|
|
59708
|
-
/**
|
|
59709
|
-
* optional bytes identity_proof_bytes = 2;
|
|
59710
|
-
* This is a type-conversion wrapper around `getIdentityProofBytes()`
|
|
59711
|
-
* @return {string}
|
|
59712
|
-
*/
|
|
59713
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.getIdentityProofBytes_asB64 = function() {
|
|
59714
|
-
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
|
59715
|
-
this.getIdentityProofBytes()));
|
|
59716
|
-
};
|
|
59717
|
-
|
|
59718
|
-
|
|
59719
|
-
/**
|
|
59720
|
-
* optional bytes identity_proof_bytes = 2;
|
|
59721
|
-
* Note that Uint8Array is not supported on all browsers.
|
|
59722
|
-
* @see http://caniuse.com/Uint8Array
|
|
59723
|
-
* This is a type-conversion wrapper around `getIdentityProofBytes()`
|
|
59724
|
-
* @return {!Uint8Array}
|
|
59725
|
-
*/
|
|
59726
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.getIdentityProofBytes_asU8 = function() {
|
|
59727
|
-
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
|
59728
|
-
this.getIdentityProofBytes()));
|
|
59729
|
-
};
|
|
59730
|
-
|
|
59731
|
-
|
|
59732
|
-
/**
|
|
59733
|
-
* @param {!(string|Uint8Array)} value
|
|
59734
|
-
* @return {!proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse} returns this
|
|
59735
|
-
*/
|
|
59736
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.setIdentityProofBytes = function(value) {
|
|
59737
|
-
return jspb.Message.setField(this, 2, value);
|
|
59738
|
-
};
|
|
59739
|
-
|
|
59740
|
-
|
|
59741
|
-
/**
|
|
59742
|
-
* Clears the field making it undefined.
|
|
59743
|
-
* @return {!proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse} returns this
|
|
59744
|
-
*/
|
|
59745
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.clearIdentityProofBytes = function() {
|
|
59746
|
-
return jspb.Message.setField(this, 2, undefined);
|
|
59747
|
-
};
|
|
59748
|
-
|
|
59749
|
-
|
|
59750
|
-
/**
|
|
59751
|
-
* Returns whether this field is set.
|
|
59752
|
-
* @return {boolean}
|
|
59753
|
-
*/
|
|
59754
|
-
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse.prototype.hasIdentityProofBytes = function() {
|
|
59755
|
-
return jspb.Message.getField(this, 2) != null;
|
|
59756
|
-
};
|
|
59757
|
-
|
|
59758
|
-
|
|
59759
59516
|
/**
|
|
59760
59517
|
* optional IdentityResponse identity = 1;
|
|
59761
59518
|
* @return {?proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponse}
|
|
@@ -59794,21 +59551,21 @@ proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetI
|
|
|
59794
59551
|
|
|
59795
59552
|
|
|
59796
59553
|
/**
|
|
59797
|
-
* optional
|
|
59798
|
-
* @return {?proto.org.dash.platform.dapi.v0.
|
|
59554
|
+
* optional Proof proof = 4;
|
|
59555
|
+
* @return {?proto.org.dash.platform.dapi.v0.Proof}
|
|
59799
59556
|
*/
|
|
59800
59557
|
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.prototype.getProof = function() {
|
|
59801
|
-
return /** @type{?proto.org.dash.platform.dapi.v0.
|
|
59802
|
-
jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.
|
|
59558
|
+
return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ (
|
|
59559
|
+
jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 4));
|
|
59803
59560
|
};
|
|
59804
59561
|
|
|
59805
59562
|
|
|
59806
59563
|
/**
|
|
59807
|
-
* @param {?proto.org.dash.platform.dapi.v0.
|
|
59564
|
+
* @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value
|
|
59808
59565
|
* @return {!proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0} returns this
|
|
59809
59566
|
*/
|
|
59810
59567
|
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.prototype.setProof = function(value) {
|
|
59811
|
-
return jspb.Message.setOneofWrapperField(this,
|
|
59568
|
+
return jspb.Message.setOneofWrapperField(this, 4, proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.oneofGroups_[0], value);
|
|
59812
59569
|
};
|
|
59813
59570
|
|
|
59814
59571
|
|
|
@@ -59826,7 +59583,7 @@ proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetI
|
|
|
59826
59583
|
* @return {boolean}
|
|
59827
59584
|
*/
|
|
59828
59585
|
proto.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.prototype.hasProof = function() {
|
|
59829
|
-
return jspb.Message.getField(this,
|
|
59586
|
+
return jspb.Message.getField(this, 4) != null;
|
|
59830
59587
|
};
|
|
59831
59588
|
|
|
59832
59589
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-grpc",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.5",
|
|
4
4
|
"description": "DAPI GRPC definition file and generated clients",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"main": "node.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/dashevo/dapi-grpc#readme",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@dashevo/grpc-common": "5.0.0-beta.
|
|
48
|
+
"@dashevo/grpc-common": "5.0.0-beta.5",
|
|
49
49
|
"@dashevo/protobufjs": "6.10.5",
|
|
50
50
|
"@grpc/grpc-js": "^1.14.3",
|
|
51
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
@@ -1240,9 +1240,9 @@ message GetDocumentsRequest {
|
|
|
1240
1240
|
//
|
|
1241
1241
|
// `BETWEEN*` operators expect the right-hand operand to be a
|
|
1242
1242
|
// 2-element `DocumentFieldValue.list` carrying `[lower, upper]`;
|
|
1243
|
-
// `IN`
|
|
1244
|
-
// expect a scalar `DocumentFieldValue` matching the
|
|
1245
|
-
// field's type.
|
|
1243
|
+
// `IN` and `CONTAINS_ANY` expect a `list` of candidate values; all
|
|
1244
|
+
// other operators expect a scalar `DocumentFieldValue` matching the
|
|
1245
|
+
// indexed field's type (for `CONTAINS`, the type of one element).
|
|
1246
1246
|
enum WhereOperator {
|
|
1247
1247
|
EQUAL = 0;
|
|
1248
1248
|
GREATER_THAN = 1;
|
|
@@ -1276,6 +1276,22 @@ message GetDocumentsRequest {
|
|
|
1276
1276
|
// proof. See `integerRange` in the document meta-schema and
|
|
1277
1277
|
// `drive::query::resolve_integer_range_bucket_clause`.
|
|
1278
1278
|
IN_INTEGER_RANGE = 12;
|
|
1279
|
+
// An element of a typed array equals the operand (v1 only; protocol
|
|
1280
|
+
// version 14). `field` names a typed array an index keys by its
|
|
1281
|
+
// elements: the index holds a document once per distinct element,
|
|
1282
|
+
// so the clause is an equality on one element's key and may page
|
|
1283
|
+
// with a cursor whose document holds the element. No other
|
|
1284
|
+
// operator may name a typed array. See "Indexes on typed arrays"
|
|
1285
|
+
// in the book's indexes chapter.
|
|
1286
|
+
CONTAINS = 13;
|
|
1287
|
+
// An element of a typed array is one of the operands (v1 only;
|
|
1288
|
+
// protocol version 14): an `IN` over the elements. A document
|
|
1289
|
+
// holding several of them is under each, and a documents page
|
|
1290
|
+
// returns it once, where it first appears; the limit counts every
|
|
1291
|
+
// entry the walk passes. Takes an `ORDER BY` on the array (the
|
|
1292
|
+
// order the elements are walked in) and no cursor. Counts, sums and
|
|
1293
|
+
// averages read several elements only grouped by them.
|
|
1294
|
+
CONTAINS_ANY = 14;
|
|
1279
1295
|
}
|
|
1280
1296
|
|
|
1281
1297
|
// Tagged scalar (or list) operand for a `WhereClause`. The
|
|
@@ -2535,13 +2551,10 @@ message GetIdentityByNonUniquePublicKeyHashResponse {
|
|
|
2535
2551
|
message GetIdentityByNonUniquePublicKeyHashResponseV0 {
|
|
2536
2552
|
message IdentityResponse { optional bytes identity = 1; }
|
|
2537
2553
|
|
|
2538
|
-
|
|
2539
|
-
Proof grovedb_identity_public_key_hash_proof = 1;
|
|
2540
|
-
optional bytes identity_proof_bytes = 2; // A hack, we return 2 proofs
|
|
2541
|
-
}
|
|
2554
|
+
reserved 2;
|
|
2542
2555
|
oneof result {
|
|
2543
2556
|
IdentityResponse identity = 1;
|
|
2544
|
-
|
|
2557
|
+
Proof proof = 4;
|
|
2545
2558
|
}
|
|
2546
2559
|
|
|
2547
2560
|
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
package/src/lib.rs
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//! Classify protobuf payload failures at the server's request boundary.
|
|
2
|
+
|
|
3
|
+
use prost::Message;
|
|
4
|
+
use std::marker::PhantomData;
|
|
5
|
+
use tonic::codec::{BufferSettings, Codec, DecodeBuf, Decoder};
|
|
6
|
+
use tonic::Status;
|
|
7
|
+
use tonic_prost::{ProstCodec, ProstEncoder};
|
|
8
|
+
|
|
9
|
+
pub(crate) struct RequestCodec<T, U>(PhantomData<(T, U)>);
|
|
10
|
+
|
|
11
|
+
impl<T, U> Default for RequestCodec<T, U> {
|
|
12
|
+
fn default() -> Self {
|
|
13
|
+
Self(PhantomData)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
impl<T, U> Codec for RequestCodec<T, U>
|
|
18
|
+
where
|
|
19
|
+
T: Message + Send + 'static,
|
|
20
|
+
U: Message + Default + Send + 'static,
|
|
21
|
+
{
|
|
22
|
+
type Encode = T;
|
|
23
|
+
type Decode = U;
|
|
24
|
+
type Encoder = ProstEncoder<T>;
|
|
25
|
+
type Decoder = RequestDecoder<U>;
|
|
26
|
+
|
|
27
|
+
fn encoder(&mut self) -> Self::Encoder {
|
|
28
|
+
ProstCodec::<T, U>::raw_encoder(BufferSettings::default())
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
fn decoder(&mut self) -> Self::Decoder {
|
|
32
|
+
RequestDecoder(PhantomData)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
pub(crate) struct RequestDecoder<U>(PhantomData<U>);
|
|
37
|
+
|
|
38
|
+
impl<U: Message + Default> Decoder for RequestDecoder<U> {
|
|
39
|
+
type Item = U;
|
|
40
|
+
type Error = Status;
|
|
41
|
+
|
|
42
|
+
fn decode(&mut self, buf: &mut DecodeBuf<'_>) -> Result<Option<U>, Status> {
|
|
43
|
+
// The generated server uses this decoder only for the caller's protobuf payload.
|
|
44
|
+
// Client response decoding and transport framing errors keep their own statuses.
|
|
45
|
+
Message::decode(buf)
|
|
46
|
+
.map(Some)
|
|
47
|
+
.map_err(|error| Status::invalid_argument(error.to_string()))
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const assert = require('node:assert/strict');
|
|
2
|
+
const nodeMessages = require('../../clients/platform/v0/nodejs/platform_protoc');
|
|
3
|
+
const webMessages = require('../../clients/platform/v0/web/platform_pb');
|
|
4
|
+
const protobufMessages = require('../../clients/platform/v0/nodejs/platform_pbjs');
|
|
5
|
+
const driveMessages = require('../../clients/drive/v0/nodejs/drive_pbjs');
|
|
6
|
+
|
|
7
|
+
const name = 'GetIdentityByNonUniquePublicKeyHashResponse';
|
|
8
|
+
const innerName = `${name}V0`;
|
|
9
|
+
const singleWire = Buffer.from([0x0a, 0x06, 0x22, 0x04, 0x0a, 0x02, 1, 2]);
|
|
10
|
+
const retiredWire = Buffer.from([0x0a, 0x08, 0x12, 0x06, 0x0a, 0x04, 0x0a, 0x02, 1, 2]);
|
|
11
|
+
|
|
12
|
+
describe('non-unique identity complete proof wire format', () => {
|
|
13
|
+
it('should round trip a standard Proof at field 4 across all published JS clients', () => {
|
|
14
|
+
const response = new nodeMessages[name]();
|
|
15
|
+
const v0 = new nodeMessages[name][innerName]();
|
|
16
|
+
const proof = new nodeMessages.Proof();
|
|
17
|
+
proof.setGrovedbProof(Buffer.from([1, 2]));
|
|
18
|
+
v0.setProof(proof);
|
|
19
|
+
response.setV0(v0);
|
|
20
|
+
assert.deepEqual(Buffer.from(response.serializeBinary()), singleWire);
|
|
21
|
+
const web = webMessages[name].deserializeBinary(singleWire);
|
|
22
|
+
assert.deepEqual(Buffer.from(web.getV0().getProof().getGrovedbProof_asU8()), Buffer.from([1, 2]));
|
|
23
|
+
[protobufMessages, driveMessages].forEach((messages) => {
|
|
24
|
+
const Response = messages.org.dash.platform.dapi.v0[name];
|
|
25
|
+
const decoded = Response.decode(singleWire);
|
|
26
|
+
assert.deepEqual(Buffer.from(decoded.v0.proof.grovedbProof), Buffer.from([1, 2]));
|
|
27
|
+
assert.deepEqual(Buffer.from(Response.encode(decoded).finish()), singleWire);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should discard retired field 2 without treating it as a supported proof', () => {
|
|
32
|
+
[nodeMessages, webMessages].forEach((messages) => {
|
|
33
|
+
assert.equal(messages[name].deserializeBinary(retiredWire).getV0().hasProof(), false);
|
|
34
|
+
assert.equal(messages[name][innerName].IdentityProvedResponse, undefined);
|
|
35
|
+
});
|
|
36
|
+
[protobufMessages, driveMessages].forEach((messages) => {
|
|
37
|
+
const Response = messages.org.dash.platform.dapi.v0[name];
|
|
38
|
+
assert.equal(Response.decode(retiredWire).v0.proof, null);
|
|
39
|
+
assert.equal(Response[innerName].IdentityProvedResponse, undefined);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|