@dashevo/dapi-grpc 1.0.0-dev.6 → 1.0.0-dev.8
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "dapi-grpc"
|
|
3
3
|
description = "GRPC client for Dash Platform"
|
|
4
|
-
version = "1.0.0-dev.
|
|
4
|
+
version = "1.0.0-dev.8"
|
|
5
5
|
authors = [
|
|
6
6
|
"Samuel Westrich <sam@dash.org>",
|
|
7
7
|
"Igor Markin <igor.markin@dash.org>",
|
|
@@ -37,8 +37,8 @@ tonic = { version = "0.11", features = [
|
|
|
37
37
|
serde = { version = "1.0.171", optional = true, features = ["derive"] }
|
|
38
38
|
serde_bytes = { version = "0.11.12", optional = true }
|
|
39
39
|
serde_json = { version = "1.0", optional = true }
|
|
40
|
-
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci",
|
|
41
|
-
"grpc
|
|
40
|
+
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", version = "0.14.0-dev.8", features = [
|
|
41
|
+
"grpc",
|
|
42
42
|
] }
|
|
43
43
|
dapi-grpc-macros = { path = "../rs-dapi-grpc-macros" }
|
|
44
44
|
platform-version = { path = "../rs-platform-version" }
|
|
@@ -54,6 +54,8 @@ const {
|
|
|
54
54
|
GetIdentityContractNonceResponse: PBJSGetIdentityContractNonceResponse,
|
|
55
55
|
GetIdentityNonceRequest: PBJSGetIdentityNonceRequest,
|
|
56
56
|
GetIdentityNonceResponse: PBJSGetIdentityNonceResponse,
|
|
57
|
+
GetIdentityKeysRequest: PBJSGetIdentityKeysRequest,
|
|
58
|
+
GetIdentityKeysResponse: PBJSGetIdentityKeysResponse,
|
|
57
59
|
},
|
|
58
60
|
},
|
|
59
61
|
},
|
|
@@ -76,6 +78,7 @@ const {
|
|
|
76
78
|
GetProofsResponse: ProtocGetProofsResponse,
|
|
77
79
|
GetIdentityContractNonceResponse: ProtocGetIdentityContractNonceResponse,
|
|
78
80
|
GetIdentityNonceResponse: ProtocGetIdentityNonceResponse,
|
|
81
|
+
GetIdentityKeysResponse: ProtocGetIdentityKeysResponse,
|
|
79
82
|
} = require('./platform_protoc');
|
|
80
83
|
|
|
81
84
|
const getPlatformDefinition = require('../../../../lib/getPlatformDefinition');
|
|
@@ -158,6 +161,10 @@ class PlatformPromiseClient {
|
|
|
158
161
|
this.client.getIdentityNonce.bind(this.client),
|
|
159
162
|
);
|
|
160
163
|
|
|
164
|
+
this.client.getIdentityKeys = promisify(
|
|
165
|
+
this.client.getIdentityKeys.bind(this.client),
|
|
166
|
+
);
|
|
167
|
+
|
|
161
168
|
this.protocolVersion = undefined;
|
|
162
169
|
}
|
|
163
170
|
|
|
@@ -613,6 +620,35 @@ class PlatformPromiseClient {
|
|
|
613
620
|
);
|
|
614
621
|
}
|
|
615
622
|
|
|
623
|
+
getIdentityKeys(
|
|
624
|
+
getIdentityKeysRequest,
|
|
625
|
+
metadata = {},
|
|
626
|
+
options = {},
|
|
627
|
+
) {
|
|
628
|
+
if (!isObject(metadata)) {
|
|
629
|
+
throw new Error('metadata must be an object');
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
return this.client.getIdentityKeys(
|
|
633
|
+
getIdentityKeysRequest,
|
|
634
|
+
convertObjectToMetadata(metadata),
|
|
635
|
+
{
|
|
636
|
+
interceptors: [
|
|
637
|
+
jsonToProtobufInterceptorFactory(
|
|
638
|
+
jsonToProtobufFactory(
|
|
639
|
+
ProtocGetIdentityKeysResponse,
|
|
640
|
+
PBJSGetIdentityKeysResponse,
|
|
641
|
+
),
|
|
642
|
+
protobufToJsonFactory(
|
|
643
|
+
PBJSGetIdentityKeysRequest,
|
|
644
|
+
),
|
|
645
|
+
),
|
|
646
|
+
],
|
|
647
|
+
...options,
|
|
648
|
+
},
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
|
|
616
652
|
/**
|
|
617
653
|
* @param {string} protocolVersion
|
|
618
654
|
*/
|
|
@@ -204,6 +204,20 @@ class PlatformPromiseClient {
|
|
|
204
204
|
);
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
/**
|
|
208
|
+
* @param {!GetIdentityKeysRequest} getIdentityKeysRequest
|
|
209
|
+
* @param {?Object<string, string>} metadata
|
|
210
|
+
* @return {Promise<!GetIdentityKeysResponse>}
|
|
211
|
+
*/
|
|
212
|
+
getIdentityKeys(getIdentityKeysRequest, metadata = {}) {
|
|
213
|
+
return promisify(
|
|
214
|
+
this.client.getIdentityKeys.bind(this.client),
|
|
215
|
+
)(
|
|
216
|
+
getIdentityKeysRequest,
|
|
217
|
+
metadata,
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
207
221
|
/**
|
|
208
222
|
* @param {string} protocolVersion
|
|
209
223
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-grpc",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.8",
|
|
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": "1.0.0-dev.
|
|
48
|
+
"@dashevo/grpc-common": "1.0.0-dev.8",
|
|
49
49
|
"@dashevo/protobufjs": "6.10.5",
|
|
50
50
|
"@grpc/grpc-js": "1.4.4",
|
|
51
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|
package/src/lib.rs
CHANGED
|
@@ -20,6 +20,7 @@ describe('PlatformPromiseClient', () => {
|
|
|
20
20
|
getProtocolVersionUpgradeState: this.sinon.stub().resolves(response),
|
|
21
21
|
getIdentityContractNonce: this.sinon.stub().resolves(response),
|
|
22
22
|
getIdentityNonce: this.sinon.stub().resolves(response),
|
|
23
|
+
getIdentityKeys: this.sinon.stub().resolves(response),
|
|
23
24
|
};
|
|
24
25
|
});
|
|
25
26
|
|
|
@@ -138,4 +139,14 @@ describe('PlatformPromiseClient', () => {
|
|
|
138
139
|
.to.be.calledOnceWith(request);
|
|
139
140
|
});
|
|
140
141
|
});
|
|
142
|
+
|
|
143
|
+
describe('#getIdentityKeys', () => {
|
|
144
|
+
it('should get identity keys', async () => {
|
|
145
|
+
const result = await platformPromiseClient.getIdentityKeys(request);
|
|
146
|
+
|
|
147
|
+
expect(result).to.equal(response);
|
|
148
|
+
expect(platformPromiseClient.client.getIdentityKeys)
|
|
149
|
+
.to.be.calledOnceWith(request);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
141
152
|
});
|