@dashevo/dapi-grpc 1.0.0-dev.10 → 1.0.0-dev.12
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 +14 -8
- package/build.rs +6 -2
- package/clients/core/v0/nodejs/CorePromiseClient.js +51 -13
- package/clients/core/v0/nodejs/core_pbjs.js +869 -703
- package/clients/core/v0/nodejs/core_protoc.js +681 -609
- package/clients/core/v0/web/CorePromiseClient.js +19 -5
- package/clients/core/v0/web/core_pb.d.ts +99 -89
- package/clients/core/v0/web/core_pb.js +681 -609
- package/clients/core/v0/web/core_pb_service.d.ts +29 -10
- package/clients/core/v0/web/core_pb_service.js +46 -6
- package/clients/platform/v0/nodejs/PlatformPromiseClient.js +55 -14
- package/clients/platform/v0/nodejs/platform_pbjs.js +7805 -7761
- package/clients/platform/v0/nodejs/platform_protoc.js +7845 -7749
- package/clients/platform/v0/web/PlatformPromiseClient.js +22 -8
- package/clients/platform/v0/web/platform_pb.d.ts +388 -372
- package/clients/platform/v0/web/platform_pb.js +7845 -7749
- package/clients/platform/v0/web/platform_pb_service.d.ts +35 -35
- package/clients/platform/v0/web/platform_pb_service.js +35 -35
- package/package.json +2 -2
- package/protos/core/v0/core.proto +27 -23
- package/protos/platform/v0/platform.proto +81 -64
- package/src/core/proto/org.dash.platform.dapi.v0.rs +196 -101
- package/src/platform/proto/org.dash.platform.dapi.v0.rs +381 -353
- package/test/unit/clients/core/v0/nodejs/CorePromiseClient.spec.js +27 -6
- package/test/unit/clients/platform/v0/nodejs/PlatformPromiseClient.spec.js +21 -0
- package/test/unit/getCoreDefinition.spec.js +5 -2
|
@@ -11,7 +11,8 @@ describe('CorePromiseClient', () => {
|
|
|
11
11
|
|
|
12
12
|
corePromiseClient = new CorePromiseClient('https://localhost/');
|
|
13
13
|
corePromiseClient.client = {
|
|
14
|
-
|
|
14
|
+
getBlockchainStatus: this.sinon.stub().resolves(response),
|
|
15
|
+
getMasternodeStatus: this.sinon.stub().resolves(response),
|
|
15
16
|
getBlock: this.sinon.stub().resolves(response),
|
|
16
17
|
broadcastTransaction: this.sinon.stub().resolves(response),
|
|
17
18
|
getTransaction: this.sinon.stub().resolves(response),
|
|
@@ -20,17 +21,37 @@ describe('CorePromiseClient', () => {
|
|
|
20
21
|
};
|
|
21
22
|
});
|
|
22
23
|
|
|
23
|
-
describe('#
|
|
24
|
-
it('should return status', async () => {
|
|
25
|
-
const result = await corePromiseClient.
|
|
24
|
+
describe('#getBlockchainStatus', () => {
|
|
25
|
+
it('should return core chain status', async () => {
|
|
26
|
+
const result = await corePromiseClient.getBlockchainStatus(request);
|
|
27
|
+
|
|
28
|
+
expect(result).to.equal(response);
|
|
29
|
+
expect(corePromiseClient.client.getBlockchainStatus).to.be.calledOnceWith(request);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should throw an error when metadata is not an object', async () => {
|
|
33
|
+
try {
|
|
34
|
+
corePromiseClient.getBlockchainStatus({}, 'metadata');
|
|
35
|
+
|
|
36
|
+
expect.fail('Error was not thrown');
|
|
37
|
+
} catch (e) {
|
|
38
|
+
expect(e.message).to.equal('metadata must be an object');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('#getMasternodeStatus', () => {
|
|
44
|
+
it('should return masternode status', async () => {
|
|
45
|
+
const result = await corePromiseClient.getMasternodeStatus(request);
|
|
26
46
|
|
|
27
47
|
expect(result).to.equal(response);
|
|
28
|
-
expect(corePromiseClient.client.
|
|
48
|
+
expect(corePromiseClient.client.getMasternodeStatus)
|
|
49
|
+
.to.be.calledOnceWith(request);
|
|
29
50
|
});
|
|
30
51
|
|
|
31
52
|
it('should throw an error when metadata is not an object', async () => {
|
|
32
53
|
try {
|
|
33
|
-
corePromiseClient.
|
|
54
|
+
corePromiseClient.getMasternodeStatus({}, 'metadata');
|
|
34
55
|
|
|
35
56
|
expect.fail('Error was not thrown');
|
|
36
57
|
} catch (e) {
|
|
@@ -13,6 +13,7 @@ describe('PlatformPromiseClient', () => {
|
|
|
13
13
|
platformPromiseClient.client = {
|
|
14
14
|
broadcastStateTransition: this.sinon.stub().resolves(response),
|
|
15
15
|
getIdentity: this.sinon.stub().resolves(response),
|
|
16
|
+
getIdentitiesContractKeys: this.sinon.stub().resolves(response),
|
|
16
17
|
getDataContract: this.sinon.stub().resolves(response),
|
|
17
18
|
getDocuments: this.sinon.stub().resolves(response),
|
|
18
19
|
getEpochsInfo: this.sinon.stub().resolves(response),
|
|
@@ -63,6 +64,26 @@ describe('PlatformPromiseClient', () => {
|
|
|
63
64
|
});
|
|
64
65
|
});
|
|
65
66
|
|
|
67
|
+
describe('#getIdentitiesContractKeys', () => {
|
|
68
|
+
it('should get identities', async () => {
|
|
69
|
+
const result = await platformPromiseClient.getIdentitiesContractKeys(request);
|
|
70
|
+
|
|
71
|
+
expect(result).to.equal(response);
|
|
72
|
+
expect(platformPromiseClient.client.getIdentitiesContractKeys)
|
|
73
|
+
.to.be.calledOnceWith(request);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('should throw an error when metadata is not an object', async () => {
|
|
77
|
+
try {
|
|
78
|
+
platformPromiseClient.getIdentitiesContractKeys({}, 'metadata');
|
|
79
|
+
|
|
80
|
+
expect.fail('Error was not thrown');
|
|
81
|
+
} catch (e) {
|
|
82
|
+
expect(e.message).to.equal('metadata must be an object');
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
66
87
|
describe('#getDataContract', () => {
|
|
67
88
|
it('should get data contract', async () => {
|
|
68
89
|
const result = await platformPromiseClient.getDataContract(request);
|
|
@@ -14,8 +14,11 @@ describe('getCoreDefinition', () => {
|
|
|
14
14
|
expect(coreDefinition.service).to.have.property('getTransaction');
|
|
15
15
|
expect(coreDefinition.service.getTransaction.path).to.equal('/org.dash.platform.dapi.v0.Core/getTransaction');
|
|
16
16
|
|
|
17
|
-
expect(coreDefinition.service).to.have.property('
|
|
18
|
-
expect(coreDefinition.service.
|
|
17
|
+
expect(coreDefinition.service).to.have.property('getBlockchainStatus');
|
|
18
|
+
expect(coreDefinition.service.getBlockchainStatus.path).to.equal('/org.dash.platform.dapi.v0.Core/getBlockchainStatus');
|
|
19
|
+
|
|
20
|
+
expect(coreDefinition.service).to.have.property('getMasternodeStatus');
|
|
21
|
+
expect(coreDefinition.service.getMasternodeStatus.path).to.equal('/org.dash.platform.dapi.v0.Core/getMasternodeStatus');
|
|
19
22
|
|
|
20
23
|
expect(coreDefinition.service).to.have.property('getBlock');
|
|
21
24
|
expect(coreDefinition.service.getBlock.path).to.equal('/org.dash.platform.dapi.v0.Core/getBlock');
|