Skip to content

Commit

Permalink
Merge branch 'feat/queryEpochInfo' of github.com:dashpay/platform int…
Browse files Browse the repository at this point in the history
…o feat/queryEpochInfo
  • Loading branch information
QuantumExplorer committed Oct 30, 2023
2 parents 1548233 + 7bf8755 commit 2e870c3
Show file tree
Hide file tree
Showing 19 changed files with 30,073 additions and 13,802 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const {
WaitForStateTransitionResultResponse: PBJSWaitForStateTransitionResultResponse,
GetConsensusParamsRequest: PBJSGetConsensusParamsRequest,
GetConsensusParamsResponse: PBJSGetConsensusParamsResponse,
GetEpochsInfoRequest: PBJSGetEpochsInfoRequest,
GetEpochsInfoResponse: PBJSGetEpochsInfoResponse,
},
},
},
Expand All @@ -56,6 +58,7 @@ const {
GetIdentitiesByPublicKeyHashesResponse: ProtocGetIdentitiesByPublicKeyHashesResponse,
WaitForStateTransitionResultResponse: ProtocWaitForStateTransitionResultResponse,
GetConsensusParamsResponse: ProtocGetConsensusParamsResponse,
GetEpochsInfoResponse: ProtocGetEpochsInfoResponse,
} = require('./platform_protoc');

const getPlatformDefinition = require('../../../../lib/getPlatformDefinition');
Expand Down Expand Up @@ -114,6 +117,10 @@ class PlatformPromiseClient {
this.client.getConsensusParams.bind(this.client),
);

this.client.getEpochInfos = promisify(
this.client.getEpochInfos.bind(this.client),
);

this.protocolVersion = undefined;
}

Expand Down Expand Up @@ -374,6 +381,37 @@ class PlatformPromiseClient {
);
}

/**
* @param {!GetEpochsInfoRequest} getEpochsInfoRequest
* @param {?Object<string, string>} metadata
* @param {CallOptions} [options={}]
* @return {Promise<!GetEpochsInfoResponse>}
*/
getIdentity(getEpochsInfoRequest, metadata = {}, options = {}) {
if (!isObject(metadata)) {
throw new Error('metadata must be an object');
}

return this.client.getEpochInfos(
getEpochsInfoRequest,
convertObjectToMetadata(metadata),
{
interceptors: [
jsonToProtobufInterceptorFactory(
jsonToProtobufFactory(
ProtocGetEpochsInfoResponse,
PBJSGetEpochsInfoResponse,
),
protobufToJsonFactory(
PBJSGetEpochsInfoRequest,
),
),
],
...options,
},
);
}

/**
* @param {string} protocolVersion
*/
Expand Down
4,260 changes: 4,255 additions & 5 deletions packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js

Large diffs are not rendered by default.

17,349 changes: 10,668 additions & 6,681 deletions packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js

Large diffs are not rendered by default.

Loading

0 comments on commit 2e870c3

Please sign in to comment.