From be5c569e0df6049603f2b5f101c308794d543bf4 Mon Sep 17 00:00:00 2001 From: Konstantin Shuplenkov Date: Tue, 3 Aug 2021 17:28:22 +0200 Subject: [PATCH 1/3] feat: getConsensusParams method --- .../v0/nodejs/PlatformPromiseClient.js | 40 ++++ .../platform/v0/objective-c/Platform.pbobjc.h | 63 ++++++ .../platform/v0/objective-c/Platform.pbobjc.m | 204 ++++++++++++++++++ clients/platform/v0/python/platform_pb2.py | 185 +++++++++++++++- protos/platform/v0/platform.proto | 19 ++ 5 files changed, 508 insertions(+), 3 deletions(-) diff --git a/clients/platform/v0/nodejs/PlatformPromiseClient.js b/clients/platform/v0/nodejs/PlatformPromiseClient.js index 74204c5..17dad09 100644 --- a/clients/platform/v0/nodejs/PlatformPromiseClient.js +++ b/clients/platform/v0/nodejs/PlatformPromiseClient.js @@ -37,6 +37,8 @@ const { GetIdentityIdsByPublicKeyHashesResponse: PBJSGetIdentityIdsByPublicKeyHashesResponse, WaitForStateTransitionResultRequest: PBJSWaitForStateTransitionResultRequest, WaitForStateTransitionResultResponse: PBJSWaitForStateTransitionResultResponse, + GetConsensusParamsRequest: PBJSGetConsensusParamsRequest, + GetConsensusParamsResponse: PBJSGetConsensusParamsResponse, }, }, }, @@ -52,6 +54,7 @@ const { GetIdentitiesByPublicKeyHashesResponse: ProtocGetIdentitiesByPublicKeyHashesResponse, GetIdentityIdsByPublicKeyHashesResponse: ProtocGetIdentityIdsByPublicKeyHashesResponse, WaitForStateTransitionResultResponse: ProtocWaitForStateTransitionResultResponse, + GetConsensusParamsResponse: ProtocGetConsensusParamsResponse, } = require('./platform_protoc'); const getPlatformDefinition = require('../../../../lib/getPlatformDefinition'); @@ -98,6 +101,10 @@ class PlatformPromiseClient { this.client.waitForStateTransitionResult.bind(this.client), ); + this.client.getConsensusParams = promisify( + this.client.getConsensusParams.bind(this.client), + ); + this.protocolVersion = undefined; } @@ -326,6 +333,39 @@ class PlatformPromiseClient { ); } + /** + * @param {!GetConsensusParamsRequest} getConsensusParamsRequest + * @param {?Object} metadata + * @param {CallOptions} [options={}] + * @returns {Promise} + */ + getConsensusParams( + getConsensusParamsRequest, metadata = {}, options = {}, + ) { + if (!isObject(metadata)) { + throw new Error('metadata must be an object'); + } + + return this.client.getConsensusParams( + getConsensusParamsRequest, + convertObjectToMetadata(metadata), + { + interceptors: [ + jsonToProtobufInterceptorFactory( + jsonToProtobufFactory( + ProtocGetConsensusParamsResponse, + PBJSGetConsensusParamsResponse, + ), + protobufToJsonFactory( + PBJSGetConsensusParamsRequest, + ), + ), + ], + ...options, + }, + ); + } + /** * @param {string} protocolVersion */ diff --git a/clients/platform/v0/objective-c/Platform.pbobjc.h b/clients/platform/v0/objective-c/Platform.pbobjc.h index 541f3a8..c58b14d 100644 --- a/clients/platform/v0/objective-c/Platform.pbobjc.h +++ b/clients/platform/v0/objective-c/Platform.pbobjc.h @@ -27,6 +27,8 @@ CF_EXTERN_C_BEGIN +@class ConsensusParamsBlock; +@class ConsensusParamsEvidence; @class Proof; @class ResponseMetadata; @class StateTransitionBroadcastError; @@ -394,6 +396,67 @@ typedef GPB_ENUM(WaitForStateTransitionResultResponse_Responses_OneOfCase) { **/ void WaitForStateTransitionResultResponse_ClearResponsesOneOfCase(WaitForStateTransitionResultResponse *message); +#pragma mark - ConsensusParamsBlock + +typedef GPB_ENUM(ConsensusParamsBlock_FieldNumber) { + ConsensusParamsBlock_FieldNumber_MaxBytes = 1, + ConsensusParamsBlock_FieldNumber_MaxGas = 2, + ConsensusParamsBlock_FieldNumber_TimeIotaMs = 3, +}; + +@interface ConsensusParamsBlock : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSString *maxBytes; + +@property(nonatomic, readwrite, copy, null_resettable) NSString *maxGas; + +@property(nonatomic, readwrite, copy, null_resettable) NSString *timeIotaMs; + +@end + +#pragma mark - ConsensusParamsEvidence + +typedef GPB_ENUM(ConsensusParamsEvidence_FieldNumber) { + ConsensusParamsEvidence_FieldNumber_MaxAge = 1, +}; + +@interface ConsensusParamsEvidence : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSString *maxAge; + +@end + +#pragma mark - GetConsensusParamsRequest + +typedef GPB_ENUM(GetConsensusParamsRequest_FieldNumber) { + GetConsensusParamsRequest_FieldNumber_Prove = 1, +}; + +@interface GetConsensusParamsRequest : GPBMessage + +@property(nonatomic, readwrite) BOOL prove; + +@end + +#pragma mark - GetConsensusParamsResponse + +typedef GPB_ENUM(GetConsensusParamsResponse_FieldNumber) { + GetConsensusParamsResponse_FieldNumber_Block = 1, + GetConsensusParamsResponse_FieldNumber_Evidence = 2, +}; + +@interface GetConsensusParamsResponse : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) ConsensusParamsBlock *block; +/** Test to see if @c block has been set. */ +@property(nonatomic, readwrite) BOOL hasBlock; + +@property(nonatomic, readwrite, strong, null_resettable) ConsensusParamsEvidence *evidence; +/** Test to see if @c evidence has been set. */ +@property(nonatomic, readwrite) BOOL hasEvidence; + +@end + NS_ASSUME_NONNULL_END CF_EXTERN_C_END diff --git a/clients/platform/v0/objective-c/Platform.pbobjc.m b/clients/platform/v0/objective-c/Platform.pbobjc.m index e95e8a2..cad77ed 100644 --- a/clients/platform/v0/objective-c/Platform.pbobjc.m +++ b/clients/platform/v0/objective-c/Platform.pbobjc.m @@ -1109,6 +1109,210 @@ void WaitForStateTransitionResultResponse_ClearResponsesOneOfCase(WaitForStateTr GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; GPBMaybeClearOneof(message, oneof, -1, 0); } +#pragma mark - ConsensusParamsBlock + +@implementation ConsensusParamsBlock + +@dynamic maxBytes; +@dynamic maxGas; +@dynamic timeIotaMs; + +typedef struct ConsensusParamsBlock__storage_ { + uint32_t _has_storage_[1]; + NSString *maxBytes; + NSString *maxGas; + NSString *timeIotaMs; +} ConsensusParamsBlock__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "maxBytes", + .dataTypeSpecific.className = NULL, + .number = ConsensusParamsBlock_FieldNumber_MaxBytes, + .hasIndex = 0, + .offset = (uint32_t)offsetof(ConsensusParamsBlock__storage_, maxBytes), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "maxGas", + .dataTypeSpecific.className = NULL, + .number = ConsensusParamsBlock_FieldNumber_MaxGas, + .hasIndex = 1, + .offset = (uint32_t)offsetof(ConsensusParamsBlock__storage_, maxGas), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "timeIotaMs", + .dataTypeSpecific.className = NULL, + .number = ConsensusParamsBlock_FieldNumber_TimeIotaMs, + .hasIndex = 2, + .offset = (uint32_t)offsetof(ConsensusParamsBlock__storage_, timeIotaMs), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[ConsensusParamsBlock class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(ConsensusParamsBlock__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - ConsensusParamsEvidence + +@implementation ConsensusParamsEvidence + +@dynamic maxAge; + +typedef struct ConsensusParamsEvidence__storage_ { + uint32_t _has_storage_[1]; + NSString *maxAge; +} ConsensusParamsEvidence__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "maxAge", + .dataTypeSpecific.className = NULL, + .number = ConsensusParamsEvidence_FieldNumber_MaxAge, + .hasIndex = 0, + .offset = (uint32_t)offsetof(ConsensusParamsEvidence__storage_, maxAge), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[ConsensusParamsEvidence class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(ConsensusParamsEvidence__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetConsensusParamsRequest + +@implementation GetConsensusParamsRequest + +@dynamic prove; + +typedef struct GetConsensusParamsRequest__storage_ { + uint32_t _has_storage_[1]; +} GetConsensusParamsRequest__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "prove", + .dataTypeSpecific.className = NULL, + .number = GetConsensusParamsRequest_FieldNumber_Prove, + .hasIndex = 0, + .offset = 1, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetConsensusParamsRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetConsensusParamsRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetConsensusParamsResponse + +@implementation GetConsensusParamsResponse + +@dynamic hasBlock, block; +@dynamic hasEvidence, evidence; + +typedef struct GetConsensusParamsResponse__storage_ { + uint32_t _has_storage_[1]; + ConsensusParamsBlock *block; + ConsensusParamsEvidence *evidence; +} GetConsensusParamsResponse__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "block", + .dataTypeSpecific.className = GPBStringifySymbol(ConsensusParamsBlock), + .number = GetConsensusParamsResponse_FieldNumber_Block, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetConsensusParamsResponse__storage_, block), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "evidence", + .dataTypeSpecific.className = GPBStringifySymbol(ConsensusParamsEvidence), + .number = GetConsensusParamsResponse_FieldNumber_Evidence, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetConsensusParamsResponse__storage_, evidence), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetConsensusParamsResponse class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetConsensusParamsResponse__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + #pragma clang diagnostic pop diff --git a/clients/platform/v0/python/platform_pb2.py b/clients/platform/v0/python/platform_pb2.py index 0bd08a0..8cd4789 100644 --- a/clients/platform/v0/python/platform_pb2.py +++ b/clients/platform/v0/python/platform_pb2.py @@ -19,7 +19,7 @@ name='platform.proto', package='org.dash.platform.dapi.v0', syntax='proto3', - serialized_pb=_b('\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\"j\n\x05Proof\x12\x17\n\x0froot_tree_proof\x18\x01 \x01(\x0c\x12\x18\n\x10store_tree_proof\x18\x02 \x01(\x0c\x12\x1b\n\x13signature_llmq_hash\x18\x03 \x01(\x0c\x12\x11\n\tsignature\x18\x04 \x01(\x0c\"D\n\x10ResponseMetadata\x12\x0e\n\x06height\x18\x01 \x01(\x03\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"/\n\x12GetIdentityRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\x97\x01\n\x13GetIdentityResponse\x12\x10\n\x08identity\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"3\n\x16GetDataContractRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xa0\x01\n\x17GetDataContractResponse\x12\x15\n\rdata_contract\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"\xb9\x01\n\x13GetDocumentsRequest\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\rH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\rH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05start\"\x99\x01\n\x14GetDocumentsResponse\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"Q\n%GetIdentitiesByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xac\x01\n&GetIdentitiesByPublicKeyHashesResponse\x12\x12\n\nidentities\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"R\n&GetIdentityIdsByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xaf\x01\n\'GetIdentityIdsByPublicKeyHashesResponse\x12\x14\n\x0cidentity_ids\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"S\n#WaitForStateTransitionResultRequest\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xf0\x01\n$WaitForStateTransitionResultResponse\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x0b\n\tresponses2\xee\x07\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\xa5\x01\n\x1egetIdentitiesByPublicKeyHashes\x12@.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest\x1a\x41.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse\x12\xa8\x01\n\x1fgetIdentityIdsByPublicKeyHashes\x12\x41.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesRequest\x1a\x42.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponseb\x06proto3') + serialized_pb=_b('\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\"j\n\x05Proof\x12\x17\n\x0froot_tree_proof\x18\x01 \x01(\x0c\x12\x18\n\x10store_tree_proof\x18\x02 \x01(\x0c\x12\x1b\n\x13signature_llmq_hash\x18\x03 \x01(\x0c\x12\x11\n\tsignature\x18\x04 \x01(\x0c\"D\n\x10ResponseMetadata\x12\x0e\n\x06height\x18\x01 \x01(\x03\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"/\n\x12GetIdentityRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\x97\x01\n\x13GetIdentityResponse\x12\x10\n\x08identity\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"3\n\x16GetDataContractRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xa0\x01\n\x17GetDataContractResponse\x12\x15\n\rdata_contract\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"\xb9\x01\n\x13GetDocumentsRequest\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\rH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\rH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05start\"\x99\x01\n\x14GetDocumentsResponse\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"Q\n%GetIdentitiesByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xac\x01\n&GetIdentitiesByPublicKeyHashesResponse\x12\x12\n\nidentities\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"R\n&GetIdentityIdsByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xaf\x01\n\'GetIdentityIdsByPublicKeyHashesResponse\x12\x14\n\x0cidentity_ids\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"S\n#WaitForStateTransitionResultRequest\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xf0\x01\n$WaitForStateTransitionResultResponse\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x0b\n\tresponses\"P\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\"*\n\x17\x43onsensusParamsEvidence\x12\x0f\n\x07max_age\x18\x01 \x01(\t\"*\n\x19GetConsensusParamsRequest\x12\r\n\x05prove\x18\x01 \x01(\x08\"\xa2\x01\n\x1aGetConsensusParamsResponse\x12>\n\x05\x62lock\x18\x01 \x01(\x0b\x32/.org.dash.platform.dapi.v0.ConsensusParamsBlock\x12\x44\n\x08\x65vidence\x18\x02 \x01(\x0b\x32\x32.org.dash.platform.dapi.v0.ConsensusParamsEvidence2\xee\x07\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\xa5\x01\n\x1egetIdentitiesByPublicKeyHashes\x12@.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest\x1a\x41.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse\x12\xa8\x01\n\x1fgetIdentityIdsByPublicKeyHashes\x12\x41.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesRequest\x1a\x42.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponseb\x06proto3') ) @@ -760,6 +760,151 @@ serialized_end=2007, ) + +_CONSENSUSPARAMSBLOCK = _descriptor.Descriptor( + name='ConsensusParamsBlock', + full_name='org.dash.platform.dapi.v0.ConsensusParamsBlock', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='max_bytes', full_name='org.dash.platform.dapi.v0.ConsensusParamsBlock.max_bytes', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='max_gas', full_name='org.dash.platform.dapi.v0.ConsensusParamsBlock.max_gas', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='time_iota_ms', full_name='org.dash.platform.dapi.v0.ConsensusParamsBlock.time_iota_ms', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2009, + serialized_end=2089, +) + + +_CONSENSUSPARAMSEVIDENCE = _descriptor.Descriptor( + name='ConsensusParamsEvidence', + full_name='org.dash.platform.dapi.v0.ConsensusParamsEvidence', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='max_age', full_name='org.dash.platform.dapi.v0.ConsensusParamsEvidence.max_age', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2091, + serialized_end=2133, +) + + +_GETCONSENSUSPARAMSREQUEST = _descriptor.Descriptor( + name='GetConsensusParamsRequest', + full_name='org.dash.platform.dapi.v0.GetConsensusParamsRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='prove', full_name='org.dash.platform.dapi.v0.GetConsensusParamsRequest.prove', index=0, + number=1, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2135, + serialized_end=2177, +) + + +_GETCONSENSUSPARAMSRESPONSE = _descriptor.Descriptor( + name='GetConsensusParamsResponse', + full_name='org.dash.platform.dapi.v0.GetConsensusParamsResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='block', full_name='org.dash.platform.dapi.v0.GetConsensusParamsResponse.block', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='evidence', full_name='org.dash.platform.dapi.v0.GetConsensusParamsResponse.evidence', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2180, + serialized_end=2342, +) + _GETIDENTITYRESPONSE.fields_by_name['proof'].message_type = _PROOF _GETIDENTITYRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA _GETDATACONTRACTRESPONSE.fields_by_name['proof'].message_type = _PROOF @@ -785,6 +930,8 @@ _WAITFORSTATETRANSITIONRESULTRESPONSE.oneofs_by_name['responses'].fields.append( _WAITFORSTATETRANSITIONRESULTRESPONSE.fields_by_name['proof']) _WAITFORSTATETRANSITIONRESULTRESPONSE.fields_by_name['proof'].containing_oneof = _WAITFORSTATETRANSITIONRESULTRESPONSE.oneofs_by_name['responses'] +_GETCONSENSUSPARAMSRESPONSE.fields_by_name['block'].message_type = _CONSENSUSPARAMSBLOCK +_GETCONSENSUSPARAMSRESPONSE.fields_by_name['evidence'].message_type = _CONSENSUSPARAMSEVIDENCE DESCRIPTOR.message_types_by_name['Proof'] = _PROOF DESCRIPTOR.message_types_by_name['ResponseMetadata'] = _RESPONSEMETADATA DESCRIPTOR.message_types_by_name['StateTransitionBroadcastError'] = _STATETRANSITIONBROADCASTERROR @@ -802,6 +949,10 @@ DESCRIPTOR.message_types_by_name['GetIdentityIdsByPublicKeyHashesResponse'] = _GETIDENTITYIDSBYPUBLICKEYHASHESRESPONSE DESCRIPTOR.message_types_by_name['WaitForStateTransitionResultRequest'] = _WAITFORSTATETRANSITIONRESULTREQUEST DESCRIPTOR.message_types_by_name['WaitForStateTransitionResultResponse'] = _WAITFORSTATETRANSITIONRESULTRESPONSE +DESCRIPTOR.message_types_by_name['ConsensusParamsBlock'] = _CONSENSUSPARAMSBLOCK +DESCRIPTOR.message_types_by_name['ConsensusParamsEvidence'] = _CONSENSUSPARAMSEVIDENCE +DESCRIPTOR.message_types_by_name['GetConsensusParamsRequest'] = _GETCONSENSUSPARAMSREQUEST +DESCRIPTOR.message_types_by_name['GetConsensusParamsResponse'] = _GETCONSENSUSPARAMSRESPONSE _sym_db.RegisterFileDescriptor(DESCRIPTOR) Proof = _reflection.GeneratedProtocolMessageType('Proof', (_message.Message,), dict( @@ -923,6 +1074,34 @@ )) _sym_db.RegisterMessage(WaitForStateTransitionResultResponse) +ConsensusParamsBlock = _reflection.GeneratedProtocolMessageType('ConsensusParamsBlock', (_message.Message,), dict( + DESCRIPTOR = _CONSENSUSPARAMSBLOCK, + __module__ = 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.ConsensusParamsBlock) + )) +_sym_db.RegisterMessage(ConsensusParamsBlock) + +ConsensusParamsEvidence = _reflection.GeneratedProtocolMessageType('ConsensusParamsEvidence', (_message.Message,), dict( + DESCRIPTOR = _CONSENSUSPARAMSEVIDENCE, + __module__ = 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.ConsensusParamsEvidence) + )) +_sym_db.RegisterMessage(ConsensusParamsEvidence) + +GetConsensusParamsRequest = _reflection.GeneratedProtocolMessageType('GetConsensusParamsRequest', (_message.Message,), dict( + DESCRIPTOR = _GETCONSENSUSPARAMSREQUEST, + __module__ = 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetConsensusParamsRequest) + )) +_sym_db.RegisterMessage(GetConsensusParamsRequest) + +GetConsensusParamsResponse = _reflection.GeneratedProtocolMessageType('GetConsensusParamsResponse', (_message.Message,), dict( + DESCRIPTOR = _GETCONSENSUSPARAMSRESPONSE, + __module__ = 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetConsensusParamsResponse) + )) +_sym_db.RegisterMessage(GetConsensusParamsResponse) + _PLATFORM = _descriptor.ServiceDescriptor( @@ -931,8 +1110,8 @@ file=DESCRIPTOR, index=0, options=None, - serialized_start=2010, - serialized_end=3016, + serialized_start=2345, + serialized_end=3351, methods=[ _descriptor.MethodDescriptor( name='broadcastStateTransition', diff --git a/protos/platform/v0/platform.proto b/protos/platform/v0/platform.proto index edf0b07..1237b0b 100644 --- a/protos/platform/v0/platform.proto +++ b/protos/platform/v0/platform.proto @@ -117,3 +117,22 @@ message WaitForStateTransitionResultResponse { } ResponseMetadata metadata = 3; } + +message ConsensusParamsBlock { + string max_bytes = 1; + string max_gas = 2; + string time_iota_ms = 3; +} + +message ConsensusParamsEvidence { + string max_age = 1; +} + +message GetConsensusParamsRequest { + bool prove = 1; +} + +message GetConsensusParamsResponse { + ConsensusParamsBlock block = 1; + ConsensusParamsEvidence evidence = 2; +} From 761cdbb16df193589f67744b91fb837ab4042e86 Mon Sep 17 00:00:00 2001 From: Konstantin Shuplenkov Date: Thu, 5 Aug 2021 13:55:32 +0300 Subject: [PATCH 2/3] feat: getConsensusParams method --- .../dash/platform/dapi/v0/PlatformGrpc.java | 55 +++++++++++++++++++ .../platform/v0/objective-c/Platform.pbrpc.h | 7 +++ .../platform/v0/objective-c/Platform.pbrpc.m | 12 ++++ clients/platform/v0/python/platform_pb2.py | 45 ++++++++++++++- .../platform/v0/python/platform_pb2_grpc.py | 17 ++++++ protos/platform/v0/platform.proto | 1 + 6 files changed, 135 insertions(+), 2 deletions(-) diff --git a/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java b/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java index c42cb5a..355baaf 100644 --- a/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java +++ b/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java @@ -111,6 +111,18 @@ private PlatformGrpc() {} .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( org.dash.platform.dapi.v0.PlatformOuterClass.WaitForStateTransitionResultResponse.getDefaultInstance())) .build(); + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static final io.grpc.MethodDescriptor METHOD_GET_CONSENSUS_PARAMS = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "org.dash.platform.dapi.v0.Platform", "getConsensusParams")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetConsensusParamsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetConsensusParamsResponse.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service @@ -188,6 +200,13 @@ public void waitForStateTransitionResult(org.dash.platform.dapi.v0.PlatformOuter asyncUnimplementedUnaryCall(METHOD_WAIT_FOR_STATE_TRANSITION_RESULT, responseObserver); } + /** + */ + public void getConsensusParams(org.dash.platform.dapi.v0.PlatformOuterClass.GetConsensusParamsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(METHOD_GET_CONSENSUS_PARAMS, responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -239,6 +258,13 @@ public void waitForStateTransitionResult(org.dash.platform.dapi.v0.PlatformOuter org.dash.platform.dapi.v0.PlatformOuterClass.WaitForStateTransitionResultRequest, org.dash.platform.dapi.v0.PlatformOuterClass.WaitForStateTransitionResultResponse>( this, METHODID_WAIT_FOR_STATE_TRANSITION_RESULT))) + .addMethod( + METHOD_GET_CONSENSUS_PARAMS, + asyncUnaryCall( + new MethodHandlers< + org.dash.platform.dapi.v0.PlatformOuterClass.GetConsensusParamsRequest, + org.dash.platform.dapi.v0.PlatformOuterClass.GetConsensusParamsResponse>( + this, METHODID_GET_CONSENSUS_PARAMS))) .build(); } } @@ -316,6 +342,14 @@ public void waitForStateTransitionResult(org.dash.platform.dapi.v0.PlatformOuter asyncUnaryCall( getChannel().newCall(METHOD_WAIT_FOR_STATE_TRANSITION_RESULT, getCallOptions()), request, responseObserver); } + + /** + */ + public void getConsensusParams(org.dash.platform.dapi.v0.PlatformOuterClass.GetConsensusParamsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_GET_CONSENSUS_PARAMS, getCallOptions()), request, responseObserver); + } } /** @@ -384,6 +418,13 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.WaitForStateTransitionResult return blockingUnaryCall( getChannel(), METHOD_WAIT_FOR_STATE_TRANSITION_RESULT, getCallOptions(), request); } + + /** + */ + public org.dash.platform.dapi.v0.PlatformOuterClass.GetConsensusParamsResponse getConsensusParams(org.dash.platform.dapi.v0.PlatformOuterClass.GetConsensusParamsRequest request) { + return blockingUnaryCall( + getChannel(), METHOD_GET_CONSENSUS_PARAMS, getCallOptions(), request); + } } /** @@ -459,6 +500,14 @@ public com.google.common.util.concurrent.ListenableFuture getConsensusParams( + org.dash.platform.dapi.v0.PlatformOuterClass.GetConsensusParamsRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_GET_CONSENSUS_PARAMS, getCallOptions()), request); + } } private static final int METHODID_BROADCAST_STATE_TRANSITION = 0; @@ -468,6 +517,7 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -514,6 +564,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.waitForStateTransitionResult((org.dash.platform.dapi.v0.PlatformOuterClass.WaitForStateTransitionResultRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_CONSENSUS_PARAMS: + serviceImpl.getConsensusParams((org.dash.platform.dapi.v0.PlatformOuterClass.GetConsensusParamsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -554,6 +608,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(METHOD_GET_IDENTITIES_BY_PUBLIC_KEY_HASHES) .addMethod(METHOD_GET_IDENTITY_IDS_BY_PUBLIC_KEY_HASHES) .addMethod(METHOD_WAIT_FOR_STATE_TRANSITION_RESULT) + .addMethod(METHOD_GET_CONSENSUS_PARAMS) .build(); } } diff --git a/clients/platform/v0/objective-c/Platform.pbrpc.h b/clients/platform/v0/objective-c/Platform.pbrpc.h index f17b6ba..3f025ec 100644 --- a/clients/platform/v0/objective-c/Platform.pbrpc.h +++ b/clients/platform/v0/objective-c/Platform.pbrpc.h @@ -60,6 +60,13 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCProtoCall *)RPCTowaitForStateTransitionResultWithRequest:(WaitForStateTransitionResultRequest *)request handler:(void(^)(WaitForStateTransitionResultResponse *_Nullable response, NSError *_Nullable error))handler; +#pragma mark getConsensusParams(GetConsensusParamsRequest) returns (GetConsensusParamsResponse) + +- (void)getConsensusParamsWithRequest:(GetConsensusParamsRequest *)request handler:(void(^)(GetConsensusParamsResponse *_Nullable response, NSError *_Nullable error))handler; + +- (GRPCProtoCall *)RPCTogetConsensusParamsWithRequest:(GetConsensusParamsRequest *)request handler:(void(^)(GetConsensusParamsResponse *_Nullable response, NSError *_Nullable error))handler; + + @end /** diff --git a/clients/platform/v0/objective-c/Platform.pbrpc.m b/clients/platform/v0/objective-c/Platform.pbrpc.m index 9183c8f..a1ecb4c 100644 --- a/clients/platform/v0/objective-c/Platform.pbrpc.m +++ b/clients/platform/v0/objective-c/Platform.pbrpc.m @@ -106,4 +106,16 @@ - (GRPCProtoCall *)RPCTowaitForStateTransitionResultWithRequest:(WaitForStateTra responseClass:[WaitForStateTransitionResultResponse class] responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; } +#pragma mark getConsensusParams(GetConsensusParamsRequest) returns (GetConsensusParamsResponse) + +- (void)getConsensusParamsWithRequest:(GetConsensusParamsRequest *)request handler:(void(^)(GetConsensusParamsResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCTogetConsensusParamsWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (GRPCProtoCall *)RPCTogetConsensusParamsWithRequest:(GetConsensusParamsRequest *)request handler:(void(^)(GetConsensusParamsResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"getConsensusParams" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GetConsensusParamsResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} @end diff --git a/clients/platform/v0/python/platform_pb2.py b/clients/platform/v0/python/platform_pb2.py index 8cd4789..567738a 100644 --- a/clients/platform/v0/python/platform_pb2.py +++ b/clients/platform/v0/python/platform_pb2.py @@ -19,7 +19,7 @@ name='platform.proto', package='org.dash.platform.dapi.v0', syntax='proto3', - serialized_pb=_b('\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\"j\n\x05Proof\x12\x17\n\x0froot_tree_proof\x18\x01 \x01(\x0c\x12\x18\n\x10store_tree_proof\x18\x02 \x01(\x0c\x12\x1b\n\x13signature_llmq_hash\x18\x03 \x01(\x0c\x12\x11\n\tsignature\x18\x04 \x01(\x0c\"D\n\x10ResponseMetadata\x12\x0e\n\x06height\x18\x01 \x01(\x03\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"/\n\x12GetIdentityRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\x97\x01\n\x13GetIdentityResponse\x12\x10\n\x08identity\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"3\n\x16GetDataContractRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xa0\x01\n\x17GetDataContractResponse\x12\x15\n\rdata_contract\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"\xb9\x01\n\x13GetDocumentsRequest\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\rH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\rH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05start\"\x99\x01\n\x14GetDocumentsResponse\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"Q\n%GetIdentitiesByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xac\x01\n&GetIdentitiesByPublicKeyHashesResponse\x12\x12\n\nidentities\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"R\n&GetIdentityIdsByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xaf\x01\n\'GetIdentityIdsByPublicKeyHashesResponse\x12\x14\n\x0cidentity_ids\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"S\n#WaitForStateTransitionResultRequest\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xf0\x01\n$WaitForStateTransitionResultResponse\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x0b\n\tresponses\"P\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\"*\n\x17\x43onsensusParamsEvidence\x12\x0f\n\x07max_age\x18\x01 \x01(\t\"*\n\x19GetConsensusParamsRequest\x12\r\n\x05prove\x18\x01 \x01(\x08\"\xa2\x01\n\x1aGetConsensusParamsResponse\x12>\n\x05\x62lock\x18\x01 \x01(\x0b\x32/.org.dash.platform.dapi.v0.ConsensusParamsBlock\x12\x44\n\x08\x65vidence\x18\x02 \x01(\x0b\x32\x32.org.dash.platform.dapi.v0.ConsensusParamsEvidence2\xee\x07\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\xa5\x01\n\x1egetIdentitiesByPublicKeyHashes\x12@.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest\x1a\x41.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse\x12\xa8\x01\n\x1fgetIdentityIdsByPublicKeyHashes\x12\x41.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesRequest\x1a\x42.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponseb\x06proto3') + serialized_pb=_b('\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\"j\n\x05Proof\x12\x17\n\x0froot_tree_proof\x18\x01 \x01(\x0c\x12\x18\n\x10store_tree_proof\x18\x02 \x01(\x0c\x12\x1b\n\x13signature_llmq_hash\x18\x03 \x01(\x0c\x12\x11\n\tsignature\x18\x04 \x01(\x0c\"D\n\x10ResponseMetadata\x12\x0e\n\x06height\x18\x01 \x01(\x03\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"/\n\x12GetIdentityRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\x97\x01\n\x13GetIdentityResponse\x12\x10\n\x08identity\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"3\n\x16GetDataContractRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xa0\x01\n\x17GetDataContractResponse\x12\x15\n\rdata_contract\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"\xb9\x01\n\x13GetDocumentsRequest\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\rH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\rH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05start\"\x99\x01\n\x14GetDocumentsResponse\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"Q\n%GetIdentitiesByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xac\x01\n&GetIdentitiesByPublicKeyHashesResponse\x12\x12\n\nidentities\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"R\n&GetIdentityIdsByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xaf\x01\n\'GetIdentityIdsByPublicKeyHashesResponse\x12\x14\n\x0cidentity_ids\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"S\n#WaitForStateTransitionResultRequest\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xf0\x01\n$WaitForStateTransitionResultResponse\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x0b\n\tresponses\"P\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\"*\n\x17\x43onsensusParamsEvidence\x12\x0f\n\x07max_age\x18\x01 \x01(\t\"*\n\x19GetConsensusParamsRequest\x12\r\n\x05prove\x18\x01 \x01(\x08\"\xa2\x01\n\x1aGetConsensusParamsResponse\x12>\n\x05\x62lock\x18\x01 \x01(\x0b\x32/.org.dash.platform.dapi.v0.ConsensusParamsBlock\x12\x44\n\x08\x65vidence\x18\x02 \x01(\x0b\x32\x32.org.dash.platform.dapi.v0.ConsensusParamsEvidence2\xf2\x08\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\xa5\x01\n\x1egetIdentitiesByPublicKeyHashes\x12@.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest\x1a\x41.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse\x12\xa8\x01\n\x1fgetIdentityIdsByPublicKeyHashes\x12\x41.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesRequest\x1a\x42.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse\x12\x81\x01\n\x12getConsensusParams\x12\x34.org.dash.platform.dapi.v0.GetConsensusParamsRequest\x1a\x35.org.dash.platform.dapi.v0.GetConsensusParamsResponseb\x06proto3') ) @@ -1111,7 +1111,7 @@ index=0, options=None, serialized_start=2345, - serialized_end=3351, + serialized_end=3483, methods=[ _descriptor.MethodDescriptor( name='broadcastStateTransition', @@ -1176,6 +1176,15 @@ output_type=_WAITFORSTATETRANSITIONRESULTRESPONSE, options=None, ), + _descriptor.MethodDescriptor( + name='getConsensusParams', + full_name='org.dash.platform.dapi.v0.Platform.getConsensusParams', + index=7, + containing_service=None, + input_type=_GETCONSENSUSPARAMSREQUEST, + output_type=_GETCONSENSUSPARAMSRESPONSE, + options=None, + ), ]) _sym_db.RegisterServiceDescriptor(_PLATFORM) @@ -1236,6 +1245,11 @@ def __init__(self, channel): request_serializer=WaitForStateTransitionResultRequest.SerializeToString, response_deserializer=WaitForStateTransitionResultResponse.FromString, ) + self.getConsensusParams = channel.unary_unary( + '/org.dash.platform.dapi.v0.Platform/getConsensusParams', + request_serializer=GetConsensusParamsRequest.SerializeToString, + response_deserializer=GetConsensusParamsResponse.FromString, + ) class PlatformServicer(object): @@ -1291,6 +1305,13 @@ def waitForStateTransitionResult(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def getConsensusParams(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_PlatformServicer_to_server(servicer, server): rpc_method_handlers = { @@ -1329,6 +1350,11 @@ def add_PlatformServicer_to_server(servicer, server): request_deserializer=WaitForStateTransitionResultRequest.FromString, response_serializer=WaitForStateTransitionResultResponse.SerializeToString, ), + 'getConsensusParams': grpc.unary_unary_rpc_method_handler( + servicer.getConsensusParams, + request_deserializer=GetConsensusParamsRequest.FromString, + response_serializer=GetConsensusParamsResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'org.dash.platform.dapi.v0.Platform', rpc_method_handlers) @@ -1371,6 +1397,10 @@ def waitForStateTransitionResult(self, request, context): # missing associated documentation comment in .proto file pass context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def getConsensusParams(self, request, context): + # missing associated documentation comment in .proto file + pass + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) class BetaPlatformStub(object): @@ -1416,6 +1446,11 @@ def waitForStateTransitionResult(self, request, timeout, metadata=None, with_cal pass raise NotImplementedError() waitForStateTransitionResult.future = None + def getConsensusParams(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + # missing associated documentation comment in .proto file + pass + raise NotImplementedError() + getConsensusParams.future = None def beta_create_Platform_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): @@ -1426,6 +1461,7 @@ def beta_create_Platform_server(servicer, pool=None, pool_size=None, default_tim generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" request_deserializers = { ('org.dash.platform.dapi.v0.Platform', 'broadcastStateTransition'): BroadcastStateTransitionRequest.FromString, + ('org.dash.platform.dapi.v0.Platform', 'getConsensusParams'): GetConsensusParamsRequest.FromString, ('org.dash.platform.dapi.v0.Platform', 'getDataContract'): GetDataContractRequest.FromString, ('org.dash.platform.dapi.v0.Platform', 'getDocuments'): GetDocumentsRequest.FromString, ('org.dash.platform.dapi.v0.Platform', 'getIdentitiesByPublicKeyHashes'): GetIdentitiesByPublicKeyHashesRequest.FromString, @@ -1435,6 +1471,7 @@ def beta_create_Platform_server(servicer, pool=None, pool_size=None, default_tim } response_serializers = { ('org.dash.platform.dapi.v0.Platform', 'broadcastStateTransition'): BroadcastStateTransitionResponse.SerializeToString, + ('org.dash.platform.dapi.v0.Platform', 'getConsensusParams'): GetConsensusParamsResponse.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getDataContract'): GetDataContractResponse.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getDocuments'): GetDocumentsResponse.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getIdentitiesByPublicKeyHashes'): GetIdentitiesByPublicKeyHashesResponse.SerializeToString, @@ -1444,6 +1481,7 @@ def beta_create_Platform_server(servicer, pool=None, pool_size=None, default_tim } method_implementations = { ('org.dash.platform.dapi.v0.Platform', 'broadcastStateTransition'): face_utilities.unary_unary_inline(servicer.broadcastStateTransition), + ('org.dash.platform.dapi.v0.Platform', 'getConsensusParams'): face_utilities.unary_unary_inline(servicer.getConsensusParams), ('org.dash.platform.dapi.v0.Platform', 'getDataContract'): face_utilities.unary_unary_inline(servicer.getDataContract), ('org.dash.platform.dapi.v0.Platform', 'getDocuments'): face_utilities.unary_unary_inline(servicer.getDocuments), ('org.dash.platform.dapi.v0.Platform', 'getIdentitiesByPublicKeyHashes'): face_utilities.unary_unary_inline(servicer.getIdentitiesByPublicKeyHashes), @@ -1463,6 +1501,7 @@ def beta_create_Platform_stub(channel, host=None, metadata_transformer=None, poo generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" request_serializers = { ('org.dash.platform.dapi.v0.Platform', 'broadcastStateTransition'): BroadcastStateTransitionRequest.SerializeToString, + ('org.dash.platform.dapi.v0.Platform', 'getConsensusParams'): GetConsensusParamsRequest.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getDataContract'): GetDataContractRequest.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getDocuments'): GetDocumentsRequest.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getIdentitiesByPublicKeyHashes'): GetIdentitiesByPublicKeyHashesRequest.SerializeToString, @@ -1472,6 +1511,7 @@ def beta_create_Platform_stub(channel, host=None, metadata_transformer=None, poo } response_deserializers = { ('org.dash.platform.dapi.v0.Platform', 'broadcastStateTransition'): BroadcastStateTransitionResponse.FromString, + ('org.dash.platform.dapi.v0.Platform', 'getConsensusParams'): GetConsensusParamsResponse.FromString, ('org.dash.platform.dapi.v0.Platform', 'getDataContract'): GetDataContractResponse.FromString, ('org.dash.platform.dapi.v0.Platform', 'getDocuments'): GetDocumentsResponse.FromString, ('org.dash.platform.dapi.v0.Platform', 'getIdentitiesByPublicKeyHashes'): GetIdentitiesByPublicKeyHashesResponse.FromString, @@ -1481,6 +1521,7 @@ def beta_create_Platform_stub(channel, host=None, metadata_transformer=None, poo } cardinalities = { 'broadcastStateTransition': cardinality.Cardinality.UNARY_UNARY, + 'getConsensusParams': cardinality.Cardinality.UNARY_UNARY, 'getDataContract': cardinality.Cardinality.UNARY_UNARY, 'getDocuments': cardinality.Cardinality.UNARY_UNARY, 'getIdentitiesByPublicKeyHashes': cardinality.Cardinality.UNARY_UNARY, diff --git a/clients/platform/v0/python/platform_pb2_grpc.py b/clients/platform/v0/python/platform_pb2_grpc.py index 88f1283..25e3f71 100644 --- a/clients/platform/v0/python/platform_pb2_grpc.py +++ b/clients/platform/v0/python/platform_pb2_grpc.py @@ -49,6 +49,11 @@ def __init__(self, channel): request_serializer=platform__pb2.WaitForStateTransitionResultRequest.SerializeToString, response_deserializer=platform__pb2.WaitForStateTransitionResultResponse.FromString, ) + self.getConsensusParams = channel.unary_unary( + '/org.dash.platform.dapi.v0.Platform/getConsensusParams', + request_serializer=platform__pb2.GetConsensusParamsRequest.SerializeToString, + response_deserializer=platform__pb2.GetConsensusParamsResponse.FromString, + ) class PlatformServicer(object): @@ -104,6 +109,13 @@ def waitForStateTransitionResult(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def getConsensusParams(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_PlatformServicer_to_server(servicer, server): rpc_method_handlers = { @@ -142,6 +154,11 @@ def add_PlatformServicer_to_server(servicer, server): request_deserializer=platform__pb2.WaitForStateTransitionResultRequest.FromString, response_serializer=platform__pb2.WaitForStateTransitionResultResponse.SerializeToString, ), + 'getConsensusParams': grpc.unary_unary_rpc_method_handler( + servicer.getConsensusParams, + request_deserializer=platform__pb2.GetConsensusParamsRequest.FromString, + response_serializer=platform__pb2.GetConsensusParamsResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'org.dash.platform.dapi.v0.Platform', rpc_method_handlers) diff --git a/protos/platform/v0/platform.proto b/protos/platform/v0/platform.proto index 1237b0b..8e33866 100644 --- a/protos/platform/v0/platform.proto +++ b/protos/platform/v0/platform.proto @@ -10,6 +10,7 @@ service Platform { rpc getIdentitiesByPublicKeyHashes (GetIdentitiesByPublicKeyHashesRequest) returns (GetIdentitiesByPublicKeyHashesResponse); rpc getIdentityIdsByPublicKeyHashes (GetIdentityIdsByPublicKeyHashesRequest) returns (GetIdentityIdsByPublicKeyHashesResponse); rpc waitForStateTransitionResult (WaitForStateTransitionResultRequest) returns (WaitForStateTransitionResultResponse); + rpc getConsensusParams (GetConsensusParamsRequest) returns (GetConsensusParamsResponse); } message Proof { From 39f26ce33cba0e4559a051228001be1095ce5012 Mon Sep 17 00:00:00 2001 From: Konstantin Shuplenkov Date: Thu, 5 Aug 2021 16:49:20 +0300 Subject: [PATCH 3/3] feat: getConsensusParams method --- clients/platform/v0/python/platform_pb2.py | 226 ++++++++++++++++++++- 1 file changed, 223 insertions(+), 3 deletions(-) diff --git a/clients/platform/v0/python/platform_pb2.py b/clients/platform/v0/python/platform_pb2.py index 98a0c4b..d0d117b 100644 --- a/clients/platform/v0/python/platform_pb2.py +++ b/clients/platform/v0/python/platform_pb2.py @@ -19,7 +19,7 @@ name='platform.proto', package='org.dash.platform.dapi.v0', syntax='proto3', - serialized_pb=_b('\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\"\x93\x01\n\x0fStoreTreeProofs\x12\x18\n\x10identities_proof\x18\x01 \x01(\x0c\x12/\n\'public_key_hashes_to_identity_ids_proof\x18\x02 \x01(\x0c\x12\x1c\n\x14\x64\x61ta_contracts_proof\x18\x03 \x01(\x0c\x12\x17\n\x0f\x64ocuments_proof\x18\x04 \x01(\x0c\"\x97\x01\n\x05Proof\x12\x17\n\x0froot_tree_proof\x18\x01 \x01(\x0c\x12\x45\n\x11store_tree_proofs\x18\x02 \x01(\x0b\x32*.org.dash.platform.dapi.v0.StoreTreeProofs\x12\x1b\n\x13signature_llmq_hash\x18\x03 \x01(\x0c\x12\x11\n\tsignature\x18\x04 \x01(\x0c\"D\n\x10ResponseMetadata\x12\x0e\n\x06height\x18\x01 \x01(\x03\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"/\n\x12GetIdentityRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\x97\x01\n\x13GetIdentityResponse\x12\x10\n\x08identity\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"3\n\x16GetDataContractRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xa0\x01\n\x17GetDataContractResponse\x12\x15\n\rdata_contract\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"\xb9\x01\n\x13GetDocumentsRequest\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\rH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\rH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05start\"\x99\x01\n\x14GetDocumentsResponse\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"Q\n%GetIdentitiesByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xac\x01\n&GetIdentitiesByPublicKeyHashesResponse\x12\x12\n\nidentities\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"R\n&GetIdentityIdsByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xaf\x01\n\'GetIdentityIdsByPublicKeyHashesResponse\x12\x14\n\x0cidentity_ids\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"S\n#WaitForStateTransitionResultRequest\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xf0\x01\n$WaitForStateTransitionResultResponse\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x0b\n\tresponses2\xee\x07\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\xa5\x01\n\x1egetIdentitiesByPublicKeyHashes\x12@.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest\x1a\x41.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse\x12\xa8\x01\n\x1fgetIdentityIdsByPublicKeyHashes\x12\x41.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesRequest\x1a\x42.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponseb\x06proto3') + serialized_pb=_b('\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\"\x93\x01\n\x0fStoreTreeProofs\x12\x18\n\x10identities_proof\x18\x01 \x01(\x0c\x12/\n\'public_key_hashes_to_identity_ids_proof\x18\x02 \x01(\x0c\x12\x1c\n\x14\x64\x61ta_contracts_proof\x18\x03 \x01(\x0c\x12\x17\n\x0f\x64ocuments_proof\x18\x04 \x01(\x0c\"\x97\x01\n\x05Proof\x12\x17\n\x0froot_tree_proof\x18\x01 \x01(\x0c\x12\x45\n\x11store_tree_proofs\x18\x02 \x01(\x0b\x32*.org.dash.platform.dapi.v0.StoreTreeProofs\x12\x1b\n\x13signature_llmq_hash\x18\x03 \x01(\x0c\x12\x11\n\tsignature\x18\x04 \x01(\x0c\"D\n\x10ResponseMetadata\x12\x0e\n\x06height\x18\x01 \x01(\x03\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"/\n\x12GetIdentityRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\x97\x01\n\x13GetIdentityResponse\x12\x10\n\x08identity\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"3\n\x16GetDataContractRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xa0\x01\n\x17GetDataContractResponse\x12\x15\n\rdata_contract\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"\xb9\x01\n\x13GetDocumentsRequest\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\rH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\rH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05start\"\x99\x01\n\x14GetDocumentsResponse\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"Q\n%GetIdentitiesByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xac\x01\n&GetIdentitiesByPublicKeyHashesResponse\x12\x12\n\nidentities\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"R\n&GetIdentityIdsByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xaf\x01\n\'GetIdentityIdsByPublicKeyHashesResponse\x12\x14\n\x0cidentity_ids\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"S\n#WaitForStateTransitionResultRequest\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xf0\x01\n$WaitForStateTransitionResultResponse\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x0b\n\tresponses\"P\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\"*\n\x17\x43onsensusParamsEvidence\x12\x0f\n\x07max_age\x18\x01 \x01(\t\"*\n\x19GetConsensusParamsRequest\x12\r\n\x05prove\x18\x01 \x01(\x08\"\xa2\x01\n\x1aGetConsensusParamsResponse\x12>\n\x05\x62lock\x18\x01 \x01(\x0b\x32/.org.dash.platform.dapi.v0.ConsensusParamsBlock\x12\x44\n\x08\x65vidence\x18\x02 \x01(\x0b\x32\x32.org.dash.platform.dapi.v0.ConsensusParamsEvidence2\xf2\x08\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\xa5\x01\n\x1egetIdentitiesByPublicKeyHashes\x12@.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest\x1a\x41.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse\x12\xa8\x01\n\x1fgetIdentityIdsByPublicKeyHashes\x12\x41.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesRequest\x1a\x42.org.dash.platform.dapi.v0.GetIdentityIdsByPublicKeyHashesResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse\x12\x81\x01\n\x12getConsensusParams\x12\x34.org.dash.platform.dapi.v0.GetConsensusParamsRequest\x1a\x35.org.dash.platform.dapi.v0.GetConsensusParamsResponseb\x06proto3') ) @@ -812,6 +812,151 @@ serialized_end=2203, ) + +_CONSENSUSPARAMSBLOCK = _descriptor.Descriptor( + name='ConsensusParamsBlock', + full_name='org.dash.platform.dapi.v0.ConsensusParamsBlock', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='max_bytes', full_name='org.dash.platform.dapi.v0.ConsensusParamsBlock.max_bytes', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='max_gas', full_name='org.dash.platform.dapi.v0.ConsensusParamsBlock.max_gas', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='time_iota_ms', full_name='org.dash.platform.dapi.v0.ConsensusParamsBlock.time_iota_ms', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2205, + serialized_end=2285, +) + + +_CONSENSUSPARAMSEVIDENCE = _descriptor.Descriptor( + name='ConsensusParamsEvidence', + full_name='org.dash.platform.dapi.v0.ConsensusParamsEvidence', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='max_age', full_name='org.dash.platform.dapi.v0.ConsensusParamsEvidence.max_age', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2287, + serialized_end=2329, +) + + +_GETCONSENSUSPARAMSREQUEST = _descriptor.Descriptor( + name='GetConsensusParamsRequest', + full_name='org.dash.platform.dapi.v0.GetConsensusParamsRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='prove', full_name='org.dash.platform.dapi.v0.GetConsensusParamsRequest.prove', index=0, + number=1, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2331, + serialized_end=2373, +) + + +_GETCONSENSUSPARAMSRESPONSE = _descriptor.Descriptor( + name='GetConsensusParamsResponse', + full_name='org.dash.platform.dapi.v0.GetConsensusParamsResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='block', full_name='org.dash.platform.dapi.v0.GetConsensusParamsResponse.block', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='evidence', full_name='org.dash.platform.dapi.v0.GetConsensusParamsResponse.evidence', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2376, + serialized_end=2538, +) + _PROOF.fields_by_name['store_tree_proofs'].message_type = _STORETREEPROOFS _GETIDENTITYRESPONSE.fields_by_name['proof'].message_type = _PROOF _GETIDENTITYRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA @@ -838,6 +983,8 @@ _WAITFORSTATETRANSITIONRESULTRESPONSE.oneofs_by_name['responses'].fields.append( _WAITFORSTATETRANSITIONRESULTRESPONSE.fields_by_name['proof']) _WAITFORSTATETRANSITIONRESULTRESPONSE.fields_by_name['proof'].containing_oneof = _WAITFORSTATETRANSITIONRESULTRESPONSE.oneofs_by_name['responses'] +_GETCONSENSUSPARAMSRESPONSE.fields_by_name['block'].message_type = _CONSENSUSPARAMSBLOCK +_GETCONSENSUSPARAMSRESPONSE.fields_by_name['evidence'].message_type = _CONSENSUSPARAMSEVIDENCE DESCRIPTOR.message_types_by_name['StoreTreeProofs'] = _STORETREEPROOFS DESCRIPTOR.message_types_by_name['Proof'] = _PROOF DESCRIPTOR.message_types_by_name['ResponseMetadata'] = _RESPONSEMETADATA @@ -856,6 +1003,10 @@ DESCRIPTOR.message_types_by_name['GetIdentityIdsByPublicKeyHashesResponse'] = _GETIDENTITYIDSBYPUBLICKEYHASHESRESPONSE DESCRIPTOR.message_types_by_name['WaitForStateTransitionResultRequest'] = _WAITFORSTATETRANSITIONRESULTREQUEST DESCRIPTOR.message_types_by_name['WaitForStateTransitionResultResponse'] = _WAITFORSTATETRANSITIONRESULTRESPONSE +DESCRIPTOR.message_types_by_name['ConsensusParamsBlock'] = _CONSENSUSPARAMSBLOCK +DESCRIPTOR.message_types_by_name['ConsensusParamsEvidence'] = _CONSENSUSPARAMSEVIDENCE +DESCRIPTOR.message_types_by_name['GetConsensusParamsRequest'] = _GETCONSENSUSPARAMSREQUEST +DESCRIPTOR.message_types_by_name['GetConsensusParamsResponse'] = _GETCONSENSUSPARAMSRESPONSE _sym_db.RegisterFileDescriptor(DESCRIPTOR) StoreTreeProofs = _reflection.GeneratedProtocolMessageType('StoreTreeProofs', (_message.Message,), dict( @@ -984,6 +1135,34 @@ )) _sym_db.RegisterMessage(WaitForStateTransitionResultResponse) +ConsensusParamsBlock = _reflection.GeneratedProtocolMessageType('ConsensusParamsBlock', (_message.Message,), dict( + DESCRIPTOR = _CONSENSUSPARAMSBLOCK, + __module__ = 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.ConsensusParamsBlock) + )) +_sym_db.RegisterMessage(ConsensusParamsBlock) + +ConsensusParamsEvidence = _reflection.GeneratedProtocolMessageType('ConsensusParamsEvidence', (_message.Message,), dict( + DESCRIPTOR = _CONSENSUSPARAMSEVIDENCE, + __module__ = 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.ConsensusParamsEvidence) + )) +_sym_db.RegisterMessage(ConsensusParamsEvidence) + +GetConsensusParamsRequest = _reflection.GeneratedProtocolMessageType('GetConsensusParamsRequest', (_message.Message,), dict( + DESCRIPTOR = _GETCONSENSUSPARAMSREQUEST, + __module__ = 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetConsensusParamsRequest) + )) +_sym_db.RegisterMessage(GetConsensusParamsRequest) + +GetConsensusParamsResponse = _reflection.GeneratedProtocolMessageType('GetConsensusParamsResponse', (_message.Message,), dict( + DESCRIPTOR = _GETCONSENSUSPARAMSRESPONSE, + __module__ = 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetConsensusParamsResponse) + )) +_sym_db.RegisterMessage(GetConsensusParamsResponse) + _PLATFORM = _descriptor.ServiceDescriptor( @@ -992,8 +1171,8 @@ file=DESCRIPTOR, index=0, options=None, - serialized_start=2206, - serialized_end=3212, + serialized_start=2541, + serialized_end=3679, methods=[ _descriptor.MethodDescriptor( name='broadcastStateTransition', @@ -1058,6 +1237,15 @@ output_type=_WAITFORSTATETRANSITIONRESULTRESPONSE, options=None, ), + _descriptor.MethodDescriptor( + name='getConsensusParams', + full_name='org.dash.platform.dapi.v0.Platform.getConsensusParams', + index=7, + containing_service=None, + input_type=_GETCONSENSUSPARAMSREQUEST, + output_type=_GETCONSENSUSPARAMSRESPONSE, + options=None, + ), ]) _sym_db.RegisterServiceDescriptor(_PLATFORM) @@ -1118,6 +1306,11 @@ def __init__(self, channel): request_serializer=WaitForStateTransitionResultRequest.SerializeToString, response_deserializer=WaitForStateTransitionResultResponse.FromString, ) + self.getConsensusParams = channel.unary_unary( + '/org.dash.platform.dapi.v0.Platform/getConsensusParams', + request_serializer=GetConsensusParamsRequest.SerializeToString, + response_deserializer=GetConsensusParamsResponse.FromString, + ) class PlatformServicer(object): @@ -1173,6 +1366,13 @@ def waitForStateTransitionResult(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def getConsensusParams(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_PlatformServicer_to_server(servicer, server): rpc_method_handlers = { @@ -1211,6 +1411,11 @@ def add_PlatformServicer_to_server(servicer, server): request_deserializer=WaitForStateTransitionResultRequest.FromString, response_serializer=WaitForStateTransitionResultResponse.SerializeToString, ), + 'getConsensusParams': grpc.unary_unary_rpc_method_handler( + servicer.getConsensusParams, + request_deserializer=GetConsensusParamsRequest.FromString, + response_serializer=GetConsensusParamsResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'org.dash.platform.dapi.v0.Platform', rpc_method_handlers) @@ -1253,6 +1458,10 @@ def waitForStateTransitionResult(self, request, context): # missing associated documentation comment in .proto file pass context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def getConsensusParams(self, request, context): + # missing associated documentation comment in .proto file + pass + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) class BetaPlatformStub(object): @@ -1298,6 +1507,11 @@ def waitForStateTransitionResult(self, request, timeout, metadata=None, with_cal pass raise NotImplementedError() waitForStateTransitionResult.future = None + def getConsensusParams(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + # missing associated documentation comment in .proto file + pass + raise NotImplementedError() + getConsensusParams.future = None def beta_create_Platform_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): @@ -1308,6 +1522,7 @@ def beta_create_Platform_server(servicer, pool=None, pool_size=None, default_tim generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" request_deserializers = { ('org.dash.platform.dapi.v0.Platform', 'broadcastStateTransition'): BroadcastStateTransitionRequest.FromString, + ('org.dash.platform.dapi.v0.Platform', 'getConsensusParams'): GetConsensusParamsRequest.FromString, ('org.dash.platform.dapi.v0.Platform', 'getDataContract'): GetDataContractRequest.FromString, ('org.dash.platform.dapi.v0.Platform', 'getDocuments'): GetDocumentsRequest.FromString, ('org.dash.platform.dapi.v0.Platform', 'getIdentitiesByPublicKeyHashes'): GetIdentitiesByPublicKeyHashesRequest.FromString, @@ -1317,6 +1532,7 @@ def beta_create_Platform_server(servicer, pool=None, pool_size=None, default_tim } response_serializers = { ('org.dash.platform.dapi.v0.Platform', 'broadcastStateTransition'): BroadcastStateTransitionResponse.SerializeToString, + ('org.dash.platform.dapi.v0.Platform', 'getConsensusParams'): GetConsensusParamsResponse.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getDataContract'): GetDataContractResponse.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getDocuments'): GetDocumentsResponse.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getIdentitiesByPublicKeyHashes'): GetIdentitiesByPublicKeyHashesResponse.SerializeToString, @@ -1326,6 +1542,7 @@ def beta_create_Platform_server(servicer, pool=None, pool_size=None, default_tim } method_implementations = { ('org.dash.platform.dapi.v0.Platform', 'broadcastStateTransition'): face_utilities.unary_unary_inline(servicer.broadcastStateTransition), + ('org.dash.platform.dapi.v0.Platform', 'getConsensusParams'): face_utilities.unary_unary_inline(servicer.getConsensusParams), ('org.dash.platform.dapi.v0.Platform', 'getDataContract'): face_utilities.unary_unary_inline(servicer.getDataContract), ('org.dash.platform.dapi.v0.Platform', 'getDocuments'): face_utilities.unary_unary_inline(servicer.getDocuments), ('org.dash.platform.dapi.v0.Platform', 'getIdentitiesByPublicKeyHashes'): face_utilities.unary_unary_inline(servicer.getIdentitiesByPublicKeyHashes), @@ -1345,6 +1562,7 @@ def beta_create_Platform_stub(channel, host=None, metadata_transformer=None, poo generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" request_serializers = { ('org.dash.platform.dapi.v0.Platform', 'broadcastStateTransition'): BroadcastStateTransitionRequest.SerializeToString, + ('org.dash.platform.dapi.v0.Platform', 'getConsensusParams'): GetConsensusParamsRequest.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getDataContract'): GetDataContractRequest.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getDocuments'): GetDocumentsRequest.SerializeToString, ('org.dash.platform.dapi.v0.Platform', 'getIdentitiesByPublicKeyHashes'): GetIdentitiesByPublicKeyHashesRequest.SerializeToString, @@ -1354,6 +1572,7 @@ def beta_create_Platform_stub(channel, host=None, metadata_transformer=None, poo } response_deserializers = { ('org.dash.platform.dapi.v0.Platform', 'broadcastStateTransition'): BroadcastStateTransitionResponse.FromString, + ('org.dash.platform.dapi.v0.Platform', 'getConsensusParams'): GetConsensusParamsResponse.FromString, ('org.dash.platform.dapi.v0.Platform', 'getDataContract'): GetDataContractResponse.FromString, ('org.dash.platform.dapi.v0.Platform', 'getDocuments'): GetDocumentsResponse.FromString, ('org.dash.platform.dapi.v0.Platform', 'getIdentitiesByPublicKeyHashes'): GetIdentitiesByPublicKeyHashesResponse.FromString, @@ -1363,6 +1582,7 @@ def beta_create_Platform_stub(channel, host=None, metadata_transformer=None, poo } cardinalities = { 'broadcastStateTransition': cardinality.Cardinality.UNARY_UNARY, + 'getConsensusParams': cardinality.Cardinality.UNARY_UNARY, 'getDataContract': cardinality.Cardinality.UNARY_UNARY, 'getDocuments': cardinality.Cardinality.UNARY_UNARY, 'getIdentitiesByPublicKeyHashes': cardinality.Cardinality.UNARY_UNARY,