diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f6f9810a6..09a9d209c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -214,7 +214,7 @@ jobs: - package_type: deb os: ubuntu-22.04 - package_type: macos - os: macos-12 + os: macos-14 steps: - name: Check out repo uses: actions/checkout@v4 diff --git a/Cargo.lock b/Cargo.lock index 4028c50790..ad59187b72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -781,7 +781,7 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "check-features" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "toml", ] @@ -1147,7 +1147,7 @@ dependencies = [ [[package]] name = "dapi-grpc" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "dapi-grpc-macros", "futures-core", @@ -1163,7 +1163,7 @@ dependencies = [ [[package]] name = "dapi-grpc-macros" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "dapi-grpc", "heck 0.5.0", @@ -1208,7 +1208,7 @@ dependencies = [ [[package]] name = "dash-sdk" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "arc-swap", "async-trait", @@ -1308,7 +1308,7 @@ dependencies = [ [[package]] name = "dashpay-contract" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "platform-value", "platform-version", @@ -1318,7 +1318,7 @@ dependencies = [ [[package]] name = "data-contracts" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "dashpay-contract", "dpns-contract", @@ -1434,7 +1434,7 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "dpns-contract" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "platform-value", "platform-version", @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "dpp" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "anyhow", "assert_matches", @@ -1496,7 +1496,7 @@ dependencies = [ [[package]] name = "drive" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "arc-swap", "base64 0.22.1", @@ -1536,7 +1536,7 @@ dependencies = [ [[package]] name = "drive-abci" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "arc-swap", "assert_matches", @@ -1592,7 +1592,7 @@ dependencies = [ [[package]] name = "drive-proof-verifier" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "bincode", "dapi-grpc", @@ -1806,7 +1806,7 @@ checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "feature-flags-contract" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "platform-value", "platform-version", @@ -2750,7 +2750,7 @@ dependencies = [ [[package]] name = "json-schema-compatibility-validator" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "assert_matches", "json-patch", @@ -2923,7 +2923,7 @@ dependencies = [ [[package]] name = "masternode-reward-shares-contract" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "platform-value", "platform-version", @@ -3497,7 +3497,7 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "platform-serialization" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "bincode", "platform-version", @@ -3505,7 +3505,7 @@ dependencies = [ [[package]] name = "platform-serialization-derive" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "proc-macro2", "quote", @@ -3515,7 +3515,7 @@ dependencies = [ [[package]] name = "platform-value" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "base64 0.22.1", "bincode", @@ -3536,7 +3536,7 @@ dependencies = [ [[package]] name = "platform-value-convertible" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "quote", "syn 2.0.75", @@ -3544,7 +3544,7 @@ dependencies = [ [[package]] name = "platform-version" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "bincode", "grovedb-version", @@ -3555,7 +3555,7 @@ dependencies = [ [[package]] name = "platform-versioning" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "proc-macro2", "quote", @@ -3665,9 +3665,9 @@ dependencies = [ [[package]] name = "pretty_assertions" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" dependencies = [ "diff", "yansi", @@ -4168,7 +4168,7 @@ dependencies = [ [[package]] name = "rs-dapi-client" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "backon", "chrono", @@ -4685,7 +4685,7 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "simple-signer" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "base64 0.22.1", "bincode", @@ -4776,7 +4776,7 @@ dependencies = [ [[package]] name = "strategy-tests" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "bincode", "dpp", @@ -5820,7 +5820,7 @@ checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "wasm-dpp" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "anyhow", "async-trait", @@ -6122,7 +6122,7 @@ dependencies = [ [[package]] name = "withdrawals-contract" -version = "1.3.0" +version = "1.4.0-dev.1" dependencies = [ "num_enum", "platform-value", @@ -6144,9 +6144,9 @@ dependencies = [ [[package]] name = "yansi" -version = "0.5.1" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "zerocopy" diff --git a/package.json b/package.json index 84cecf3a0d..1b58fdb2e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/platform", - "version": "1.3.0", + "version": "1.4.0-dev.1", "private": true, "scripts": { "setup": "yarn install && yarn run build && yarn run configure", diff --git a/packages/bench-suite/package.json b/packages/bench-suite/package.json index 6ef6bd3cbf..3b274c7309 100644 --- a/packages/bench-suite/package.json +++ b/packages/bench-suite/package.json @@ -1,7 +1,7 @@ { "name": "@dashevo/bench-suite", "private": true, - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "Dash Platform benchmark tool", "scripts": { "bench": "node ./bin/bench.js", diff --git a/packages/check-features/Cargo.toml b/packages/check-features/Cargo.toml index 9d1ae45015..32fa620a54 100644 --- a/packages/check-features/Cargo.toml +++ b/packages/check-features/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "check-features" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/dapi-grpc/Cargo.toml b/packages/dapi-grpc/Cargo.toml index bdd678305b..35a9f633cb 100644 --- a/packages/dapi-grpc/Cargo.toml +++ b/packages/dapi-grpc/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dapi-grpc" description = "GRPC client for Dash Platform" -version = "1.3.0" +version = "1.4.0-dev.1" authors = [ "Samuel Westrich ", "Igor Markin ", diff --git a/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java b/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java index 035bb98138..26cf1818f9 100644 --- a/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java +++ b/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java @@ -976,6 +976,37 @@ org.dash.platform.dapi.v0.PlatformOuterClass.GetStatusResponse> getGetStatusMeth return getGetStatusMethod; } + private static volatile io.grpc.MethodDescriptor getGetCurrentQuorumsInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "getCurrentQuorumsInfo", + requestType = org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoRequest.class, + responseType = org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetCurrentQuorumsInfoMethod() { + io.grpc.MethodDescriptor getGetCurrentQuorumsInfoMethod; + if ((getGetCurrentQuorumsInfoMethod = PlatformGrpc.getGetCurrentQuorumsInfoMethod) == null) { + synchronized (PlatformGrpc.class) { + if ((getGetCurrentQuorumsInfoMethod = PlatformGrpc.getGetCurrentQuorumsInfoMethod) == null) { + PlatformGrpc.getGetCurrentQuorumsInfoMethod = getGetCurrentQuorumsInfoMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getCurrentQuorumsInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoResponse.getDefaultInstance())) + .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("getCurrentQuorumsInfo")) + .build(); + } + } + } + return getGetCurrentQuorumsInfoMethod; + } + /** * Creates a new async stub that supports all call types for the service */ @@ -1256,6 +1287,13 @@ public void getStatus(org.dash.platform.dapi.v0.PlatformOuterClass.GetStatusRequ io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStatusMethod(), responseObserver); } + /** + */ + public void getCurrentQuorumsInfo(org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetCurrentQuorumsInfoMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -1475,6 +1513,13 @@ public void getStatus(org.dash.platform.dapi.v0.PlatformOuterClass.GetStatusRequ org.dash.platform.dapi.v0.PlatformOuterClass.GetStatusRequest, org.dash.platform.dapi.v0.PlatformOuterClass.GetStatusResponse>( this, METHODID_GET_STATUS))) + .addMethod( + getGetCurrentQuorumsInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoRequest, + org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoResponse>( + this, METHODID_GET_CURRENT_QUORUMS_INFO))) .build(); } } @@ -1755,6 +1800,14 @@ public void getStatus(org.dash.platform.dapi.v0.PlatformOuterClass.GetStatusRequ io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetStatusMethod(), getCallOptions()), request, responseObserver); } + + /** + */ + public void getCurrentQuorumsInfo(org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetCurrentQuorumsInfoMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -2002,6 +2055,13 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.GetStatusResponse getStatus( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetStatusMethod(), getCallOptions(), request); } + + /** + */ + public org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoResponse getCurrentQuorumsInfo(org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetCurrentQuorumsInfoMethod(), getCallOptions(), request); + } } /** @@ -2280,6 +2340,14 @@ public com.google.common.util.concurrent.ListenableFuture getCurrentQuorumsInfo( + org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetCurrentQuorumsInfoMethod(), getCallOptions()), request); + } } private static final int METHODID_BROADCAST_STATE_TRANSITION = 0; @@ -2313,6 +2381,7 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -2455,6 +2524,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.getStatus((org.dash.platform.dapi.v0.PlatformOuterClass.GetStatusRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_CURRENT_QUORUMS_INFO: + serviceImpl.getCurrentQuorumsInfo((org.dash.platform.dapi.v0.PlatformOuterClass.GetCurrentQuorumsInfoRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -2547,6 +2620,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetTotalCreditsInPlatformMethod()) .addMethod(getGetPathElementsMethod()) .addMethod(getGetStatusMethod()) + .addMethod(getGetCurrentQuorumsInfoMethod()) .build(); } } diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js index 91ba238650..1818a68889 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js @@ -1109,6 +1109,39 @@ $root.org = (function() { * @variation 2 */ + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getCurrentQuorumsInfo}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getCurrentQuorumsInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} [response] GetCurrentQuorumsInfoResponse + */ + + /** + * Calls getCurrentQuorumsInfo. + * @function getCurrentQuorumsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getCurrentQuorumsInfoCallback} callback Node-style callback called with the error, if any, and GetCurrentQuorumsInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getCurrentQuorumsInfo = function getCurrentQuorumsInfo(request, callback) { + return this.rpcCall(getCurrentQuorumsInfo, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse, request, callback); + }, "name", { value: "getCurrentQuorumsInfo" }); + + /** + * Calls getCurrentQuorumsInfo. + * @function getCurrentQuorumsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return Platform; })(); @@ -13454,7 +13487,7 @@ $root.org = (function() { * Properties of a GetIdentitiesBalancesRequestV0. * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest * @interface IGetIdentitiesBalancesRequestV0 - * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.IGetIdentitiesBalancesByKnownIdentityIds|null} [identitiesIds] GetIdentitiesBalancesRequestV0 identitiesIds + * @property {Array.|null} [ids] GetIdentitiesBalancesRequestV0 ids * @property {boolean|null} [prove] GetIdentitiesBalancesRequestV0 prove */ @@ -13467,6 +13500,7 @@ $root.org = (function() { * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0=} [properties] Properties to set */ function GetIdentitiesBalancesRequestV0(properties) { + this.ids = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13474,12 +13508,12 @@ $root.org = (function() { } /** - * GetIdentitiesBalancesRequestV0 identitiesIds. - * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.IGetIdentitiesBalancesByKnownIdentityIds|null|undefined} identitiesIds + * GetIdentitiesBalancesRequestV0 ids. + * @member {Array.} ids * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 * @instance */ - GetIdentitiesBalancesRequestV0.prototype.identitiesIds = null; + GetIdentitiesBalancesRequestV0.prototype.ids = $util.emptyArray; /** * GetIdentitiesBalancesRequestV0 prove. @@ -13513,8 +13547,9 @@ $root.org = (function() { GetIdentitiesBalancesRequestV0.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.identitiesIds != null && Object.hasOwnProperty.call(message, "identitiesIds")) - $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.encode(message.identitiesIds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); return writer; @@ -13552,7 +13587,9 @@ $root.org = (function() { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.identitiesIds = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.decode(reader, reader.uint32()); + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.bytes()); break; case 2: message.prove = reader.bool(); @@ -13592,10 +13629,12 @@ $root.org = (function() { GetIdentitiesBalancesRequestV0.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.identitiesIds != null && message.hasOwnProperty("identitiesIds")) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.verify(message.identitiesIds); - if (error) - return "identitiesIds." + error; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) + return "ids: buffer[] expected"; } if (message.prove != null && message.hasOwnProperty("prove")) if (typeof message.prove !== "boolean") @@ -13615,10 +13654,15 @@ $root.org = (function() { if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0) return object; var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0(); - if (object.identitiesIds != null) { - if (typeof object.identitiesIds !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.identitiesIds: object expected"); - message.identitiesIds = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.fromObject(object.identitiesIds); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if (typeof object.ids[i] === "string") + $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); + else if (object.ids[i].length >= 0) + message.ids[i] = object.ids[i]; } if (object.prove != null) message.prove = Boolean(object.prove); @@ -13638,12 +13682,15 @@ $root.org = (function() { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.identitiesIds = null; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) object.prove = false; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; } - if (message.identitiesIds != null && message.hasOwnProperty("identitiesIds")) - object.identitiesIds = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.toObject(message.identitiesIds, options); if (message.prove != null && message.hasOwnProperty("prove")) object.prove = message.prove; return object; @@ -13660,212 +13707,6 @@ $root.org = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds = (function() { - - /** - * Properties of a GetIdentitiesBalancesByKnownIdentityIds. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @interface IGetIdentitiesBalancesByKnownIdentityIds - * @property {Array.|null} [identitiesIds] GetIdentitiesBalancesByKnownIdentityIds identitiesIds - */ - - /** - * Constructs a new GetIdentitiesBalancesByKnownIdentityIds. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @classdesc Represents a GetIdentitiesBalancesByKnownIdentityIds. - * @implements IGetIdentitiesBalancesByKnownIdentityIds - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.IGetIdentitiesBalancesByKnownIdentityIds=} [properties] Properties to set - */ - function GetIdentitiesBalancesByKnownIdentityIds(properties) { - this.identitiesIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesBalancesByKnownIdentityIds identitiesIds. - * @member {Array.} identitiesIds - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds - * @instance - */ - GetIdentitiesBalancesByKnownIdentityIds.prototype.identitiesIds = $util.emptyArray; - - /** - * Creates a new GetIdentitiesBalancesByKnownIdentityIds instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.IGetIdentitiesBalancesByKnownIdentityIds=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} GetIdentitiesBalancesByKnownIdentityIds instance - */ - GetIdentitiesBalancesByKnownIdentityIds.create = function create(properties) { - return new GetIdentitiesBalancesByKnownIdentityIds(properties); - }; - - /** - * Encodes the specified GetIdentitiesBalancesByKnownIdentityIds message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.IGetIdentitiesBalancesByKnownIdentityIds} message GetIdentitiesBalancesByKnownIdentityIds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesByKnownIdentityIds.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identitiesIds != null && message.identitiesIds.length) - for (var i = 0; i < message.identitiesIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identitiesIds[i]); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesBalancesByKnownIdentityIds message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.IGetIdentitiesBalancesByKnownIdentityIds} message GetIdentitiesBalancesByKnownIdentityIds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesByKnownIdentityIds.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesBalancesByKnownIdentityIds message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} GetIdentitiesBalancesByKnownIdentityIds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesByKnownIdentityIds.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.identitiesIds && message.identitiesIds.length)) - message.identitiesIds = []; - message.identitiesIds.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesBalancesByKnownIdentityIds message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} GetIdentitiesBalancesByKnownIdentityIds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesByKnownIdentityIds.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesBalancesByKnownIdentityIds message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesBalancesByKnownIdentityIds.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identitiesIds != null && message.hasOwnProperty("identitiesIds")) { - if (!Array.isArray(message.identitiesIds)) - return "identitiesIds: array expected"; - for (var i = 0; i < message.identitiesIds.length; ++i) - if (!(message.identitiesIds[i] && typeof message.identitiesIds[i].length === "number" || $util.isString(message.identitiesIds[i]))) - return "identitiesIds: buffer[] expected"; - } - return null; - }; - - /** - * Creates a GetIdentitiesBalancesByKnownIdentityIds message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} GetIdentitiesBalancesByKnownIdentityIds - */ - GetIdentitiesBalancesByKnownIdentityIds.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds(); - if (object.identitiesIds) { - if (!Array.isArray(object.identitiesIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.identitiesIds: array expected"); - message.identitiesIds = []; - for (var i = 0; i < object.identitiesIds.length; ++i) - if (typeof object.identitiesIds[i] === "string") - $util.base64.decode(object.identitiesIds[i], message.identitiesIds[i] = $util.newBuffer($util.base64.length(object.identitiesIds[i])), 0); - else if (object.identitiesIds[i].length >= 0) - message.identitiesIds[i] = object.identitiesIds[i]; - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesBalancesByKnownIdentityIds message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} message GetIdentitiesBalancesByKnownIdentityIds - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesBalancesByKnownIdentityIds.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.identitiesIds = []; - if (message.identitiesIds && message.identitiesIds.length) { - object.identitiesIds = []; - for (var j = 0; j < message.identitiesIds.length; ++j) - object.identitiesIds[j] = options.bytes === String ? $util.base64.encode(message.identitiesIds[j], 0, message.identitiesIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identitiesIds[j]) : message.identitiesIds[j]; - } - return object; - }; - - /** - * Converts this GetIdentitiesBalancesByKnownIdentityIds to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesBalancesByKnownIdentityIds.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentitiesBalancesByKnownIdentityIds; - })(); - return GetIdentitiesBalancesRequestV0; })(); @@ -45293,6 +45134,1464 @@ $root.org = (function() { return GetStatusResponse; })(); + v0.GetCurrentQuorumsInfoRequest = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetCurrentQuorumsInfoRequest + * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null} [v0] GetCurrentQuorumsInfoRequest v0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetCurrentQuorumsInfoRequest. + * @implements IGetCurrentQuorumsInfoRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCurrentQuorumsInfoRequest v0. + * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + */ + GetCurrentQuorumsInfoRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetCurrentQuorumsInfoRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + */ + Object.defineProperty(GetCurrentQuorumsInfoRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetCurrentQuorumsInfoRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest instance + */ + GetCurrentQuorumsInfoRequest.create = function create(properties) { + return new GetCurrentQuorumsInfoRequest(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + */ + GetCurrentQuorumsInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @interface IGetCurrentQuorumsInfoRequestV0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @classdesc Represents a GetCurrentQuorumsInfoRequestV0. + * @implements IGetCurrentQuorumsInfoRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetCurrentQuorumsInfoRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 instance + */ + GetCurrentQuorumsInfoRequestV0.create = function create(properties) { + return new GetCurrentQuorumsInfoRequestV0(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + */ + GetCurrentQuorumsInfoRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0) + return object; + return new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoRequestV0.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetCurrentQuorumsInfoRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetCurrentQuorumsInfoRequestV0; + })(); + + return GetCurrentQuorumsInfoRequest; + })(); + + v0.GetCurrentQuorumsInfoResponse = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetCurrentQuorumsInfoResponse + * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null} [v0] GetCurrentQuorumsInfoResponse v0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetCurrentQuorumsInfoResponse. + * @implements IGetCurrentQuorumsInfoResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCurrentQuorumsInfoResponse v0. + * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + */ + GetCurrentQuorumsInfoResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetCurrentQuorumsInfoResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + */ + Object.defineProperty(GetCurrentQuorumsInfoResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetCurrentQuorumsInfoResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse instance + */ + GetCurrentQuorumsInfoResponse.create = function create(properties) { + return new GetCurrentQuorumsInfoResponse(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + */ + GetCurrentQuorumsInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetCurrentQuorumsInfoResponse.ValidatorV0 = (function() { + + /** + * Properties of a ValidatorV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IValidatorV0 + * @property {Uint8Array|null} [proTxHash] ValidatorV0 proTxHash + * @property {string|null} [nodeIp] ValidatorV0 nodeIp + * @property {boolean|null} [isBanned] ValidatorV0 isBanned + */ + + /** + * Constructs a new ValidatorV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a ValidatorV0. + * @implements IValidatorV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set + */ + function ValidatorV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorV0 proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.proTxHash = $util.newBuffer([]); + + /** + * ValidatorV0 nodeIp. + * @member {string} nodeIp + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.nodeIp = ""; + + /** + * ValidatorV0 isBanned. + * @member {boolean} isBanned + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.isBanned = false; + + /** + * Creates a new ValidatorV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 instance + */ + ValidatorV0.create = function create(properties) { + return new ValidatorV0(properties); + }; + + /** + * Encodes the specified ValidatorV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); + if (message.nodeIp != null && Object.hasOwnProperty.call(message, "nodeIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIp); + if (message.isBanned != null && Object.hasOwnProperty.call(message, "isBanned")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isBanned); + return writer; + }; + + /** + * Encodes the specified ValidatorV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proTxHash = reader.bytes(); + break; + case 2: + message.nodeIp = reader.string(); + break; + case 3: + message.isBanned = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) + if (!$util.isString(message.nodeIp)) + return "nodeIp: string expected"; + if (message.isBanned != null && message.hasOwnProperty("isBanned")) + if (typeof message.isBanned !== "boolean") + return "isBanned: boolean expected"; + return null; + }; + + /** + * Creates a ValidatorV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + */ + ValidatorV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + if (object.nodeIp != null) + message.nodeIp = String(object.nodeIp); + if (object.isBanned != null) + message.isBanned = Boolean(object.isBanned); + return message; + }; + + /** + * Creates a plain object from a ValidatorV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} message ValidatorV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + object.nodeIp = ""; + object.isBanned = false; + } + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) + object.nodeIp = message.nodeIp; + if (message.isBanned != null && message.hasOwnProperty("isBanned")) + object.isBanned = message.isBanned; + return object; + }; + + /** + * Converts this ValidatorV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + * @returns {Object.} JSON object + */ + ValidatorV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorV0; + })(); + + GetCurrentQuorumsInfoResponse.ValidatorSetV0 = (function() { + + /** + * Properties of a ValidatorSetV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IValidatorSetV0 + * @property {Uint8Array|null} [quorumHash] ValidatorSetV0 quorumHash + * @property {number|null} [coreHeight] ValidatorSetV0 coreHeight + * @property {Array.|null} [members] ValidatorSetV0 members + * @property {Uint8Array|null} [thresholdPublicKey] ValidatorSetV0 thresholdPublicKey + */ + + /** + * Constructs a new ValidatorSetV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a ValidatorSetV0. + * @implements IValidatorSetV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set + */ + function ValidatorSetV0(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorSetV0 quorumHash. + * @member {Uint8Array} quorumHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.quorumHash = $util.newBuffer([]); + + /** + * ValidatorSetV0 coreHeight. + * @member {number} coreHeight + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.coreHeight = 0; + + /** + * ValidatorSetV0 members. + * @member {Array.} members + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.members = $util.emptyArray; + + /** + * ValidatorSetV0 thresholdPublicKey. + * @member {Uint8Array} thresholdPublicKey + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.thresholdPublicKey = $util.newBuffer([]); + + /** + * Creates a new ValidatorSetV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 instance + */ + ValidatorSetV0.create = function create(properties) { + return new ValidatorSetV0(properties); + }; + + /** + * Encodes the specified ValidatorSetV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSetV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHash); + if (message.coreHeight != null && Object.hasOwnProperty.call(message, "coreHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreHeight); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.encode(message.members[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.thresholdPublicKey != null && Object.hasOwnProperty.call(message, "thresholdPublicKey")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.thresholdPublicKey); + return writer; + }; + + /** + * Encodes the specified ValidatorSetV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSetV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorSetV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSetV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorumHash = reader.bytes(); + break; + case 2: + message.coreHeight = reader.uint32(); + break; + case 3: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.decode(reader, reader.uint32())); + break; + case 4: + message.thresholdPublicKey = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorSetV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSetV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorSetV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorSetV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) + return "quorumHash: buffer expected"; + if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) + if (!$util.isInteger(message.coreHeight)) + return "coreHeight: integer expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify(message.members[i]); + if (error) + return "members." + error; + } + } + if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) + if (!(message.thresholdPublicKey && typeof message.thresholdPublicKey.length === "number" || $util.isString(message.thresholdPublicKey))) + return "thresholdPublicKey: buffer expected"; + return null; + }; + + /** + * Creates a ValidatorSetV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + */ + ValidatorSetV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); + if (object.quorumHash != null) + if (typeof object.quorumHash === "string") + $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); + else if (object.quorumHash.length >= 0) + message.quorumHash = object.quorumHash; + if (object.coreHeight != null) + message.coreHeight = object.coreHeight >>> 0; + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: object expected"); + message.members[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.fromObject(object.members[i]); + } + } + if (object.thresholdPublicKey != null) + if (typeof object.thresholdPublicKey === "string") + $util.base64.decode(object.thresholdPublicKey, message.thresholdPublicKey = $util.newBuffer($util.base64.length(object.thresholdPublicKey)), 0); + else if (object.thresholdPublicKey.length >= 0) + message.thresholdPublicKey = object.thresholdPublicKey; + return message; + }; + + /** + * Creates a plain object from a ValidatorSetV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} message ValidatorSetV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorSetV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + if (options.bytes === String) + object.quorumHash = ""; + else { + object.quorumHash = []; + if (options.bytes !== Array) + object.quorumHash = $util.newBuffer(object.quorumHash); + } + object.coreHeight = 0; + if (options.bytes === String) + object.thresholdPublicKey = ""; + else { + object.thresholdPublicKey = []; + if (options.bytes !== Array) + object.thresholdPublicKey = $util.newBuffer(object.thresholdPublicKey); + } + } + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; + if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) + object.coreHeight = message.coreHeight; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject(message.members[j], options); + } + if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) + object.thresholdPublicKey = options.bytes === String ? $util.base64.encode(message.thresholdPublicKey, 0, message.thresholdPublicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.thresholdPublicKey) : message.thresholdPublicKey; + return object; + }; + + /** + * Converts this ValidatorSetV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + * @returns {Object.} JSON object + */ + ValidatorSetV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorSetV0; + })(); + + GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IGetCurrentQuorumsInfoResponseV0 + * @property {Array.|null} [quorumHashes] GetCurrentQuorumsInfoResponseV0 quorumHashes + * @property {Uint8Array|null} [currentQuorumHash] GetCurrentQuorumsInfoResponseV0 currentQuorumHash + * @property {Array.|null} [validatorSets] GetCurrentQuorumsInfoResponseV0 validatorSets + * @property {Uint8Array|null} [lastBlockProposer] GetCurrentQuorumsInfoResponseV0 lastBlockProposer + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetCurrentQuorumsInfoResponseV0 metadata + */ + + /** + * Constructs a new GetCurrentQuorumsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a GetCurrentQuorumsInfoResponseV0. + * @implements IGetCurrentQuorumsInfoResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoResponseV0(properties) { + this.quorumHashes = []; + this.validatorSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCurrentQuorumsInfoResponseV0 quorumHashes. + * @member {Array.} quorumHashes + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.quorumHashes = $util.emptyArray; + + /** + * GetCurrentQuorumsInfoResponseV0 currentQuorumHash. + * @member {Uint8Array} currentQuorumHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.currentQuorumHash = $util.newBuffer([]); + + /** + * GetCurrentQuorumsInfoResponseV0 validatorSets. + * @member {Array.} validatorSets + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.validatorSets = $util.emptyArray; + + /** + * GetCurrentQuorumsInfoResponseV0 lastBlockProposer. + * @member {Uint8Array} lastBlockProposer + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.lastBlockProposer = $util.newBuffer([]); + + /** + * GetCurrentQuorumsInfoResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.metadata = null; + + /** + * Creates a new GetCurrentQuorumsInfoResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 instance + */ + GetCurrentQuorumsInfoResponseV0.create = function create(properties) { + return new GetCurrentQuorumsInfoResponseV0(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorumHashes != null && message.quorumHashes.length) + for (var i = 0; i < message.quorumHashes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHashes[i]); + if (message.currentQuorumHash != null && Object.hasOwnProperty.call(message, "currentQuorumHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.currentQuorumHash); + if (message.validatorSets != null && message.validatorSets.length) + for (var i = 0; i < message.validatorSets.length; ++i) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.encode(message.validatorSets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lastBlockProposer != null && Object.hasOwnProperty.call(message, "lastBlockProposer")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.lastBlockProposer); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quorumHashes && message.quorumHashes.length)) + message.quorumHashes = []; + message.quorumHashes.push(reader.bytes()); + break; + case 2: + message.currentQuorumHash = reader.bytes(); + break; + case 3: + if (!(message.validatorSets && message.validatorSets.length)) + message.validatorSets = []; + message.validatorSets.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.decode(reader, reader.uint32())); + break; + case 4: + message.lastBlockProposer = reader.bytes(); + break; + case 5: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorumHashes != null && message.hasOwnProperty("quorumHashes")) { + if (!Array.isArray(message.quorumHashes)) + return "quorumHashes: array expected"; + for (var i = 0; i < message.quorumHashes.length; ++i) + if (!(message.quorumHashes[i] && typeof message.quorumHashes[i].length === "number" || $util.isString(message.quorumHashes[i]))) + return "quorumHashes: buffer[] expected"; + } + if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) + if (!(message.currentQuorumHash && typeof message.currentQuorumHash.length === "number" || $util.isString(message.currentQuorumHash))) + return "currentQuorumHash: buffer expected"; + if (message.validatorSets != null && message.hasOwnProperty("validatorSets")) { + if (!Array.isArray(message.validatorSets)) + return "validatorSets: array expected"; + for (var i = 0; i < message.validatorSets.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify(message.validatorSets[i]); + if (error) + return "validatorSets." + error; + } + } + if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) + if (!(message.lastBlockProposer && typeof message.lastBlockProposer.length === "number" || $util.isString(message.lastBlockProposer))) + return "lastBlockProposer: buffer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + */ + GetCurrentQuorumsInfoResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); + if (object.quorumHashes) { + if (!Array.isArray(object.quorumHashes)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.quorumHashes: array expected"); + message.quorumHashes = []; + for (var i = 0; i < object.quorumHashes.length; ++i) + if (typeof object.quorumHashes[i] === "string") + $util.base64.decode(object.quorumHashes[i], message.quorumHashes[i] = $util.newBuffer($util.base64.length(object.quorumHashes[i])), 0); + else if (object.quorumHashes[i].length >= 0) + message.quorumHashes[i] = object.quorumHashes[i]; + } + if (object.currentQuorumHash != null) + if (typeof object.currentQuorumHash === "string") + $util.base64.decode(object.currentQuorumHash, message.currentQuorumHash = $util.newBuffer($util.base64.length(object.currentQuorumHash)), 0); + else if (object.currentQuorumHash.length >= 0) + message.currentQuorumHash = object.currentQuorumHash; + if (object.validatorSets) { + if (!Array.isArray(object.validatorSets)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: array expected"); + message.validatorSets = []; + for (var i = 0; i < object.validatorSets.length; ++i) { + if (typeof object.validatorSets[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: object expected"); + message.validatorSets[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.fromObject(object.validatorSets[i]); + } + } + if (object.lastBlockProposer != null) + if (typeof object.lastBlockProposer === "string") + $util.base64.decode(object.lastBlockProposer, message.lastBlockProposer = $util.newBuffer($util.base64.length(object.lastBlockProposer)), 0); + else if (object.lastBlockProposer.length >= 0) + message.lastBlockProposer = object.lastBlockProposer; + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.quorumHashes = []; + object.validatorSets = []; + } + if (options.defaults) { + if (options.bytes === String) + object.currentQuorumHash = ""; + else { + object.currentQuorumHash = []; + if (options.bytes !== Array) + object.currentQuorumHash = $util.newBuffer(object.currentQuorumHash); + } + if (options.bytes === String) + object.lastBlockProposer = ""; + else { + object.lastBlockProposer = []; + if (options.bytes !== Array) + object.lastBlockProposer = $util.newBuffer(object.lastBlockProposer); + } + object.metadata = null; + } + if (message.quorumHashes && message.quorumHashes.length) { + object.quorumHashes = []; + for (var j = 0; j < message.quorumHashes.length; ++j) + object.quorumHashes[j] = options.bytes === String ? $util.base64.encode(message.quorumHashes[j], 0, message.quorumHashes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHashes[j]) : message.quorumHashes[j]; + } + if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) + object.currentQuorumHash = options.bytes === String ? $util.base64.encode(message.currentQuorumHash, 0, message.currentQuorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.currentQuorumHash) : message.currentQuorumHash; + if (message.validatorSets && message.validatorSets.length) { + object.validatorSets = []; + for (var j = 0; j < message.validatorSets.length; ++j) + object.validatorSets[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject(message.validatorSets[j], options); + } + if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) + object.lastBlockProposer = options.bytes === String ? $util.base64.encode(message.lastBlockProposer, 0, message.lastBlockProposer.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastBlockProposer) : message.lastBlockProposer; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetCurrentQuorumsInfoResponseV0; + })(); + + return GetCurrentQuorumsInfoResponse; + })(); + return v0; })(); diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js index 746f5210fd..ca80ce2ad7 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js @@ -75,6 +75,14 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.VersionCase', null, { proto }); @@ -133,7 +141,6 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlock goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0', null, { proto }); @@ -1404,7 +1411,7 @@ if (goog.DEBUG && !COMPILED) { * @constructor */ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.repeatedFields_, null); }; goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0, jspb.Message); if (goog.DEBUG && !COMPILED) { @@ -1414,27 +1421,6 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0'; } -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.repeatedFields_, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds'; -} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -4144,6 +4130,132 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.displayName = 'proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0'; +} @@ -13367,8 +13479,8 @@ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEv */ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getEpoch(); - if (f !== 0) { + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { writer.writeUint32( 1, f @@ -13405,7 +13517,25 @@ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEv * @return {!proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} returns this */ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.setEpoch = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.clearEpoch = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.hasEpoch = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -14611,8 +14741,8 @@ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.Get */ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getEpoch(); - if (f !== 0) { + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { writer.writeUint32( 1, f @@ -14663,7 +14793,25 @@ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.Get * @return {!proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} returns this */ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.setEpoch = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.clearEpoch = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.hasEpoch = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -15018,6 +15166,13 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.serializeBinaryToWr +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -15049,7 +15204,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalanc */ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.toObject = function(includeInstance, msg) { var f, obj = { - identitiesIds: (f = msg.getIdentitiesIds()) && proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.toObject(includeInstance, f), + idsList: msg.getIdsList_asB64(), prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) }; @@ -15088,9 +15243,8 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalanc var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.deserializeBinaryFromReader); - msg.setIdentitiesIds(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addIds(value); break; case 2: var value = /** @type {boolean} */ (reader.readBool()); @@ -15125,12 +15279,11 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalanc */ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getIdentitiesIds(); - if (f != null) { - writer.writeMessage( + f = message.getIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( 1, - f, - proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.serializeBinaryToWriter + f ); } f = message.getProve(); @@ -15143,163 +15296,44 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalanc }; - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.toObject = function(includeInstance, msg) { - var f, obj = { - identitiesIdsList: msg.getIdentitiesIdsList_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds; - return proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addIdentitiesIds(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getIdentitiesIdsList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 1, - f - ); - } -}; - - /** - * repeated bytes identities_ids = 1; + * repeated bytes ids = 1; * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.getIdentitiesIdsList = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.getIdsList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * repeated bytes identities_ids = 1; - * This is a type-conversion wrapper around `getIdentitiesIdsList()` + * repeated bytes ids = 1; + * This is a type-conversion wrapper around `getIdsList()` * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.getIdentitiesIdsList_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.getIdsList_asB64 = function() { return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getIdentitiesIdsList())); + this.getIdsList())); }; /** - * repeated bytes identities_ids = 1; + * repeated bytes ids = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentitiesIdsList()` + * This is a type-conversion wrapper around `getIdsList()` * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.getIdentitiesIdsList_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.getIdsList_asU8 = function() { return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getIdentitiesIdsList())); + this.getIdsList())); }; /** * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.setIdentitiesIdsList = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.setIdsList = function(value) { return jspb.Message.setField(this, 1, value || []); }; @@ -15307,56 +15341,19 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalanc /** * @param {!(string|Uint8Array)} value * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.addIdentitiesIds = function(value, opt_index) { +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.addIds = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} returns this - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.clearIdentitiesIdsList = function() { - return this.setIdentitiesIdsList([]); -}; - - -/** - * optional GetIdentitiesBalancesByKnownIdentityIds identities_ids = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.getIdentitiesIds = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.setIdentitiesIds = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.clearIdentitiesIds = function() { - return this.setIdentitiesIds(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.hasIdentitiesIds = function() { - return jspb.Message.getField(this, 1) != null; +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.clearIdsList = function() { + return this.setIdsList([]); }; @@ -44168,6 +44165,1363 @@ proto.org.dash.platform.dapi.v0.GetStatusResponse.prototype.hasV0 = function() { }; + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +/** + * optional GetCurrentQuorumsInfoRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject = function(includeInstance, msg) { + var f, obj = { + proTxHash: msg.getProTxHash_asB64(), + nodeIp: jspb.Message.getFieldWithDefault(msg, 2, ""), + isBanned: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setProTxHash(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setNodeIp(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsBanned(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProTxHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getNodeIp(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getIsBanned(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * optional bytes pro_tx_hash = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.getProTxHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes pro_tx_hash = 1; + * This is a type-conversion wrapper around `getProTxHash()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.getProTxHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getProTxHash())); +}; + + +/** + * optional bytes pro_tx_hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getProTxHash()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.getProTxHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getProTxHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.setProTxHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string node_ip = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.getNodeIp = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.setNodeIp = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bool is_banned = 3; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.getIsBanned = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.setIsBanned = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject = function(includeInstance, msg) { + var f, obj = { + quorumHash: msg.getQuorumHash_asB64(), + coreHeight: jspb.Message.getFieldWithDefault(msg, 2, 0), + membersList: jspb.Message.toObjectList(msg.getMembersList(), + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject, includeInstance), + thresholdPublicKey: msg.getThresholdPublicKey_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setQuorumHash(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setCoreHeight(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.deserializeBinaryFromReader); + msg.addMembers(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setThresholdPublicKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getQuorumHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getCoreHeight(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } + f = message.getMembersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.serializeBinaryToWriter + ); + } + f = message.getThresholdPublicKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } +}; + + +/** + * optional bytes quorum_hash = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getQuorumHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes quorum_hash = 1; + * This is a type-conversion wrapper around `getQuorumHash()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getQuorumHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getQuorumHash())); +}; + + +/** + * optional bytes quorum_hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getQuorumHash()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getQuorumHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getQuorumHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.setQuorumHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional uint32 core_height = 2; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getCoreHeight = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.setCoreHeight = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * repeated ValidatorV0 members = 3; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getMembersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.setMembersList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.addMembers = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.clearMembersList = function() { + return this.setMembersList([]); +}; + + +/** + * optional bytes threshold_public_key = 4; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getThresholdPublicKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes threshold_public_key = 4; + * This is a type-conversion wrapper around `getThresholdPublicKey()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getThresholdPublicKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getThresholdPublicKey())); +}; + + +/** + * optional bytes threshold_public_key = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getThresholdPublicKey()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getThresholdPublicKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getThresholdPublicKey())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.setThresholdPublicKey = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.repeatedFields_ = [1,3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject = function(includeInstance, msg) { + var f, obj = { + quorumHashesList: msg.getQuorumHashesList_asB64(), + currentQuorumHash: msg.getCurrentQuorumHash_asB64(), + validatorSetsList: jspb.Message.toObjectList(msg.getValidatorSetsList(), + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject, includeInstance), + lastBlockProposer: msg.getLastBlockProposer_asB64(), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addQuorumHashes(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setCurrentQuorumHash(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.deserializeBinaryFromReader); + msg.addValidatorSets(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setLastBlockProposer(value); + break; + case 5: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getQuorumHashesList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getCurrentQuorumHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getValidatorSetsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.serializeBinaryToWriter + ); + } + f = message.getLastBlockProposer_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated bytes quorum_hashes = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getQuorumHashesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes quorum_hashes = 1; + * This is a type-conversion wrapper around `getQuorumHashesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getQuorumHashesList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getQuorumHashesList())); +}; + + +/** + * repeated bytes quorum_hashes = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getQuorumHashesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getQuorumHashesList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getQuorumHashesList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.setQuorumHashesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.addQuorumHashes = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.clearQuorumHashesList = function() { + return this.setQuorumHashesList([]); +}; + + +/** + * optional bytes current_quorum_hash = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getCurrentQuorumHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes current_quorum_hash = 2; + * This is a type-conversion wrapper around `getCurrentQuorumHash()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getCurrentQuorumHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getCurrentQuorumHash())); +}; + + +/** + * optional bytes current_quorum_hash = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getCurrentQuorumHash()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getCurrentQuorumHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getCurrentQuorumHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.setCurrentQuorumHash = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * repeated ValidatorSetV0 validator_sets = 3; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getValidatorSetsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.setValidatorSetsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.addValidatorSets = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.clearValidatorSetsList = function() { + return this.setValidatorSetsList([]); +}; + + +/** + * optional bytes last_block_proposer = 4; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getLastBlockProposer = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes last_block_proposer = 4; + * This is a type-conversion wrapper around `getLastBlockProposer()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getLastBlockProposer_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getLastBlockProposer())); +}; + + +/** + * optional bytes last_block_proposer = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getLastBlockProposer()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getLastBlockProposer_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getLastBlockProposer())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.setLastBlockProposer = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); +}; + + +/** + * optional ResponseMetadata metadata = 5; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 5)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional GetCurrentQuorumsInfoResponseV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + /** * @enum {number} */ diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h index d6a635ad22..bafa69fcb7 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h @@ -54,6 +54,10 @@ CF_EXTERN_C_BEGIN @class GetContestedResourcesRequest_GetContestedResourcesRequestV0_StartAtValueInfo; @class GetContestedResourcesResponse_GetContestedResourcesResponseV0; @class GetContestedResourcesResponse_GetContestedResourcesResponseV0_ContestedResourceValues; +@class GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0; +@class GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0; +@class GetCurrentQuorumsInfoResponse_ValidatorSetV0; +@class GetCurrentQuorumsInfoResponse_ValidatorV0; @class GetDataContractHistoryRequest_GetDataContractHistoryRequestV0; @class GetDataContractHistoryResponse_GetDataContractHistoryResponseV0; @class GetDataContractHistoryResponse_GetDataContractHistoryResponseV0_DataContractHistory; @@ -77,7 +81,6 @@ CF_EXTERN_C_BEGIN @class GetEvonodesProposedEpochBlocksResponse_GetEvonodesProposedEpochBlocksResponseV0_EvonodeProposedBlocks; @class GetEvonodesProposedEpochBlocksResponse_GetEvonodesProposedEpochBlocksResponseV0_EvonodesProposedBlocks; @class GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0; -@class GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds; @class GetIdentitiesBalancesResponse_GetIdentitiesBalancesResponseV0; @class GetIdentitiesBalancesResponse_GetIdentitiesBalancesResponseV0_IdentitiesBalances; @class GetIdentitiesBalancesResponse_GetIdentitiesBalancesResponseV0_IdentityBalance; @@ -1396,8 +1399,10 @@ typedef GPB_ENUM(GetEvonodesProposedEpochBlocksByIdsRequest_GetEvonodesProposedE GPB_FINAL @interface GetEvonodesProposedEpochBlocksByIdsRequest_GetEvonodesProposedEpochBlocksByIdsRequestV0 : GPBMessage +/** The epoch we are querying for, if none is set, get current epoch */ @property(nonatomic, readwrite) uint32_t epoch; +@property(nonatomic, readwrite) BOOL hasEpoch; /** IDs of the evonodes for which we want to get their proposed blocks */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *idsArray; /** The number of items in @c idsArray without causing the array to be created. */ @@ -1539,9 +1544,10 @@ typedef GPB_ENUM(GetEvonodesProposedEpochBlocksByRangeRequest_GetEvonodesPropose GPB_FINAL @interface GetEvonodesProposedEpochBlocksByRangeRequest_GetEvonodesProposedEpochBlocksByRangeRequestV0 : GPBMessage -/** The epoch we are querying for */ +/** The epoch we are querying for, if none is set, get current epoch */ @property(nonatomic, readwrite) uint32_t epoch; +@property(nonatomic, readwrite) BOOL hasEpoch; /** Maximum number of evonodes proposed epoch blocks to return */ @property(nonatomic, readwrite) uint32_t limit; @@ -1591,34 +1597,20 @@ void GetIdentitiesBalancesRequest_ClearVersionOneOfCase(GetIdentitiesBalancesReq #pragma mark - GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0 typedef GPB_ENUM(GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_FieldNumber) { - GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_FieldNumber_IdentitiesIds = 1, + GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_FieldNumber_IdsArray = 1, GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_FieldNumber_Prove = 2, }; GPB_FINAL @interface GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0 : GPBMessage -@property(nonatomic, readwrite, strong, null_resettable) GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds *identitiesIds; -/** Test to see if @c identitiesIds has been set. */ -@property(nonatomic, readwrite) BOOL hasIdentitiesIds; +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *idsArray; +/** The number of items in @c idsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger idsArray_Count; @property(nonatomic, readwrite) BOOL prove; @end -#pragma mark - GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds - -typedef GPB_ENUM(GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds_FieldNumber) { - GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds_FieldNumber_IdentitiesIdsArray = 1, -}; - -GPB_FINAL @interface GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds : GPBMessage - -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *identitiesIdsArray; -/** The number of items in @c identitiesIdsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger identitiesIdsArray_Count; - -@end - #pragma mark - GetIdentitiesBalancesResponse typedef GPB_ENUM(GetIdentitiesBalancesResponse_FieldNumber) { @@ -4845,6 +4837,131 @@ GPB_FINAL @interface GetStatusResponse_GetStatusResponseV0_StateSync : GPBMessag @end +#pragma mark - GetCurrentQuorumsInfoRequest + +typedef GPB_ENUM(GetCurrentQuorumsInfoRequest_FieldNumber) { + GetCurrentQuorumsInfoRequest_FieldNumber_V0 = 1, +}; + +typedef GPB_ENUM(GetCurrentQuorumsInfoRequest_Version_OneOfCase) { + GetCurrentQuorumsInfoRequest_Version_OneOfCase_GPBUnsetOneOfCase = 0, + GetCurrentQuorumsInfoRequest_Version_OneOfCase_V0 = 1, +}; + +GPB_FINAL @interface GetCurrentQuorumsInfoRequest : GPBMessage + +@property(nonatomic, readonly) GetCurrentQuorumsInfoRequest_Version_OneOfCase versionOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0 *v0; + +@end + +/** + * Clears whatever value was set for the oneof 'version'. + **/ +void GetCurrentQuorumsInfoRequest_ClearVersionOneOfCase(GetCurrentQuorumsInfoRequest *message); + +#pragma mark - GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0 + +GPB_FINAL @interface GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0 : GPBMessage + +@end + +#pragma mark - GetCurrentQuorumsInfoResponse + +typedef GPB_ENUM(GetCurrentQuorumsInfoResponse_FieldNumber) { + GetCurrentQuorumsInfoResponse_FieldNumber_V0 = 1, +}; + +typedef GPB_ENUM(GetCurrentQuorumsInfoResponse_Version_OneOfCase) { + GetCurrentQuorumsInfoResponse_Version_OneOfCase_GPBUnsetOneOfCase = 0, + GetCurrentQuorumsInfoResponse_Version_OneOfCase_V0 = 1, +}; + +GPB_FINAL @interface GetCurrentQuorumsInfoResponse : GPBMessage + +@property(nonatomic, readonly) GetCurrentQuorumsInfoResponse_Version_OneOfCase versionOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0 *v0; + +@end + +/** + * Clears whatever value was set for the oneof 'version'. + **/ +void GetCurrentQuorumsInfoResponse_ClearVersionOneOfCase(GetCurrentQuorumsInfoResponse *message); + +#pragma mark - GetCurrentQuorumsInfoResponse_ValidatorV0 + +typedef GPB_ENUM(GetCurrentQuorumsInfoResponse_ValidatorV0_FieldNumber) { + GetCurrentQuorumsInfoResponse_ValidatorV0_FieldNumber_ProTxHash = 1, + GetCurrentQuorumsInfoResponse_ValidatorV0_FieldNumber_NodeIp = 2, + GetCurrentQuorumsInfoResponse_ValidatorV0_FieldNumber_IsBanned = 3, +}; + +GPB_FINAL @interface GetCurrentQuorumsInfoResponse_ValidatorV0 : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSData *proTxHash; + +@property(nonatomic, readwrite, copy, null_resettable) NSString *nodeIp; + +@property(nonatomic, readwrite) BOOL isBanned; + +@end + +#pragma mark - GetCurrentQuorumsInfoResponse_ValidatorSetV0 + +typedef GPB_ENUM(GetCurrentQuorumsInfoResponse_ValidatorSetV0_FieldNumber) { + GetCurrentQuorumsInfoResponse_ValidatorSetV0_FieldNumber_QuorumHash = 1, + GetCurrentQuorumsInfoResponse_ValidatorSetV0_FieldNumber_CoreHeight = 2, + GetCurrentQuorumsInfoResponse_ValidatorSetV0_FieldNumber_MembersArray = 3, + GetCurrentQuorumsInfoResponse_ValidatorSetV0_FieldNumber_ThresholdPublicKey = 4, +}; + +GPB_FINAL @interface GetCurrentQuorumsInfoResponse_ValidatorSetV0 : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSData *quorumHash; + +@property(nonatomic, readwrite) uint32_t coreHeight; + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *membersArray; +/** The number of items in @c membersArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger membersArray_Count; + +@property(nonatomic, readwrite, copy, null_resettable) NSData *thresholdPublicKey; + +@end + +#pragma mark - GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0 + +typedef GPB_ENUM(GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0_FieldNumber) { + GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0_FieldNumber_QuorumHashesArray = 1, + GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0_FieldNumber_CurrentQuorumHash = 2, + GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0_FieldNumber_ValidatorSetsArray = 3, + GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0_FieldNumber_LastBlockProposer = 4, + GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0_FieldNumber_Metadata = 5, +}; + +GPB_FINAL @interface GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0 : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *quorumHashesArray; +/** The number of items in @c quorumHashesArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger quorumHashesArray_Count; + +@property(nonatomic, readwrite, copy, null_resettable) NSData *currentQuorumHash; + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *validatorSetsArray; +/** The number of items in @c validatorSetsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger validatorSetsArray_Count; + +@property(nonatomic, readwrite, copy, null_resettable) NSData *lastBlockProposer; + +@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; +/** Test to see if @c metadata has been set. */ +@property(nonatomic, readwrite) BOOL hasMetadata; + +@end + NS_ASSUME_NONNULL_END CF_EXTERN_C_END diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m index 7d1ef92f7a..e0bff0f273 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m @@ -64,6 +64,12 @@ GPBObjCClassDeclaration(GetContestedResourcesResponse); GPBObjCClassDeclaration(GetContestedResourcesResponse_GetContestedResourcesResponseV0); GPBObjCClassDeclaration(GetContestedResourcesResponse_GetContestedResourcesResponseV0_ContestedResourceValues); +GPBObjCClassDeclaration(GetCurrentQuorumsInfoRequest); +GPBObjCClassDeclaration(GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0); +GPBObjCClassDeclaration(GetCurrentQuorumsInfoResponse); +GPBObjCClassDeclaration(GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0); +GPBObjCClassDeclaration(GetCurrentQuorumsInfoResponse_ValidatorSetV0); +GPBObjCClassDeclaration(GetCurrentQuorumsInfoResponse_ValidatorV0); GPBObjCClassDeclaration(GetDataContractHistoryRequest); GPBObjCClassDeclaration(GetDataContractHistoryRequest_GetDataContractHistoryRequestV0); GPBObjCClassDeclaration(GetDataContractHistoryResponse); @@ -101,7 +107,6 @@ GPBObjCClassDeclaration(GetEvonodesProposedEpochBlocksResponse_GetEvonodesProposedEpochBlocksResponseV0_EvonodesProposedBlocks); GPBObjCClassDeclaration(GetIdentitiesBalancesRequest); GPBObjCClassDeclaration(GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0); -GPBObjCClassDeclaration(GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds); GPBObjCClassDeclaration(GetIdentitiesBalancesResponse); GPBObjCClassDeclaration(GetIdentitiesBalancesResponse_GetIdentitiesBalancesResponseV0); GPBObjCClassDeclaration(GetIdentitiesBalancesResponse_GetIdentitiesBalancesResponseV0_IdentitiesBalances); @@ -3065,7 +3070,7 @@ void GetEvonodesProposedEpochBlocksByIdsRequest_ClearVersionOneOfCase(GetEvonode @implementation GetEvonodesProposedEpochBlocksByIdsRequest_GetEvonodesProposedEpochBlocksByIdsRequestV0 -@dynamic epoch; +@dynamic hasEpoch, epoch; @dynamic idsArray, idsArray_Count; @dynamic prove; @@ -3087,7 +3092,7 @@ + (GPBDescriptor *)descriptor { .number = GetEvonodesProposedEpochBlocksByIdsRequest_GetEvonodesProposedEpochBlocksByIdsRequestV0_FieldNumber_Epoch, .hasIndex = 0, .offset = (uint32_t)offsetof(GetEvonodesProposedEpochBlocksByIdsRequest_GetEvonodesProposedEpochBlocksByIdsRequestV0__storage_, epoch), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .flags = GPBFieldOptional, .dataType = GPBDataTypeUInt32, }, { @@ -3430,7 +3435,7 @@ void GetEvonodesProposedEpochBlocksByRangeRequest_ClearVersionOneOfCase(GetEvono @implementation GetEvonodesProposedEpochBlocksByRangeRequest_GetEvonodesProposedEpochBlocksByRangeRequestV0 @dynamic startOneOfCase; -@dynamic epoch; +@dynamic hasEpoch, epoch; @dynamic hasLimit, limit; @dynamic startAfter; @dynamic startAt; @@ -3456,7 +3461,7 @@ + (GPBDescriptor *)descriptor { .number = GetEvonodesProposedEpochBlocksByRangeRequest_GetEvonodesProposedEpochBlocksByRangeRequestV0_FieldNumber_Epoch, .hasIndex = 0, .offset = (uint32_t)offsetof(GetEvonodesProposedEpochBlocksByRangeRequest_GetEvonodesProposedEpochBlocksByRangeRequestV0__storage_, epoch), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .flags = GPBFieldOptional, .dataType = GPBDataTypeUInt32, }, { @@ -3587,12 +3592,12 @@ void GetIdentitiesBalancesRequest_ClearVersionOneOfCase(GetIdentitiesBalancesReq @implementation GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0 -@dynamic hasIdentitiesIds, identitiesIds; +@dynamic idsArray, idsArray_Count; @dynamic prove; typedef struct GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0__storage_ { uint32_t _has_storage_[1]; - GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds *identitiesIds; + NSMutableArray *idsArray; } GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0__storage_; // This method is threadsafe because it is initially called @@ -3602,20 +3607,20 @@ + (GPBDescriptor *)descriptor { if (!descriptor) { static GPBMessageFieldDescription fields[] = { { - .name = "identitiesIds", - .dataTypeSpecific.clazz = GPBObjCClass(GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds), - .number = GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_FieldNumber_IdentitiesIds, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0__storage_, identitiesIds), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, + .name = "idsArray", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_FieldNumber_IdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0__storage_, idsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, }, { .name = "prove", .dataTypeSpecific.clazz = Nil, .number = GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_FieldNumber_Prove, - .hasIndex = 1, - .offset = 2, // Stored in _has_storage_ to save space. + .hasIndex = 0, + .offset = 1, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, @@ -3639,52 +3644,6 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds - -@implementation GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds - -@dynamic identitiesIdsArray, identitiesIdsArray_Count; - -typedef struct GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *identitiesIdsArray; -} GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds__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 = "identitiesIdsArray", - .dataTypeSpecific.clazz = Nil, - .number = GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds_FieldNumber_IdentitiesIdsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds__storage_, identitiesIdsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0_GetIdentitiesBalancesByKnownIdentityIds__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetIdentitiesBalancesRequest_GetIdentitiesBalancesRequestV0)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - #pragma mark - GetIdentitiesBalancesResponse @implementation GetIdentitiesBalancesResponse @@ -12484,6 +12443,389 @@ + (GPBDescriptor *)descriptor { @end +#pragma mark - GetCurrentQuorumsInfoRequest + +@implementation GetCurrentQuorumsInfoRequest + +@dynamic versionOneOfCase; +@dynamic v0; + +typedef struct GetCurrentQuorumsInfoRequest__storage_ { + uint32_t _has_storage_[2]; + GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0 *v0; +} GetCurrentQuorumsInfoRequest__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 = "v0", + .dataTypeSpecific.clazz = GPBObjCClass(GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0), + .number = GetCurrentQuorumsInfoRequest_FieldNumber_V0, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoRequest__storage_, v0), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetCurrentQuorumsInfoRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetCurrentQuorumsInfoRequest__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "version", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetCurrentQuorumsInfoRequest_ClearVersionOneOfCase(GetCurrentQuorumsInfoRequest *message) { + GPBDescriptor *descriptor = [GetCurrentQuorumsInfoRequest descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0 + +@implementation GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0 + + +typedef struct GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0__storage_ { + uint32_t _has_storage_[1]; +} GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0 class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:NULL + fieldCount:0 + storageSize:sizeof(GetCurrentQuorumsInfoRequest_GetCurrentQuorumsInfoRequestV0__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetCurrentQuorumsInfoRequest)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetCurrentQuorumsInfoResponse + +@implementation GetCurrentQuorumsInfoResponse + +@dynamic versionOneOfCase; +@dynamic v0; + +typedef struct GetCurrentQuorumsInfoResponse__storage_ { + uint32_t _has_storage_[2]; + GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0 *v0; +} GetCurrentQuorumsInfoResponse__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 = "v0", + .dataTypeSpecific.clazz = GPBObjCClass(GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0), + .number = GetCurrentQuorumsInfoResponse_FieldNumber_V0, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse__storage_, v0), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetCurrentQuorumsInfoResponse class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetCurrentQuorumsInfoResponse__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "version", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetCurrentQuorumsInfoResponse_ClearVersionOneOfCase(GetCurrentQuorumsInfoResponse *message) { + GPBDescriptor *descriptor = [GetCurrentQuorumsInfoResponse descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetCurrentQuorumsInfoResponse_ValidatorV0 + +@implementation GetCurrentQuorumsInfoResponse_ValidatorV0 + +@dynamic proTxHash; +@dynamic nodeIp; +@dynamic isBanned; + +typedef struct GetCurrentQuorumsInfoResponse_ValidatorV0__storage_ { + uint32_t _has_storage_[1]; + NSData *proTxHash; + NSString *nodeIp; +} GetCurrentQuorumsInfoResponse_ValidatorV0__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 = "proTxHash", + .dataTypeSpecific.clazz = Nil, + .number = GetCurrentQuorumsInfoResponse_ValidatorV0_FieldNumber_ProTxHash, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse_ValidatorV0__storage_, proTxHash), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "nodeIp", + .dataTypeSpecific.clazz = Nil, + .number = GetCurrentQuorumsInfoResponse_ValidatorV0_FieldNumber_NodeIp, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse_ValidatorV0__storage_, nodeIp), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeString, + }, + { + .name = "isBanned", + .dataTypeSpecific.clazz = Nil, + .number = GetCurrentQuorumsInfoResponse_ValidatorV0_FieldNumber_IsBanned, + .hasIndex = 2, + .offset = 3, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetCurrentQuorumsInfoResponse_ValidatorV0 class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetCurrentQuorumsInfoResponse_ValidatorV0__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetCurrentQuorumsInfoResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetCurrentQuorumsInfoResponse_ValidatorSetV0 + +@implementation GetCurrentQuorumsInfoResponse_ValidatorSetV0 + +@dynamic quorumHash; +@dynamic coreHeight; +@dynamic membersArray, membersArray_Count; +@dynamic thresholdPublicKey; + +typedef struct GetCurrentQuorumsInfoResponse_ValidatorSetV0__storage_ { + uint32_t _has_storage_[1]; + uint32_t coreHeight; + NSData *quorumHash; + NSMutableArray *membersArray; + NSData *thresholdPublicKey; +} GetCurrentQuorumsInfoResponse_ValidatorSetV0__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 = "quorumHash", + .dataTypeSpecific.clazz = Nil, + .number = GetCurrentQuorumsInfoResponse_ValidatorSetV0_FieldNumber_QuorumHash, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse_ValidatorSetV0__storage_, quorumHash), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "coreHeight", + .dataTypeSpecific.clazz = Nil, + .number = GetCurrentQuorumsInfoResponse_ValidatorSetV0_FieldNumber_CoreHeight, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse_ValidatorSetV0__storage_, coreHeight), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeUInt32, + }, + { + .name = "membersArray", + .dataTypeSpecific.clazz = GPBObjCClass(GetCurrentQuorumsInfoResponse_ValidatorV0), + .number = GetCurrentQuorumsInfoResponse_ValidatorSetV0_FieldNumber_MembersArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse_ValidatorSetV0__storage_, membersArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "thresholdPublicKey", + .dataTypeSpecific.clazz = Nil, + .number = GetCurrentQuorumsInfoResponse_ValidatorSetV0_FieldNumber_ThresholdPublicKey, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse_ValidatorSetV0__storage_, thresholdPublicKey), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetCurrentQuorumsInfoResponse_ValidatorSetV0 class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetCurrentQuorumsInfoResponse_ValidatorSetV0__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetCurrentQuorumsInfoResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0 + +@implementation GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0 + +@dynamic quorumHashesArray, quorumHashesArray_Count; +@dynamic currentQuorumHash; +@dynamic validatorSetsArray, validatorSetsArray_Count; +@dynamic lastBlockProposer; +@dynamic hasMetadata, metadata; + +typedef struct GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *quorumHashesArray; + NSData *currentQuorumHash; + NSMutableArray *validatorSetsArray; + NSData *lastBlockProposer; + ResponseMetadata *metadata; +} GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0__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 = "quorumHashesArray", + .dataTypeSpecific.clazz = Nil, + .number = GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0_FieldNumber_QuorumHashesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0__storage_, quorumHashesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, + }, + { + .name = "currentQuorumHash", + .dataTypeSpecific.clazz = Nil, + .number = GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0_FieldNumber_CurrentQuorumHash, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0__storage_, currentQuorumHash), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "validatorSetsArray", + .dataTypeSpecific.clazz = GPBObjCClass(GetCurrentQuorumsInfoResponse_ValidatorSetV0), + .number = GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0_FieldNumber_ValidatorSetsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0__storage_, validatorSetsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "lastBlockProposer", + .dataTypeSpecific.clazz = Nil, + .number = GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0_FieldNumber_LastBlockProposer, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0__storage_, lastBlockProposer), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "metadata", + .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), + .number = GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0_FieldNumber_Metadata, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0__storage_, metadata), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0 class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetCurrentQuorumsInfoResponse_GetCurrentQuorumsInfoResponseV0__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetCurrentQuorumsInfoResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + #pragma clang diagnostic pop diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h index fb69ec2af8..9bfcd4ba16 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h @@ -26,6 +26,8 @@ @class GetContestedResourceVotersForIdentityResponse; @class GetContestedResourcesRequest; @class GetContestedResourcesResponse; +@class GetCurrentQuorumsInfoRequest; +@class GetCurrentQuorumsInfoResponse; @class GetDataContractHistoryRequest; @class GetDataContractHistoryResponse; @class GetDataContractRequest; @@ -244,6 +246,10 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCUnaryProtoCall *)getStatusWithMessage:(GetStatusRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; +#pragma mark getCurrentQuorumsInfo(GetCurrentQuorumsInfoRequest) returns (GetCurrentQuorumsInfoResponse) + +- (GRPCUnaryProtoCall *)getCurrentQuorumsInfoWithMessage:(GetCurrentQuorumsInfoRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; + @end /** @@ -519,6 +525,13 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCProtoCall *)RPCTogetStatusWithRequest:(GetStatusRequest *)request handler:(void(^)(GetStatusResponse *_Nullable response, NSError *_Nullable error))handler; +#pragma mark getCurrentQuorumsInfo(GetCurrentQuorumsInfoRequest) returns (GetCurrentQuorumsInfoResponse) + +- (void)getCurrentQuorumsInfoWithRequest:(GetCurrentQuorumsInfoRequest *)request handler:(void(^)(GetCurrentQuorumsInfoResponse *_Nullable response, NSError *_Nullable error))handler; + +- (GRPCProtoCall *)RPCTogetCurrentQuorumsInfoWithRequest:(GetCurrentQuorumsInfoRequest *)request handler:(void(^)(GetCurrentQuorumsInfoResponse *_Nullable response, NSError *_Nullable error))handler; + + @end diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m index df7dcb06e0..b8e6852fe6 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m @@ -755,5 +755,25 @@ - (GRPCUnaryProtoCall *)getStatusWithMessage:(GetStatusRequest *)message respons responseClass:[GetStatusResponse class]]; } +#pragma mark getCurrentQuorumsInfo(GetCurrentQuorumsInfoRequest) returns (GetCurrentQuorumsInfoResponse) + +- (void)getCurrentQuorumsInfoWithRequest:(GetCurrentQuorumsInfoRequest *)request handler:(void(^)(GetCurrentQuorumsInfoResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCTogetCurrentQuorumsInfoWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (GRPCProtoCall *)RPCTogetCurrentQuorumsInfoWithRequest:(GetCurrentQuorumsInfoRequest *)request handler:(void(^)(GetCurrentQuorumsInfoResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"getCurrentQuorumsInfo" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GetCurrentQuorumsInfoResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +- (GRPCUnaryProtoCall *)getCurrentQuorumsInfoWithMessage:(GetCurrentQuorumsInfoRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { + return [self RPCToMethod:@"getCurrentQuorumsInfo" + message:message + responseHandler:handler + callOptions:callOptions + responseClass:[GetCurrentQuorumsInfoResponse class]]; +} + @end #endif diff --git a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py index e28c4f3249..be8a64f309 100644 --- a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py +++ b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py @@ -23,7 +23,7 @@ syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x81\x01\n\x05Proof\x12\x15\n\rgrovedb_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\x12\x15\n\rblock_id_hash\x18\x05 \x01(\x0c\x12\x13\n\x0bquorum_type\x18\x06 \x01(\r\"\x90\x01\n\x10ResponseMetadata\x12\x0e\n\x06height\x18\x01 \x01(\x04\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\r\n\x05\x65poch\x18\x03 \x01(\r\x12\x0f\n\x07time_ms\x18\x04 \x01(\x04\x12\x18\n\x10protocol_version\x18\x05 \x01(\r\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\t\"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\"\xa4\x01\n\x12GetIdentityRequest\x12P\n\x02v0\x18\x01 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0H\x00\x1a\x31\n\x14GetIdentityRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xc1\x01\n\x17GetIdentityNonceRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0H\x00\x1a?\n\x19GetIdentityNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf6\x01\n\x1fGetIdentityContractNonceRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0H\x00\x1a\\\n!GetIdentityContractNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xc0\x01\n\x19GetIdentityBalanceRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0H\x00\x1a\x38\n\x1bGetIdentityBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xec\x01\n$GetIdentityBalanceAndRevisionRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0H\x00\x1a\x43\n&GetIdentityBalanceAndRevisionRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9e\x02\n\x13GetIdentityResponse\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0H\x00\x1a\xa7\x01\n\x15GetIdentityResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\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\x08\n\x06resultB\t\n\x07version\"\xb8\x02\n\x18GetIdentityNonceResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0H\x00\x1a\xb2\x01\n\x1aGetIdentityNonceResponseV0\x12\x18\n\x0eidentity_nonce\x18\x01 \x01(\x04H\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\x08\n\x06resultB\t\n\x07version\"\xe1\x02\n GetIdentityContractNonceResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0H\x00\x1a\xc3\x01\n\"GetIdentityContractNonceResponseV0\x12!\n\x17identity_contract_nonce\x18\x01 \x01(\x04H\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\x08\n\x06resultB\t\n\x07version\"\xb9\x02\n\x1aGetIdentityBalanceResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0H\x00\x1a\xad\x01\n\x1cGetIdentityBalanceResponseV0\x12\x11\n\x07\x62\x61lance\x18\x01 \x01(\x04H\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\x08\n\x06resultB\t\n\x07version\"\xa9\x04\n%GetIdentityBalanceAndRevisionResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0H\x00\x1a\xfc\x02\n\'GetIdentityBalanceAndRevisionResponseV0\x12\x9b\x01\n\x14\x62\x61lance_and_revision\x18\x01 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevisionH\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.ResponseMetadata\x1a\x37\n\x12\x42\x61lanceAndRevision\x12\x0f\n\x07\x62\x61lance\x18\x01 \x01(\x04\x12\x10\n\x08revision\x18\x02 \x01(\x04\x42\x08\n\x06resultB\t\n\x07version\"\xd1\x01\n\x0eKeyRequestType\x12\x36\n\x08\x61ll_keys\x18\x01 \x01(\x0b\x32\".org.dash.platform.dapi.v0.AllKeysH\x00\x12@\n\rspecific_keys\x18\x02 \x01(\x0b\x32\'.org.dash.platform.dapi.v0.SpecificKeysH\x00\x12:\n\nsearch_key\x18\x03 \x01(\x0b\x32$.org.dash.platform.dapi.v0.SearchKeyH\x00\x42\t\n\x07request\"\t\n\x07\x41llKeys\"\x1f\n\x0cSpecificKeys\x12\x0f\n\x07key_ids\x18\x01 \x03(\r\"\xb6\x01\n\tSearchKey\x12I\n\x0bpurpose_map\x18\x01 \x03(\x0b\x32\x34.org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry\x1a^\n\x0fPurposeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.SecurityLevelMap:\x02\x38\x01\"\xbf\x02\n\x10SecurityLevelMap\x12]\n\x12security_level_map\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry\x1aw\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12M\n\x05value\x18\x02 \x01(\x0e\x32>.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"S\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\x12\x1c\n\x18\x41LL_KEYS_OF_KIND_REQUEST\x10\x01\"\xda\x02\n\x16GetIdentityKeysRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0H\x00\x1a\xda\x01\n\x18GetIdentityKeysRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\x99\x03\n\x17GetIdentityKeysResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0H\x00\x1a\x96\x02\n\x19GetIdentityKeysResponseV0\x12\x61\n\x04keys\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.KeysH\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.ResponseMetadata\x1a\x1a\n\x04Keys\x12\x12\n\nkeys_bytes\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xef\x02\n GetIdentitiesContractKeysRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0H\x00\x1a\xd1\x01\n\"GetIdentitiesContractKeysRequestV0\x12\x16\n\x0eidentities_ids\x18\x01 \x03(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\x1f\n\x12\x64ocument_type_name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x08purposes\x18\x04 \x03(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x15\n\x13_document_type_nameB\t\n\x07version\"\xdf\x06\n!GetIdentitiesContractKeysResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0H\x00\x1a\xbe\x05\n#GetIdentitiesContractKeysResponseV0\x12\x8a\x01\n\x0fidentities_keys\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeysH\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.ResponseMetadata\x1aY\n\x0bPurposeKeys\x12\x36\n\x07purpose\x18\x01 \x01(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\x12\n\nkeys_bytes\x18\x02 \x03(\x0c\x1a\x9f\x01\n\x0cIdentityKeys\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12z\n\x04keys\x18\x02 \x03(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys\x1a\x90\x01\n\x0eIdentitiesKeys\x12~\n\x07\x65ntries\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeysB\x08\n\x06resultB\t\n\x07version\"\x95\x02\n*GetEvonodesProposedEpochBlocksByIdsRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0H\x00\x1aY\n,GetEvonodesProposedEpochBlocksByIdsRequestV0\x12\r\n\x05\x65poch\x18\x01 \x01(\r\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\x8e\x06\n&GetEvonodesProposedEpochBlocksResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0H\x00\x1a\xde\x04\n(GetEvonodesProposedEpochBlocksResponseV0\x12\xb1\x01\n#evonodes_proposed_block_counts_info\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocksH\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.ResponseMetadata\x1a;\n\x15\x45vonodeProposedBlocks\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\x04\x1a\xc4\x01\n\x16\x45vonodesProposedBlocks\x12\xa9\x01\n\x1e\x65vonodes_proposed_block_counts\x18\x01 \x03(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocksB\x08\n\x06resultB\t\n\x07version\"\xe3\x02\n,GetEvonodesProposedEpochBlocksByRangeRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0H\x00\x1a\xa0\x01\n.GetEvonodesProposedEpochBlocksByRangeRequestV0\x12\r\n\x05\x65poch\x18\x01 \x01(\r\x12\x12\n\x05limit\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x04 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_limitB\t\n\x07version\"\x9d\x03\n\x1cGetIdentitiesBalancesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0H\x00\x1a\x8b\x02\n\x1eGetIdentitiesBalancesRequestV0\x12\x96\x01\n\x0eidentities_ids\x18\x01 \x01(\x0b\x32~.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds\x12\r\n\x05prove\x18\x02 \x01(\x08\x1a\x41\n\'GetIdentitiesBalancesByKnownIdentityIds\x12\x16\n\x0eidentities_ids\x18\x01 \x03(\x0c\x42\t\n\x07version\"\x9b\x05\n\x1dGetIdentitiesBalancesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0H\x00\x1a\x86\x04\n\x1fGetIdentitiesBalancesResponseV0\x12\x8a\x01\n\x13identities_balances\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalancesH\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.ResponseMetadata\x1aH\n\x0fIdentityBalance\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x8f\x01\n\x12IdentitiesBalances\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalanceB\x08\n\x06resultB\t\n\x07version\"\xcb\x0b\n\x10GetProofsRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0H\x00\x1a\xdd\n\n\x12GetProofsRequestV0\x12\x62\n\nidentities\x18\x01 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest\x12\x61\n\tcontracts\x18\x02 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest\x12\x61\n\tdocuments\x18\x03 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest\x12_\n\x05votes\x18\x04 \x03(\x0b\x32P.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest\x1a\xd5\x02\n\x0f\x44ocumentRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12#\n\x1b\x64ocument_type_keeps_history\x18\x03 \x01(\x08\x12\x13\n\x0b\x64ocument_id\x18\x04 \x01(\x0c\x12\x89\x01\n\x19\x64ocument_contested_status\x18\x05 \x01(\x0e\x32\x66.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus\"P\n\x17\x44ocumentContestedStatus\x12\x11\n\rNOT_CONTESTED\x10\x00\x12\x13\n\x0fMAYBE_CONTESTED\x10\x01\x12\r\n\tCONTESTED\x10\x02\x1a\xd1\x01\n\x0fIdentityRequest\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12i\n\x0crequest_type\x18\x02 \x01(\x0e\x32S.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type\">\n\x04Type\x12\x11\n\rFULL_IDENTITY\x10\x00\x12\x0b\n\x07\x42\x41LANCE\x10\x01\x12\x08\n\x04KEYS\x10\x02\x12\x0c\n\x08REVISION\x10\x03\x1a&\n\x0f\x43ontractRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x1a\xe7\x02\n\x11VoteStatusRequest\x12\xa5\x01\n&contested_resource_vote_status_request\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequestH\x00\x1a\x99\x01\n\"ContestedResourceVoteStatusRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x18\n\x10voter_identifier\x18\x05 \x01(\x0c\x42\x0e\n\x0crequest_typeB\t\n\x07version\"\x82\x02\n\x11GetProofsResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0H\x00\x1a\x91\x01\n\x13GetProofsResponseV0\x12\x31\n\x05proof\x18\x01 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb4\x01\n\x16GetDataContractRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0H\x00\x1a\x35\n\x18GetDataContractRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb3\x02\n\x17GetDataContractResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0H\x00\x1a\xb0\x01\n\x19GetDataContractResponseV0\x12\x17\n\rdata_contract\x18\x01 \x01(\x0cH\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\x08\n\x06resultB\t\n\x07version\"\xb9\x01\n\x17GetDataContractsRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0H\x00\x1a\x37\n\x19GetDataContractsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xcf\x04\n\x18GetDataContractsResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0H\x00\x1a[\n\x11\x44\x61taContractEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x32\n\rdata_contract\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x1au\n\rDataContracts\x12\x64\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry\x1a\xf5\x01\n\x1aGetDataContractsResponseV0\x12[\n\x0e\x64\x61ta_contracts\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractsH\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\x08\n\x06resultB\t\n\x07version\"\xc1\x02\n\x1dGetDataContractHistoryRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0H\x00\x1a\xac\x01\n\x1fGetDataContractHistoryRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x13\n\x0bstart_at_ms\x18\x04 \x01(\x04\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xae\x05\n\x1eGetDataContractHistoryResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0H\x00\x1a\x96\x04\n GetDataContractHistoryResponseV0\x12\x8f\x01\n\x15\x64\x61ta_contract_history\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryH\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.ResponseMetadata\x1a\x37\n\x18\x44\x61taContractHistoryEntry\x12\x0c\n\x04\x64\x61te\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\xaa\x01\n\x13\x44\x61taContractHistory\x12\x92\x01\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32s.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntryB\x08\n\x06resultB\t\n\x07version\"\xb2\x02\n\x13GetDocumentsRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0H\x00\x1a\xbb\x01\n\x15GetDocumentsRequestV0\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(\x0cH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05startB\t\n\x07version\"\x95\x03\n\x14GetDocumentsResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0H\x00\x1a\x9b\x02\n\x16GetDocumentsResponseV0\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.DocumentsH\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.ResponseMetadata\x1a\x1e\n\tDocuments\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xed\x01\n!GetIdentityByPublicKeyHashRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0H\x00\x1aM\n#GetIdentityByPublicKeyHashRequestV0\x12\x17\n\x0fpublic_key_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xda\x02\n\"GetIdentityByPublicKeyHashResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0H\x00\x1a\xb6\x01\n$GetIdentityByPublicKeyHashResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\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\x08\n\x06resultB\t\n\x07version\"\xfb\x01\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1aU\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\xef\x01\n&WaitForStateTransitionResultResponseV0\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\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x19GetConsensusParamsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0H\x00\x1a<\n\x1bGetConsensusParamsRequestV0\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9c\x04\n\x1aGetConsensusParamsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0H\x00\x1aP\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\x1a\x62\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\x1a\xda\x01\n\x1cGetConsensusParamsResponseV0\x12Y\n\x05\x62lock\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock\x12_\n\x08\x65vidence\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidenceB\t\n\x07version\"\xe4\x01\n%GetProtocolVersionUpgradeStateRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0H\x00\x1a\x38\n\'GetProtocolVersionUpgradeStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n&GetProtocolVersionUpgradeStateResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0H\x00\x1a\x85\x04\n(GetProtocolVersionUpgradeStateResponseV0\x12\x87\x01\n\x08versions\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionsH\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.ResponseMetadata\x1a\x96\x01\n\x08Versions\x12\x89\x01\n\x08versions\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry\x1a:\n\x0cVersionEntry\x12\x16\n\x0eversion_number\x18\x01 \x01(\r\x12\x12\n\nvote_count\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xa3\x02\n*GetProtocolVersionUpgradeVoteStatusRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0H\x00\x1ag\n,GetProtocolVersionUpgradeVoteStatusRequestV0\x12\x19\n\x11start_pro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xef\x05\n+GetProtocolVersionUpgradeVoteStatusResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0H\x00\x1a\xaf\x04\n-GetProtocolVersionUpgradeVoteStatusResponseV0\x12\x98\x01\n\x08versions\x18\x01 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignalsH\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.ResponseMetadata\x1a\xaf\x01\n\x0eVersionSignals\x12\x9c\x01\n\x0fversion_signals\x18\x01 \x03(\x0b\x32\x82\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal\x1a\x35\n\rVersionSignal\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07version\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xf5\x01\n\x14GetEpochsInfoRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0H\x00\x1a|\n\x16GetEpochsInfoRequestV0\x12\x31\n\x0bstart_epoch\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\x11\n\tascending\x18\x03 \x01(\x08\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\x91\x05\n\x15GetEpochsInfoResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0H\x00\x1a\x94\x04\n\x17GetEpochsInfoResponseV0\x12\x65\n\x06\x65pochs\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfosH\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.ResponseMetadata\x1au\n\nEpochInfos\x12g\n\x0b\x65poch_infos\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo\x1a\x9e\x01\n\tEpochInfo\x12\x0e\n\x06number\x18\x01 \x01(\r\x12\x1a\n\x12\x66irst_block_height\x18\x02 \x01(\x04\x12\x1f\n\x17\x66irst_core_block_height\x18\x03 \x01(\r\x12\x12\n\nstart_time\x18\x04 \x01(\x04\x12\x16\n\x0e\x66\x65\x65_multiplier\x18\x05 \x01(\x01\x12\x18\n\x10protocol_version\x18\x06 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xde\x04\n\x1cGetContestedResourcesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0H\x00\x1a\xcc\x03\n\x1eGetContestedResourcesRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x1a\n\x12start_index_values\x18\x04 \x03(\x0c\x12\x18\n\x10\x65nd_index_values\x18\x05 \x03(\x0c\x12\x89\x01\n\x13start_at_value_info\x18\x06 \x01(\x0b\x32g.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1a\x45\n\x10StartAtValueInfo\x12\x13\n\x0bstart_value\x18\x01 \x01(\x0c\x12\x1c\n\x14start_value_included\x18\x02 \x01(\x08\x42\x16\n\x14_start_at_value_infoB\x08\n\x06_countB\t\n\x07version\"\x88\x04\n\x1dGetContestedResourcesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0H\x00\x1a\xf3\x02\n\x1fGetContestedResourcesResponseV0\x12\x95\x01\n\x19\x63ontested_resource_values\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValuesH\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.ResponseMetadata\x1a<\n\x17\x43ontestedResourceValues\x12!\n\x19\x63ontested_resource_values\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xca\x05\n\x1cGetVotePollsByEndDateRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0H\x00\x1a\xb8\x04\n\x1eGetVotePollsByEndDateRequestV0\x12\x84\x01\n\x0fstart_time_info\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfoH\x00\x88\x01\x01\x12\x80\x01\n\rend_time_info\x18\x02 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfoH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x13\n\x06offset\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x11\n\tascending\x18\x05 \x01(\x08\x12\r\n\x05prove\x18\x06 \x01(\x08\x1a\x45\n\x0fStartAtTimeInfo\x12\x15\n\rstart_time_ms\x18\x01 \x01(\x04\x12\x1b\n\x13start_time_included\x18\x02 \x01(\x08\x1a?\n\rEndAtTimeInfo\x12\x13\n\x0b\x65nd_time_ms\x18\x01 \x01(\x04\x12\x19\n\x11\x65nd_time_included\x18\x02 \x01(\x08\x42\x12\n\x10_start_time_infoB\x10\n\x0e_end_time_infoB\x08\n\x06_limitB\t\n\x07_offsetB\t\n\x07version\"\xff\x05\n\x1dGetVotePollsByEndDateResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0H\x00\x1a\xea\x04\n\x1fGetVotePollsByEndDateResponseV0\x12\x9c\x01\n\x18vote_polls_by_timestamps\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestampsH\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.ResponseMetadata\x1aR\n\x1eSerializedVotePollsByTimestamp\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\x1d\n\x15serialized_vote_polls\x18\x02 \x03(\x0c\x1a\xd7\x01\n\x1fSerializedVotePollsByTimestamps\x12\x99\x01\n\x18vote_polls_by_timestamps\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xff\x06\n$GetContestedResourceVoteStateRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0H\x00\x1a\xd5\x05\n&GetContestedResourceVoteStateRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x86\x01\n\x0bresult_type\x18\x05 \x01(\x0e\x32q.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType\x12\x36\n.allow_include_locked_and_abstaining_vote_tally\x18\x06 \x01(\x08\x12\xa3\x01\n\x18start_at_identifier_info\x18\x07 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x08 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\"I\n\nResultType\x12\r\n\tDOCUMENTS\x10\x00\x12\x0e\n\nVOTE_TALLY\x10\x01\x12\x1c\n\x18\x44OCUMENTS_AND_VOTE_TALLY\x10\x02\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\x8c\x0c\n%GetContestedResourceVoteStateResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0H\x00\x1a\xdf\n\n\'GetContestedResourceVoteStateResponseV0\x12\xae\x01\n\x1d\x63ontested_resource_contenders\x18\x01 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContendersH\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.ResponseMetadata\x1a\xd2\x03\n\x10\x46inishedVoteInfo\x12\xad\x01\n\x15\x66inished_vote_outcome\x18\x01 \x01(\x0e\x32\x8d\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome\x12\x1f\n\x12won_by_identity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12 \n\x18\x66inished_at_block_height\x18\x03 \x01(\x04\x12%\n\x1d\x66inished_at_core_block_height\x18\x04 \x01(\r\x12!\n\x19\x66inished_at_block_time_ms\x18\x05 \x01(\x04\x12\x19\n\x11\x66inished_at_epoch\x18\x06 \x01(\r\"O\n\x13\x46inishedVoteOutcome\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\n\n\x06LOCKED\x10\x01\x12\x16\n\x12NO_PREVIOUS_WINNER\x10\x02\x42\x15\n\x13_won_by_identity_id\x1a\xc4\x03\n\x1b\x43ontestedResourceContenders\x12\x86\x01\n\ncontenders\x18\x01 \x03(\x0b\x32r.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender\x12\x1f\n\x12\x61\x62stain_vote_tally\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1c\n\x0flock_vote_tally\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x9a\x01\n\x12\x66inished_vote_info\x18\x04 \x01(\x0b\x32y.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfoH\x02\x88\x01\x01\x42\x15\n\x13_abstain_vote_tallyB\x12\n\x10_lock_vote_tallyB\x15\n\x13_finished_vote_info\x1ak\n\tContender\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x17\n\nvote_count\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x15\n\x08\x64ocument\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x42\r\n\x0b_vote_countB\x0b\n\t_documentB\x08\n\x06resultB\t\n\x07version\"\xd5\x05\n,GetContestedResourceVotersForIdentityRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0H\x00\x1a\x92\x04\n.GetContestedResourceVotersForIdentityRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x15\n\rcontestant_id\x18\x05 \x01(\x0c\x12\xb4\x01\n\x18start_at_identifier_info\x18\x06 \x01(\x0b\x32\x8c\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\xf1\x04\n-GetContestedResourceVotersForIdentityResponse\x12\x86\x01\n\x02v0\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0H\x00\x1a\xab\x03\n/GetContestedResourceVotersForIdentityResponseV0\x12\xb6\x01\n\x19\x63ontested_resource_voters\x18\x01 \x01(\x0b\x32\x90\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVotersH\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.ResponseMetadata\x1a\x43\n\x17\x43ontestedResourceVoters\x12\x0e\n\x06voters\x18\x01 \x03(\x0c\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xad\x05\n(GetContestedResourceIdentityVotesRequest\x12|\n\x02v0\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0H\x00\x1a\xf7\x03\n*GetContestedResourceIdentityVotesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0forder_ascending\x18\x04 \x01(\x08\x12\xae\x01\n\x1astart_at_vote_poll_id_info\x18\x05 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfoH\x00\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x1a\x61\n\x15StartAtVotePollIdInfo\x12 \n\x18start_at_poll_identifier\x18\x01 \x01(\x0c\x12&\n\x1estart_poll_identifier_included\x18\x02 \x01(\x08\x42\x1d\n\x1b_start_at_vote_poll_id_infoB\t\n\x07version\"\xc8\n\n)GetContestedResourceIdentityVotesResponse\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0H\x00\x1a\x8f\t\n+GetContestedResourceIdentityVotesResponseV0\x12\xa1\x01\n\x05votes\x18\x01 \x01(\x0b\x32\x8f\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotesH\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.ResponseMetadata\x1a\xf7\x01\n\x1e\x43ontestedResourceIdentityVotes\x12\xba\x01\n!contested_resource_identity_votes\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x1a\xad\x02\n\x12ResourceVoteChoice\x12\xad\x01\n\x10vote_choice_type\x18\x01 \x01(\x0e\x32\x92\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType\x12\x18\n\x0bidentity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\"=\n\x0eVoteChoiceType\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\x0b\n\x07\x41\x42STAIN\x10\x01\x12\x08\n\x04LOCK\x10\x02\x42\x0e\n\x0c_identity_id\x1a\x95\x02\n\x1d\x43ontestedResourceIdentityVote\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\'\n\x1fserialized_index_storage_values\x18\x03 \x03(\x0c\x12\x99\x01\n\x0bvote_choice\x18\x04 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoiceB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n%GetPrefundedSpecializedBalanceRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0H\x00\x1a\x44\n\'GetPrefundedSpecializedBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xe9\x02\n&GetPrefundedSpecializedBalanceResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0H\x00\x1a\xb9\x01\n(GetPrefundedSpecializedBalanceResponseV0\x12\x11\n\x07\x62\x61lance\x18\x01 \x01(\x04H\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\x08\n\x06resultB\t\n\x07version\"\xd0\x01\n GetTotalCreditsInPlatformRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0H\x00\x1a\x33\n\"GetTotalCreditsInPlatformRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xd5\x02\n!GetTotalCreditsInPlatformResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0H\x00\x1a\xb4\x01\n#GetTotalCreditsInPlatformResponseV0\x12\x11\n\x07\x63redits\x18\x01 \x01(\x04H\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\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x16GetPathElementsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0H\x00\x1a\x45\n\x18GetPathElementsRequestV0\x12\x0c\n\x04path\x18\x01 \x03(\x0c\x12\x0c\n\x04keys\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xa3\x03\n\x17GetPathElementsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0H\x00\x1a\xa0\x02\n\x19GetPathElementsResponseV0\x12i\n\x08\x65lements\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.ElementsH\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.ResponseMetadata\x1a\x1c\n\x08\x45lements\x12\x10\n\x08\x65lements\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\x81\x01\n\x10GetStatusRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0H\x00\x1a\x14\n\x12GetStatusRequestV0B\t\n\x07version\"\x9c\x10\n\x11GetStatusResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0H\x00\x1a\xab\x0f\n\x13GetStatusResponseV0\x12Y\n\x07version\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version\x12S\n\x04node\x18\x02 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node\x12U\n\x05\x63hain\x18\x03 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain\x12Y\n\x07network\x18\x04 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network\x12^\n\nstate_sync\x18\x05 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync\x12S\n\x04time\x18\x06 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time\x1a\xee\x04\n\x07Version\x12\x63\n\x08software\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software\x12\x63\n\x08protocol\x18\x02 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol\x1a^\n\x08Software\x12\x0c\n\x04\x64\x61pi\x18\x01 \x01(\t\x12\x12\n\x05\x64rive\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntenderdash\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_driveB\r\n\x0b_tenderdash\x1a\xb8\x02\n\x08Protocol\x12p\n\ntenderdash\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash\x12\x66\n\x05\x64rive\x18\x02 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive\x1a(\n\nTenderdash\x12\x0b\n\x03p2p\x18\x01 \x01(\r\x12\r\n\x05\x62lock\x18\x02 \x01(\r\x1a(\n\x05\x44rive\x12\x0e\n\x06latest\x18\x03 \x01(\r\x12\x0f\n\x07\x63urrent\x18\x04 \x01(\r\x1as\n\x04Time\x12\r\n\x05local\x18\x01 \x01(\x04\x12\x12\n\x05\x62lock\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07genesis\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x12\n\x05\x65poch\x18\x04 \x01(\rH\x02\x88\x01\x01\x42\x08\n\x06_blockB\n\n\x08_genesisB\x08\n\x06_epoch\x1a<\n\x04Node\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x18\n\x0bpro_tx_hash\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0e\n\x0c_pro_tx_hash\x1a\xa7\x02\n\x05\x43hain\x12\x13\n\x0b\x63\x61tching_up\x18\x01 \x01(\x08\x12\x19\n\x11latest_block_hash\x18\x02 \x01(\x0c\x12\x17\n\x0flatest_app_hash\x18\x03 \x01(\x0c\x12\x1b\n\x13latest_block_height\x18\x04 \x01(\x04\x12\x1b\n\x13\x65\x61rliest_block_hash\x18\x05 \x01(\x0c\x12\x19\n\x11\x65\x61rliest_app_hash\x18\x06 \x01(\x0c\x12\x1d\n\x15\x65\x61rliest_block_height\x18\x07 \x01(\x04\x12\x1d\n\x15max_peer_block_height\x18\t \x01(\x04\x12%\n\x18\x63ore_chain_locked_height\x18\n \x01(\rH\x00\x88\x01\x01\x42\x1b\n\x19_core_chain_locked_height\x1a\x43\n\x07Network\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\t\x12\x13\n\x0bpeers_count\x18\x02 \x01(\r\x12\x11\n\tlistening\x18\x03 \x01(\x08\x1a\xe9\x01\n\tStateSync\x12\x19\n\x11total_synced_time\x18\x01 \x01(\x04\x12\x16\n\x0eremaining_time\x18\x02 \x01(\x04\x12\x17\n\x0ftotal_snapshots\x18\x03 \x01(\r\x12\x1e\n\x16\x63hunk_process_avg_time\x18\x04 \x01(\x04\x12\x17\n\x0fsnapshot_height\x18\x05 \x01(\x04\x12\x1d\n\x15snapshot_chunks_count\x18\x06 \x01(\x04\x12\x19\n\x11\x62\x61\x63kfilled_blocks\x18\x07 \x01(\x04\x12\x1d\n\x15\x62\x61\x63kfill_blocks_total\x18\x08 \x01(\x04\x42\t\n\x07version*Z\n\nKeyPurpose\x12\x12\n\x0e\x41UTHENTICATION\x10\x00\x12\x0e\n\nENCRYPTION\x10\x01\x12\x0e\n\nDECRYPTION\x10\x02\x12\x0c\n\x08TRANSFER\x10\x03\x12\n\n\x06VOTING\x10\x05\x32\x97#\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\x0fgetIdentityKeys\x12\x31.org.dash.platform.dapi.v0.GetIdentityKeysRequest\x1a\x32.org.dash.platform.dapi.v0.GetIdentityKeysResponse\x12\x96\x01\n\x19getIdentitiesContractKeys\x12;.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest\x1a<.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse\x12{\n\x10getIdentityNonce\x12\x32.org.dash.platform.dapi.v0.GetIdentityNonceRequest\x1a\x33.org.dash.platform.dapi.v0.GetIdentityNonceResponse\x12\x93\x01\n\x18getIdentityContractNonce\x12:.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse\x12\x81\x01\n\x12getIdentityBalance\x12\x34.org.dash.platform.dapi.v0.GetIdentityBalanceRequest\x1a\x35.org.dash.platform.dapi.v0.GetIdentityBalanceResponse\x12\x8a\x01\n\x15getIdentitiesBalances\x12\x37.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse\x12\xa2\x01\n\x1dgetIdentityBalanceAndRevision\x12?.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest\x1a@.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse\x12\xaf\x01\n#getEvonodesProposedEpochBlocksByIds\x12\x45.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\xb3\x01\n%getEvonodesProposedEpochBlocksByRange\x12G.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\x66\n\tgetProofs\x12+.org.dash.platform.dapi.v0.GetProofsRequest\x1a,.org.dash.platform.dapi.v0.GetProofsResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12\x8d\x01\n\x16getDataContractHistory\x12\x38.org.dash.platform.dapi.v0.GetDataContractHistoryRequest\x1a\x39.org.dash.platform.dapi.v0.GetDataContractHistoryResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\x99\x01\n\x1agetIdentityByPublicKeyHash\x12<.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest\x1a=.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse\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.GetConsensusParamsResponse\x12\xa5\x01\n\x1egetProtocolVersionUpgradeState\x12@.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest\x1a\x41.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse\x12\xb4\x01\n#getProtocolVersionUpgradeVoteStatus\x12\x45.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest\x1a\x46.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse\x12r\n\rgetEpochsInfo\x12/.org.dash.platform.dapi.v0.GetEpochsInfoRequest\x1a\x30.org.dash.platform.dapi.v0.GetEpochsInfoResponse\x12\x8a\x01\n\x15getContestedResources\x12\x37.org.dash.platform.dapi.v0.GetContestedResourcesRequest\x1a\x38.org.dash.platform.dapi.v0.GetContestedResourcesResponse\x12\xa2\x01\n\x1dgetContestedResourceVoteState\x12?.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest\x1a@.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse\x12\xba\x01\n%getContestedResourceVotersForIdentity\x12G.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest\x1aH.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse\x12\xae\x01\n!getContestedResourceIdentityVotes\x12\x43.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest\x1a\x44.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse\x12\x8a\x01\n\x15getVotePollsByEndDate\x12\x37.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest\x1a\x38.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse\x12\xa5\x01\n\x1egetPrefundedSpecializedBalance\x12@.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest\x1a\x41.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse\x12\x96\x01\n\x19getTotalCreditsInPlatform\x12;.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest\x1a<.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse\x12x\n\x0fgetPathElements\x12\x31.org.dash.platform.dapi.v0.GetPathElementsRequest\x1a\x32.org.dash.platform.dapi.v0.GetPathElementsResponse\x12\x66\n\tgetStatus\x12+.org.dash.platform.dapi.v0.GetStatusRequest\x1a,.org.dash.platform.dapi.v0.GetStatusResponseb\x06proto3' + serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x81\x01\n\x05Proof\x12\x15\n\rgrovedb_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\x12\x15\n\rblock_id_hash\x18\x05 \x01(\x0c\x12\x13\n\x0bquorum_type\x18\x06 \x01(\r\"\x90\x01\n\x10ResponseMetadata\x12\x0e\n\x06height\x18\x01 \x01(\x04\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\r\n\x05\x65poch\x18\x03 \x01(\r\x12\x0f\n\x07time_ms\x18\x04 \x01(\x04\x12\x18\n\x10protocol_version\x18\x05 \x01(\r\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\t\"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\"\xa4\x01\n\x12GetIdentityRequest\x12P\n\x02v0\x18\x01 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0H\x00\x1a\x31\n\x14GetIdentityRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xc1\x01\n\x17GetIdentityNonceRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0H\x00\x1a?\n\x19GetIdentityNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf6\x01\n\x1fGetIdentityContractNonceRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0H\x00\x1a\\\n!GetIdentityContractNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xc0\x01\n\x19GetIdentityBalanceRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0H\x00\x1a\x38\n\x1bGetIdentityBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xec\x01\n$GetIdentityBalanceAndRevisionRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0H\x00\x1a\x43\n&GetIdentityBalanceAndRevisionRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9e\x02\n\x13GetIdentityResponse\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0H\x00\x1a\xa7\x01\n\x15GetIdentityResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\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\x08\n\x06resultB\t\n\x07version\"\xb8\x02\n\x18GetIdentityNonceResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0H\x00\x1a\xb2\x01\n\x1aGetIdentityNonceResponseV0\x12\x18\n\x0eidentity_nonce\x18\x01 \x01(\x04H\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\x08\n\x06resultB\t\n\x07version\"\xe1\x02\n GetIdentityContractNonceResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0H\x00\x1a\xc3\x01\n\"GetIdentityContractNonceResponseV0\x12!\n\x17identity_contract_nonce\x18\x01 \x01(\x04H\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\x08\n\x06resultB\t\n\x07version\"\xb9\x02\n\x1aGetIdentityBalanceResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0H\x00\x1a\xad\x01\n\x1cGetIdentityBalanceResponseV0\x12\x11\n\x07\x62\x61lance\x18\x01 \x01(\x04H\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\x08\n\x06resultB\t\n\x07version\"\xa9\x04\n%GetIdentityBalanceAndRevisionResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0H\x00\x1a\xfc\x02\n\'GetIdentityBalanceAndRevisionResponseV0\x12\x9b\x01\n\x14\x62\x61lance_and_revision\x18\x01 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevisionH\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.ResponseMetadata\x1a\x37\n\x12\x42\x61lanceAndRevision\x12\x0f\n\x07\x62\x61lance\x18\x01 \x01(\x04\x12\x10\n\x08revision\x18\x02 \x01(\x04\x42\x08\n\x06resultB\t\n\x07version\"\xd1\x01\n\x0eKeyRequestType\x12\x36\n\x08\x61ll_keys\x18\x01 \x01(\x0b\x32\".org.dash.platform.dapi.v0.AllKeysH\x00\x12@\n\rspecific_keys\x18\x02 \x01(\x0b\x32\'.org.dash.platform.dapi.v0.SpecificKeysH\x00\x12:\n\nsearch_key\x18\x03 \x01(\x0b\x32$.org.dash.platform.dapi.v0.SearchKeyH\x00\x42\t\n\x07request\"\t\n\x07\x41llKeys\"\x1f\n\x0cSpecificKeys\x12\x0f\n\x07key_ids\x18\x01 \x03(\r\"\xb6\x01\n\tSearchKey\x12I\n\x0bpurpose_map\x18\x01 \x03(\x0b\x32\x34.org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry\x1a^\n\x0fPurposeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.SecurityLevelMap:\x02\x38\x01\"\xbf\x02\n\x10SecurityLevelMap\x12]\n\x12security_level_map\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry\x1aw\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12M\n\x05value\x18\x02 \x01(\x0e\x32>.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"S\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\x12\x1c\n\x18\x41LL_KEYS_OF_KIND_REQUEST\x10\x01\"\xda\x02\n\x16GetIdentityKeysRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0H\x00\x1a\xda\x01\n\x18GetIdentityKeysRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\x99\x03\n\x17GetIdentityKeysResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0H\x00\x1a\x96\x02\n\x19GetIdentityKeysResponseV0\x12\x61\n\x04keys\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.KeysH\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.ResponseMetadata\x1a\x1a\n\x04Keys\x12\x12\n\nkeys_bytes\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xef\x02\n GetIdentitiesContractKeysRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0H\x00\x1a\xd1\x01\n\"GetIdentitiesContractKeysRequestV0\x12\x16\n\x0eidentities_ids\x18\x01 \x03(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\x1f\n\x12\x64ocument_type_name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x08purposes\x18\x04 \x03(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x15\n\x13_document_type_nameB\t\n\x07version\"\xdf\x06\n!GetIdentitiesContractKeysResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0H\x00\x1a\xbe\x05\n#GetIdentitiesContractKeysResponseV0\x12\x8a\x01\n\x0fidentities_keys\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeysH\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.ResponseMetadata\x1aY\n\x0bPurposeKeys\x12\x36\n\x07purpose\x18\x01 \x01(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\x12\n\nkeys_bytes\x18\x02 \x03(\x0c\x1a\x9f\x01\n\x0cIdentityKeys\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12z\n\x04keys\x18\x02 \x03(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys\x1a\x90\x01\n\x0eIdentitiesKeys\x12~\n\x07\x65ntries\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeysB\x08\n\x06resultB\t\n\x07version\"\xa4\x02\n*GetEvonodesProposedEpochBlocksByIdsRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0H\x00\x1ah\n,GetEvonodesProposedEpochBlocksByIdsRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\x08\n\x06_epochB\t\n\x07version\"\x8e\x06\n&GetEvonodesProposedEpochBlocksResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0H\x00\x1a\xde\x04\n(GetEvonodesProposedEpochBlocksResponseV0\x12\xb1\x01\n#evonodes_proposed_block_counts_info\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocksH\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.ResponseMetadata\x1a;\n\x15\x45vonodeProposedBlocks\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\x04\x1a\xc4\x01\n\x16\x45vonodesProposedBlocks\x12\xa9\x01\n\x1e\x65vonodes_proposed_block_counts\x18\x01 \x03(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocksB\x08\n\x06resultB\t\n\x07version\"\xf2\x02\n,GetEvonodesProposedEpochBlocksByRangeRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0H\x00\x1a\xaf\x01\n.GetEvonodesProposedEpochBlocksByRangeRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x02 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x04 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_epochB\x08\n\x06_limitB\t\n\x07version\"\xcd\x01\n\x1cGetIdentitiesBalancesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0H\x00\x1a<\n\x1eGetIdentitiesBalancesRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9b\x05\n\x1dGetIdentitiesBalancesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0H\x00\x1a\x86\x04\n\x1fGetIdentitiesBalancesResponseV0\x12\x8a\x01\n\x13identities_balances\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalancesH\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.ResponseMetadata\x1aH\n\x0fIdentityBalance\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x8f\x01\n\x12IdentitiesBalances\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalanceB\x08\n\x06resultB\t\n\x07version\"\xcb\x0b\n\x10GetProofsRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0H\x00\x1a\xdd\n\n\x12GetProofsRequestV0\x12\x62\n\nidentities\x18\x01 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest\x12\x61\n\tcontracts\x18\x02 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest\x12\x61\n\tdocuments\x18\x03 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest\x12_\n\x05votes\x18\x04 \x03(\x0b\x32P.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest\x1a\xd5\x02\n\x0f\x44ocumentRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12#\n\x1b\x64ocument_type_keeps_history\x18\x03 \x01(\x08\x12\x13\n\x0b\x64ocument_id\x18\x04 \x01(\x0c\x12\x89\x01\n\x19\x64ocument_contested_status\x18\x05 \x01(\x0e\x32\x66.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus\"P\n\x17\x44ocumentContestedStatus\x12\x11\n\rNOT_CONTESTED\x10\x00\x12\x13\n\x0fMAYBE_CONTESTED\x10\x01\x12\r\n\tCONTESTED\x10\x02\x1a\xd1\x01\n\x0fIdentityRequest\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12i\n\x0crequest_type\x18\x02 \x01(\x0e\x32S.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type\">\n\x04Type\x12\x11\n\rFULL_IDENTITY\x10\x00\x12\x0b\n\x07\x42\x41LANCE\x10\x01\x12\x08\n\x04KEYS\x10\x02\x12\x0c\n\x08REVISION\x10\x03\x1a&\n\x0f\x43ontractRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x1a\xe7\x02\n\x11VoteStatusRequest\x12\xa5\x01\n&contested_resource_vote_status_request\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequestH\x00\x1a\x99\x01\n\"ContestedResourceVoteStatusRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x18\n\x10voter_identifier\x18\x05 \x01(\x0c\x42\x0e\n\x0crequest_typeB\t\n\x07version\"\x82\x02\n\x11GetProofsResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0H\x00\x1a\x91\x01\n\x13GetProofsResponseV0\x12\x31\n\x05proof\x18\x01 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb4\x01\n\x16GetDataContractRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0H\x00\x1a\x35\n\x18GetDataContractRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb3\x02\n\x17GetDataContractResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0H\x00\x1a\xb0\x01\n\x19GetDataContractResponseV0\x12\x17\n\rdata_contract\x18\x01 \x01(\x0cH\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\x08\n\x06resultB\t\n\x07version\"\xb9\x01\n\x17GetDataContractsRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0H\x00\x1a\x37\n\x19GetDataContractsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xcf\x04\n\x18GetDataContractsResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0H\x00\x1a[\n\x11\x44\x61taContractEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x32\n\rdata_contract\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x1au\n\rDataContracts\x12\x64\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry\x1a\xf5\x01\n\x1aGetDataContractsResponseV0\x12[\n\x0e\x64\x61ta_contracts\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractsH\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\x08\n\x06resultB\t\n\x07version\"\xc1\x02\n\x1dGetDataContractHistoryRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0H\x00\x1a\xac\x01\n\x1fGetDataContractHistoryRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x13\n\x0bstart_at_ms\x18\x04 \x01(\x04\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xae\x05\n\x1eGetDataContractHistoryResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0H\x00\x1a\x96\x04\n GetDataContractHistoryResponseV0\x12\x8f\x01\n\x15\x64\x61ta_contract_history\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryH\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.ResponseMetadata\x1a\x37\n\x18\x44\x61taContractHistoryEntry\x12\x0c\n\x04\x64\x61te\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\xaa\x01\n\x13\x44\x61taContractHistory\x12\x92\x01\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32s.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntryB\x08\n\x06resultB\t\n\x07version\"\xb2\x02\n\x13GetDocumentsRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0H\x00\x1a\xbb\x01\n\x15GetDocumentsRequestV0\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(\x0cH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05startB\t\n\x07version\"\x95\x03\n\x14GetDocumentsResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0H\x00\x1a\x9b\x02\n\x16GetDocumentsResponseV0\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.DocumentsH\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.ResponseMetadata\x1a\x1e\n\tDocuments\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xed\x01\n!GetIdentityByPublicKeyHashRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0H\x00\x1aM\n#GetIdentityByPublicKeyHashRequestV0\x12\x17\n\x0fpublic_key_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xda\x02\n\"GetIdentityByPublicKeyHashResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0H\x00\x1a\xb6\x01\n$GetIdentityByPublicKeyHashResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\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\x08\n\x06resultB\t\n\x07version\"\xfb\x01\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1aU\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\xef\x01\n&WaitForStateTransitionResultResponseV0\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\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x19GetConsensusParamsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0H\x00\x1a<\n\x1bGetConsensusParamsRequestV0\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9c\x04\n\x1aGetConsensusParamsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0H\x00\x1aP\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\x1a\x62\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\x1a\xda\x01\n\x1cGetConsensusParamsResponseV0\x12Y\n\x05\x62lock\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock\x12_\n\x08\x65vidence\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidenceB\t\n\x07version\"\xe4\x01\n%GetProtocolVersionUpgradeStateRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0H\x00\x1a\x38\n\'GetProtocolVersionUpgradeStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n&GetProtocolVersionUpgradeStateResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0H\x00\x1a\x85\x04\n(GetProtocolVersionUpgradeStateResponseV0\x12\x87\x01\n\x08versions\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionsH\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.ResponseMetadata\x1a\x96\x01\n\x08Versions\x12\x89\x01\n\x08versions\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry\x1a:\n\x0cVersionEntry\x12\x16\n\x0eversion_number\x18\x01 \x01(\r\x12\x12\n\nvote_count\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xa3\x02\n*GetProtocolVersionUpgradeVoteStatusRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0H\x00\x1ag\n,GetProtocolVersionUpgradeVoteStatusRequestV0\x12\x19\n\x11start_pro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xef\x05\n+GetProtocolVersionUpgradeVoteStatusResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0H\x00\x1a\xaf\x04\n-GetProtocolVersionUpgradeVoteStatusResponseV0\x12\x98\x01\n\x08versions\x18\x01 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignalsH\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.ResponseMetadata\x1a\xaf\x01\n\x0eVersionSignals\x12\x9c\x01\n\x0fversion_signals\x18\x01 \x03(\x0b\x32\x82\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal\x1a\x35\n\rVersionSignal\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07version\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xf5\x01\n\x14GetEpochsInfoRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0H\x00\x1a|\n\x16GetEpochsInfoRequestV0\x12\x31\n\x0bstart_epoch\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\x11\n\tascending\x18\x03 \x01(\x08\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\x91\x05\n\x15GetEpochsInfoResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0H\x00\x1a\x94\x04\n\x17GetEpochsInfoResponseV0\x12\x65\n\x06\x65pochs\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfosH\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.ResponseMetadata\x1au\n\nEpochInfos\x12g\n\x0b\x65poch_infos\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo\x1a\x9e\x01\n\tEpochInfo\x12\x0e\n\x06number\x18\x01 \x01(\r\x12\x1a\n\x12\x66irst_block_height\x18\x02 \x01(\x04\x12\x1f\n\x17\x66irst_core_block_height\x18\x03 \x01(\r\x12\x12\n\nstart_time\x18\x04 \x01(\x04\x12\x16\n\x0e\x66\x65\x65_multiplier\x18\x05 \x01(\x01\x12\x18\n\x10protocol_version\x18\x06 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xde\x04\n\x1cGetContestedResourcesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0H\x00\x1a\xcc\x03\n\x1eGetContestedResourcesRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x1a\n\x12start_index_values\x18\x04 \x03(\x0c\x12\x18\n\x10\x65nd_index_values\x18\x05 \x03(\x0c\x12\x89\x01\n\x13start_at_value_info\x18\x06 \x01(\x0b\x32g.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1a\x45\n\x10StartAtValueInfo\x12\x13\n\x0bstart_value\x18\x01 \x01(\x0c\x12\x1c\n\x14start_value_included\x18\x02 \x01(\x08\x42\x16\n\x14_start_at_value_infoB\x08\n\x06_countB\t\n\x07version\"\x88\x04\n\x1dGetContestedResourcesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0H\x00\x1a\xf3\x02\n\x1fGetContestedResourcesResponseV0\x12\x95\x01\n\x19\x63ontested_resource_values\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValuesH\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.ResponseMetadata\x1a<\n\x17\x43ontestedResourceValues\x12!\n\x19\x63ontested_resource_values\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xca\x05\n\x1cGetVotePollsByEndDateRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0H\x00\x1a\xb8\x04\n\x1eGetVotePollsByEndDateRequestV0\x12\x84\x01\n\x0fstart_time_info\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfoH\x00\x88\x01\x01\x12\x80\x01\n\rend_time_info\x18\x02 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfoH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x13\n\x06offset\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x11\n\tascending\x18\x05 \x01(\x08\x12\r\n\x05prove\x18\x06 \x01(\x08\x1a\x45\n\x0fStartAtTimeInfo\x12\x15\n\rstart_time_ms\x18\x01 \x01(\x04\x12\x1b\n\x13start_time_included\x18\x02 \x01(\x08\x1a?\n\rEndAtTimeInfo\x12\x13\n\x0b\x65nd_time_ms\x18\x01 \x01(\x04\x12\x19\n\x11\x65nd_time_included\x18\x02 \x01(\x08\x42\x12\n\x10_start_time_infoB\x10\n\x0e_end_time_infoB\x08\n\x06_limitB\t\n\x07_offsetB\t\n\x07version\"\xff\x05\n\x1dGetVotePollsByEndDateResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0H\x00\x1a\xea\x04\n\x1fGetVotePollsByEndDateResponseV0\x12\x9c\x01\n\x18vote_polls_by_timestamps\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestampsH\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.ResponseMetadata\x1aR\n\x1eSerializedVotePollsByTimestamp\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\x1d\n\x15serialized_vote_polls\x18\x02 \x03(\x0c\x1a\xd7\x01\n\x1fSerializedVotePollsByTimestamps\x12\x99\x01\n\x18vote_polls_by_timestamps\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xff\x06\n$GetContestedResourceVoteStateRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0H\x00\x1a\xd5\x05\n&GetContestedResourceVoteStateRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x86\x01\n\x0bresult_type\x18\x05 \x01(\x0e\x32q.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType\x12\x36\n.allow_include_locked_and_abstaining_vote_tally\x18\x06 \x01(\x08\x12\xa3\x01\n\x18start_at_identifier_info\x18\x07 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x08 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\"I\n\nResultType\x12\r\n\tDOCUMENTS\x10\x00\x12\x0e\n\nVOTE_TALLY\x10\x01\x12\x1c\n\x18\x44OCUMENTS_AND_VOTE_TALLY\x10\x02\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\x8c\x0c\n%GetContestedResourceVoteStateResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0H\x00\x1a\xdf\n\n\'GetContestedResourceVoteStateResponseV0\x12\xae\x01\n\x1d\x63ontested_resource_contenders\x18\x01 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContendersH\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.ResponseMetadata\x1a\xd2\x03\n\x10\x46inishedVoteInfo\x12\xad\x01\n\x15\x66inished_vote_outcome\x18\x01 \x01(\x0e\x32\x8d\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome\x12\x1f\n\x12won_by_identity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12 \n\x18\x66inished_at_block_height\x18\x03 \x01(\x04\x12%\n\x1d\x66inished_at_core_block_height\x18\x04 \x01(\r\x12!\n\x19\x66inished_at_block_time_ms\x18\x05 \x01(\x04\x12\x19\n\x11\x66inished_at_epoch\x18\x06 \x01(\r\"O\n\x13\x46inishedVoteOutcome\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\n\n\x06LOCKED\x10\x01\x12\x16\n\x12NO_PREVIOUS_WINNER\x10\x02\x42\x15\n\x13_won_by_identity_id\x1a\xc4\x03\n\x1b\x43ontestedResourceContenders\x12\x86\x01\n\ncontenders\x18\x01 \x03(\x0b\x32r.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender\x12\x1f\n\x12\x61\x62stain_vote_tally\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1c\n\x0flock_vote_tally\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x9a\x01\n\x12\x66inished_vote_info\x18\x04 \x01(\x0b\x32y.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfoH\x02\x88\x01\x01\x42\x15\n\x13_abstain_vote_tallyB\x12\n\x10_lock_vote_tallyB\x15\n\x13_finished_vote_info\x1ak\n\tContender\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x17\n\nvote_count\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x15\n\x08\x64ocument\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x42\r\n\x0b_vote_countB\x0b\n\t_documentB\x08\n\x06resultB\t\n\x07version\"\xd5\x05\n,GetContestedResourceVotersForIdentityRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0H\x00\x1a\x92\x04\n.GetContestedResourceVotersForIdentityRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x15\n\rcontestant_id\x18\x05 \x01(\x0c\x12\xb4\x01\n\x18start_at_identifier_info\x18\x06 \x01(\x0b\x32\x8c\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\xf1\x04\n-GetContestedResourceVotersForIdentityResponse\x12\x86\x01\n\x02v0\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0H\x00\x1a\xab\x03\n/GetContestedResourceVotersForIdentityResponseV0\x12\xb6\x01\n\x19\x63ontested_resource_voters\x18\x01 \x01(\x0b\x32\x90\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVotersH\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.ResponseMetadata\x1a\x43\n\x17\x43ontestedResourceVoters\x12\x0e\n\x06voters\x18\x01 \x03(\x0c\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xad\x05\n(GetContestedResourceIdentityVotesRequest\x12|\n\x02v0\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0H\x00\x1a\xf7\x03\n*GetContestedResourceIdentityVotesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0forder_ascending\x18\x04 \x01(\x08\x12\xae\x01\n\x1astart_at_vote_poll_id_info\x18\x05 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfoH\x00\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x1a\x61\n\x15StartAtVotePollIdInfo\x12 \n\x18start_at_poll_identifier\x18\x01 \x01(\x0c\x12&\n\x1estart_poll_identifier_included\x18\x02 \x01(\x08\x42\x1d\n\x1b_start_at_vote_poll_id_infoB\t\n\x07version\"\xc8\n\n)GetContestedResourceIdentityVotesResponse\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0H\x00\x1a\x8f\t\n+GetContestedResourceIdentityVotesResponseV0\x12\xa1\x01\n\x05votes\x18\x01 \x01(\x0b\x32\x8f\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotesH\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.ResponseMetadata\x1a\xf7\x01\n\x1e\x43ontestedResourceIdentityVotes\x12\xba\x01\n!contested_resource_identity_votes\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x1a\xad\x02\n\x12ResourceVoteChoice\x12\xad\x01\n\x10vote_choice_type\x18\x01 \x01(\x0e\x32\x92\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType\x12\x18\n\x0bidentity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\"=\n\x0eVoteChoiceType\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\x0b\n\x07\x41\x42STAIN\x10\x01\x12\x08\n\x04LOCK\x10\x02\x42\x0e\n\x0c_identity_id\x1a\x95\x02\n\x1d\x43ontestedResourceIdentityVote\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\'\n\x1fserialized_index_storage_values\x18\x03 \x03(\x0c\x12\x99\x01\n\x0bvote_choice\x18\x04 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoiceB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n%GetPrefundedSpecializedBalanceRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0H\x00\x1a\x44\n\'GetPrefundedSpecializedBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xe9\x02\n&GetPrefundedSpecializedBalanceResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0H\x00\x1a\xb9\x01\n(GetPrefundedSpecializedBalanceResponseV0\x12\x11\n\x07\x62\x61lance\x18\x01 \x01(\x04H\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\x08\n\x06resultB\t\n\x07version\"\xd0\x01\n GetTotalCreditsInPlatformRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0H\x00\x1a\x33\n\"GetTotalCreditsInPlatformRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xd5\x02\n!GetTotalCreditsInPlatformResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0H\x00\x1a\xb4\x01\n#GetTotalCreditsInPlatformResponseV0\x12\x11\n\x07\x63redits\x18\x01 \x01(\x04H\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\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x16GetPathElementsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0H\x00\x1a\x45\n\x18GetPathElementsRequestV0\x12\x0c\n\x04path\x18\x01 \x03(\x0c\x12\x0c\n\x04keys\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xa3\x03\n\x17GetPathElementsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0H\x00\x1a\xa0\x02\n\x19GetPathElementsResponseV0\x12i\n\x08\x65lements\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.ElementsH\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.ResponseMetadata\x1a\x1c\n\x08\x45lements\x12\x10\n\x08\x65lements\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\x81\x01\n\x10GetStatusRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0H\x00\x1a\x14\n\x12GetStatusRequestV0B\t\n\x07version\"\x9c\x10\n\x11GetStatusResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0H\x00\x1a\xab\x0f\n\x13GetStatusResponseV0\x12Y\n\x07version\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version\x12S\n\x04node\x18\x02 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node\x12U\n\x05\x63hain\x18\x03 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain\x12Y\n\x07network\x18\x04 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network\x12^\n\nstate_sync\x18\x05 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync\x12S\n\x04time\x18\x06 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time\x1a\xee\x04\n\x07Version\x12\x63\n\x08software\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software\x12\x63\n\x08protocol\x18\x02 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol\x1a^\n\x08Software\x12\x0c\n\x04\x64\x61pi\x18\x01 \x01(\t\x12\x12\n\x05\x64rive\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntenderdash\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_driveB\r\n\x0b_tenderdash\x1a\xb8\x02\n\x08Protocol\x12p\n\ntenderdash\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash\x12\x66\n\x05\x64rive\x18\x02 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive\x1a(\n\nTenderdash\x12\x0b\n\x03p2p\x18\x01 \x01(\r\x12\r\n\x05\x62lock\x18\x02 \x01(\r\x1a(\n\x05\x44rive\x12\x0e\n\x06latest\x18\x03 \x01(\r\x12\x0f\n\x07\x63urrent\x18\x04 \x01(\r\x1as\n\x04Time\x12\r\n\x05local\x18\x01 \x01(\x04\x12\x12\n\x05\x62lock\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07genesis\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x12\n\x05\x65poch\x18\x04 \x01(\rH\x02\x88\x01\x01\x42\x08\n\x06_blockB\n\n\x08_genesisB\x08\n\x06_epoch\x1a<\n\x04Node\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x18\n\x0bpro_tx_hash\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0e\n\x0c_pro_tx_hash\x1a\xa7\x02\n\x05\x43hain\x12\x13\n\x0b\x63\x61tching_up\x18\x01 \x01(\x08\x12\x19\n\x11latest_block_hash\x18\x02 \x01(\x0c\x12\x17\n\x0flatest_app_hash\x18\x03 \x01(\x0c\x12\x1b\n\x13latest_block_height\x18\x04 \x01(\x04\x12\x1b\n\x13\x65\x61rliest_block_hash\x18\x05 \x01(\x0c\x12\x19\n\x11\x65\x61rliest_app_hash\x18\x06 \x01(\x0c\x12\x1d\n\x15\x65\x61rliest_block_height\x18\x07 \x01(\x04\x12\x1d\n\x15max_peer_block_height\x18\t \x01(\x04\x12%\n\x18\x63ore_chain_locked_height\x18\n \x01(\rH\x00\x88\x01\x01\x42\x1b\n\x19_core_chain_locked_height\x1a\x43\n\x07Network\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\t\x12\x13\n\x0bpeers_count\x18\x02 \x01(\r\x12\x11\n\tlistening\x18\x03 \x01(\x08\x1a\xe9\x01\n\tStateSync\x12\x19\n\x11total_synced_time\x18\x01 \x01(\x04\x12\x16\n\x0eremaining_time\x18\x02 \x01(\x04\x12\x17\n\x0ftotal_snapshots\x18\x03 \x01(\r\x12\x1e\n\x16\x63hunk_process_avg_time\x18\x04 \x01(\x04\x12\x17\n\x0fsnapshot_height\x18\x05 \x01(\x04\x12\x1d\n\x15snapshot_chunks_count\x18\x06 \x01(\x04\x12\x19\n\x11\x62\x61\x63kfilled_blocks\x18\x07 \x01(\x04\x12\x1d\n\x15\x62\x61\x63kfill_blocks_total\x18\x08 \x01(\x04\x42\t\n\x07version\"\xb1\x01\n\x1cGetCurrentQuorumsInfoRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0H\x00\x1a \n\x1eGetCurrentQuorumsInfoRequestV0B\t\n\x07version\"\xa1\x05\n\x1dGetCurrentQuorumsInfoResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0H\x00\x1a\x46\n\x0bValidatorV0\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07node_ip\x18\x02 \x01(\t\x12\x11\n\tis_banned\x18\x03 \x01(\x08\x1a\xaf\x01\n\x0eValidatorSetV0\x12\x13\n\x0bquorum_hash\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ore_height\x18\x02 \x01(\r\x12U\n\x07members\x18\x03 \x03(\x0b\x32\x44.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0\x12\x1c\n\x14threshold_public_key\x18\x04 \x01(\x0c\x1a\x92\x02\n\x1fGetCurrentQuorumsInfoResponseV0\x12\x15\n\rquorum_hashes\x18\x01 \x03(\x0c\x12\x1b\n\x13\x63urrent_quorum_hash\x18\x02 \x01(\x0c\x12_\n\x0evalidator_sets\x18\x03 \x03(\x0b\x32G.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0\x12\x1b\n\x13last_block_proposer\x18\x04 \x01(\x0c\x12=\n\x08metadata\x18\x05 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\t\n\x07version*Z\n\nKeyPurpose\x12\x12\n\x0e\x41UTHENTICATION\x10\x00\x12\x0e\n\nENCRYPTION\x10\x01\x12\x0e\n\nDECRYPTION\x10\x02\x12\x0c\n\x08TRANSFER\x10\x03\x12\n\n\x06VOTING\x10\x05\x32\xa4$\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\x0fgetIdentityKeys\x12\x31.org.dash.platform.dapi.v0.GetIdentityKeysRequest\x1a\x32.org.dash.platform.dapi.v0.GetIdentityKeysResponse\x12\x96\x01\n\x19getIdentitiesContractKeys\x12;.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest\x1a<.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse\x12{\n\x10getIdentityNonce\x12\x32.org.dash.platform.dapi.v0.GetIdentityNonceRequest\x1a\x33.org.dash.platform.dapi.v0.GetIdentityNonceResponse\x12\x93\x01\n\x18getIdentityContractNonce\x12:.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse\x12\x81\x01\n\x12getIdentityBalance\x12\x34.org.dash.platform.dapi.v0.GetIdentityBalanceRequest\x1a\x35.org.dash.platform.dapi.v0.GetIdentityBalanceResponse\x12\x8a\x01\n\x15getIdentitiesBalances\x12\x37.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse\x12\xa2\x01\n\x1dgetIdentityBalanceAndRevision\x12?.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest\x1a@.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse\x12\xaf\x01\n#getEvonodesProposedEpochBlocksByIds\x12\x45.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\xb3\x01\n%getEvonodesProposedEpochBlocksByRange\x12G.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\x66\n\tgetProofs\x12+.org.dash.platform.dapi.v0.GetProofsRequest\x1a,.org.dash.platform.dapi.v0.GetProofsResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12\x8d\x01\n\x16getDataContractHistory\x12\x38.org.dash.platform.dapi.v0.GetDataContractHistoryRequest\x1a\x39.org.dash.platform.dapi.v0.GetDataContractHistoryResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\x99\x01\n\x1agetIdentityByPublicKeyHash\x12<.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest\x1a=.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse\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.GetConsensusParamsResponse\x12\xa5\x01\n\x1egetProtocolVersionUpgradeState\x12@.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest\x1a\x41.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse\x12\xb4\x01\n#getProtocolVersionUpgradeVoteStatus\x12\x45.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest\x1a\x46.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse\x12r\n\rgetEpochsInfo\x12/.org.dash.platform.dapi.v0.GetEpochsInfoRequest\x1a\x30.org.dash.platform.dapi.v0.GetEpochsInfoResponse\x12\x8a\x01\n\x15getContestedResources\x12\x37.org.dash.platform.dapi.v0.GetContestedResourcesRequest\x1a\x38.org.dash.platform.dapi.v0.GetContestedResourcesResponse\x12\xa2\x01\n\x1dgetContestedResourceVoteState\x12?.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest\x1a@.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse\x12\xba\x01\n%getContestedResourceVotersForIdentity\x12G.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest\x1aH.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse\x12\xae\x01\n!getContestedResourceIdentityVotes\x12\x43.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest\x1a\x44.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse\x12\x8a\x01\n\x15getVotePollsByEndDate\x12\x37.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest\x1a\x38.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse\x12\xa5\x01\n\x1egetPrefundedSpecializedBalance\x12@.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest\x1a\x41.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse\x12\x96\x01\n\x19getTotalCreditsInPlatform\x12;.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest\x1a<.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse\x12x\n\x0fgetPathElements\x12\x31.org.dash.platform.dapi.v0.GetPathElementsRequest\x1a\x32.org.dash.platform.dapi.v0.GetPathElementsResponse\x12\x66\n\tgetStatus\x12+.org.dash.platform.dapi.v0.GetStatusRequest\x1a,.org.dash.platform.dapi.v0.GetStatusResponse\x12\x8a\x01\n\x15getCurrentQuorumsInfo\x12\x37.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest\x1a\x38.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponseb\x06proto3' , dependencies=[google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) @@ -62,8 +62,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=30834, - serialized_end=30924, + serialized_start=31512, + serialized_end=31602, ) _sym_db.RegisterEnumDescriptor(_KEYPURPOSE) @@ -125,8 +125,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=9520, - serialized_end=9600, + serialized_start=9342, + serialized_end=9422, ) _sym_db.RegisterEnumDescriptor(_GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST_DOCUMENTCONTESTEDSTATUS) @@ -160,8 +160,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=9750, - serialized_end=9812, + serialized_start=9572, + serialized_end=9634, ) _sym_db.RegisterEnumDescriptor(_GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST_TYPE) @@ -190,8 +190,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=21765, - serialized_end=21838, + serialized_start=21587, + serialized_end=21660, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEVOTESTATEREQUEST_GETCONTESTEDRESOURCEVOTESTATEREQUESTV0_RESULTTYPE) @@ -220,8 +220,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=22752, - serialized_end=22831, + serialized_start=22574, + serialized_end=22653, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_FINISHEDVOTEINFO_FINISHEDVOTEOUTCOME) @@ -250,8 +250,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=26460, - serialized_end=26521, + serialized_start=26282, + serialized_end=26343, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_RESOURCEVOTECHOICE_VOTECHOICETYPE) @@ -2146,9 +2146,14 @@ syntax='proto3', extension_ranges=[], oneofs=[ + _descriptor.OneofDescriptor( + name='_epoch', full_name='org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0._epoch', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), ], serialized_start=6410, - serialized_end=6499, + serialized_end=6514, ) _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST = _descriptor.Descriptor( @@ -2184,7 +2189,7 @@ fields=[]), ], serialized_start=6233, - serialized_end=6510, + serialized_end=6525, ) @@ -2222,8 +2227,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=7016, - serialized_end=7075, + serialized_start=7031, + serialized_end=7090, ) _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0_EVONODESPROPOSEDBLOCKS = _descriptor.Descriptor( @@ -2253,8 +2258,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=7078, - serialized_end=7274, + serialized_start=7093, + serialized_end=7289, ) _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0 = _descriptor.Descriptor( @@ -2303,8 +2308,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=6678, - serialized_end=7284, + serialized_start=6693, + serialized_end=7299, ) _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE = _descriptor.Descriptor( @@ -2339,8 +2344,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=6513, - serialized_end=7295, + serialized_start=6528, + serialized_end=7310, ) @@ -2404,13 +2409,18 @@ create_key=_descriptor._internal_create_key, fields=[]), _descriptor.OneofDescriptor( - name='_limit', full_name='org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0._limit', + name='_epoch', full_name='org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0._epoch', index=1, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), + _descriptor.OneofDescriptor( + name='_limit', full_name='org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0._limit', + index=2, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), ], - serialized_start=7482, - serialized_end=7642, + serialized_start=7497, + serialized_end=7672, ) _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST = _descriptor.Descriptor( @@ -2445,42 +2455,11 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=7298, - serialized_end=7653, + serialized_start=7313, + serialized_end=7683, ) -_GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0_GETIDENTITIESBALANCESBYKNOWNIDENTITYIDS = _descriptor.Descriptor( - name='GetIdentitiesBalancesByKnownIdentityIds', - full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='identities_ids', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.identities_ids', index=0, - number=1, type=12, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7993, - serialized_end=8058, -) - _GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0 = _descriptor.Descriptor( name='GetIdentitiesBalancesRequestV0', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0', @@ -2490,9 +2469,9 @@ create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='identities_ids', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.identities_ids', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='ids', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.ids', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), @@ -2506,7 +2485,7 @@ ], extensions=[ ], - nested_types=[_GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0_GETIDENTITIESBALANCESBYKNOWNIDENTITYIDS, ], + nested_types=[], enum_types=[ ], serialized_options=None, @@ -2515,8 +2494,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=7791, - serialized_end=8058, + serialized_start=7820, + serialized_end=7880, ) _GETIDENTITIESBALANCESREQUEST = _descriptor.Descriptor( @@ -2551,8 +2530,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=7656, - serialized_end=8069, + serialized_start=7686, + serialized_end=7891, ) @@ -2595,8 +2574,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=8500, - serialized_end=8572, + serialized_start=8322, + serialized_end=8394, ) _GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0_IDENTITIESBALANCES = _descriptor.Descriptor( @@ -2626,8 +2605,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=8575, - serialized_end=8718, + serialized_start=8397, + serialized_end=8540, ) _GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0 = _descriptor.Descriptor( @@ -2676,8 +2655,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=8210, - serialized_end=8728, + serialized_start=8032, + serialized_end=8550, ) _GETIDENTITIESBALANCESRESPONSE = _descriptor.Descriptor( @@ -2712,8 +2691,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=8072, - serialized_end=8739, + serialized_start=7894, + serialized_end=8561, ) @@ -2773,8 +2752,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=9259, - serialized_end=9600, + serialized_start=9081, + serialized_end=9422, ) _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST = _descriptor.Descriptor( @@ -2812,8 +2791,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=9603, - serialized_end=9812, + serialized_start=9425, + serialized_end=9634, ) _GETPROOFSREQUEST_GETPROOFSREQUESTV0_CONTRACTREQUEST = _descriptor.Descriptor( @@ -2843,8 +2822,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=9814, - serialized_end=9852, + serialized_start=9636, + serialized_end=9674, ) _GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST_CONTESTEDRESOURCEVOTESTATUSREQUEST = _descriptor.Descriptor( @@ -2902,8 +2881,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=10045, - serialized_end=10198, + serialized_start=9867, + serialized_end=10020, ) _GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST = _descriptor.Descriptor( @@ -2938,8 +2917,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=9855, - serialized_end=10214, + serialized_start=9677, + serialized_end=10036, ) _GETPROOFSREQUEST_GETPROOFSREQUESTV0 = _descriptor.Descriptor( @@ -2990,8 +2969,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=8841, - serialized_end=10214, + serialized_start=8663, + serialized_end=10036, ) _GETPROOFSREQUEST = _descriptor.Descriptor( @@ -3026,8 +3005,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=8742, - serialized_end=10225, + serialized_start=8564, + serialized_end=10047, ) @@ -3070,8 +3049,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=10330, - serialized_end=10475, + serialized_start=10152, + serialized_end=10297, ) _GETPROOFSRESPONSE = _descriptor.Descriptor( @@ -3106,8 +3085,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=10228, - serialized_end=10486, + serialized_start=10050, + serialized_end=10308, ) @@ -3145,8 +3124,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=10605, - serialized_end=10658, + serialized_start=10427, + serialized_end=10480, ) _GETDATACONTRACTREQUEST = _descriptor.Descriptor( @@ -3181,8 +3160,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=10489, - serialized_end=10669, + serialized_start=10311, + serialized_end=10491, ) @@ -3232,8 +3211,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=10792, - serialized_end=10968, + serialized_start=10614, + serialized_end=10790, ) _GETDATACONTRACTRESPONSE = _descriptor.Descriptor( @@ -3268,8 +3247,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=10672, - serialized_end=10979, + serialized_start=10494, + serialized_end=10801, ) @@ -3307,8 +3286,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=11101, - serialized_end=11156, + serialized_start=10923, + serialized_end=10978, ) _GETDATACONTRACTSREQUEST = _descriptor.Descriptor( @@ -3343,8 +3322,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=10982, - serialized_end=11167, + serialized_start=10804, + serialized_end=10989, ) @@ -3382,8 +3361,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=11292, - serialized_end=11383, + serialized_start=11114, + serialized_end=11205, ) _GETDATACONTRACTSRESPONSE_DATACONTRACTS = _descriptor.Descriptor( @@ -3413,8 +3392,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=11385, - serialized_end=11502, + serialized_start=11207, + serialized_end=11324, ) _GETDATACONTRACTSRESPONSE_GETDATACONTRACTSRESPONSEV0 = _descriptor.Descriptor( @@ -3463,8 +3442,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11505, - serialized_end=11750, + serialized_start=11327, + serialized_end=11572, ) _GETDATACONTRACTSRESPONSE = _descriptor.Descriptor( @@ -3499,8 +3478,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11170, - serialized_end=11761, + serialized_start=10992, + serialized_end=11583, ) @@ -3559,8 +3538,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=11902, - serialized_end=12074, + serialized_start=11724, + serialized_end=11896, ) _GETDATACONTRACTHISTORYREQUEST = _descriptor.Descriptor( @@ -3595,8 +3574,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11764, - serialized_end=12085, + serialized_start=11586, + serialized_end=11907, ) @@ -3634,8 +3613,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=12525, - serialized_end=12580, + serialized_start=12347, + serialized_end=12402, ) _GETDATACONTRACTHISTORYRESPONSE_GETDATACONTRACTHISTORYRESPONSEV0_DATACONTRACTHISTORY = _descriptor.Descriptor( @@ -3665,8 +3644,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=12583, - serialized_end=12753, + serialized_start=12405, + serialized_end=12575, ) _GETDATACONTRACTHISTORYRESPONSE_GETDATACONTRACTHISTORYRESPONSEV0 = _descriptor.Descriptor( @@ -3715,8 +3694,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12229, - serialized_end=12763, + serialized_start=12051, + serialized_end=12585, ) _GETDATACONTRACTHISTORYRESPONSE = _descriptor.Descriptor( @@ -3751,8 +3730,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12088, - serialized_end=12774, + serialized_start=11910, + serialized_end=12596, ) @@ -3837,8 +3816,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12885, - serialized_end=13072, + serialized_start=12707, + serialized_end=12894, ) _GETDOCUMENTSREQUEST = _descriptor.Descriptor( @@ -3873,8 +3852,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12777, - serialized_end=13083, + serialized_start=12599, + serialized_end=12905, ) @@ -3905,8 +3884,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=13440, - serialized_end=13470, + serialized_start=13262, + serialized_end=13292, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0 = _descriptor.Descriptor( @@ -3955,8 +3934,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13197, - serialized_end=13480, + serialized_start=13019, + serialized_end=13302, ) _GETDOCUMENTSRESPONSE = _descriptor.Descriptor( @@ -3991,8 +3970,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13086, - serialized_end=13491, + serialized_start=12908, + serialized_end=13313, ) @@ -4030,8 +4009,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=13643, - serialized_end=13720, + serialized_start=13465, + serialized_end=13542, ) _GETIDENTITYBYPUBLICKEYHASHREQUEST = _descriptor.Descriptor( @@ -4066,8 +4045,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13494, - serialized_end=13731, + serialized_start=13316, + serialized_end=13553, ) @@ -4117,8 +4096,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13887, - serialized_end=14069, + serialized_start=13709, + serialized_end=13891, ) _GETIDENTITYBYPUBLICKEYHASHRESPONSE = _descriptor.Descriptor( @@ -4153,8 +4132,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13734, - serialized_end=14080, + serialized_start=13556, + serialized_end=13902, ) @@ -4192,8 +4171,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=14238, - serialized_end=14323, + serialized_start=14060, + serialized_end=14145, ) _WAITFORSTATETRANSITIONRESULTREQUEST = _descriptor.Descriptor( @@ -4228,8 +4207,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14083, - serialized_end=14334, + serialized_start=13905, + serialized_end=14156, ) @@ -4279,8 +4258,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14496, - serialized_end=14735, + serialized_start=14318, + serialized_end=14557, ) _WAITFORSTATETRANSITIONRESULTRESPONSE = _descriptor.Descriptor( @@ -4315,8 +4294,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14337, - serialized_end=14746, + serialized_start=14159, + serialized_end=14568, ) @@ -4354,8 +4333,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=14874, - serialized_end=14934, + serialized_start=14696, + serialized_end=14756, ) _GETCONSENSUSPARAMSREQUEST = _descriptor.Descriptor( @@ -4390,8 +4369,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14749, - serialized_end=14945, + serialized_start=14571, + serialized_end=14767, ) @@ -4436,8 +4415,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15076, - serialized_end=15156, + serialized_start=14898, + serialized_end=14978, ) _GETCONSENSUSPARAMSRESPONSE_CONSENSUSPARAMSEVIDENCE = _descriptor.Descriptor( @@ -4481,8 +4460,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15158, - serialized_end=15256, + serialized_start=14980, + serialized_end=15078, ) _GETCONSENSUSPARAMSRESPONSE_GETCONSENSUSPARAMSRESPONSEV0 = _descriptor.Descriptor( @@ -4519,8 +4498,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15259, - serialized_end=15477, + serialized_start=15081, + serialized_end=15299, ) _GETCONSENSUSPARAMSRESPONSE = _descriptor.Descriptor( @@ -4555,8 +4534,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14948, - serialized_end=15488, + serialized_start=14770, + serialized_end=15310, ) @@ -4587,8 +4566,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15652, - serialized_end=15708, + serialized_start=15474, + serialized_end=15530, ) _GETPROTOCOLVERSIONUPGRADESTATEREQUEST = _descriptor.Descriptor( @@ -4623,8 +4602,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=15491, - serialized_end=15719, + serialized_start=15313, + serialized_end=15541, ) @@ -4655,8 +4634,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16184, - serialized_end=16334, + serialized_start=16006, + serialized_end=16156, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE_GETPROTOCOLVERSIONUPGRADESTATERESPONSEV0_VERSIONENTRY = _descriptor.Descriptor( @@ -4693,8 +4672,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16336, - serialized_end=16394, + serialized_start=16158, + serialized_end=16216, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE_GETPROTOCOLVERSIONUPGRADESTATERESPONSEV0 = _descriptor.Descriptor( @@ -4743,8 +4722,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=15887, - serialized_end=16404, + serialized_start=15709, + serialized_end=16226, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE = _descriptor.Descriptor( @@ -4779,8 +4758,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=15722, - serialized_end=16415, + serialized_start=15544, + serialized_end=16237, ) @@ -4825,8 +4804,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16595, - serialized_end=16698, + serialized_start=16417, + serialized_end=16520, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSREQUEST = _descriptor.Descriptor( @@ -4861,8 +4840,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16418, - serialized_end=16709, + serialized_start=16240, + serialized_end=16531, ) @@ -4893,8 +4872,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17212, - serialized_end=17387, + serialized_start=17034, + serialized_end=17209, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE_GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSEV0_VERSIONSIGNAL = _descriptor.Descriptor( @@ -4931,8 +4910,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17389, - serialized_end=17442, + serialized_start=17211, + serialized_end=17264, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE_GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSEV0 = _descriptor.Descriptor( @@ -4981,8 +4960,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16893, - serialized_end=17452, + serialized_start=16715, + serialized_end=17274, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE = _descriptor.Descriptor( @@ -5017,8 +4996,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16712, - serialized_end=17463, + serialized_start=16534, + serialized_end=17285, ) @@ -5070,8 +5049,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17576, - serialized_end=17700, + serialized_start=17398, + serialized_end=17522, ) _GETEPOCHSINFOREQUEST = _descriptor.Descriptor( @@ -5106,8 +5085,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=17466, - serialized_end=17711, + serialized_start=17288, + serialized_end=17533, ) @@ -5138,8 +5117,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=18072, - serialized_end=18189, + serialized_start=17894, + serialized_end=18011, ) _GETEPOCHSINFORESPONSE_GETEPOCHSINFORESPONSEV0_EPOCHINFO = _descriptor.Descriptor( @@ -5204,8 +5183,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=18192, - serialized_end=18350, + serialized_start=18014, + serialized_end=18172, ) _GETEPOCHSINFORESPONSE_GETEPOCHSINFORESPONSEV0 = _descriptor.Descriptor( @@ -5254,8 +5233,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=17828, - serialized_end=18360, + serialized_start=17650, + serialized_end=18182, ) _GETEPOCHSINFORESPONSE = _descriptor.Descriptor( @@ -5290,8 +5269,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=17714, - serialized_end=18371, + serialized_start=17536, + serialized_end=18193, ) @@ -5329,8 +5308,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=18866, - serialized_end=18935, + serialized_start=18688, + serialized_end=18757, ) _GETCONTESTEDRESOURCESREQUEST_GETCONTESTEDRESOURCESREQUESTV0 = _descriptor.Descriptor( @@ -5426,8 +5405,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18509, - serialized_end=18969, + serialized_start=18331, + serialized_end=18791, ) _GETCONTESTEDRESOURCESREQUEST = _descriptor.Descriptor( @@ -5462,8 +5441,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18374, - serialized_end=18980, + serialized_start=18196, + serialized_end=18802, ) @@ -5494,8 +5473,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=19422, - serialized_end=19482, + serialized_start=19244, + serialized_end=19304, ) _GETCONTESTEDRESOURCESRESPONSE_GETCONTESTEDRESOURCESRESPONSEV0 = _descriptor.Descriptor( @@ -5544,8 +5523,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19121, - serialized_end=19492, + serialized_start=18943, + serialized_end=19314, ) _GETCONTESTEDRESOURCESRESPONSE = _descriptor.Descriptor( @@ -5580,8 +5559,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18983, - serialized_end=19503, + serialized_start=18805, + serialized_end=19325, ) @@ -5619,8 +5598,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=20016, - serialized_end=20085, + serialized_start=19838, + serialized_end=19907, ) _GETVOTEPOLLSBYENDDATEREQUEST_GETVOTEPOLLSBYENDDATEREQUESTV0_ENDATTIMEINFO = _descriptor.Descriptor( @@ -5657,8 +5636,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=20087, - serialized_end=20150, + serialized_start=19909, + serialized_end=19972, ) _GETVOTEPOLLSBYENDDATEREQUEST_GETVOTEPOLLSBYENDDATEREQUESTV0 = _descriptor.Descriptor( @@ -5743,8 +5722,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19641, - serialized_end=20209, + serialized_start=19463, + serialized_end=20031, ) _GETVOTEPOLLSBYENDDATEREQUEST = _descriptor.Descriptor( @@ -5779,8 +5758,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19506, - serialized_end=20220, + serialized_start=19328, + serialized_end=20042, ) @@ -5818,8 +5797,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=20669, - serialized_end=20751, + serialized_start=20491, + serialized_end=20573, ) _GETVOTEPOLLSBYENDDATERESPONSE_GETVOTEPOLLSBYENDDATERESPONSEV0_SERIALIZEDVOTEPOLLSBYTIMESTAMPS = _descriptor.Descriptor( @@ -5856,8 +5835,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=20754, - serialized_end=20969, + serialized_start=20576, + serialized_end=20791, ) _GETVOTEPOLLSBYENDDATERESPONSE_GETVOTEPOLLSBYENDDATERESPONSEV0 = _descriptor.Descriptor( @@ -5906,8 +5885,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20361, - serialized_end=20979, + serialized_start=20183, + serialized_end=20801, ) _GETVOTEPOLLSBYENDDATERESPONSE = _descriptor.Descriptor( @@ -5942,8 +5921,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20223, - serialized_end=20990, + serialized_start=20045, + serialized_end=20812, ) @@ -5981,8 +5960,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=21679, - serialized_end=21763, + serialized_start=21501, + serialized_end=21585, ) _GETCONTESTEDRESOURCEVOTESTATEREQUEST_GETCONTESTEDRESOURCEVOTESTATEREQUESTV0 = _descriptor.Descriptor( @@ -6079,8 +6058,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=21152, - serialized_end=21877, + serialized_start=20974, + serialized_end=21699, ) _GETCONTESTEDRESOURCEVOTESTATEREQUEST = _descriptor.Descriptor( @@ -6115,8 +6094,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20993, - serialized_end=21888, + serialized_start=20815, + serialized_end=21710, ) @@ -6188,8 +6167,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22388, - serialized_end=22854, + serialized_start=22210, + serialized_end=22676, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_CONTESTEDRESOURCECONTENDERS = _descriptor.Descriptor( @@ -6255,8 +6234,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22857, - serialized_end=23309, + serialized_start=22679, + serialized_end=23131, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_CONTENDER = _descriptor.Descriptor( @@ -6310,8 +6289,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=23311, - serialized_end=23418, + serialized_start=23133, + serialized_end=23240, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0 = _descriptor.Descriptor( @@ -6360,8 +6339,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22053, - serialized_end=23428, + serialized_start=21875, + serialized_end=23250, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE = _descriptor.Descriptor( @@ -6396,8 +6375,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=21891, - serialized_end=23439, + serialized_start=21713, + serialized_end=23261, ) @@ -6435,8 +6414,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=21679, - serialized_end=21763, + serialized_start=21501, + serialized_end=21585, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUEST_GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUESTV0 = _descriptor.Descriptor( @@ -6532,8 +6511,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=23626, - serialized_end=24156, + serialized_start=23448, + serialized_end=23978, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUEST = _descriptor.Descriptor( @@ -6568,8 +6547,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=23442, - serialized_end=24167, + serialized_start=23264, + serialized_end=23989, ) @@ -6607,8 +6586,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=24707, - serialized_end=24774, + serialized_start=24529, + serialized_end=24596, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSE_GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSEV0 = _descriptor.Descriptor( @@ -6657,8 +6636,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24357, - serialized_end=24784, + serialized_start=24179, + serialized_end=24606, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSE = _descriptor.Descriptor( @@ -6693,8 +6672,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24170, - serialized_end=24795, + serialized_start=23992, + serialized_end=24617, ) @@ -6732,8 +6711,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=25344, - serialized_end=25441, + serialized_start=25166, + serialized_end=25263, ) _GETCONTESTEDRESOURCEIDENTITYVOTESREQUEST_GETCONTESTEDRESOURCEIDENTITYVOTESREQUESTV0 = _descriptor.Descriptor( @@ -6803,8 +6782,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24969, - serialized_end=25472, + serialized_start=24791, + serialized_end=25294, ) _GETCONTESTEDRESOURCEIDENTITYVOTESREQUEST = _descriptor.Descriptor( @@ -6839,8 +6818,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24798, - serialized_end=25483, + serialized_start=24620, + serialized_end=25305, ) @@ -6878,8 +6857,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=25986, - serialized_end=26233, + serialized_start=25808, + serialized_end=26055, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_RESOURCEVOTECHOICE = _descriptor.Descriptor( @@ -6922,8 +6901,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26236, - serialized_end=26537, + serialized_start=26058, + serialized_end=26359, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_CONTESTEDRESOURCEIDENTITYVOTE = _descriptor.Descriptor( @@ -6974,8 +6953,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=26540, - serialized_end=26817, + serialized_start=26362, + serialized_end=26639, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0 = _descriptor.Descriptor( @@ -7024,8 +7003,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25660, - serialized_end=26827, + serialized_start=25482, + serialized_end=26649, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE = _descriptor.Descriptor( @@ -7060,8 +7039,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25486, - serialized_end=26838, + serialized_start=25308, + serialized_end=26660, ) @@ -7099,8 +7078,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=27002, - serialized_end=27070, + serialized_start=26824, + serialized_end=26892, ) _GETPREFUNDEDSPECIALIZEDBALANCEREQUEST = _descriptor.Descriptor( @@ -7135,8 +7114,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26841, - serialized_end=27081, + serialized_start=26663, + serialized_end=26903, ) @@ -7186,8 +7165,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27249, - serialized_end=27434, + serialized_start=27071, + serialized_end=27256, ) _GETPREFUNDEDSPECIALIZEDBALANCERESPONSE = _descriptor.Descriptor( @@ -7222,8 +7201,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27084, - serialized_end=27445, + serialized_start=26906, + serialized_end=27267, ) @@ -7254,8 +7233,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=27594, - serialized_end=27645, + serialized_start=27416, + serialized_end=27467, ) _GETTOTALCREDITSINPLATFORMREQUEST = _descriptor.Descriptor( @@ -7290,8 +7269,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27448, - serialized_end=27656, + serialized_start=27270, + serialized_end=27478, ) @@ -7341,8 +7320,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27809, - serialized_end=27989, + serialized_start=27631, + serialized_end=27811, ) _GETTOTALCREDITSINPLATFORMRESPONSE = _descriptor.Descriptor( @@ -7377,8 +7356,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27659, - serialized_end=28000, + serialized_start=27481, + serialized_end=27822, ) @@ -7423,8 +7402,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=28119, - serialized_end=28188, + serialized_start=27941, + serialized_end=28010, ) _GETPATHELEMENTSREQUEST = _descriptor.Descriptor( @@ -7459,8 +7438,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28003, - serialized_end=28199, + serialized_start=27825, + serialized_end=28021, ) @@ -7491,8 +7470,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=28572, - serialized_end=28600, + serialized_start=28394, + serialized_end=28422, ) _GETPATHELEMENTSRESPONSE_GETPATHELEMENTSRESPONSEV0 = _descriptor.Descriptor( @@ -7541,8 +7520,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28322, - serialized_end=28610, + serialized_start=28144, + serialized_end=28432, ) _GETPATHELEMENTSRESPONSE = _descriptor.Descriptor( @@ -7577,8 +7556,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28202, - serialized_end=28621, + serialized_start=28024, + serialized_end=28443, ) @@ -7602,8 +7581,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=28722, - serialized_end=28742, + serialized_start=28544, + serialized_end=28564, ) _GETSTATUSREQUEST = _descriptor.Descriptor( @@ -7638,8 +7617,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28624, - serialized_end=28753, + serialized_start=28446, + serialized_end=28575, ) @@ -7694,8 +7673,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29630, - serialized_end=29724, + serialized_start=29452, + serialized_end=29546, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL_TENDERDASH = _descriptor.Descriptor( @@ -7732,8 +7711,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=29957, - serialized_end=29997, + serialized_start=29779, + serialized_end=29819, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL_DRIVE = _descriptor.Descriptor( @@ -7770,8 +7749,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=29999, - serialized_end=30039, + serialized_start=29821, + serialized_end=29861, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL = _descriptor.Descriptor( @@ -7808,8 +7787,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=29727, - serialized_end=30039, + serialized_start=29549, + serialized_end=29861, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION = _descriptor.Descriptor( @@ -7846,8 +7825,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=29417, - serialized_end=30039, + serialized_start=29239, + serialized_end=29861, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_TIME = _descriptor.Descriptor( @@ -7913,8 +7892,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30041, - serialized_end=30156, + serialized_start=29863, + serialized_end=29978, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_NODE = _descriptor.Descriptor( @@ -7956,8 +7935,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30158, - serialized_end=30218, + serialized_start=29980, + serialized_end=30040, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_CHAIN = _descriptor.Descriptor( @@ -8048,8 +8027,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30221, - serialized_end=30516, + serialized_start=30043, + serialized_end=30338, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_NETWORK = _descriptor.Descriptor( @@ -8093,8 +8072,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=30518, - serialized_end=30585, + serialized_start=30340, + serialized_end=30407, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_STATESYNC = _descriptor.Descriptor( @@ -8173,8 +8152,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=30588, - serialized_end=30821, + serialized_start=30410, + serialized_end=30643, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0 = _descriptor.Descriptor( @@ -8239,8 +8218,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=28858, - serialized_end=30821, + serialized_start=28680, + serialized_end=30643, ) _GETSTATUSRESPONSE = _descriptor.Descriptor( @@ -8275,8 +8254,262 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28756, - serialized_end=30832, + serialized_start=28578, + serialized_end=30654, +) + + +_GETCURRENTQUORUMSINFOREQUEST_GETCURRENTQUORUMSINFOREQUESTV0 = _descriptor.Descriptor( + name='GetCurrentQuorumsInfoRequestV0', + full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=30791, + serialized_end=30823, +) + +_GETCURRENTQUORUMSINFOREQUEST = _descriptor.Descriptor( + name='GetCurrentQuorumsInfoRequest', + full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='v0', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.v0', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_GETCURRENTQUORUMSINFOREQUEST_GETCURRENTQUORUMSINFOREQUESTV0, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='version', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.version', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=30657, + serialized_end=30834, +) + + +_GETCURRENTQUORUMSINFORESPONSE_VALIDATORV0 = _descriptor.Descriptor( + name='ValidatorV0', + full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='pro_tx_hash', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.pro_tx_hash', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='node_ip', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.node_ip', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='is_banned', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.is_banned', index=2, + number=3, 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=30974, + serialized_end=31044, +) + +_GETCURRENTQUORUMSINFORESPONSE_VALIDATORSETV0 = _descriptor.Descriptor( + name='ValidatorSetV0', + full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='quorum_hash', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.quorum_hash', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='core_height', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.core_height', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='members', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='threshold_public_key', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.threshold_public_key', index=3, + number=4, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=31047, + serialized_end=31222, +) + +_GETCURRENTQUORUMSINFORESPONSE_GETCURRENTQUORUMSINFORESPONSEV0 = _descriptor.Descriptor( + name='GetCurrentQuorumsInfoResponseV0', + full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='quorum_hashes', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.quorum_hashes', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='current_quorum_hash', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.current_quorum_hash', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='validator_sets', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validator_sets', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='last_block_proposer', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.last_block_proposer', index=3, + number=4, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.metadata', index=4, + number=5, 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=31225, + serialized_end=31499, +) + +_GETCURRENTQUORUMSINFORESPONSE = _descriptor.Descriptor( + name='GetCurrentQuorumsInfoResponse', + full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='v0', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.v0', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_GETCURRENTQUORUMSINFORESPONSE_VALIDATORV0, _GETCURRENTQUORUMSINFORESPONSE_VALIDATORSETV0, _GETCURRENTQUORUMSINFORESPONSE_GETCURRENTQUORUMSINFORESPONSEV0, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='version', full_name='org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.version', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=30837, + serialized_end=31510, ) _GETIDENTITYREQUEST_GETIDENTITYREQUESTV0.containing_type = _GETIDENTITYREQUEST @@ -8443,6 +8676,9 @@ _GETIDENTITIESCONTRACTKEYSRESPONSE.fields_by_name['v0']) _GETIDENTITIESCONTRACTKEYSRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITIESCONTRACTKEYSRESPONSE.oneofs_by_name['version'] _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.containing_type = _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST +_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.oneofs_by_name['_epoch'].fields.append( + _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.fields_by_name['epoch']) +_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.fields_by_name['epoch'].containing_oneof = _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.oneofs_by_name['_epoch'] _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.fields_by_name['v0'].message_type = _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0 _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.oneofs_by_name['version'].fields.append( _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.fields_by_name['v0']) @@ -8471,6 +8707,9 @@ _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.oneofs_by_name['start'].fields.append( _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.fields_by_name['start_at']) _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.fields_by_name['start_at'].containing_oneof = _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.oneofs_by_name['start'] +_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.oneofs_by_name['_epoch'].fields.append( + _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.fields_by_name['epoch']) +_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.fields_by_name['epoch'].containing_oneof = _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.oneofs_by_name['_epoch'] _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.oneofs_by_name['_limit'].fields.append( _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.fields_by_name['limit']) _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.fields_by_name['limit'].containing_oneof = _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0.oneofs_by_name['_limit'] @@ -8478,8 +8717,6 @@ _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST.oneofs_by_name['version'].fields.append( _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST.fields_by_name['v0']) _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST.fields_by_name['v0'].containing_oneof = _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST.oneofs_by_name['version'] -_GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0_GETIDENTITIESBALANCESBYKNOWNIDENTITYIDS.containing_type = _GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0 -_GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0.fields_by_name['identities_ids'].message_type = _GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0_GETIDENTITIESBALANCESBYKNOWNIDENTITYIDS _GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0.containing_type = _GETIDENTITIESBALANCESREQUEST _GETIDENTITIESBALANCESREQUEST.fields_by_name['v0'].message_type = _GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0 _GETIDENTITIESBALANCESREQUEST.oneofs_by_name['version'].fields.append( @@ -9037,6 +9274,21 @@ _GETSTATUSRESPONSE.oneofs_by_name['version'].fields.append( _GETSTATUSRESPONSE.fields_by_name['v0']) _GETSTATUSRESPONSE.fields_by_name['v0'].containing_oneof = _GETSTATUSRESPONSE.oneofs_by_name['version'] +_GETCURRENTQUORUMSINFOREQUEST_GETCURRENTQUORUMSINFOREQUESTV0.containing_type = _GETCURRENTQUORUMSINFOREQUEST +_GETCURRENTQUORUMSINFOREQUEST.fields_by_name['v0'].message_type = _GETCURRENTQUORUMSINFOREQUEST_GETCURRENTQUORUMSINFOREQUESTV0 +_GETCURRENTQUORUMSINFOREQUEST.oneofs_by_name['version'].fields.append( + _GETCURRENTQUORUMSINFOREQUEST.fields_by_name['v0']) +_GETCURRENTQUORUMSINFOREQUEST.fields_by_name['v0'].containing_oneof = _GETCURRENTQUORUMSINFOREQUEST.oneofs_by_name['version'] +_GETCURRENTQUORUMSINFORESPONSE_VALIDATORV0.containing_type = _GETCURRENTQUORUMSINFORESPONSE +_GETCURRENTQUORUMSINFORESPONSE_VALIDATORSETV0.fields_by_name['members'].message_type = _GETCURRENTQUORUMSINFORESPONSE_VALIDATORV0 +_GETCURRENTQUORUMSINFORESPONSE_VALIDATORSETV0.containing_type = _GETCURRENTQUORUMSINFORESPONSE +_GETCURRENTQUORUMSINFORESPONSE_GETCURRENTQUORUMSINFORESPONSEV0.fields_by_name['validator_sets'].message_type = _GETCURRENTQUORUMSINFORESPONSE_VALIDATORSETV0 +_GETCURRENTQUORUMSINFORESPONSE_GETCURRENTQUORUMSINFORESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETCURRENTQUORUMSINFORESPONSE_GETCURRENTQUORUMSINFORESPONSEV0.containing_type = _GETCURRENTQUORUMSINFORESPONSE +_GETCURRENTQUORUMSINFORESPONSE.fields_by_name['v0'].message_type = _GETCURRENTQUORUMSINFORESPONSE_GETCURRENTQUORUMSINFORESPONSEV0 +_GETCURRENTQUORUMSINFORESPONSE.oneofs_by_name['version'].fields.append( + _GETCURRENTQUORUMSINFORESPONSE.fields_by_name['v0']) +_GETCURRENTQUORUMSINFORESPONSE.fields_by_name['v0'].containing_oneof = _GETCURRENTQUORUMSINFORESPONSE.oneofs_by_name['version'] DESCRIPTOR.message_types_by_name['Proof'] = _PROOF DESCRIPTOR.message_types_by_name['ResponseMetadata'] = _RESPONSEMETADATA DESCRIPTOR.message_types_by_name['StateTransitionBroadcastError'] = _STATETRANSITIONBROADCASTERROR @@ -9106,6 +9358,8 @@ DESCRIPTOR.message_types_by_name['GetPathElementsResponse'] = _GETPATHELEMENTSRESPONSE DESCRIPTOR.message_types_by_name['GetStatusRequest'] = _GETSTATUSREQUEST DESCRIPTOR.message_types_by_name['GetStatusResponse'] = _GETSTATUSRESPONSE +DESCRIPTOR.message_types_by_name['GetCurrentQuorumsInfoRequest'] = _GETCURRENTQUORUMSINFOREQUEST +DESCRIPTOR.message_types_by_name['GetCurrentQuorumsInfoResponse'] = _GETCURRENTQUORUMSINFORESPONSE DESCRIPTOR.enum_types_by_name['KeyPurpose'] = _KEYPURPOSE _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -9509,13 +9763,6 @@ GetIdentitiesBalancesRequest = _reflection.GeneratedProtocolMessageType('GetIdentitiesBalancesRequest', (_message.Message,), { 'GetIdentitiesBalancesRequestV0' : _reflection.GeneratedProtocolMessageType('GetIdentitiesBalancesRequestV0', (_message.Message,), { - - 'GetIdentitiesBalancesByKnownIdentityIds' : _reflection.GeneratedProtocolMessageType('GetIdentitiesBalancesByKnownIdentityIds', (_message.Message,), { - 'DESCRIPTOR' : _GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0_GETIDENTITIESBALANCESBYKNOWNIDENTITYIDS, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds) - }) - , 'DESCRIPTOR' : _GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0, '__module__' : 'platform_pb2' # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0) @@ -9527,7 +9774,6 @@ }) _sym_db.RegisterMessage(GetIdentitiesBalancesRequest) _sym_db.RegisterMessage(GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0) -_sym_db.RegisterMessage(GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds) GetIdentitiesBalancesResponse = _reflection.GeneratedProtocolMessageType('GetIdentitiesBalancesResponse', (_message.Message,), { @@ -10520,6 +10766,52 @@ _sym_db.RegisterMessage(GetStatusResponse.GetStatusResponseV0.Network) _sym_db.RegisterMessage(GetStatusResponse.GetStatusResponseV0.StateSync) +GetCurrentQuorumsInfoRequest = _reflection.GeneratedProtocolMessageType('GetCurrentQuorumsInfoRequest', (_message.Message,), { + + 'GetCurrentQuorumsInfoRequestV0' : _reflection.GeneratedProtocolMessageType('GetCurrentQuorumsInfoRequestV0', (_message.Message,), { + 'DESCRIPTOR' : _GETCURRENTQUORUMSINFOREQUEST_GETCURRENTQUORUMSINFOREQUESTV0, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0) + }) + , + 'DESCRIPTOR' : _GETCURRENTQUORUMSINFOREQUEST, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest) + }) +_sym_db.RegisterMessage(GetCurrentQuorumsInfoRequest) +_sym_db.RegisterMessage(GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0) + +GetCurrentQuorumsInfoResponse = _reflection.GeneratedProtocolMessageType('GetCurrentQuorumsInfoResponse', (_message.Message,), { + + 'ValidatorV0' : _reflection.GeneratedProtocolMessageType('ValidatorV0', (_message.Message,), { + 'DESCRIPTOR' : _GETCURRENTQUORUMSINFORESPONSE_VALIDATORV0, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0) + }) + , + + 'ValidatorSetV0' : _reflection.GeneratedProtocolMessageType('ValidatorSetV0', (_message.Message,), { + 'DESCRIPTOR' : _GETCURRENTQUORUMSINFORESPONSE_VALIDATORSETV0, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0) + }) + , + + 'GetCurrentQuorumsInfoResponseV0' : _reflection.GeneratedProtocolMessageType('GetCurrentQuorumsInfoResponseV0', (_message.Message,), { + 'DESCRIPTOR' : _GETCURRENTQUORUMSINFORESPONSE_GETCURRENTQUORUMSINFORESPONSEV0, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0) + }) + , + 'DESCRIPTOR' : _GETCURRENTQUORUMSINFORESPONSE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse) + }) +_sym_db.RegisterMessage(GetCurrentQuorumsInfoResponse) +_sym_db.RegisterMessage(GetCurrentQuorumsInfoResponse.ValidatorV0) +_sym_db.RegisterMessage(GetCurrentQuorumsInfoResponse.ValidatorSetV0) +_sym_db.RegisterMessage(GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0) + _SEARCHKEY_PURPOSEMAPENTRY._options = None _SECURITYLEVELMAP_SECURITYLEVELMAPENTRY._options = None @@ -10531,8 +10823,8 @@ index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=30927, - serialized_end=35430, + serialized_start=31605, + serialized_end=36249, methods=[ _descriptor.MethodDescriptor( name='broadcastStateTransition', @@ -10844,6 +11136,16 @@ serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='getCurrentQuorumsInfo', + full_name='org.dash.platform.dapi.v0.Platform.getCurrentQuorumsInfo', + index=31, + containing_service=None, + input_type=_GETCURRENTQUORUMSINFOREQUEST, + output_type=_GETCURRENTQUORUMSINFORESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), ]) _sym_db.RegisterServiceDescriptor(_PLATFORM) diff --git a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py index 4c1c93e835..b8c3847869 100644 --- a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py +++ b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py @@ -169,6 +169,11 @@ def __init__(self, channel): request_serializer=platform__pb2.GetStatusRequest.SerializeToString, response_deserializer=platform__pb2.GetStatusResponse.FromString, ) + self.getCurrentQuorumsInfo = channel.unary_unary( + '/org.dash.platform.dapi.v0.Platform/getCurrentQuorumsInfo', + request_serializer=platform__pb2.GetCurrentQuorumsInfoRequest.SerializeToString, + response_deserializer=platform__pb2.GetCurrentQuorumsInfoResponse.FromString, + ) class PlatformServicer(object): @@ -365,6 +370,12 @@ def getStatus(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def getCurrentQuorumsInfo(self, request, context): + """Missing associated documentation comment in .proto file.""" + 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 = { @@ -523,6 +534,11 @@ def add_PlatformServicer_to_server(servicer, server): request_deserializer=platform__pb2.GetStatusRequest.FromString, response_serializer=platform__pb2.GetStatusResponse.SerializeToString, ), + 'getCurrentQuorumsInfo': grpc.unary_unary_rpc_method_handler( + servicer.getCurrentQuorumsInfo, + request_deserializer=platform__pb2.GetCurrentQuorumsInfoRequest.FromString, + response_serializer=platform__pb2.GetCurrentQuorumsInfoResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'org.dash.platform.dapi.v0.Platform', rpc_method_handlers) @@ -1059,3 +1075,20 @@ def getStatus(request, platform__pb2.GetStatusResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def getCurrentQuorumsInfo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/org.dash.platform.dapi.v0.Platform/getCurrentQuorumsInfo', + platform__pb2.GetCurrentQuorumsInfoRequest.SerializeToString, + platform__pb2.GetCurrentQuorumsInfoResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts index b017271418..e9028523b9 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts @@ -1343,6 +1343,8 @@ export namespace GetEvonodesProposedEpochBlocksByIdsRequest { } export class GetEvonodesProposedEpochBlocksByIdsRequestV0 extends jspb.Message { + hasEpoch(): boolean; + clearEpoch(): void; getEpoch(): number; setEpoch(value: number): void; @@ -1520,6 +1522,8 @@ export namespace GetEvonodesProposedEpochBlocksByRangeRequest { } export class GetEvonodesProposedEpochBlocksByRangeRequestV0 extends jspb.Message { + hasEpoch(): boolean; + clearEpoch(): void; getEpoch(): number; setEpoch(value: number): void; @@ -1601,10 +1605,12 @@ export namespace GetIdentitiesBalancesRequest { } export class GetIdentitiesBalancesRequestV0 extends jspb.Message { - hasIdentitiesIds(): boolean; - clearIdentitiesIds(): void; - getIdentitiesIds(): GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds | undefined; - setIdentitiesIds(value?: GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds): void; + clearIdsList(): void; + getIdsList(): Array; + getIdsList_asU8(): Array; + getIdsList_asB64(): Array; + setIdsList(value: Array): void; + addIds(value: Uint8Array | string, index?: number): Uint8Array | string; getProve(): boolean; setProve(value: boolean): void; @@ -1621,33 +1627,9 @@ export namespace GetIdentitiesBalancesRequest { export namespace GetIdentitiesBalancesRequestV0 { export type AsObject = { - identitiesIds?: GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.AsObject, + idsList: Array, prove: boolean, } - - export class GetIdentitiesBalancesByKnownIdentityIds extends jspb.Message { - clearIdentitiesIdsList(): void; - getIdentitiesIdsList(): Array; - getIdentitiesIdsList_asU8(): Array; - getIdentitiesIdsList_asB64(): Array; - setIdentitiesIdsList(value: Array): void; - addIdentitiesIds(value: Uint8Array | string, index?: number): Uint8Array | string; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetIdentitiesBalancesByKnownIdentityIds.AsObject; - static toObject(includeInstance: boolean, msg: GetIdentitiesBalancesByKnownIdentityIds): GetIdentitiesBalancesByKnownIdentityIds.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetIdentitiesBalancesByKnownIdentityIds, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetIdentitiesBalancesByKnownIdentityIds; - static deserializeBinaryFromReader(message: GetIdentitiesBalancesByKnownIdentityIds, reader: jspb.BinaryReader): GetIdentitiesBalancesByKnownIdentityIds; - } - - export namespace GetIdentitiesBalancesByKnownIdentityIds { - export type AsObject = { - identitiesIdsList: Array, - } - } } export enum VersionCase { @@ -5834,6 +5816,194 @@ export namespace GetStatusResponse { } } +export class GetCurrentQuorumsInfoRequest extends jspb.Message { + hasV0(): boolean; + clearV0(): void; + getV0(): GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 | undefined; + setV0(value?: GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0): void; + + getVersionCase(): GetCurrentQuorumsInfoRequest.VersionCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetCurrentQuorumsInfoRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetCurrentQuorumsInfoRequest): GetCurrentQuorumsInfoRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetCurrentQuorumsInfoRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetCurrentQuorumsInfoRequest; + static deserializeBinaryFromReader(message: GetCurrentQuorumsInfoRequest, reader: jspb.BinaryReader): GetCurrentQuorumsInfoRequest; +} + +export namespace GetCurrentQuorumsInfoRequest { + export type AsObject = { + v0?: GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.AsObject, + } + + export class GetCurrentQuorumsInfoRequestV0 extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetCurrentQuorumsInfoRequestV0.AsObject; + static toObject(includeInstance: boolean, msg: GetCurrentQuorumsInfoRequestV0): GetCurrentQuorumsInfoRequestV0.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetCurrentQuorumsInfoRequestV0, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetCurrentQuorumsInfoRequestV0; + static deserializeBinaryFromReader(message: GetCurrentQuorumsInfoRequestV0, reader: jspb.BinaryReader): GetCurrentQuorumsInfoRequestV0; + } + + export namespace GetCurrentQuorumsInfoRequestV0 { + export type AsObject = { + } + } + + export enum VersionCase { + VERSION_NOT_SET = 0, + V0 = 1, + } +} + +export class GetCurrentQuorumsInfoResponse extends jspb.Message { + hasV0(): boolean; + clearV0(): void; + getV0(): GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 | undefined; + setV0(value?: GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0): void; + + getVersionCase(): GetCurrentQuorumsInfoResponse.VersionCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetCurrentQuorumsInfoResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetCurrentQuorumsInfoResponse): GetCurrentQuorumsInfoResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetCurrentQuorumsInfoResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetCurrentQuorumsInfoResponse; + static deserializeBinaryFromReader(message: GetCurrentQuorumsInfoResponse, reader: jspb.BinaryReader): GetCurrentQuorumsInfoResponse; +} + +export namespace GetCurrentQuorumsInfoResponse { + export type AsObject = { + v0?: GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.AsObject, + } + + export class ValidatorV0 extends jspb.Message { + getProTxHash(): Uint8Array | string; + getProTxHash_asU8(): Uint8Array; + getProTxHash_asB64(): string; + setProTxHash(value: Uint8Array | string): void; + + getNodeIp(): string; + setNodeIp(value: string): void; + + getIsBanned(): boolean; + setIsBanned(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ValidatorV0.AsObject; + static toObject(includeInstance: boolean, msg: ValidatorV0): ValidatorV0.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ValidatorV0, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ValidatorV0; + static deserializeBinaryFromReader(message: ValidatorV0, reader: jspb.BinaryReader): ValidatorV0; + } + + export namespace ValidatorV0 { + export type AsObject = { + proTxHash: Uint8Array | string, + nodeIp: string, + isBanned: boolean, + } + } + + export class ValidatorSetV0 extends jspb.Message { + getQuorumHash(): Uint8Array | string; + getQuorumHash_asU8(): Uint8Array; + getQuorumHash_asB64(): string; + setQuorumHash(value: Uint8Array | string): void; + + getCoreHeight(): number; + setCoreHeight(value: number): void; + + clearMembersList(): void; + getMembersList(): Array; + setMembersList(value: Array): void; + addMembers(value?: GetCurrentQuorumsInfoResponse.ValidatorV0, index?: number): GetCurrentQuorumsInfoResponse.ValidatorV0; + + getThresholdPublicKey(): Uint8Array | string; + getThresholdPublicKey_asU8(): Uint8Array; + getThresholdPublicKey_asB64(): string; + setThresholdPublicKey(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ValidatorSetV0.AsObject; + static toObject(includeInstance: boolean, msg: ValidatorSetV0): ValidatorSetV0.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ValidatorSetV0, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ValidatorSetV0; + static deserializeBinaryFromReader(message: ValidatorSetV0, reader: jspb.BinaryReader): ValidatorSetV0; + } + + export namespace ValidatorSetV0 { + export type AsObject = { + quorumHash: Uint8Array | string, + coreHeight: number, + membersList: Array, + thresholdPublicKey: Uint8Array | string, + } + } + + export class GetCurrentQuorumsInfoResponseV0 extends jspb.Message { + clearQuorumHashesList(): void; + getQuorumHashesList(): Array; + getQuorumHashesList_asU8(): Array; + getQuorumHashesList_asB64(): Array; + setQuorumHashesList(value: Array): void; + addQuorumHashes(value: Uint8Array | string, index?: number): Uint8Array | string; + + getCurrentQuorumHash(): Uint8Array | string; + getCurrentQuorumHash_asU8(): Uint8Array; + getCurrentQuorumHash_asB64(): string; + setCurrentQuorumHash(value: Uint8Array | string): void; + + clearValidatorSetsList(): void; + getValidatorSetsList(): Array; + setValidatorSetsList(value: Array): void; + addValidatorSets(value?: GetCurrentQuorumsInfoResponse.ValidatorSetV0, index?: number): GetCurrentQuorumsInfoResponse.ValidatorSetV0; + + getLastBlockProposer(): Uint8Array | string; + getLastBlockProposer_asU8(): Uint8Array; + getLastBlockProposer_asB64(): string; + setLastBlockProposer(value: Uint8Array | string): void; + + hasMetadata(): boolean; + clearMetadata(): void; + getMetadata(): ResponseMetadata | undefined; + setMetadata(value?: ResponseMetadata): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetCurrentQuorumsInfoResponseV0.AsObject; + static toObject(includeInstance: boolean, msg: GetCurrentQuorumsInfoResponseV0): GetCurrentQuorumsInfoResponseV0.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetCurrentQuorumsInfoResponseV0, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetCurrentQuorumsInfoResponseV0; + static deserializeBinaryFromReader(message: GetCurrentQuorumsInfoResponseV0, reader: jspb.BinaryReader): GetCurrentQuorumsInfoResponseV0; + } + + export namespace GetCurrentQuorumsInfoResponseV0 { + export type AsObject = { + quorumHashesList: Array, + currentQuorumHash: Uint8Array | string, + validatorSetsList: Array, + lastBlockProposer: Uint8Array | string, + metadata?: ResponseMetadata.AsObject, + } + } + + export enum VersionCase { + VERSION_NOT_SET = 0, + V0 = 1, + } +} + export interface KeyPurposeMap { AUTHENTICATION: 0; ENCRYPTION: 1; diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js index 746f5210fd..ca80ce2ad7 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js @@ -75,6 +75,14 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.VersionCase', null, { proto }); @@ -133,7 +141,6 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlock goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0', null, { proto }); @@ -1404,7 +1411,7 @@ if (goog.DEBUG && !COMPILED) { * @constructor */ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.repeatedFields_, null); }; goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0, jspb.Message); if (goog.DEBUG && !COMPILED) { @@ -1414,27 +1421,6 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0'; } -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.repeatedFields_, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds'; -} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -4144,6 +4130,132 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.displayName = 'proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0'; +} @@ -13367,8 +13479,8 @@ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEv */ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getEpoch(); - if (f !== 0) { + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { writer.writeUint32( 1, f @@ -13405,7 +13517,25 @@ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEv * @return {!proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} returns this */ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.setEpoch = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.clearEpoch = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.hasEpoch = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -14611,8 +14741,8 @@ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.Get */ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getEpoch(); - if (f !== 0) { + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { writer.writeUint32( 1, f @@ -14663,7 +14793,25 @@ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.Get * @return {!proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} returns this */ proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.setEpoch = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.clearEpoch = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.hasEpoch = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -15018,6 +15166,13 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.serializeBinaryToWr +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -15049,7 +15204,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalanc */ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.toObject = function(includeInstance, msg) { var f, obj = { - identitiesIds: (f = msg.getIdentitiesIds()) && proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.toObject(includeInstance, f), + idsList: msg.getIdsList_asB64(), prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) }; @@ -15088,9 +15243,8 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalanc var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.deserializeBinaryFromReader); - msg.setIdentitiesIds(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addIds(value); break; case 2: var value = /** @type {boolean} */ (reader.readBool()); @@ -15125,12 +15279,11 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalanc */ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getIdentitiesIds(); - if (f != null) { - writer.writeMessage( + f = message.getIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( 1, - f, - proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.serializeBinaryToWriter + f ); } f = message.getProve(); @@ -15143,163 +15296,44 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalanc }; - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.toObject = function(includeInstance, msg) { - var f, obj = { - identitiesIdsList: msg.getIdentitiesIdsList_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds; - return proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addIdentitiesIds(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getIdentitiesIdsList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 1, - f - ); - } -}; - - /** - * repeated bytes identities_ids = 1; + * repeated bytes ids = 1; * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.getIdentitiesIdsList = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.getIdsList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * repeated bytes identities_ids = 1; - * This is a type-conversion wrapper around `getIdentitiesIdsList()` + * repeated bytes ids = 1; + * This is a type-conversion wrapper around `getIdsList()` * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.getIdentitiesIdsList_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.getIdsList_asB64 = function() { return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getIdentitiesIdsList())); + this.getIdsList())); }; /** - * repeated bytes identities_ids = 1; + * repeated bytes ids = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentitiesIdsList()` + * This is a type-conversion wrapper around `getIdsList()` * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.getIdentitiesIdsList_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.getIdsList_asU8 = function() { return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getIdentitiesIdsList())); + this.getIdsList())); }; /** * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.setIdentitiesIdsList = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.setIdsList = function(value) { return jspb.Message.setField(this, 1, value || []); }; @@ -15307,56 +15341,19 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalanc /** * @param {!(string|Uint8Array)} value * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.addIdentitiesIds = function(value, opt_index) { +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.addIds = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} returns this - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds.prototype.clearIdentitiesIdsList = function() { - return this.setIdentitiesIdsList([]); -}; - - -/** - * optional GetIdentitiesBalancesByKnownIdentityIds identities_ids = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.getIdentitiesIds = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.GetIdentitiesBalancesByKnownIdentityIds|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.setIdentitiesIds = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.clearIdentitiesIds = function() { - return this.setIdentitiesIds(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.hasIdentitiesIds = function() { - return jspb.Message.getField(this, 1) != null; +proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prototype.clearIdsList = function() { + return this.setIdsList([]); }; @@ -44168,6 +44165,1363 @@ proto.org.dash.platform.dapi.v0.GetStatusResponse.prototype.hasV0 = function() { }; + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +/** + * optional GetCurrentQuorumsInfoRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject = function(includeInstance, msg) { + var f, obj = { + proTxHash: msg.getProTxHash_asB64(), + nodeIp: jspb.Message.getFieldWithDefault(msg, 2, ""), + isBanned: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setProTxHash(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setNodeIp(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsBanned(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProTxHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getNodeIp(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getIsBanned(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * optional bytes pro_tx_hash = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.getProTxHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes pro_tx_hash = 1; + * This is a type-conversion wrapper around `getProTxHash()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.getProTxHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getProTxHash())); +}; + + +/** + * optional bytes pro_tx_hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getProTxHash()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.getProTxHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getProTxHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.setProTxHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string node_ip = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.getNodeIp = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.setNodeIp = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bool is_banned = 3; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.getIsBanned = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.prototype.setIsBanned = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject = function(includeInstance, msg) { + var f, obj = { + quorumHash: msg.getQuorumHash_asB64(), + coreHeight: jspb.Message.getFieldWithDefault(msg, 2, 0), + membersList: jspb.Message.toObjectList(msg.getMembersList(), + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject, includeInstance), + thresholdPublicKey: msg.getThresholdPublicKey_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setQuorumHash(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setCoreHeight(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.deserializeBinaryFromReader); + msg.addMembers(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setThresholdPublicKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getQuorumHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getCoreHeight(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } + f = message.getMembersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.serializeBinaryToWriter + ); + } + f = message.getThresholdPublicKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } +}; + + +/** + * optional bytes quorum_hash = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getQuorumHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes quorum_hash = 1; + * This is a type-conversion wrapper around `getQuorumHash()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getQuorumHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getQuorumHash())); +}; + + +/** + * optional bytes quorum_hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getQuorumHash()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getQuorumHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getQuorumHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.setQuorumHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional uint32 core_height = 2; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getCoreHeight = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.setCoreHeight = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * repeated ValidatorV0 members = 3; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getMembersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.setMembersList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.addMembers = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.clearMembersList = function() { + return this.setMembersList([]); +}; + + +/** + * optional bytes threshold_public_key = 4; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getThresholdPublicKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes threshold_public_key = 4; + * This is a type-conversion wrapper around `getThresholdPublicKey()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getThresholdPublicKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getThresholdPublicKey())); +}; + + +/** + * optional bytes threshold_public_key = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getThresholdPublicKey()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.getThresholdPublicKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getThresholdPublicKey())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.prototype.setThresholdPublicKey = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.repeatedFields_ = [1,3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject = function(includeInstance, msg) { + var f, obj = { + quorumHashesList: msg.getQuorumHashesList_asB64(), + currentQuorumHash: msg.getCurrentQuorumHash_asB64(), + validatorSetsList: jspb.Message.toObjectList(msg.getValidatorSetsList(), + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject, includeInstance), + lastBlockProposer: msg.getLastBlockProposer_asB64(), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0; + return proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addQuorumHashes(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setCurrentQuorumHash(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.deserializeBinaryFromReader); + msg.addValidatorSets(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setLastBlockProposer(value); + break; + case 5: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getQuorumHashesList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getCurrentQuorumHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getValidatorSetsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.serializeBinaryToWriter + ); + } + f = message.getLastBlockProposer_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated bytes quorum_hashes = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getQuorumHashesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes quorum_hashes = 1; + * This is a type-conversion wrapper around `getQuorumHashesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getQuorumHashesList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getQuorumHashesList())); +}; + + +/** + * repeated bytes quorum_hashes = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getQuorumHashesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getQuorumHashesList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getQuorumHashesList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.setQuorumHashesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.addQuorumHashes = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.clearQuorumHashesList = function() { + return this.setQuorumHashesList([]); +}; + + +/** + * optional bytes current_quorum_hash = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getCurrentQuorumHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes current_quorum_hash = 2; + * This is a type-conversion wrapper around `getCurrentQuorumHash()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getCurrentQuorumHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getCurrentQuorumHash())); +}; + + +/** + * optional bytes current_quorum_hash = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getCurrentQuorumHash()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getCurrentQuorumHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getCurrentQuorumHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.setCurrentQuorumHash = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * repeated ValidatorSetV0 validator_sets = 3; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getValidatorSetsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.setValidatorSetsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.addValidatorSets = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.clearValidatorSetsList = function() { + return this.setValidatorSetsList([]); +}; + + +/** + * optional bytes last_block_proposer = 4; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getLastBlockProposer = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes last_block_proposer = 4; + * This is a type-conversion wrapper around `getLastBlockProposer()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getLastBlockProposer_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getLastBlockProposer())); +}; + + +/** + * optional bytes last_block_proposer = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getLastBlockProposer()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getLastBlockProposer_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getLastBlockProposer())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.setLastBlockProposer = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); +}; + + +/** + * optional ResponseMetadata metadata = 5; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 5)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional GetCurrentQuorumsInfoResponseV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + /** * @enum {number} */ diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts index 6488351eb1..11bc954b2d 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts @@ -283,6 +283,15 @@ type PlatformgetStatus = { readonly responseType: typeof platform_pb.GetStatusResponse; }; +type PlatformgetCurrentQuorumsInfo = { + readonly methodName: string; + readonly service: typeof Platform; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof platform_pb.GetCurrentQuorumsInfoRequest; + readonly responseType: typeof platform_pb.GetCurrentQuorumsInfoResponse; +}; + export class Platform { static readonly serviceName: string; static readonly broadcastStateTransition: PlatformbroadcastStateTransition; @@ -316,6 +325,7 @@ export class Platform { static readonly getTotalCreditsInPlatform: PlatformgetTotalCreditsInPlatform; static readonly getPathElements: PlatformgetPathElements; static readonly getStatus: PlatformgetStatus; + static readonly getCurrentQuorumsInfo: PlatformgetCurrentQuorumsInfo; } export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } @@ -629,5 +639,14 @@ export class PlatformClient { requestMessage: platform_pb.GetStatusRequest, callback: (error: ServiceError|null, responseMessage: platform_pb.GetStatusResponse|null) => void ): UnaryResponse; + getCurrentQuorumsInfo( + requestMessage: platform_pb.GetCurrentQuorumsInfoRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetCurrentQuorumsInfoResponse|null) => void + ): UnaryResponse; + getCurrentQuorumsInfo( + requestMessage: platform_pb.GetCurrentQuorumsInfoRequest, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetCurrentQuorumsInfoResponse|null) => void + ): UnaryResponse; } diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js index 103a394fea..5ba77dbcd4 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js @@ -289,6 +289,15 @@ Platform.getStatus = { responseType: platform_pb.GetStatusResponse }; +Platform.getCurrentQuorumsInfo = { + methodName: "getCurrentQuorumsInfo", + service: Platform, + requestStream: false, + responseStream: false, + requestType: platform_pb.GetCurrentQuorumsInfoRequest, + responseType: platform_pb.GetCurrentQuorumsInfoResponse +}; + exports.Platform = Platform; function PlatformClient(serviceHost, options) { @@ -1257,5 +1266,36 @@ PlatformClient.prototype.getStatus = function getStatus(requestMessage, metadata }; }; +PlatformClient.prototype.getCurrentQuorumsInfo = function getCurrentQuorumsInfo(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Platform.getCurrentQuorumsInfo, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + exports.PlatformClient = PlatformClient; diff --git a/packages/dapi-grpc/package.json b/packages/dapi-grpc/package.json index b46e45c071..a60b2363ad 100644 --- a/packages/dapi-grpc/package.json +++ b/packages/dapi-grpc/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/dapi-grpc", - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "DAPI GRPC definition file and generated clients", "browser": "browser.js", "main": "node.js", diff --git a/packages/dapi-grpc/protos/platform/v0/platform.proto b/packages/dapi-grpc/protos/platform/v0/platform.proto index b690d3f7cc..b46d784ceb 100644 --- a/packages/dapi-grpc/protos/platform/v0/platform.proto +++ b/packages/dapi-grpc/protos/platform/v0/platform.proto @@ -54,6 +54,7 @@ service Platform { rpc getTotalCreditsInPlatform(GetTotalCreditsInPlatformRequest) returns (GetTotalCreditsInPlatformResponse); rpc getPathElements(GetPathElementsRequest) returns (GetPathElementsResponse); rpc getStatus(GetStatusRequest) returns (GetStatusResponse); + rpc getCurrentQuorumsInfo(GetCurrentQuorumsInfoRequest) returns (GetCurrentQuorumsInfoResponse); } // Proof message includes cryptographic proofs for validating responses @@ -1184,3 +1185,33 @@ message GetStatusResponse { oneof version { GetStatusResponseV0 v0 = 1; } } + +message GetCurrentQuorumsInfoRequest { + message GetCurrentQuorumsInfoRequestV0 { + } + + oneof version { GetCurrentQuorumsInfoRequestV0 v0 = 1; } +} + +message GetCurrentQuorumsInfoResponse { + message ValidatorV0 { + bytes pro_tx_hash = 1; + string node_ip = 2; + bool is_banned = 3; + } + message ValidatorSetV0 { + bytes quorum_hash = 1; + uint32 core_height = 2; + repeated ValidatorV0 members = 3; + bytes threshold_public_key = 4; + } + + message GetCurrentQuorumsInfoResponseV0 { + repeated bytes quorum_hashes = 1; + bytes current_quorum_hash = 2; + repeated ValidatorSetV0 validator_sets = 3; + bytes last_block_proposer = 4; + ResponseMetadata metadata = 5; + } + oneof version { GetCurrentQuorumsInfoResponseV0 v0 = 1; } +} diff --git a/packages/dapi/package.json b/packages/dapi/package.json index 9fb334c4e7..0e6a27e61a 100644 --- a/packages/dapi/package.json +++ b/packages/dapi/package.json @@ -1,7 +1,7 @@ { "name": "@dashevo/dapi", "private": true, - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "A decentralized API for the Dash network", "scripts": { "api": "node scripts/api.js", diff --git a/packages/dash-spv/package.json b/packages/dash-spv/package.json index 658852b865..184d91d8ac 100644 --- a/packages/dash-spv/package.json +++ b/packages/dash-spv/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/dash-spv", - "version": "2.3.0", + "version": "2.4.0-dev.1", "description": "Repository containing SPV functions used by @dashevo", "main": "index.js", "scripts": { diff --git a/packages/dashmate/configs/getConfigFileMigrationsFactory.js b/packages/dashmate/configs/getConfigFileMigrationsFactory.js index 3131f435a0..4b04f1376e 100644 --- a/packages/dashmate/configs/getConfigFileMigrationsFactory.js +++ b/packages/dashmate/configs/getConfigFileMigrationsFactory.js @@ -902,6 +902,15 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs) }); return configFile; }, + '1.4.0-dev.1': (configFile) => { + Object.entries(configFile.configs) + .forEach(([, options]) => { + options.platform.drive.tenderdash.docker.image = 'dashpay/tenderdash:1.3'; + options.platform.drive.abci.docker.image = 'dashpay/drive:1-dev'; + options.platform.dapi.api.docker.image = 'dashpay/dapi:1-dev'; + }); + return configFile; + }, }; } diff --git a/packages/dashmate/package.json b/packages/dashmate/package.json index 4a04956ccc..0479cce9b8 100644 --- a/packages/dashmate/package.json +++ b/packages/dashmate/package.json @@ -1,6 +1,6 @@ { "name": "dashmate", - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "Distribution package for Dash node installation", "scripts": { "lint": "eslint .", diff --git a/packages/dashmate/src/commands/reset.js b/packages/dashmate/src/commands/reset.js index 99b640cdfc..571b3b2ff3 100644 --- a/packages/dashmate/src/commands/reset.js +++ b/packages/dashmate/src/commands/reset.js @@ -9,7 +9,7 @@ export default class ResetCommand extends ConfigBaseCommand { static flags = { ...ConfigBaseCommand.flags, - hard: Flags.boolean({ char: 'h', description: 'reset config as well as services and data', default: false }), + hard: Flags.boolean({ description: 'reset config as well as services and data', default: false }), force: Flags.boolean({ char: 'f', description: 'skip running services check', default: false }), platform: Flags.boolean({ char: 'p', description: 'reset platform services and data only', default: false }), verbose: Flags.boolean({ char: 'v', description: 'use verbose mode for output', default: false }), @@ -38,6 +38,49 @@ export default class ResetCommand extends ConfigBaseCommand { ) { const tasks = new Listr( [ + { + enabled: (ctx) => !ctx.isForce, + task: async (ctx, task) => { + let message; + if (ctx.isHardReset) { + if (ctx.keepData) { + message = 'Are you sure you want to reset your node configuration? Data will be' + + ' kept.'; + if (ctx.isPlatformOnlyReset) { + message = 'Are you sure you want to reset platform related configuration? Data' + + ' will be kept'; + } + } else { + message = 'Are you sure you want to reset your node data and configuration?'; + if (ctx.isPlatformOnlyReset) { + message = 'Are you sure you want to reset platform related data and configuration?'; + } + } + } else if (ctx.keepData) { + message = 'Are you sure you want to reset docker containers?'; + if (ctx.isPlatformOnlyReset) { + message = 'Are you sure you want to reset platform related docker containers?'; + } + } else { + message = 'Are you sure you want to reset your node data?'; + if (ctx.isPlatformOnlyReset) { + message = 'Are you sure you want to reset platform related data?'; + } + } + + const agreement = await task.prompt({ + type: 'toggle', + name: 'confirm', + message, + enabled: 'Yes', + disabled: 'No', + }); + + if (!agreement) { + throw new Error('Reset operation was declined'); + } + }, + }, { title: `Reset ${config.getName()} node`, task: () => resetNodeTask(config), diff --git a/packages/dashmate/src/docker/DockerCompose.js b/packages/dashmate/src/docker/DockerCompose.js index c9231128be..8a50800805 100644 --- a/packages/dashmate/src/docker/DockerCompose.js +++ b/packages/dashmate/src/docker/DockerCompose.js @@ -487,13 +487,23 @@ export default class DockerCompose { * Logs * * @param {Config} config - * @return {Promise} + * @param {string[]} services + * @param {Object} options + * @param {number} options.tail + * @return {Promise<{exitCode: number | null, out: string, err: string}>} */ - async logs(config, services = []) { + async logs(config, services = [], options = {}) { await this.throwErrorIfNotInstalled(); + const args = [...services]; + if (options.tail) { + args.unshift('--tail', options.tail.toString()); + } + + const commandOptions = this.#createOptions(config); + try { - return dockerCompose.logs(services, this.#createOptions(config)); + return await dockerCompose.logs(args, commandOptions); } catch (e) { throw new DockerComposeError(e); } diff --git a/packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js b/packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js index 1c4d7540be..8e4ae5794a 100644 --- a/packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js +++ b/packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js @@ -323,7 +323,7 @@ export default function collectSamplesTaskFactory( services.map(async (service) => { const [inspect, logs] = (await Promise.allSettled([ dockerCompose.inspectService(config, service.name), - dockerCompose.logs(config, [service.name]), + dockerCompose.logs(config, [service.name], { tail: 300000 }), ])).map((e) => e.value || e.reason); if (logs?.out) { diff --git a/packages/dashmate/src/update/updateNodeFactory.js b/packages/dashmate/src/update/updateNodeFactory.js index 13cf1ef83c..0f50d44acb 100644 --- a/packages/dashmate/src/update/updateNodeFactory.js +++ b/packages/dashmate/src/update/updateNodeFactory.js @@ -31,7 +31,7 @@ export default function updateNodeFactory(getServiceList, docker) { name, title, image, updated: 'error', }); } else { - let updated = null; + let updated = 'error'; stream.on('data', (data) => { // parse all stdout and gather Status message diff --git a/packages/dashpay-contract/Cargo.toml b/packages/dashpay-contract/Cargo.toml index 6efcb83f63..cdb3ea808e 100644 --- a/packages/dashpay-contract/Cargo.toml +++ b/packages/dashpay-contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dashpay-contract" description = "DashPay data contract schema and tools" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/dashpay-contract/package.json b/packages/dashpay-contract/package.json index 96f0356074..a13c5e8590 100644 --- a/packages/dashpay-contract/package.json +++ b/packages/dashpay-contract/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/dashpay-contract", - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "Reference contract of the DashPay DPA on Dash Evolution", "scripts": { "lint": "eslint .", diff --git a/packages/data-contracts/Cargo.toml b/packages/data-contracts/Cargo.toml index a49e9512a3..84cf2284a0 100644 --- a/packages/data-contracts/Cargo.toml +++ b/packages/data-contracts/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "data-contracts" description = "Dash Platform system data contracts" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/dpns-contract/Cargo.toml b/packages/dpns-contract/Cargo.toml index 248a26eeb6..8b66395d80 100644 --- a/packages/dpns-contract/Cargo.toml +++ b/packages/dpns-contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dpns-contract" description = "DPNS data contract schema and tools" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/dpns-contract/package.json b/packages/dpns-contract/package.json index cc3187f1c6..440a7beb75 100644 --- a/packages/dpns-contract/package.json +++ b/packages/dpns-contract/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/dpns-contract", - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "A contract and helper scripts for DPNS DApp", "scripts": { "lint": "eslint .", diff --git a/packages/feature-flags-contract/Cargo.toml b/packages/feature-flags-contract/Cargo.toml index 2044bbbf66..2bfb4c0087 100644 --- a/packages/feature-flags-contract/Cargo.toml +++ b/packages/feature-flags-contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "feature-flags-contract" description = "Feature flags data contract schema and tools" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/feature-flags-contract/package.json b/packages/feature-flags-contract/package.json index 34bf2c1210..0e7889df7a 100644 --- a/packages/feature-flags-contract/package.json +++ b/packages/feature-flags-contract/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/feature-flags-contract", - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "Data Contract to store Dash Platform feature flags", "scripts": { "build": "", diff --git a/packages/js-dapi-client/package.json b/packages/js-dapi-client/package.json index 516e8514b1..27fb6d3f51 100644 --- a/packages/js-dapi-client/package.json +++ b/packages/js-dapi-client/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/dapi-client", - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "Client library used to access Dash DAPI endpoints", "main": "lib/index.js", "contributors": [ diff --git a/packages/js-grpc-common/package.json b/packages/js-grpc-common/package.json index ab854954b1..02124c466d 100644 --- a/packages/js-grpc-common/package.json +++ b/packages/js-grpc-common/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/grpc-common", - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "Common GRPC library", "main": "index.js", "scripts": { diff --git a/packages/masternode-reward-shares-contract/Cargo.toml b/packages/masternode-reward-shares-contract/Cargo.toml index 5fbfd27173..49c81c24db 100644 --- a/packages/masternode-reward-shares-contract/Cargo.toml +++ b/packages/masternode-reward-shares-contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "masternode-reward-shares-contract" description = "Masternode reward shares data contract schema and tools" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/masternode-reward-shares-contract/package.json b/packages/masternode-reward-shares-contract/package.json index 2d2a3d2988..3610bd1ae6 100644 --- a/packages/masternode-reward-shares-contract/package.json +++ b/packages/masternode-reward-shares-contract/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/masternode-reward-shares-contract", - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "A contract and helper scripts for reward sharing", "scripts": { "lint": "eslint .", diff --git a/packages/platform-test-suite/package.json b/packages/platform-test-suite/package.json index d50fb65b87..336b45bed5 100644 --- a/packages/platform-test-suite/package.json +++ b/packages/platform-test-suite/package.json @@ -1,7 +1,7 @@ { "name": "@dashevo/platform-test-suite", "private": true, - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "Dash Network end-to-end tests", "scripts": { "test": "yarn exec bin/test.sh", diff --git a/packages/rs-dapi-client/Cargo.toml b/packages/rs-dapi-client/Cargo.toml index 7c805d47d0..c95a2a458d 100644 --- a/packages/rs-dapi-client/Cargo.toml +++ b/packages/rs-dapi-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rs-dapi-client" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" [features] diff --git a/packages/rs-dapi-client/src/transport/grpc.rs b/packages/rs-dapi-client/src/transport/grpc.rs index 9350696e75..4cfa0c2649 100644 --- a/packages/rs-dapi-client/src/transport/grpc.rs +++ b/packages/rs-dapi-client/src/transport/grpc.rs @@ -376,6 +376,15 @@ impl_transport_request_grpc!( get_total_credits_in_platform ); +// rpc getCurrentQuorumsInfo(GetCurrentQuorumsInfoRequest) returns (GetCurrentQuorumsInfoResponse); +impl_transport_request_grpc!( + platform_proto::GetCurrentQuorumsInfoRequest, + platform_proto::GetCurrentQuorumsInfoResponse, + PlatformGrpcClient, + RequestSettings::default(), + get_current_quorums_info +); + // Link to each core gRPC request what client and method to use: impl_transport_request_grpc!( diff --git a/packages/rs-dapi-grpc-macros/Cargo.toml b/packages/rs-dapi-grpc-macros/Cargo.toml index b5d58b4be4..5db0e75748 100644 --- a/packages/rs-dapi-grpc-macros/Cargo.toml +++ b/packages/rs-dapi-grpc-macros/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dapi-grpc-macros" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" description = "Macros used by dapi-grpc. Internal use only." diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index 9f72b6ea77..122a75930e 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dpp" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true authors = [ @@ -70,7 +70,7 @@ once_cell = "1.19.0" [dev-dependencies] test-case = { version = "2.0" } tokio = { version = "1.17", features = ["full"] } -pretty_assertions = { version = "1.3.0" } +pretty_assertions = { version = "1.4.1" } dpp = { path = ".", features = ["all_features_without_client"] } assert_matches = "1.5.0" once_cell = "1.7" @@ -89,6 +89,9 @@ all_features = [ "identity-hashing", "identity-serialization", "ciborium", + "core-types", + "core-types-serialization", + "core-types-serde-conversion", "document-serde-conversion", "document-value-conversion", "document-json-conversion", @@ -131,6 +134,9 @@ dash-sdk-features = [ "document-value-conversion", "data-contract-value-conversion", "identity-value-conversion", + "core-types", + "core-types-serialization", + "core-types-serde-conversion", "state-transition-serde-conversion", "state-transition-value-conversion", "state-transition-json-conversion", @@ -152,6 +158,9 @@ all_features_without_client = [ "identity-hashing", "identity-serialization", "ciborium", + "core-types", + "core-types-serialization", + "core-types-serde-conversion", "document-serde-conversion", "document-value-conversion", "document-json-conversion", @@ -189,6 +198,9 @@ abci = [ "identity-serialization", "vote-serialization", "platform-value-cbor", + "core-types", + "core-types-serialization", + "core-types-serde-conversion", ] cbor = ["ciborium"] validation = [ @@ -261,6 +273,9 @@ state-transition-signing = [ ] vote-serialization = [] vote-serde-conversion = [] +core-types = ["bls-signatures"] +core-types-serialization = ["core-types"] +core-types-serde-conversion = ["core-types"] state-transitions = [] system_contracts = ["factories", "data-contracts", "platform-value-json"] fixtures-and-mocks = ["system_contracts", "platform-value/json"] diff --git a/packages/rs-dpp/src/core_types/mod.rs b/packages/rs-dpp/src/core_types/mod.rs new file mode 100644 index 0000000000..10572cdf0f --- /dev/null +++ b/packages/rs-dpp/src/core_types/mod.rs @@ -0,0 +1,2 @@ +pub mod validator; +pub mod validator_set; diff --git a/packages/rs-dpp/src/core_types/validator/mod.rs b/packages/rs-dpp/src/core_types/validator/mod.rs new file mode 100644 index 0000000000..2261bac56f --- /dev/null +++ b/packages/rs-dpp/src/core_types/validator/mod.rs @@ -0,0 +1,119 @@ +use crate::bls_signatures::PublicKey as BlsPublicKey; +use crate::core_types::validator::v0::{ValidatorV0, ValidatorV0Getters, ValidatorV0Setters}; +use dashcore::{ProTxHash, PubkeyHash}; +#[cfg(feature = "core-types-serde-conversion")] +use serde::{Deserialize, Serialize}; + +/// Version 0 +pub mod v0; + +/// A validator in the context of a quorum +#[derive(Clone, Debug, Eq, PartialEq)] +#[cfg_attr( + feature = "core-types-serde-conversion", + derive(Serialize, Deserialize) +)] +pub enum Validator { + /// Version 0 + V0(ValidatorV0), +} + +impl ValidatorV0Getters for Validator { + fn pro_tx_hash(&self) -> &ProTxHash { + match self { + Validator::V0(v0) => v0.pro_tx_hash(), + } + } + + fn public_key(&self) -> &Option { + match self { + Validator::V0(v0) => v0.public_key(), + } + } + + fn node_ip(&self) -> &String { + match self { + Validator::V0(v0) => v0.node_ip(), + } + } + + fn node_id(&self) -> &PubkeyHash { + match self { + Validator::V0(v0) => v0.node_id(), + } + } + + fn core_port(&self) -> u16 { + match self { + Validator::V0(v0) => v0.core_port(), + } + } + + fn platform_http_port(&self) -> u16 { + match self { + Validator::V0(v0) => v0.platform_http_port(), + } + } + + fn platform_p2p_port(&self) -> u16 { + match self { + Validator::V0(v0) => v0.platform_p2p_port(), + } + } + + fn is_banned(&self) -> bool { + match self { + Validator::V0(v0) => v0.is_banned(), + } + } +} + +impl ValidatorV0Setters for Validator { + fn set_pro_tx_hash(&mut self, pro_tx_hash: ProTxHash) { + match self { + Validator::V0(v0) => v0.set_pro_tx_hash(pro_tx_hash), + } + } + + fn set_public_key(&mut self, public_key: Option) { + match self { + Validator::V0(v0) => v0.set_public_key(public_key), + } + } + + fn set_node_ip(&mut self, node_ip: String) { + match self { + Validator::V0(v0) => v0.set_node_ip(node_ip), + } + } + + fn set_node_id(&mut self, node_id: PubkeyHash) { + match self { + Validator::V0(v0) => v0.set_node_id(node_id), + } + } + + fn set_core_port(&mut self, core_port: u16) { + match self { + Validator::V0(v0) => v0.set_core_port(core_port), + } + } + + fn set_platform_http_port(&mut self, platform_http_port: u16) { + match self { + Validator::V0(v0) => v0.set_platform_http_port(platform_http_port), + } + } + + fn set_platform_p2p_port(&mut self, platform_p2p_port: u16) { + match self { + Validator::V0(v0) => v0.set_platform_p2p_port(platform_p2p_port), + } + } + + fn set_is_banned(&mut self, is_banned: bool) { + match self { + Validator::V0(v0) => v0.set_is_banned(is_banned), + } + } +} diff --git a/packages/rs-dpp/src/core_types/validator/v0/mod.rs b/packages/rs-dpp/src/core_types/validator/v0/mod.rs new file mode 100644 index 0000000000..daadc197fe --- /dev/null +++ b/packages/rs-dpp/src/core_types/validator/v0/mod.rs @@ -0,0 +1,252 @@ +use dashcore::{ProTxHash, PubkeyHash}; +use std::fmt::{Debug, Formatter}; + +use crate::bls_signatures::PublicKey as BlsPublicKey; +#[cfg(feature = "core-types-serde-conversion")] +use serde::{Deserialize, Serialize}; + +#[cfg(feature = "core-types-serialization")] +use bincode::de::Decoder; +#[cfg(feature = "core-types-serialization")] +use bincode::enc::Encoder; +#[cfg(feature = "core-types-serialization")] +use bincode::error::{DecodeError, EncodeError}; +#[cfg(feature = "core-types-serialization")] +use bincode::{Decode, Encode}; +#[cfg(feature = "core-types-serialization")] +use dashcore::hashes::Hash; + +/// A validator in the context of a quorum +#[derive(Clone, Eq, PartialEq)] +#[cfg_attr( + feature = "core-types-serde-conversion", + derive(Serialize, Deserialize) +)] +pub struct ValidatorV0 { + /// The proTxHash + pub pro_tx_hash: ProTxHash, + /// The public key share of this validator for this quorum + pub public_key: Option, + /// The node address + pub node_ip: String, + /// The node id + pub node_id: PubkeyHash, + /// Core port + pub core_port: u16, + /// Http port + pub platform_http_port: u16, + /// Tenderdash port + pub platform_p2p_port: u16, + /// Is the validator banned + pub is_banned: bool, +} + +#[cfg(feature = "core-types-serialization")] +impl Encode for ValidatorV0 { + fn encode(&self, encoder: &mut E) -> Result<(), EncodeError> { + // Encode each field in the order they appear in the struct + + // Encode ProTxHash + self.pro_tx_hash.to_byte_array().to_vec().encode(encoder)?; + + // Encode Option + match &self.public_key { + Some(public_key) => { + true.encode(encoder)?; // Indicate that public_key is present + public_key.to_bytes().encode(encoder)?; + } + None => { + false.encode(encoder)?; // Indicate that public_key is not present + } + } + + // Encode node_ip as a string + self.node_ip.encode(encoder)?; + + // Encode node_id + self.node_id.to_byte_array().to_vec().encode(encoder)?; + + // Encode core_port, platform_http_port, and platform_p2p_port as u16 + self.core_port.encode(encoder)?; + self.platform_http_port.encode(encoder)?; + self.platform_p2p_port.encode(encoder)?; + + // Encode is_banned as a boolean + self.is_banned.encode(encoder)?; + + Ok(()) + } +} + +#[cfg(feature = "core-types-serialization")] +impl Decode for ValidatorV0 { + fn decode(decoder: &mut D) -> Result { + // Decode each field in the same order as they were encoded + + // Decode ProTxHash + let pro_tx_hash_bytes = Vec::::decode(decoder)?; + let pro_tx_hash = ProTxHash::from_slice(&pro_tx_hash_bytes) + .map_err(|_| DecodeError::OtherString("Failed to decode ProTxHash".to_string()))?; + + // Decode Option + let has_public_key = bool::decode(decoder)?; + let public_key = if has_public_key { + let public_key_bytes = Vec::::decode(decoder)?; + Some(BlsPublicKey::from_bytes(&public_key_bytes).map_err(|_| { + DecodeError::OtherString("Failed to decode BlsPublicKey".to_string()) + })?) + } else { + None + }; + + // Decode node_ip as a string + let node_ip = String::decode(decoder)?; + + // Decode node_id + let node_id_bytes = Vec::::decode(decoder)?; + let node_id = PubkeyHash::from_slice(&node_id_bytes) + .map_err(|_| DecodeError::OtherString("Failed to decode NodeId".to_string()))?; + + // Decode core_port, platform_http_port, and platform_p2p_port as u16 + let core_port = u16::decode(decoder)?; + let platform_http_port = u16::decode(decoder)?; + let platform_p2p_port = u16::decode(decoder)?; + + // Decode is_banned as a boolean + let is_banned = bool::decode(decoder)?; + + Ok(ValidatorV0 { + pro_tx_hash, + public_key, + node_ip, + node_id, + core_port, + platform_http_port, + platform_p2p_port, + is_banned, + }) + } +} + +impl Debug for ValidatorV0 { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("ValidatorV0") + .field("pro_tx_hash", &self.pro_tx_hash.to_string()) + .field("public_key", &self.public_key) + .field("node_ip", &self.node_ip) + .field("node_id", &self.node_id) + .field("core_port", &self.core_port) + .field("platform_http_port", &self.platform_http_port) + .field("platform_p2p_port", &self.platform_p2p_port) + .field("is_banned", &self.is_banned) + .finish() + } +} + +/// Traits to get properties of a validator. +pub trait ValidatorV0Getters { + /// Returns the proTxHash of the validator. + fn pro_tx_hash(&self) -> &ProTxHash; + /// Returns the public key share of this validator for this quorum. + fn public_key(&self) -> &Option; + /// Returns the node address of the validator. + fn node_ip(&self) -> &String; + /// Returns the node id of the validator. + fn node_id(&self) -> &PubkeyHash; + /// Returns the core port of the validator. + fn core_port(&self) -> u16; + /// Returns the Http port of the validator. + fn platform_http_port(&self) -> u16; + /// Returns the Tenderdash port of the validator. + fn platform_p2p_port(&self) -> u16; + /// Returns the status of the validator whether it's banned or not. + fn is_banned(&self) -> bool; +} + +/// Traits to set properties of a validator. +pub trait ValidatorV0Setters { + /// Sets the proTxHash of the validator. + fn set_pro_tx_hash(&mut self, pro_tx_hash: ProTxHash); + /// Sets the public key share of this validator for this quorum. + fn set_public_key(&mut self, public_key: Option); + /// Sets the node address of the validator. + fn set_node_ip(&mut self, node_ip: String); + /// Sets the node id of the validator. + fn set_node_id(&mut self, node_id: PubkeyHash); + /// Sets the core port of the validator. + fn set_core_port(&mut self, core_port: u16); + /// Sets the Http port of the validator. + fn set_platform_http_port(&mut self, platform_http_port: u16); + /// Sets the Tenderdash port of the validator. + fn set_platform_p2p_port(&mut self, platform_p2p_port: u16); + /// Sets the status of the validator whether it's banned or not. + fn set_is_banned(&mut self, is_banned: bool); +} + +impl ValidatorV0Getters for ValidatorV0 { + fn pro_tx_hash(&self) -> &ProTxHash { + &self.pro_tx_hash + } + + fn public_key(&self) -> &Option { + &self.public_key + } + + fn node_ip(&self) -> &String { + &self.node_ip + } + + fn node_id(&self) -> &PubkeyHash { + &self.node_id + } + + fn core_port(&self) -> u16 { + self.core_port + } + + fn platform_http_port(&self) -> u16 { + self.platform_http_port + } + + fn platform_p2p_port(&self) -> u16 { + self.platform_p2p_port + } + + fn is_banned(&self) -> bool { + self.is_banned + } +} + +impl ValidatorV0Setters for ValidatorV0 { + fn set_pro_tx_hash(&mut self, pro_tx_hash: ProTxHash) { + self.pro_tx_hash = pro_tx_hash; + } + + fn set_public_key(&mut self, public_key: Option) { + self.public_key = public_key; + } + + fn set_node_ip(&mut self, node_ip: String) { + self.node_ip = node_ip; + } + + fn set_node_id(&mut self, node_id: PubkeyHash) { + self.node_id = node_id; + } + + fn set_core_port(&mut self, core_port: u16) { + self.core_port = core_port; + } + + fn set_platform_http_port(&mut self, platform_http_port: u16) { + self.platform_http_port = platform_http_port; + } + + fn set_platform_p2p_port(&mut self, platform_p2p_port: u16) { + self.platform_p2p_port = platform_p2p_port; + } + + fn set_is_banned(&mut self, is_banned: bool) { + self.is_banned = is_banned; + } +} diff --git a/packages/rs-dpp/src/core_types/validator_set/mod.rs b/packages/rs-dpp/src/core_types/validator_set/mod.rs new file mode 100644 index 0000000000..7238bc0b1b --- /dev/null +++ b/packages/rs-dpp/src/core_types/validator_set/mod.rs @@ -0,0 +1,111 @@ +use crate::bls_signatures::PublicKey as BlsPublicKey; +use crate::core_types::validator::v0::ValidatorV0; +use crate::core_types::validator_set::v0::{ + ValidatorSetV0, ValidatorSetV0Getters, ValidatorSetV0Setters, +}; +#[cfg(feature = "core-types-serialization")] +use crate::ProtocolError; +#[cfg(feature = "core-types-serialization")] +use bincode::{Decode, Encode}; +use dashcore::{ProTxHash, QuorumHash}; +#[cfg(feature = "core-types-serialization")] +use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; +#[cfg(feature = "core-types-serde-conversion")] +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; + +/// Version 0 +pub mod v0; + +/// The validator set is only slightly different from a quorum as it does not contain non valid +/// members +#[derive(Clone, Debug, Eq, PartialEq)] +#[cfg_attr( + feature = "core-types-serde-conversion", + derive(Serialize, Deserialize) +)] +#[cfg_attr( + feature = "core-types-serialization", + derive(Encode, Decode, PlatformDeserialize, PlatformSerialize), + platform_serialize(limit = 15000, unversioned) +)] +pub enum ValidatorSet { + /// Version 0 + V0(ValidatorSetV0), +} + +impl ValidatorSetV0Getters for ValidatorSet { + fn quorum_hash(&self) -> &QuorumHash { + match self { + ValidatorSet::V0(v0) => v0.quorum_hash(), + } + } + + fn quorum_index(&self) -> Option { + match self { + ValidatorSet::V0(v0) => v0.quorum_index(), + } + } + + fn core_height(&self) -> u32 { + match self { + ValidatorSet::V0(v0) => v0.core_height(), + } + } + + fn members(&self) -> &BTreeMap { + match self { + ValidatorSet::V0(v0) => v0.members(), + } + } + + fn members_mut(&mut self) -> &mut BTreeMap { + match self { + ValidatorSet::V0(v0) => v0.members_mut(), + } + } + + fn members_owned(self) -> BTreeMap { + match self { + ValidatorSet::V0(v0) => v0.members_owned(), + } + } + + fn threshold_public_key(&self) -> &BlsPublicKey { + match self { + ValidatorSet::V0(v0) => v0.threshold_public_key(), + } + } +} + +impl ValidatorSetV0Setters for ValidatorSet { + fn set_quorum_hash(&mut self, quorum_hash: QuorumHash) { + match self { + ValidatorSet::V0(v0) => v0.set_quorum_hash(quorum_hash), + } + } + + fn set_quorum_index(&mut self, index: Option) { + match self { + ValidatorSet::V0(v0) => v0.set_quorum_index(index), + } + } + + fn set_core_height(&mut self, core_height: u32) { + match self { + ValidatorSet::V0(v0) => v0.set_core_height(core_height), + } + } + + fn set_members(&mut self, members: BTreeMap) { + match self { + ValidatorSet::V0(v0) => v0.set_members(members), + } + } + + fn set_threshold_public_key(&mut self, threshold_public_key: BlsPublicKey) { + match self { + ValidatorSet::V0(v0) => v0.set_threshold_public_key(threshold_public_key), + } + } +} diff --git a/packages/rs-dpp/src/core_types/validator_set/v0/mod.rs b/packages/rs-dpp/src/core_types/validator_set/v0/mod.rs new file mode 100644 index 0000000000..886489ee3b --- /dev/null +++ b/packages/rs-dpp/src/core_types/validator_set/v0/mod.rs @@ -0,0 +1,249 @@ +use crate::bls_signatures::PublicKey as BlsPublicKey; +use crate::core_types::validator::v0::ValidatorV0; +#[cfg(feature = "core-types-serialization")] +use bincode::de::Decoder; +#[cfg(feature = "core-types-serialization")] +use bincode::enc::Encoder; +#[cfg(feature = "core-types-serialization")] +use bincode::error::EncodeError; +#[cfg(feature = "core-types-serialization")] +use bincode::{BorrowDecode, Decode, Encode}; +use dashcore::hashes::Hash; +use dashcore::{ProTxHash, QuorumHash}; +#[cfg(feature = "core-types-serde-conversion")] +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use std::fmt::{Debug, Formatter}; + +/// The validator set is only slightly different from a quorum as it does not contain non valid +/// members +#[derive(Clone, Eq, PartialEq)] +#[cfg_attr( + feature = "core-types-serde-conversion", + derive(Serialize, Deserialize) +)] +pub struct ValidatorSetV0 { + /// The quorum hash + pub quorum_hash: QuorumHash, + /// Rotation quorum index is available only for DIP24 quorums + pub quorum_index: Option, + /// Active height + pub core_height: u32, + /// The list of masternodes + pub members: BTreeMap, + /// The threshold quorum public key + pub threshold_public_key: BlsPublicKey, +} + +#[cfg(feature = "core-types-serialization")] +impl Encode for ValidatorSetV0 { + fn encode(&self, encoder: &mut E) -> Result<(), EncodeError> { + // Encode each field in the order they appear in the struct + let quorum_hash_bytes = self.quorum_hash.as_byte_array().to_vec(); + quorum_hash_bytes.encode(encoder)?; + self.quorum_index.encode(encoder)?; + self.core_height.encode(encoder)?; + + // Convert BTreeMap to Vec<(Vec, ValidatorV0)> and encode it + let members_as_vec: Vec<(Vec, ValidatorV0)> = self + .members + .iter() + .map(|(key, value)| (key.as_byte_array().to_vec(), value.clone())) + .collect(); + members_as_vec.encode(encoder)?; + + // Custom encoding for BlsPublicKey if needed + // Assuming BlsPublicKey can be serialized to a byte slice + let public_key_bytes = self.threshold_public_key.to_bytes(); + public_key_bytes.encode(encoder)?; + + Ok(()) + } +} + +#[cfg(feature = "core-types-serialization")] +impl Decode for ValidatorSetV0 { + fn decode(decoder: &mut D) -> Result { + // Decode each field in the same order as they were encoded + let quorum_hash = Vec::::decode(decoder)?; + let quorum_index = Option::::decode(decoder)?; + let core_height = u32::decode(decoder)?; + + // Decode Vec<(Vec, ValidatorV0)> and convert it back to BTreeMap + let members_as_vec = Vec::<(Vec, ValidatorV0)>::decode(decoder)?; + let members: BTreeMap = members_as_vec + .into_iter() + .map(|(key_bytes, value)| { + let key = ProTxHash::from_slice(&key_bytes).map_err(|_| { + bincode::error::DecodeError::OtherString( + "Failed to decode ProTxHash".to_string(), + ) + })?; + Ok((key, value)) + }) + .collect::>()?; + + // Custom decoding for BlsPublicKey if needed + // Assuming BlsPublicKey can be deserialized from a byte slice + let public_key_bytes = Vec::::decode(decoder)?; + let threshold_public_key = BlsPublicKey::from_bytes(&public_key_bytes).map_err(|_| { + bincode::error::DecodeError::OtherString("Failed to decode BlsPublicKey".to_string()) + })?; + + Ok(ValidatorSetV0 { + quorum_hash: QuorumHash::from_slice(&quorum_hash).map_err(|_| { + bincode::error::DecodeError::OtherString("Failed to decode QuorumHash".to_string()) + })?, + quorum_index, + core_height, + members, + threshold_public_key, + }) + } +} + +#[cfg(feature = "core-types-serialization")] +impl<'de> BorrowDecode<'de> for ValidatorSetV0 { + fn borrow_decode(decoder: &mut D) -> Result { + // Decode each field in the same order as they were encoded + + // Decode quorum_hash as Vec + let quorum_hash = Vec::::decode(decoder)?; + // Decode quorum_index as Option + let quorum_index = Option::::decode(decoder)?; + // Decode core_height as u32 + let core_height = u32::decode(decoder)?; + + // Decode Vec<(Vec, ValidatorV0)> and convert it back to BTreeMap + let members_as_vec = Vec::<(Vec, ValidatorV0)>::decode(decoder)?; + let members: BTreeMap = members_as_vec + .into_iter() + .map(|(key_bytes, value)| { + let key = ProTxHash::from_slice(&key_bytes).map_err(|_| { + bincode::error::DecodeError::OtherString( + "Failed to decode ProTxHash".to_string(), + ) + })?; + Ok((key, value)) + }) + .collect::>()?; + + // Custom decoding for BlsPublicKey if needed + let public_key_bytes = Vec::::decode(decoder)?; + let threshold_public_key = BlsPublicKey::from_bytes(&public_key_bytes).map_err(|_| { + bincode::error::DecodeError::OtherString("Failed to decode BlsPublicKey".to_string()) + })?; + + Ok(ValidatorSetV0 { + quorum_hash: QuorumHash::from_slice(&quorum_hash).map_err(|_| { + bincode::error::DecodeError::OtherString("Failed to decode QuorumHash".to_string()) + })?, + quorum_index, + core_height, + members, + threshold_public_key, + }) + } +} + +impl Debug for ValidatorSetV0 { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("ValidatorSetV0") + .field("quorum_hash", &self.quorum_hash.to_string()) + .field("core_height", &self.core_height) + .field( + "members", + &self + .members + .iter() + .map(|(k, v)| (k.to_string(), v)) + .collect::>(), + ) + .field("threshold_public_key", &self.threshold_public_key) + .finish() + } +} + +/// Trait providing getter methods for `ValidatorSetV0` struct +pub trait ValidatorSetV0Getters { + /// Returns the quorum hash of the validator set. + fn quorum_hash(&self) -> &QuorumHash; + /// Returns rotation quorum index. It's available only for DIP24 quorums + fn quorum_index(&self) -> Option; + /// Returns the active height of the validator set. + fn core_height(&self) -> u32; + /// Returns the members of the validator set. + fn members(&self) -> &BTreeMap; + /// Returns the members of the validator set. + fn members_mut(&mut self) -> &mut BTreeMap; + /// Returns the members of the validator set. + fn members_owned(self) -> BTreeMap; + /// Returns the threshold public key of the validator set. + fn threshold_public_key(&self) -> &BlsPublicKey; +} + +/// Trait providing setter methods for `ValidatorSetV0` struct +pub trait ValidatorSetV0Setters { + /// Sets the quorum hash of the validator set. + fn set_quorum_hash(&mut self, quorum_hash: QuorumHash); + /// Sets the quorum index of the validator set. + fn set_quorum_index(&mut self, index: Option); + /// Sets the active height of the validator set. + fn set_core_height(&mut self, core_height: u32); + /// Sets the members of the validator set. + fn set_members(&mut self, members: BTreeMap); + /// Sets the threshold public key of the validator set. + fn set_threshold_public_key(&mut self, threshold_public_key: BlsPublicKey); +} + +impl ValidatorSetV0Getters for ValidatorSetV0 { + fn quorum_hash(&self) -> &QuorumHash { + &self.quorum_hash + } + + fn quorum_index(&self) -> Option { + self.quorum_index + } + + fn core_height(&self) -> u32 { + self.core_height + } + + fn members(&self) -> &BTreeMap { + &self.members + } + + fn members_mut(&mut self) -> &mut BTreeMap { + &mut self.members + } + + fn members_owned(self) -> BTreeMap { + self.members + } + + fn threshold_public_key(&self) -> &BlsPublicKey { + &self.threshold_public_key + } +} + +impl ValidatorSetV0Setters for ValidatorSetV0 { + fn set_quorum_hash(&mut self, quorum_hash: QuorumHash) { + self.quorum_hash = quorum_hash; + } + + fn set_quorum_index(&mut self, index: Option) { + self.quorum_index = index; + } + + fn set_core_height(&mut self, core_height: u32) { + self.core_height = core_height; + } + + fn set_members(&mut self, members: BTreeMap) { + self.members = members; + } + + fn set_threshold_public_key(&mut self, threshold_public_key: BlsPublicKey) { + self.threshold_public_key = threshold_public_key; + } +} diff --git a/packages/rs-dpp/src/errors/consensus/codes.rs b/packages/rs-dpp/src/errors/consensus/codes.rs index b425853896..ca00dc1c2b 100644 --- a/packages/rs-dpp/src/errors/consensus/codes.rs +++ b/packages/rs-dpp/src/errors/consensus/codes.rs @@ -231,6 +231,8 @@ impl ErrorWithCode for StateError { Self::IdentityPublicKeyAlreadyExistsForUniqueContractBoundsError(_) => 40211, Self::DocumentTypeUpdateError(_) => 40212, Self::DataContractUpdatePermissionError(_) => 40213, + Self::MissingTransferKeyError(_) => 40214, + Self::NoTransferKeyForCoreWithdrawalAvailableError(_) => 40215, // Voting Errors: 40300-40399 Self::MasternodeNotFoundError(_) => 40300, diff --git a/packages/rs-dpp/src/errors/consensus/signature/invalid_signature_public_key_purpose_error.rs b/packages/rs-dpp/src/errors/consensus/signature/invalid_signature_public_key_purpose_error.rs index 55a0596439..1477f7b1d9 100644 --- a/packages/rs-dpp/src/errors/consensus/signature/invalid_signature_public_key_purpose_error.rs +++ b/packages/rs-dpp/src/errors/consensus/signature/invalid_signature_public_key_purpose_error.rs @@ -8,11 +8,12 @@ use crate::errors::ProtocolError; use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; use bincode::{Decode, Encode}; +use itertools::Itertools; #[derive( Error, Debug, Clone, PartialEq, Eq, Encode, Decode, PlatformSerialize, PlatformDeserialize, )] -#[error("Invalid public key purpose {public_key_purpose}. The state transition requires {allowed_key_purpose}")] +#[error("Invalid public key purpose {public_key_purpose}. The state transition requires {}", allowed_key_purposes.iter().map(|s| s.to_string()).join(" | "))] #[platform_serialize(unversioned)] pub struct InvalidSignaturePublicKeyPurposeError { /* @@ -21,22 +22,22 @@ pub struct InvalidSignaturePublicKeyPurposeError { */ public_key_purpose: Purpose, - allowed_key_purpose: Purpose, + allowed_key_purposes: Vec, } impl InvalidSignaturePublicKeyPurposeError { - pub fn new(public_key_purpose: Purpose, allowed_key_purpose: Purpose) -> Self { + pub fn new(public_key_purpose: Purpose, allowed_key_purposes: Vec) -> Self { Self { public_key_purpose, - allowed_key_purpose, + allowed_key_purposes, } } pub fn public_key_purpose(&self) -> Purpose { self.public_key_purpose } - pub fn allowed_key_purpose(&self) -> Purpose { - self.allowed_key_purpose + pub fn allowed_key_purposes(&self) -> &Vec { + &self.allowed_key_purposes } } diff --git a/packages/rs-dpp/src/errors/consensus/signature/wrong_public_key_purpose_error.rs b/packages/rs-dpp/src/errors/consensus/signature/wrong_public_key_purpose_error.rs index 501cf0d64b..4ea2b0c246 100644 --- a/packages/rs-dpp/src/errors/consensus/signature/wrong_public_key_purpose_error.rs +++ b/packages/rs-dpp/src/errors/consensus/signature/wrong_public_key_purpose_error.rs @@ -8,11 +8,12 @@ use crate::errors::ProtocolError; use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; use bincode::{Decode, Encode}; +use itertools::Itertools; #[derive( Error, Debug, Clone, PartialEq, Eq, Encode, Decode, PlatformSerialize, PlatformDeserialize, )] -#[error("Invalid identity key purpose {public_key_purpose}. This state transition requires {key_purpose_requirement}")] +#[error("Invalid identity key purpose {public_key_purpose}. This state transition requires {}", allowed_key_purposes.iter().map(|s| s.to_string()).join(" | "))] #[platform_serialize(unversioned)] pub struct WrongPublicKeyPurposeError { /* @@ -21,22 +22,22 @@ pub struct WrongPublicKeyPurposeError { */ public_key_purpose: Purpose, - key_purpose_requirement: Purpose, + allowed_key_purposes: Vec, } impl WrongPublicKeyPurposeError { - pub fn new(public_key_purpose: Purpose, key_purpose_requirement: Purpose) -> Self { + pub fn new(public_key_purpose: Purpose, allowed_key_purposes: Vec) -> Self { Self { public_key_purpose, - key_purpose_requirement, + allowed_key_purposes, } } pub fn public_key_purpose(&self) -> Purpose { self.public_key_purpose } - pub fn key_purpose_requirement(&self) -> Purpose { - self.key_purpose_requirement + pub fn allowed_key_purposes(&self) -> &Vec { + &self.allowed_key_purposes } } @@ -56,7 +57,7 @@ impl From for Conse Self::SignatureError(SignatureError::WrongPublicKeyPurposeError( WrongPublicKeyPurposeError::new( value.public_key_purpose(), - value.key_purpose_requirement(), + value.allowed_key_purposes().clone(), ), )) } diff --git a/packages/rs-dpp/src/errors/consensus/state/identity/missing_transfer_key_error.rs b/packages/rs-dpp/src/errors/consensus/state/identity/missing_transfer_key_error.rs new file mode 100644 index 0000000000..2f14ccacbc --- /dev/null +++ b/packages/rs-dpp/src/errors/consensus/state/identity/missing_transfer_key_error.rs @@ -0,0 +1,36 @@ +use crate::consensus::state::state_error::StateError; +use crate::consensus::ConsensusError; +use crate::errors::ProtocolError; +use bincode::{Decode, Encode}; +use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; +use platform_value::Identifier; +use thiserror::Error; + +#[derive( + Error, Debug, Clone, PartialEq, Eq, Encode, Decode, PlatformSerialize, PlatformDeserialize, +)] +#[error("Identity {identity_id} does not have a key for transferring funds")] +#[platform_serialize(unversioned)] +pub struct MissingTransferKeyError { + /* + + DO NOT CHANGE ORDER OF FIELDS WITHOUT INTRODUCING OF NEW VERSION + + */ + identity_id: Identifier, +} + +impl MissingTransferKeyError { + pub fn new(identity_id: Identifier) -> Self { + Self { identity_id } + } + + pub fn identity_id(&self) -> &Identifier { + &self.identity_id + } +} +impl From for ConsensusError { + fn from(err: MissingTransferKeyError) -> Self { + Self::StateError(StateError::MissingTransferKeyError(err)) + } +} diff --git a/packages/rs-dpp/src/errors/consensus/state/identity/mod.rs b/packages/rs-dpp/src/errors/consensus/state/identity/mod.rs index 53a60d0ed4..35e6f7f79a 100644 --- a/packages/rs-dpp/src/errors/consensus/state/identity/mod.rs +++ b/packages/rs-dpp/src/errors/consensus/state/identity/mod.rs @@ -14,3 +14,5 @@ pub mod invalid_identity_revision_error; pub mod master_public_key_update_error; pub mod max_identity_public_key_limit_reached_error; pub mod missing_identity_public_key_ids_error; +pub mod missing_transfer_key_error; +pub mod no_transfer_key_for_core_withdrawal_available_error; diff --git a/packages/rs-dpp/src/errors/consensus/state/identity/no_transfer_key_for_core_withdrawal_available_error.rs b/packages/rs-dpp/src/errors/consensus/state/identity/no_transfer_key_for_core_withdrawal_available_error.rs new file mode 100644 index 0000000000..77f5d52305 --- /dev/null +++ b/packages/rs-dpp/src/errors/consensus/state/identity/no_transfer_key_for_core_withdrawal_available_error.rs @@ -0,0 +1,38 @@ +use crate::consensus::state::state_error::StateError; +use crate::consensus::ConsensusError; +use crate::errors::ProtocolError; +use bincode::{Decode, Encode}; +use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; +use platform_value::Identifier; +use thiserror::Error; + +#[derive( + Error, Debug, Clone, PartialEq, Eq, Encode, Decode, PlatformSerialize, PlatformDeserialize, +)] +#[error("There is no transfer key that can be used for a withdrawal")] +#[platform_serialize(unversioned)] +pub struct NoTransferKeyForCoreWithdrawalAvailableError { + /* + + DO NOT CHANGE ORDER OF FIELDS WITHOUT INTRODUCING OF NEW VERSION + + */ + identity_id: Identifier, +} + +impl NoTransferKeyForCoreWithdrawalAvailableError { + pub fn new(identity_id: Identifier) -> Self { + Self { identity_id } + } + + pub fn identity_id(&self) -> &Identifier { + &self.identity_id + } +} +impl From for ConsensusError { + fn from(err: NoTransferKeyForCoreWithdrawalAvailableError) -> Self { + Self::StateError(StateError::NoTransferKeyForCoreWithdrawalAvailableError( + err, + )) + } +} diff --git a/packages/rs-dpp/src/errors/consensus/state/state_error.rs b/packages/rs-dpp/src/errors/consensus/state/state_error.rs index 4cc4991c6c..ab98b5c6fe 100644 --- a/packages/rs-dpp/src/errors/consensus/state/state_error.rs +++ b/packages/rs-dpp/src/errors/consensus/state/state_error.rs @@ -37,6 +37,8 @@ use crate::consensus::state::document::document_incorrect_purchase_price_error:: use crate::consensus::state::document::document_not_for_sale_error::DocumentNotForSaleError; use crate::consensus::state::identity::identity_public_key_already_exists_for_unique_contract_bounds_error::IdentityPublicKeyAlreadyExistsForUniqueContractBoundsError; use crate::consensus::state::identity::invalid_identity_contract_nonce_error::InvalidIdentityNonceError; +use crate::consensus::state::identity::missing_transfer_key_error::MissingTransferKeyError; +use crate::consensus::state::identity::no_transfer_key_for_core_withdrawal_available_error::NoTransferKeyForCoreWithdrawalAvailableError; use crate::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_insufficient_error::PrefundedSpecializedBalanceInsufficientError; use crate::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_not_found_error::PrefundedSpecializedBalanceNotFoundError; use crate::consensus::state::voting::masternode_incorrect_voter_identity_id_error::MasternodeIncorrectVoterIdentityIdError; @@ -122,6 +124,12 @@ pub enum StateError { #[error(transparent)] MissingIdentityPublicKeyIdsError(MissingIdentityPublicKeyIdsError), + #[error(transparent)] + MissingTransferKeyError(MissingTransferKeyError), + + #[error(transparent)] + NoTransferKeyForCoreWithdrawalAvailableError(NoTransferKeyForCoreWithdrawalAvailableError), + #[error(transparent)] InvalidIdentityPublicKeyIdError(InvalidIdentityPublicKeyIdError), diff --git a/packages/rs-dpp/src/identity/core_script.rs b/packages/rs-dpp/src/identity/core_script.rs index 96cea532c7..8aa7fd38a4 100644 --- a/packages/rs-dpp/src/identity/core_script.rs +++ b/packages/rs-dpp/src/identity/core_script.rs @@ -39,18 +39,22 @@ impl CoreScript { Self(bytes.into()) } - pub fn random_p2pkh(rng: &mut StdRng) -> Self { + pub fn new_p2pkh(key_hash: [u8; 20]) -> Self { let mut bytes: Vec = vec![ opcodes::all::OP_DUP.to_u8(), opcodes::all::OP_HASH160.to_u8(), opcodes::all::OP_PUSHBYTES_20.to_u8(), ]; - bytes.append(&mut rng.gen::<[u8; 20]>().to_vec()); + bytes.extend_from_slice(&key_hash); bytes.push(opcodes::all::OP_EQUALVERIFY.to_u8()); bytes.push(opcodes::all::OP_CHECKSIG.to_u8()); Self::from_bytes(bytes) } + pub fn random_p2pkh(rng: &mut StdRng) -> Self { + Self::new_p2pkh(rng.gen::<[u8; 20]>()) + } + pub fn random_p2sh(rng: &mut StdRng) -> Self { let mut bytes = vec![ opcodes::all::OP_HASH160.to_u8(), diff --git a/packages/rs-dpp/src/identity/identity_public_key/key_type.rs b/packages/rs-dpp/src/identity/identity_public_key/key_type.rs index 0e469272da..d91bec6626 100644 --- a/packages/rs-dpp/src/identity/identity_public_key/key_type.rs +++ b/packages/rs-dpp/src/identity/identity_public_key/key_type.rs @@ -100,6 +100,17 @@ impl KeyType { } } + /// Can this key type be understood as an address on the Core chain? + pub fn is_core_address_key_type(&self) -> bool { + match self { + KeyType::ECDSA_SECP256K1 => false, + KeyType::BLS12_381 => false, + KeyType::ECDSA_HASH160 => true, + KeyType::BIP13_SCRIPT_HASH => true, + KeyType::EDDSA_25519_HASH160 => false, + } + } + pub fn signature_verify_cost( &self, platform_version: &PlatformVersion, diff --git a/packages/rs-dpp/src/identity/identity_public_key/security_level.rs b/packages/rs-dpp/src/identity/identity_public_key/security_level.rs index 978134016b..4cd9f0d2ed 100644 --- a/packages/rs-dpp/src/identity/identity_public_key/security_level.rs +++ b/packages/rs-dpp/src/identity/identity_public_key/security_level.rs @@ -35,6 +35,23 @@ pub enum SecurityLevel { MEDIUM = 3, } +impl From for [u8; 1] { + fn from(security_level: SecurityLevel) -> Self { + [security_level as u8] + } +} + +impl From for &'static [u8; 1] { + fn from(security_level: SecurityLevel) -> Self { + match security_level { + SecurityLevel::MASTER => &[0], + SecurityLevel::CRITICAL => &[1], + SecurityLevel::HIGH => &[2], + SecurityLevel::MEDIUM => &[3], + } + } +} + #[cfg(feature = "cbor")] impl Into for SecurityLevel { fn into(self) -> CborValue { diff --git a/packages/rs-dpp/src/identity/signer.rs b/packages/rs-dpp/src/identity/signer.rs index 549a55da42..e069e43a11 100644 --- a/packages/rs-dpp/src/identity/signer.rs +++ b/packages/rs-dpp/src/identity/signer.rs @@ -10,4 +10,7 @@ pub trait Signer: Sync + Debug { identity_public_key: &IdentityPublicKey, data: &[u8], ) -> Result; + + /// do we have this identity public key in the signer? + fn can_sign_with(&self, identity_public_key: &IdentityPublicKey) -> bool; } diff --git a/packages/rs-dpp/src/lib.rs b/packages/rs-dpp/src/lib.rs index d2dc8b7f6e..6dd0312fc2 100644 --- a/packages/rs-dpp/src/lib.rs +++ b/packages/rs-dpp/src/lib.rs @@ -52,6 +52,9 @@ pub mod signing; #[cfg(feature = "system_contracts")] pub mod system_data_contracts; pub mod voting; + +#[cfg(feature = "core-types")] +pub mod core_types; pub mod withdrawal; pub use async_trait; diff --git a/packages/rs-dpp/src/state_transition/errors/wrong_public_key_purpose_error.rs b/packages/rs-dpp/src/state_transition/errors/wrong_public_key_purpose_error.rs index 7f1fdb8522..5b469e2fa9 100644 --- a/packages/rs-dpp/src/state_transition/errors/wrong_public_key_purpose_error.rs +++ b/packages/rs-dpp/src/state_transition/errors/wrong_public_key_purpose_error.rs @@ -2,27 +2,28 @@ use thiserror::Error; use crate::identity::Purpose; use crate::ProtocolError; +use itertools::Itertools; #[derive(Error, Debug, Clone, PartialEq, Eq)] -#[error("Invalid identity key purpose {public_key_purpose}. This state transition requires {key_purpose_requirement}")] +#[error("Invalid identity key purpose {public_key_purpose}. This state transition requires {}", allowed_key_purposes.iter().map(|s| s.to_string()).join(" | "))] pub struct WrongPublicKeyPurposeError { public_key_purpose: Purpose, - key_purpose_requirement: Purpose, + allowed_key_purposes: Vec, } impl WrongPublicKeyPurposeError { - pub fn new(public_key_purpose: Purpose, key_purpose_requirement: Purpose) -> Self { + pub fn new(public_key_purpose: Purpose, allowed_key_purposes: Vec) -> Self { Self { public_key_purpose, - key_purpose_requirement, + allowed_key_purposes, } } pub fn public_key_purpose(&self) -> Purpose { self.public_key_purpose } - pub fn key_purpose_requirement(&self) -> Purpose { - self.key_purpose_requirement + pub fn allowed_key_purposes(&self) -> &Vec { + &self.allowed_key_purposes } } diff --git a/packages/rs-dpp/src/state_transition/mod.rs b/packages/rs-dpp/src/state_transition/mod.rs index 879bb6e871..bc20c6ab0a 100644 --- a/packages/rs-dpp/src/state_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/mod.rs @@ -400,12 +400,12 @@ impl StateTransition { } /// returns the key security level requirement for the state transition - pub fn security_level_requirement(&self) -> Option> { - call_getter_method_identity_signed!(self, security_level_requirement) + pub fn security_level_requirement(&self, purpose: Purpose) -> Option> { + call_getter_method_identity_signed!(self, security_level_requirement, purpose) } /// returns the key purpose requirement for the state transition - pub fn purpose_requirement(&self) -> Option { + pub fn purpose_requirement(&self) -> Option> { call_getter_method_identity_signed!(self, purpose_requirement) } @@ -457,7 +457,7 @@ impl StateTransition { return Err(ProtocolError::WrongPublicKeyPurposeError( WrongPublicKeyPurposeError::new( identity_public_key.purpose(), - Purpose::AUTHENTICATION, + vec![Purpose::AUTHENTICATION], ), )); } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/identity_signed.rs index fe0bff68c7..4b2704c07d 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/identity_signed.rs @@ -1,4 +1,4 @@ -use crate::identity::{KeyID, SecurityLevel}; +use crate::identity::{KeyID, Purpose, SecurityLevel}; use crate::state_transition::data_contract_create_transition::DataContractCreateTransition; use crate::state_transition::StateTransitionIdentitySigned; @@ -17,9 +17,11 @@ impl StateTransitionIdentitySigned for DataContractCreateTransition { } } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, purpose: Purpose) -> Vec { match self { - DataContractCreateTransition::V0(transition) => transition.security_level_requirement(), + DataContractCreateTransition::V0(transition) => { + transition.security_level_requirement(purpose) + } } } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/v0/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/v0/identity_signed.rs index c7b4464dec..be2682bc82 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/v0/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/v0/identity_signed.rs @@ -1,5 +1,5 @@ use crate::identity::SecurityLevel::{CRITICAL, HIGH}; -use crate::identity::{KeyID, SecurityLevel}; +use crate::identity::{KeyID, Purpose, SecurityLevel}; use crate::state_transition::data_contract_create_transition::DataContractCreateTransitionV0; use crate::state_transition::StateTransitionIdentitySigned; @@ -12,7 +12,7 @@ impl StateTransitionIdentitySigned for DataContractCreateTransitionV0 { self.signature_public_key_id = key_id } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, _purpose: Purpose) -> Vec { vec![CRITICAL, HIGH] } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/v0/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/v0/v0_methods.rs index ca6fe4e148..f1ed8c9b36 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/v0/v0_methods.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/v0/v0_methods.rs @@ -65,11 +65,11 @@ impl DataContractCreateTransitionMethodsV0 for DataContractCreateTransitionV0 { )), )?; - let security_level_requirements = state_transition.security_level_requirement().ok_or( - ProtocolError::CorruptedCodeExecution( + let security_level_requirements = state_transition + .security_level_requirement(public_key.purpose()) + .ok_or(ProtocolError::CorruptedCodeExecution( "expected security level requirements".to_string(), - ), - )?; + ))?; if !security_level_requirements.contains(&public_key.security_level()) { return Err(ProtocolError::ConsensusError(Box::new( diff --git a/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_update_transition/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_update_transition/identity_signed.rs index b56e0dd30b..50c8cb9ce4 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_update_transition/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_update_transition/identity_signed.rs @@ -1,4 +1,4 @@ -use crate::identity::{KeyID, SecurityLevel}; +use crate::identity::{KeyID, Purpose, SecurityLevel}; use crate::state_transition::data_contract_update_transition::DataContractUpdateTransition; use crate::state_transition::StateTransitionIdentitySigned; @@ -18,9 +18,11 @@ impl StateTransitionIdentitySigned for DataContractUpdateTransition { } } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, purpose: Purpose) -> Vec { match self { - DataContractUpdateTransition::V0(transition) => transition.security_level_requirement(), + DataContractUpdateTransition::V0(transition) => { + transition.security_level_requirement(purpose) + } } } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_update_transition/v0/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_update_transition/v0/identity_signed.rs index 6508a9ab76..3c39e2d90a 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_update_transition/v0/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_update_transition/v0/identity_signed.rs @@ -1,5 +1,5 @@ use crate::identity::SecurityLevel::CRITICAL; -use crate::identity::{KeyID, SecurityLevel}; +use crate::identity::{KeyID, Purpose, SecurityLevel}; use crate::state_transition::data_contract_update_transition::DataContractUpdateTransitionV0; use crate::state_transition::StateTransitionIdentitySigned; @@ -12,7 +12,7 @@ impl StateTransitionIdentitySigned for DataContractUpdateTransitionV0 { self.signature_public_key_id = key_id } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, _purpose: Purpose) -> Vec { vec![CRITICAL] } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/identity_signed.rs index f5d5f967aa..3d8a2d1486 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/identity_signed.rs @@ -1,4 +1,4 @@ -use crate::identity::{KeyID, SecurityLevel}; +use crate::identity::{KeyID, Purpose, SecurityLevel}; use crate::state_transition::documents_batch_transition::DocumentsBatchTransition; use crate::state_transition::StateTransitionIdentitySigned; @@ -17,9 +17,11 @@ impl StateTransitionIdentitySigned for DocumentsBatchTransition { } } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, purpose: Purpose) -> Vec { match self { - DocumentsBatchTransition::V0(transition) => transition.security_level_requirement(), + DocumentsBatchTransition::V0(transition) => { + transition.security_level_requirement(purpose) + } } } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/v0/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/v0/identity_signed.rs index fd4916864a..bdc0fe583a 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/v0/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/v0/identity_signed.rs @@ -1,5 +1,5 @@ use crate::identity::SecurityLevel::{CRITICAL, HIGH, MEDIUM}; -use crate::identity::{KeyID, SecurityLevel}; +use crate::identity::{KeyID, Purpose, SecurityLevel}; use crate::state_transition::documents_batch_transition::DocumentsBatchTransitionV0; use crate::state_transition::StateTransitionIdentitySigned; @@ -13,7 +13,7 @@ impl StateTransitionIdentitySigned for DocumentsBatchTransitionV0 { self.signature_public_key_id = key_id } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, _purpose: Purpose) -> Vec { // These are the available key levels that must sign the state transition // However the fact that it is signed by one of these does not guarantee that it // meets the security level requirement, as that is dictated from within the data diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/identity_signed.rs index 4b3b448eb5..60dd03cf6f 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/identity_signed.rs @@ -19,15 +19,15 @@ impl StateTransitionIdentitySigned for IdentityCreditTransferTransition { } } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, purpose: Purpose) -> Vec { match self { IdentityCreditTransferTransition::V0(transition) => { - transition.security_level_requirement() + transition.security_level_requirement(purpose) } } } - fn purpose_requirement(&self) -> Purpose { + fn purpose_requirement(&self) -> Vec { match self { IdentityCreditTransferTransition::V0(transition) => transition.purpose_requirement(), } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/v0/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/v0/identity_signed.rs index bcab635e22..acc328d274 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/v0/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/v0/identity_signed.rs @@ -12,11 +12,11 @@ impl StateTransitionIdentitySigned for IdentityCreditTransferTransitionV0 { self.signature_public_key_id = key_id } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, _purpose: Purpose) -> Vec { vec![CRITICAL] } - fn purpose_requirement(&self) -> Purpose { - Purpose::TRANSFER + fn purpose_requirement(&self) -> Vec { + vec![Purpose::TRANSFER] } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/accessors/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/accessors/mod.rs index dbf33c5a56..eb952d6509 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/accessors/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/accessors/mod.rs @@ -13,6 +13,7 @@ impl IdentityCreditWithdrawalTransitionAccessorsV0 for IdentityCreditWithdrawalT fn identity_id(&self) -> Identifier { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.identity_id, + IdentityCreditWithdrawalTransition::V1(transition) => transition.identity_id, } } @@ -21,12 +22,16 @@ impl IdentityCreditWithdrawalTransitionAccessorsV0 for IdentityCreditWithdrawalT IdentityCreditWithdrawalTransition::V0(transition) => { transition.identity_id = identity_id; } + IdentityCreditWithdrawalTransition::V1(transition) => { + transition.identity_id = identity_id; + } } } fn amount(&self) -> u64 { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.amount, + IdentityCreditWithdrawalTransition::V1(transition) => transition.amount, } } @@ -35,24 +40,30 @@ impl IdentityCreditWithdrawalTransitionAccessorsV0 for IdentityCreditWithdrawalT IdentityCreditWithdrawalTransition::V0(transition) => { transition.amount = amount; } + IdentityCreditWithdrawalTransition::V1(transition) => { + transition.amount = amount; + } } } fn set_nonce(&mut self, nonce: IdentityNonce) { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.nonce = nonce, + IdentityCreditWithdrawalTransition::V1(transition) => transition.nonce = nonce, } } fn nonce(&self) -> IdentityNonce { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.nonce, + IdentityCreditWithdrawalTransition::V1(transition) => transition.nonce, } } fn pooling(&self) -> Pooling { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.pooling, + IdentityCreditWithdrawalTransition::V1(transition) => transition.pooling, } } @@ -61,12 +72,16 @@ impl IdentityCreditWithdrawalTransitionAccessorsV0 for IdentityCreditWithdrawalT IdentityCreditWithdrawalTransition::V0(transition) => { transition.pooling = pooling; } + IdentityCreditWithdrawalTransition::V1(transition) => { + transition.pooling = pooling; + } } } fn core_fee_per_byte(&self) -> u32 { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.core_fee_per_byte, + IdentityCreditWithdrawalTransition::V1(transition) => transition.core_fee_per_byte, } } @@ -75,18 +90,29 @@ impl IdentityCreditWithdrawalTransitionAccessorsV0 for IdentityCreditWithdrawalT IdentityCreditWithdrawalTransition::V0(transition) => { transition.core_fee_per_byte = core_fee_per_byte; } + IdentityCreditWithdrawalTransition::V1(transition) => { + transition.core_fee_per_byte = core_fee_per_byte; + } } } - fn output_script(&self) -> CoreScript { + fn output_script(&self) -> Option { match self { - IdentityCreditWithdrawalTransition::V0(transition) => transition.output_script.clone(), + IdentityCreditWithdrawalTransition::V0(transition) => { + Some(transition.output_script.clone()) + } + IdentityCreditWithdrawalTransition::V1(transition) => transition.output_script.clone(), } } - fn set_output_script(&mut self, output_script: CoreScript) { + fn set_output_script(&mut self, output_script: Option) { match self { IdentityCreditWithdrawalTransition::V0(transition) => { + if let Some(output_script) = output_script { + transition.output_script = output_script; + } + } + IdentityCreditWithdrawalTransition::V1(transition) => { transition.output_script = output_script; } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/accessors/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/accessors/v0/mod.rs index 1bcd8b2945..2e666ac1c7 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/accessors/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/accessors/v0/mod.rs @@ -14,6 +14,6 @@ pub trait IdentityCreditWithdrawalTransitionAccessorsV0 { fn set_pooling(&mut self, pooling: Pooling); fn core_fee_per_byte(&self) -> u32; fn set_core_fee_per_byte(&mut self, amount: u32); - fn output_script(&self) -> CoreScript; - fn set_output_script(&mut self, output_script: CoreScript); + fn output_script(&self) -> Option; + fn set_output_script(&mut self, output_script: Option); } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/identity_signed.rs index 2dd369f3b3..75165fbb7d 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/identity_signed.rs @@ -8,6 +8,9 @@ impl StateTransitionIdentitySigned for IdentityCreditWithdrawalTransition { IdentityCreditWithdrawalTransition::V0(transition) => { transition.signature_public_key_id() } + IdentityCreditWithdrawalTransition::V1(transition) => { + transition.signature_public_key_id() + } } } @@ -16,20 +19,27 @@ impl StateTransitionIdentitySigned for IdentityCreditWithdrawalTransition { IdentityCreditWithdrawalTransition::V0(transition) => { transition.set_signature_public_key_id(key_id) } + IdentityCreditWithdrawalTransition::V1(transition) => { + transition.set_signature_public_key_id(key_id) + } } } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, purpose: Purpose) -> Vec { match self { IdentityCreditWithdrawalTransition::V0(transition) => { - transition.security_level_requirement() + transition.security_level_requirement(purpose) + } + IdentityCreditWithdrawalTransition::V1(transition) => { + transition.security_level_requirement(purpose) } } } - fn purpose_requirement(&self) -> Purpose { + fn purpose_requirement(&self) -> Vec { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.purpose_requirement(), + IdentityCreditWithdrawalTransition::V1(transition) => transition.purpose_requirement(), } } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/json_conversion.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/json_conversion.rs index b5a5946e62..ada6044e54 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/json_conversion.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/json_conversion.rs @@ -22,6 +22,15 @@ impl<'a> StateTransitionJsonConvert<'a> for IdentityCreditWithdrawalTransition { ); Ok(value) } + IdentityCreditWithdrawalTransition::V1(transition) => { + let mut value = transition.to_json(options)?; + let map_value = value.as_object_mut().expect("expected an object"); + map_value.insert( + STATE_TRANSITION_PROTOCOL_VERSION.to_string(), + JsonValue::Number(Number::from(1)), + ); + Ok(value) + } } } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/methods/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/methods/mod.rs index 96b2654046..acab5d8f3c 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/methods/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/methods/mod.rs @@ -17,7 +17,7 @@ use crate::identity::IdentityPublicKey; #[cfg(feature = "state-transition-signing")] use crate::prelude::{IdentityNonce, UserFeeIncrease}; #[cfg(feature = "state-transition-signing")] -use crate::state_transition::identity_credit_withdrawal_transition::v0::IdentityCreditWithdrawalTransitionV0; +use crate::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; #[cfg(feature = "state-transition-signing")] use crate::state_transition::StateTransition; #[cfg(feature = "state-transition-signing")] @@ -31,13 +31,14 @@ impl IdentityCreditWithdrawalTransitionMethodsV0 for IdentityCreditWithdrawalTra #[cfg(feature = "state-transition-signing")] fn try_from_identity( identity: &Identity, - withdrawal_key_to_use: Option<&IdentityPublicKey>, - output_script: CoreScript, + output_script: Option, amount: u64, pooling: Pooling, core_fee_per_byte: u32, user_fee_increase: UserFeeIncrease, signer: S, + signing_withdrawal_key_to_use: Option<&IdentityPublicKey>, + preferred_key_purpose_for_signing_withdrawal: PreferredKeyPurposeForSigningWithdrawal, nonce: IdentityNonce, platform_version: &PlatformVersion, version: Option, @@ -48,22 +49,25 @@ impl IdentityCreditWithdrawalTransitionMethodsV0 for IdentityCreditWithdrawalTra .state_transition_conversion_versions .identity_to_identity_withdrawal_transition, ) { - 0 => Ok(IdentityCreditWithdrawalTransitionV0::try_from_identity( + 1 => Ok(IdentityCreditWithdrawalTransitionV1::try_from_identity( identity, - withdrawal_key_to_use, output_script, amount, pooling, core_fee_per_byte, user_fee_increase, signer, + signing_withdrawal_key_to_use, + preferred_key_purpose_for_signing_withdrawal, nonce, platform_version, version, )?), - v => Err(ProtocolError::UnknownVersionError(format!( - "Unknown IdentityCreditWithdrawalTransition version for try_from_identity {v}" - ))), + version => Err(ProtocolError::UnknownVersionMismatch { + method: "IdentityCreditWithdrawalTransition::try_from_identity".to_string(), + known_versions: vec![1], + received: version, + }), } } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/methods/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/methods/v0/mod.rs index 0341f253f1..d143eaae31 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/methods/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/methods/v0/mod.rs @@ -1,34 +1,43 @@ #[cfg(feature = "state-transition-signing")] -use crate::identity::core_script::CoreScript; -#[cfg(feature = "state-transition-signing")] -use crate::identity::signer::Signer; -#[cfg(feature = "state-transition-signing")] -use crate::identity::Identity; -#[cfg(feature = "state-transition-signing")] -use crate::identity::IdentityPublicKey; -#[cfg(feature = "state-transition-signing")] -use crate::prelude::{IdentityNonce, UserFeeIncrease}; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::StateTransition; +use crate::{ + identity::{core_script::CoreScript, signer::Signer, Identity, IdentityPublicKey}, + prelude::{IdentityNonce, UserFeeIncrease}, + state_transition::StateTransition, + withdrawal::Pooling, + ProtocolError, +}; + use crate::state_transition::StateTransitionType; #[cfg(feature = "state-transition-signing")] -use crate::withdrawal::Pooling; -#[cfg(feature = "state-transition-signing")] -use crate::ProtocolError; -#[cfg(feature = "state-transition-signing")] use platform_version::version::{FeatureVersion, PlatformVersion}; +/// The key purpose that is preferred for signing the withdrawal +#[cfg(feature = "state-transition-signing")] +pub enum PreferredKeyPurposeForSigningWithdrawal { + /// Use any key + Any, + /// Use the master key, then the transfer key + MasterPreferred, + /// Use the transfer key, then the master key + TransferPreferred, + /// Only use the master key + MasterOnly, + /// Only use the transfer key + TransferOnly, +} + pub trait IdentityCreditWithdrawalTransitionMethodsV0 { #[cfg(feature = "state-transition-signing")] fn try_from_identity( identity: &Identity, - withdrawal_key_to_use: Option<&IdentityPublicKey>, - output_script: CoreScript, + output_script: Option, amount: u64, pooling: Pooling, core_fee_per_byte: u32, user_fee_increase: UserFeeIncrease, signer: S, + signing_withdrawal_key_to_use: Option<&IdentityPublicKey>, + preferred_key_purpose_for_signing_withdrawal: PreferredKeyPurposeForSigningWithdrawal, nonce: IdentityNonce, platform_version: &PlatformVersion, version: Option, diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/mod.rs index f773296936..5b93592a36 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/mod.rs @@ -8,6 +8,7 @@ mod json_conversion; pub mod methods; mod state_transition_like; pub mod v0; +pub mod v1; #[cfg(feature = "state-transition-value-conversion")] mod value_conversion; mod version; @@ -15,9 +16,14 @@ mod version; use crate::state_transition::identity_credit_withdrawal_transition::v0::IdentityCreditWithdrawalTransitionV0Signable; use crate::state_transition::StateTransitionFieldTypes; +use crate::balances::credits::CREDITS_PER_DUFF; use crate::identity::state_transition::OptionallyAssetLockProved; +use crate::state_transition::identity_credit_withdrawal_transition::v1::{ + IdentityCreditWithdrawalTransitionV1, IdentityCreditWithdrawalTransitionV1Signable, +}; use crate::ProtocolError; use bincode::{Decode, Encode}; +use dashcore::transaction::special_transaction::asset_unlock::qualified_asset_unlock::ASSET_UNLOCK_TX_SIZE; use derive_more::From; use fields::*; use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize, PlatformSignable}; @@ -26,7 +32,14 @@ use platform_versioning::PlatformVersioned; #[cfg(feature = "state-transition-serde-conversion")] use serde::{Deserialize, Serialize}; -pub type IdentityCreditWithdrawalTransitionLatest = IdentityCreditWithdrawalTransitionV0; +/// Minimal core per byte. Must be a fibonacci number +pub const MIN_CORE_FEE_PER_BYTE: u32 = 1; + +/// Minimal amount in credits (x1000) to avoid "dust" error in Core +pub const MIN_WITHDRAWAL_AMOUNT: u64 = + (ASSET_UNLOCK_TX_SIZE as u64) * (MIN_CORE_FEE_PER_BYTE as u64) * CREDITS_PER_DUFF; + +pub type IdentityCreditWithdrawalTransitionLatest = IdentityCreditWithdrawalTransitionV1; #[derive( Debug, @@ -52,6 +65,8 @@ pub type IdentityCreditWithdrawalTransitionLatest = IdentityCreditWithdrawalTran pub enum IdentityCreditWithdrawalTransition { #[cfg_attr(feature = "state-transition-serde-conversion", serde(rename = "0"))] V0(IdentityCreditWithdrawalTransitionV0), + #[cfg_attr(feature = "state-transition-serde-conversion", serde(rename = "1"))] + V1(IdentityCreditWithdrawalTransitionV1), } impl IdentityCreditWithdrawalTransition { @@ -64,9 +79,12 @@ impl IdentityCreditWithdrawalTransition { 0 => Ok(IdentityCreditWithdrawalTransition::V0( IdentityCreditWithdrawalTransitionV0::default(), )), + 1 => Ok(IdentityCreditWithdrawalTransition::V1( + IdentityCreditWithdrawalTransitionV1::default(), + )), version => Err(ProtocolError::UnknownVersionMismatch { method: "IdentityCreditWithdrawalTransition::default_versioned".to_string(), - known_versions: vec![0], + known_versions: vec![0, 1], received: version, }), } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/state_transition_like.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/state_transition_like.rs index 022294a3a6..165d071b4b 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/state_transition_like.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/state_transition_like.rs @@ -9,12 +9,14 @@ impl StateTransitionLike for IdentityCreditWithdrawalTransition { fn modified_data_ids(&self) -> Vec { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.modified_data_ids(), + IdentityCreditWithdrawalTransition::V1(transition) => transition.modified_data_ids(), } } fn state_transition_protocol_version(&self) -> FeatureVersion { match self { IdentityCreditWithdrawalTransition::V0(_) => 0, + IdentityCreditWithdrawalTransition::V1(_) => 0, } } /// returns the type of State Transition @@ -23,12 +25,16 @@ impl StateTransitionLike for IdentityCreditWithdrawalTransition { IdentityCreditWithdrawalTransition::V0(transition) => { transition.state_transition_type() } + IdentityCreditWithdrawalTransition::V1(transition) => { + transition.state_transition_type() + } } } /// returns the signature as a byte-array fn signature(&self) -> &BinaryData { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.signature(), + IdentityCreditWithdrawalTransition::V1(transition) => transition.signature(), } } /// set a new signature @@ -37,6 +43,9 @@ impl StateTransitionLike for IdentityCreditWithdrawalTransition { IdentityCreditWithdrawalTransition::V0(transition) => { transition.set_signature(signature) } + IdentityCreditWithdrawalTransition::V1(transition) => { + transition.set_signature(signature) + } } } @@ -44,6 +53,7 @@ impl StateTransitionLike for IdentityCreditWithdrawalTransition { fn user_fee_increase(&self) -> UserFeeIncrease { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.user_fee_increase(), + IdentityCreditWithdrawalTransition::V1(transition) => transition.user_fee_increase(), } } /// set a fee multiplier @@ -52,6 +62,9 @@ impl StateTransitionLike for IdentityCreditWithdrawalTransition { IdentityCreditWithdrawalTransition::V0(transition) => { transition.set_user_fee_increase(user_fee_increase) } + IdentityCreditWithdrawalTransition::V1(transition) => { + transition.set_user_fee_increase(user_fee_increase) + } } } @@ -60,18 +73,23 @@ impl StateTransitionLike for IdentityCreditWithdrawalTransition { IdentityCreditWithdrawalTransition::V0(transition) => { transition.set_signature_bytes(signature) } + IdentityCreditWithdrawalTransition::V1(transition) => { + transition.set_signature_bytes(signature) + } } } fn owner_id(&self) -> Identifier { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.owner_id(), + IdentityCreditWithdrawalTransition::V1(transition) => transition.owner_id(), } } fn unique_identifiers(&self) -> Vec { match self { IdentityCreditWithdrawalTransition::V0(transition) => transition.unique_identifiers(), + IdentityCreditWithdrawalTransition::V1(transition) => transition.unique_identifiers(), } } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/identity_signed.rs index 2c8011f2fd..122a1b4534 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/identity_signed.rs @@ -13,11 +13,11 @@ impl StateTransitionIdentitySigned for IdentityCreditWithdrawalTransitionV0 { self.signature_public_key_id = key_id } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, _purpose: Purpose) -> Vec { vec![CRITICAL] } - fn purpose_requirement(&self) -> Purpose { - Purpose::TRANSFER + fn purpose_requirement(&self) -> Vec { + vec![Purpose::TRANSFER] } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/mod.rs index 2a5246b9ab..2be39083e0 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/mod.rs @@ -3,19 +3,16 @@ mod identity_signed; mod json_conversion; mod state_transition_like; mod types; -mod v0_methods; #[cfg(feature = "state-transition-value-conversion")] mod value_conversion; mod version; use bincode::{Decode, Encode}; -use dashcore::transaction::special_transaction::asset_unlock::qualified_asset_unlock::ASSET_UNLOCK_TX_SIZE; use platform_serialization_derive::PlatformSignable; use platform_value::BinaryData; #[cfg(feature = "state-transition-serde-conversion")] use serde::{Deserialize, Serialize}; -use crate::balances::credits::CREDITS_PER_DUFF; use crate::prelude::{IdentityNonce, UserFeeIncrease}; use crate::{ identity::{core_script::CoreScript, KeyID}, @@ -24,14 +21,6 @@ use crate::{ ProtocolError, }; -// TODO: unsafe - we must use actual relay fee from core -/// Minimal core per byte. Must be a fibonacci number -pub const MIN_CORE_FEE_PER_BYTE: u32 = 1; - -/// Minimal amount in credits (x1000) to avoid "dust" error in Core -pub const MIN_WITHDRAWAL_AMOUNT: u64 = - (ASSET_UNLOCK_TX_SIZE as u64) * (MIN_CORE_FEE_PER_BYTE as u64) * CREDITS_PER_DUFF; - #[derive(Debug, Clone, Encode, Decode, PlatformSignable, PartialEq)] #[cfg_attr( feature = "state-transition-serde-conversion", diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/v0_methods.rs deleted file mode 100644 index 8d4f813231..0000000000 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/v0_methods.rs +++ /dev/null @@ -1,76 +0,0 @@ -#[cfg(feature = "state-transition-signing")] -use crate::identity::accessors::IdentityGettersV0; -#[cfg(feature = "state-transition-signing")] -use crate::identity::core_script::CoreScript; -#[cfg(feature = "state-transition-signing")] -use crate::identity::signer::Signer; -#[cfg(feature = "state-transition-signing")] -use crate::identity::IdentityPublicKey; -#[cfg(feature = "state-transition-signing")] -use crate::identity::{Identity, KeyType, Purpose, SecurityLevel}; -#[cfg(feature = "state-transition-signing")] -use crate::prelude::{IdentityNonce, UserFeeIncrease}; -use crate::state_transition::identity_credit_withdrawal_transition::methods::IdentityCreditWithdrawalTransitionMethodsV0; -use crate::state_transition::identity_credit_withdrawal_transition::v0::IdentityCreditWithdrawalTransitionV0; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::{GetDataContractSecurityLevelRequirementFn, StateTransition}; -#[cfg(feature = "state-transition-signing")] -use crate::withdrawal::Pooling; -#[cfg(feature = "state-transition-signing")] -use crate::ProtocolError; -#[cfg(feature = "state-transition-signing")] -use platform_version::version::{FeatureVersion, PlatformVersion}; - -impl IdentityCreditWithdrawalTransitionMethodsV0 for IdentityCreditWithdrawalTransitionV0 { - #[cfg(feature = "state-transition-signing")] - fn try_from_identity( - identity: &Identity, - withdrawal_key_to_use: Option<&IdentityPublicKey>, - output_script: CoreScript, - amount: u64, - pooling: Pooling, - core_fee_per_byte: u32, - user_fee_increase: UserFeeIncrease, - signer: S, - nonce: IdentityNonce, - _platform_version: &PlatformVersion, - _version: Option, - ) -> Result { - let mut transition: StateTransition = IdentityCreditWithdrawalTransitionV0 { - identity_id: identity.id(), - amount, - core_fee_per_byte, - pooling, - output_script, - nonce, - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), - } - .into(); - - let identity_public_key = match withdrawal_key_to_use { - Some(key) => key, - None => identity - .get_first_public_key_matching( - Purpose::TRANSFER, - SecurityLevel::full_range().into(), - KeyType::all_key_types().into(), - true, - ) - .ok_or_else(|| { - ProtocolError::DesiredKeyWithTypePurposeSecurityLevelMissing( - "no withdrawal public key".to_string(), - ) - })?, - }; - - transition.sign_external( - identity_public_key, - &signer, - None::, - )?; - - Ok(transition) - } -} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/identity_signed.rs new file mode 100644 index 0000000000..045bab7b27 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/identity_signed.rs @@ -0,0 +1,27 @@ +use crate::identity::SecurityLevel::{CRITICAL, MASTER}; +use crate::identity::{KeyID, Purpose, SecurityLevel}; +use crate::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; +use crate::state_transition::StateTransitionIdentitySigned; + +impl StateTransitionIdentitySigned for IdentityCreditWithdrawalTransitionV1 { + fn signature_public_key_id(&self) -> KeyID { + self.signature_public_key_id + } + + fn set_signature_public_key_id(&mut self, key_id: KeyID) { + self.signature_public_key_id = key_id + } + + fn security_level_requirement(&self, purpose: Purpose) -> Vec { + if purpose == Purpose::AUTHENTICATION { + vec![MASTER] + } else { + // for transfer + vec![CRITICAL] + } + } + + fn purpose_requirement(&self) -> Vec { + vec![Purpose::TRANSFER, Purpose::AUTHENTICATION] + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/json_conversion.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/json_conversion.rs new file mode 100644 index 0000000000..10b835cfc0 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/json_conversion.rs @@ -0,0 +1,4 @@ +use crate::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; +use crate::state_transition::StateTransitionJsonConvert; + +impl<'a> StateTransitionJsonConvert<'a> for IdentityCreditWithdrawalTransitionV1 {} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/mod.rs new file mode 100644 index 0000000000..ef18ac89a3 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/mod.rs @@ -0,0 +1,45 @@ +mod identity_signed; +#[cfg(feature = "state-transition-json-conversion")] +mod json_conversion; +mod state_transition_like; +mod types; +mod v0_methods; +#[cfg(feature = "state-transition-value-conversion")] +mod value_conversion; +mod version; + +use bincode::{Decode, Encode}; +use platform_serialization_derive::PlatformSignable; +use platform_value::BinaryData; +#[cfg(feature = "state-transition-serde-conversion")] +use serde::{Deserialize, Serialize}; + +use crate::prelude::{IdentityNonce, UserFeeIncrease}; +use crate::{ + identity::{core_script::CoreScript, KeyID}, + prelude::Identifier, + withdrawal::Pooling, + ProtocolError, +}; + +#[derive(Debug, Clone, Encode, Decode, PlatformSignable, PartialEq)] +#[cfg_attr( + feature = "state-transition-serde-conversion", + derive(Serialize, Deserialize), + serde(rename_all = "camelCase") +)] +#[derive(Default)] +pub struct IdentityCreditWithdrawalTransitionV1 { + pub identity_id: Identifier, + pub amount: u64, + pub core_fee_per_byte: u32, + pub pooling: Pooling, + /// If the send to output script is None, then we send the withdrawal to the address set by core + pub output_script: Option, + pub nonce: IdentityNonce, + pub user_fee_increase: UserFeeIncrease, + #[platform_signable(exclude_from_sig_hash)] + pub signature_public_key_id: KeyID, + #[platform_signable(exclude_from_sig_hash)] + pub signature: BinaryData, +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/state_transition_like.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/state_transition_like.rs new file mode 100644 index 0000000000..14462d0c28 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/state_transition_like.rs @@ -0,0 +1,72 @@ +use base64::prelude::BASE64_STANDARD; +use base64::Engine; +use platform_value::BinaryData; + +use crate::prelude::UserFeeIncrease; +use crate::{ + prelude::Identifier, + state_transition::{StateTransitionLike, StateTransitionType}, +}; + +use crate::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; +use crate::state_transition::identity_credit_withdrawal_transition::IdentityCreditWithdrawalTransition; +use crate::state_transition::StateTransition; +use crate::state_transition::StateTransitionType::IdentityCreditWithdrawal; +use crate::version::FeatureVersion; + +impl From for StateTransition { + fn from(value: IdentityCreditWithdrawalTransitionV1) -> Self { + let identity_credit_withdrawal_transition: IdentityCreditWithdrawalTransition = + value.into(); + identity_credit_withdrawal_transition.into() + } +} + +impl StateTransitionLike for IdentityCreditWithdrawalTransitionV1 { + fn state_transition_protocol_version(&self) -> FeatureVersion { + 0 + } + + /// returns the type of State Transition + fn state_transition_type(&self) -> StateTransitionType { + IdentityCreditWithdrawal + } + /// returns the signature as a byte-array + fn signature(&self) -> &BinaryData { + &self.signature + } + /// set a new signature + fn set_signature(&mut self, signature: BinaryData) { + self.signature = signature + } + /// Returns ID of the created contract + fn modified_data_ids(&self) -> Vec { + vec![self.identity_id] + } + + fn set_signature_bytes(&mut self, signature: Vec) { + self.signature = BinaryData::new(signature) + } + + /// Get owner ID + fn owner_id(&self) -> Identifier { + self.identity_id + } + + /// We want things to be unique based on the nonce, so we don't add the transition type + fn unique_identifiers(&self) -> Vec { + vec![format!( + "{}-{:x}", + BASE64_STANDARD.encode(self.identity_id), + self.nonce + )] + } + + fn user_fee_increase(&self) -> UserFeeIncrease { + self.user_fee_increase + } + + fn set_user_fee_increase(&mut self, user_fee_increase: UserFeeIncrease) { + self.user_fee_increase = user_fee_increase + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/types.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/types.rs new file mode 100644 index 0000000000..3273e62c92 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/types.rs @@ -0,0 +1,17 @@ +use crate::state_transition::identity_credit_withdrawal_transition::fields::*; +use crate::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; +use crate::state_transition::StateTransitionFieldTypes; + +impl StateTransitionFieldTypes for IdentityCreditWithdrawalTransitionV1 { + fn signature_property_paths() -> Vec<&'static str> { + vec![SIGNATURE, SIGNATURE_PUBLIC_KEY_ID] + } + + fn identifiers_property_paths() -> Vec<&'static str> { + vec![IDENTITY_ID] + } + + fn binary_property_paths() -> Vec<&'static str> { + vec![SIGNATURE, OUTPUT_SCRIPT] + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/v0_methods.rs new file mode 100644 index 0000000000..de4817bca4 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/v0_methods.rs @@ -0,0 +1,137 @@ +#[cfg(feature = "state-transition-signing")] +use crate::{ + identity::{ + accessors::IdentityGettersV0, core_script::CoreScript, signer::Signer, Identity, + IdentityPublicKey, KeyType, Purpose, SecurityLevel, + }, + prelude::{IdentityNonce, UserFeeIncrease}, + state_transition::{ + identity_credit_withdrawal_transition::methods::PreferredKeyPurposeForSigningWithdrawal, + GetDataContractSecurityLevelRequirementFn, StateTransition, + }, + withdrawal::Pooling, + ProtocolError, +}; + +#[cfg(feature = "state-transition-signing")] +use platform_version::version::{FeatureVersion, PlatformVersion}; + +use crate::state_transition::identity_credit_withdrawal_transition::methods::IdentityCreditWithdrawalTransitionMethodsV0; +use crate::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; + +impl IdentityCreditWithdrawalTransitionMethodsV0 for IdentityCreditWithdrawalTransitionV1 { + #[cfg(feature = "state-transition-signing")] + fn try_from_identity( + identity: &Identity, + output_script: Option, + amount: u64, + pooling: Pooling, + core_fee_per_byte: u32, + user_fee_increase: UserFeeIncrease, + signer: S, + signing_withdrawal_key_to_use: Option<&IdentityPublicKey>, + preferred_key_purpose_for_signing_withdrawal: PreferredKeyPurposeForSigningWithdrawal, + nonce: IdentityNonce, + _platform_version: &PlatformVersion, + _version: Option, + ) -> Result { + let mut transition: StateTransition = IdentityCreditWithdrawalTransitionV1 { + identity_id: identity.id(), + amount, + core_fee_per_byte, + pooling, + output_script, + nonce, + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + + let identity_public_key = match signing_withdrawal_key_to_use { + Some(key) => { + if signer.can_sign_with(key) { + key + } else { + return Err( + ProtocolError::DesiredKeyWithTypePurposeSecurityLevelMissing( + "specified withdrawal public key cannot be used for signing" + .to_string(), + ), + ); + } + } + None => { + let mut key: Option<&IdentityPublicKey>; + + match preferred_key_purpose_for_signing_withdrawal { + PreferredKeyPurposeForSigningWithdrawal::MasterPreferred => { + key = identity.get_first_public_key_matching( + Purpose::AUTHENTICATION, + SecurityLevel::full_range().into(), + KeyType::all_key_types().into(), + true, + ); + + if key.is_none() || !signer.can_sign_with(key.unwrap()) { + key = identity.get_first_public_key_matching( + Purpose::TRANSFER, + SecurityLevel::full_range().into(), + KeyType::all_key_types().into(), + true, + ); + } + } + PreferredKeyPurposeForSigningWithdrawal::TransferPreferred + | PreferredKeyPurposeForSigningWithdrawal::Any => { + key = identity.get_first_public_key_matching( + Purpose::TRANSFER, + SecurityLevel::full_range().into(), + KeyType::all_key_types().into(), + true, + ); + + if key.is_none() || !signer.can_sign_with(key.unwrap()) { + key = identity.get_first_public_key_matching( + Purpose::AUTHENTICATION, + SecurityLevel::full_range().into(), + KeyType::all_key_types().into(), + true, + ); + } + } + PreferredKeyPurposeForSigningWithdrawal::MasterOnly => { + key = identity.get_first_public_key_matching( + Purpose::AUTHENTICATION, + SecurityLevel::full_range().into(), + KeyType::all_key_types().into(), + true, + ); + } + PreferredKeyPurposeForSigningWithdrawal::TransferOnly => { + key = identity.get_first_public_key_matching( + Purpose::TRANSFER, + SecurityLevel::full_range().into(), + KeyType::all_key_types().into(), + true, + ); + } + } + + key.ok_or_else(|| { + ProtocolError::DesiredKeyWithTypePurposeSecurityLevelMissing( + "no withdrawal public key".to_string(), + ) + })? + } + }; + + transition.sign_external( + identity_public_key, + &signer, + None::, + )?; + + Ok(transition) + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/value_conversion.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/value_conversion.rs new file mode 100644 index 0000000000..6ef90c689a --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/value_conversion.rs @@ -0,0 +1,60 @@ +use std::collections::BTreeMap; + +use platform_value::{IntegerReplacementType, ReplacementType, Value}; + +use crate::{state_transition::StateTransitionFieldTypes, ProtocolError}; + +use crate::state_transition::identity_credit_withdrawal_transition::fields::*; +use crate::state_transition::StateTransitionValueConvert; + +use crate::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; +use platform_version::version::PlatformVersion; + +impl<'a> StateTransitionValueConvert<'a> for IdentityCreditWithdrawalTransitionV1 { + fn from_object( + raw_object: Value, + _platform_version: &PlatformVersion, + ) -> Result { + platform_value::from_value(raw_object).map_err(ProtocolError::ValueError) + } + + fn clean_value(value: &mut Value) -> Result<(), ProtocolError> { + value.replace_at_paths(IDENTIFIER_FIELDS, ReplacementType::Identifier)?; + value.replace_at_paths(BINARY_FIELDS, ReplacementType::BinaryBytes)?; + value.replace_integer_type_at_paths(U32_FIELDS, IntegerReplacementType::U32)?; + Ok(()) + } + + fn from_value_map( + raw_value_map: BTreeMap, + platform_version: &PlatformVersion, + ) -> Result { + let value: Value = raw_value_map.into(); + Self::from_object(value, platform_version) + } + + fn to_object(&self, skip_signature: bool) -> Result { + let mut value = platform_value::to_value(self)?; + if skip_signature { + value + .remove_values_matching_paths(Self::signature_property_paths()) + .map_err(ProtocolError::ValueError)?; + } + Ok(value) + } + + fn to_cleaned_object(&self, skip_signature: bool) -> Result { + let mut value = platform_value::to_value(self)?; + if skip_signature { + value + .remove_values_matching_paths(Self::signature_property_paths()) + .map_err(ProtocolError::ValueError)?; + } + Ok(value) + } + + // Override to_canonical_cleaned_object to manage add_public_keys individually + fn to_canonical_cleaned_object(&self, skip_signature: bool) -> Result { + self.to_cleaned_object(skip_signature) + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/version.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/version.rs new file mode 100644 index 0000000000..cfff287e9d --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/version.rs @@ -0,0 +1,9 @@ +use crate::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; +use crate::state_transition::FeatureVersioned; +use crate::version::FeatureVersion; + +impl FeatureVersioned for IdentityCreditWithdrawalTransitionV1 { + fn feature_version(&self) -> FeatureVersion { + 1 + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/value_conversion.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/value_conversion.rs index 365d747ea8..a62a4a184f 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/value_conversion.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/value_conversion.rs @@ -9,6 +9,7 @@ use crate::state_transition::identity_credit_withdrawal_transition::IdentityCred use crate::state_transition::state_transitions::identity_credit_withdrawal_transition::fields::*; use crate::state_transition::StateTransitionValueConvert; +use crate::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; use platform_value::btreemap_extensions::BTreeValueRemoveFromMapHelper; use platform_version::version::{FeatureVersion, PlatformVersion}; @@ -20,6 +21,11 @@ impl<'a> StateTransitionValueConvert<'a> for IdentityCreditWithdrawalTransition value.insert(STATE_TRANSITION_PROTOCOL_VERSION.to_string(), Value::U16(0))?; Ok(value) } + IdentityCreditWithdrawalTransition::V1(transition) => { + let mut value = transition.to_object(skip_signature)?; + value.insert(STATE_TRANSITION_PROTOCOL_VERSION.to_string(), Value::U16(1))?; + Ok(value) + } } } @@ -30,6 +36,11 @@ impl<'a> StateTransitionValueConvert<'a> for IdentityCreditWithdrawalTransition value.insert(STATE_TRANSITION_PROTOCOL_VERSION.to_string(), Value::U16(0))?; Ok(value) } + IdentityCreditWithdrawalTransition::V1(transition) => { + let mut value = transition.to_canonical_object(skip_signature)?; + value.insert(STATE_TRANSITION_PROTOCOL_VERSION.to_string(), Value::U16(1))?; + Ok(value) + } } } @@ -40,6 +51,11 @@ impl<'a> StateTransitionValueConvert<'a> for IdentityCreditWithdrawalTransition value.insert(STATE_TRANSITION_PROTOCOL_VERSION.to_string(), Value::U16(0))?; Ok(value) } + IdentityCreditWithdrawalTransition::V1(transition) => { + let mut value = transition.to_canonical_cleaned_object(skip_signature)?; + value.insert(STATE_TRANSITION_PROTOCOL_VERSION.to_string(), Value::U16(1))?; + Ok(value) + } } } @@ -50,6 +66,11 @@ impl<'a> StateTransitionValueConvert<'a> for IdentityCreditWithdrawalTransition value.insert(STATE_TRANSITION_PROTOCOL_VERSION.to_string(), Value::U16(0))?; Ok(value) } + IdentityCreditWithdrawalTransition::V1(transition) => { + let mut value = transition.to_cleaned_object(skip_signature)?; + value.insert(STATE_TRANSITION_PROTOCOL_VERSION.to_string(), Value::U16(1))?; + Ok(value) + } } } @@ -74,6 +95,11 @@ impl<'a> StateTransitionValueConvert<'a> for IdentityCreditWithdrawalTransition platform_version, )? .into()), + 1 => Ok(IdentityCreditWithdrawalTransitionV1::from_object( + raw_object, + platform_version, + )? + .into()), n => Err(ProtocolError::UnknownVersionError(format!( "Unknown IdentityCreditWithdrawalTransition version {n}" ))), @@ -101,6 +127,11 @@ impl<'a> StateTransitionValueConvert<'a> for IdentityCreditWithdrawalTransition platform_version, )? .into()), + 1 => Ok(IdentityCreditWithdrawalTransitionV1::from_value_map( + raw_value_map, + platform_version, + )? + .into()), n => Err(ProtocolError::UnknownVersionError(format!( "Unknown IdentityCreditWithdrawalTransition version {n}" ))), @@ -114,6 +145,7 @@ impl<'a> StateTransitionValueConvert<'a> for IdentityCreditWithdrawalTransition match version { 0 => IdentityCreditWithdrawalTransitionV0::clean_value(value), + 1 => IdentityCreditWithdrawalTransitionV1::clean_value(value), n => Err(ProtocolError::UnknownVersionError(format!( "Unknown IdentityCreditWithdrawalTransition version {n}" ))), diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/version.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/version.rs index d4afb75657..d0f7ab1687 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/version.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/version.rs @@ -6,6 +6,7 @@ impl FeatureVersioned for IdentityCreditWithdrawalTransition { fn feature_version(&self) -> FeatureVersion { match self { IdentityCreditWithdrawalTransition::V0(v0) => v0.feature_version(), + IdentityCreditWithdrawalTransition::V1(v1) => v1.feature_version(), } } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_update_transition/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_update_transition/identity_signed.rs index 471f0884e2..ce74927344 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_update_transition/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_update_transition/identity_signed.rs @@ -1,4 +1,4 @@ -use crate::identity::{KeyID, SecurityLevel}; +use crate::identity::{KeyID, Purpose, SecurityLevel}; use crate::state_transition::identity_update_transition::IdentityUpdateTransition; use crate::state_transition::StateTransitionIdentitySigned; @@ -17,9 +17,11 @@ impl StateTransitionIdentitySigned for IdentityUpdateTransition { } } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, purpose: Purpose) -> Vec { match self { - IdentityUpdateTransition::V0(transition) => transition.security_level_requirement(), + IdentityUpdateTransition::V0(transition) => { + transition.security_level_requirement(purpose) + } } } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_update_transition/v0/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_update_transition/v0/identity_signed.rs index 0b6c85a50a..54d384be93 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_update_transition/v0/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_update_transition/v0/identity_signed.rs @@ -1,5 +1,5 @@ use crate::identity::SecurityLevel::MASTER; -use crate::identity::{KeyID, SecurityLevel}; +use crate::identity::{KeyID, Purpose, SecurityLevel}; use crate::state_transition::identity_update_transition::v0::IdentityUpdateTransitionV0; use crate::state_transition::StateTransitionIdentitySigned; @@ -12,7 +12,7 @@ impl StateTransitionIdentitySigned for IdentityUpdateTransitionV0 { self.signature_public_key_id = key_id } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, _purpose: Purpose) -> Vec { vec![MASTER] } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/identity_signed.rs index cfc6f9d65b..9a02b8ddf2 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/identity_signed.rs @@ -17,13 +17,15 @@ impl StateTransitionIdentitySigned for MasternodeVoteTransition { } } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, purpose: Purpose) -> Vec { match self { - MasternodeVoteTransition::V0(transition) => transition.security_level_requirement(), + MasternodeVoteTransition::V0(transition) => { + transition.security_level_requirement(purpose) + } } } - fn purpose_requirement(&self) -> Purpose { + fn purpose_requirement(&self) -> Vec { match self { MasternodeVoteTransition::V0(transition) => transition.purpose_requirement(), } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/v0/identity_signed.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/v0/identity_signed.rs index 47531db013..7b5d731676 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/v0/identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/v0/identity_signed.rs @@ -12,11 +12,11 @@ impl StateTransitionIdentitySigned for MasternodeVoteTransitionV0 { self.signature_public_key_id = key_id } - fn security_level_requirement(&self) -> Vec { + fn security_level_requirement(&self, _purpose: Purpose) -> Vec { vec![CRITICAL, HIGH, MEDIUM] } - fn purpose_requirement(&self) -> Purpose { - Purpose::VOTING + fn purpose_requirement(&self) -> Vec { + vec![Purpose::VOTING] } } diff --git a/packages/rs-dpp/src/state_transition/traits/state_transition_identity_signed.rs b/packages/rs-dpp/src/state_transition/traits/state_transition_identity_signed.rs index c81029a7fe..4da43f68c8 100644 --- a/packages/rs-dpp/src/state_transition/traits/state_transition_identity_signed.rs +++ b/packages/rs-dpp/src/state_transition/traits/state_transition_identity_signed.rs @@ -45,24 +45,25 @@ pub trait StateTransitionIdentitySigned: StateTransitionLike { &self, public_key: &IdentityPublicKey, ) -> Result<(), ProtocolError> { + if !self.purpose_requirement().contains(&public_key.purpose()) { + return Err(ProtocolError::WrongPublicKeyPurposeError( + WrongPublicKeyPurposeError::new(public_key.purpose(), self.purpose_requirement()), + )); + } + // Otherwise, key security level should be less than MASTER but more or equal than required if !self - .security_level_requirement() + .security_level_requirement(public_key.purpose()) .contains(&public_key.security_level()) { return Err(ProtocolError::InvalidSignaturePublicKeySecurityLevelError( InvalidSignaturePublicKeySecurityLevelError::new( public_key.security_level(), - self.security_level_requirement(), + self.security_level_requirement(public_key.purpose()), ), )); } - if public_key.purpose() != self.purpose_requirement() { - return Err(ProtocolError::WrongPublicKeyPurposeError( - WrongPublicKeyPurposeError::new(public_key.purpose(), self.purpose_requirement()), - )); - } Ok(()) } @@ -85,13 +86,13 @@ pub trait StateTransitionIdentitySigned: StateTransitionLike { /// Returns minimal key security level that can be used to sign this ST. /// Override this method if the ST requires a different security level. - fn security_level_requirement(&self) -> Vec; + fn security_level_requirement(&self, purpose: Purpose) -> Vec; /// The purpose requirement for the signing key /// The default is authentication /// However for Withdrawals and Fund Transfers the requirement is TRANSFER - fn purpose_requirement(&self) -> Purpose { - Purpose::AUTHENTICATION + fn purpose_requirement(&self) -> Vec { + vec![Purpose::AUTHENTICATION] } } diff --git a/packages/rs-dpp/src/withdrawal/document_try_into_asset_unlock_base_transaction_info/mod.rs b/packages/rs-dpp/src/withdrawal/document_try_into_asset_unlock_base_transaction_info/mod.rs new file mode 100644 index 0000000000..1ca292303d --- /dev/null +++ b/packages/rs-dpp/src/withdrawal/document_try_into_asset_unlock_base_transaction_info/mod.rs @@ -0,0 +1,25 @@ +use crate::document::Document; +use crate::withdrawal::WithdrawalTransactionIndex; +use crate::ProtocolError; +use dashcore::transaction::special_transaction::asset_unlock::unqualified_asset_unlock::AssetUnlockBaseTransactionInfo; +use platform_version::version::PlatformVersion; +mod v0; +impl Document { + pub fn try_into_asset_unlock_base_transaction_info( + &self, + transaction_index: WithdrawalTransactionIndex, + platform_version: &PlatformVersion, + ) -> Result { + match platform_version + .dpp + .document_versions + .document_method_versions + .try_into_asset_unlock_base_transaction_info + { + 0 => self.try_into_asset_unlock_base_transaction_info_v0(transaction_index), + v => Err(ProtocolError::UnknownVersionError(format!( + "Unknown IdentityCreateTransition version for try_from_identity_with_signer {v}" + ))), + } + } +} diff --git a/packages/rs-dpp/src/withdrawal/document_try_into_asset_unlock_base_transaction_info/v0/mod.rs b/packages/rs-dpp/src/withdrawal/document_try_into_asset_unlock_base_transaction_info/v0/mod.rs new file mode 100644 index 0000000000..f28b9dcf8b --- /dev/null +++ b/packages/rs-dpp/src/withdrawal/document_try_into_asset_unlock_base_transaction_info/v0/mod.rs @@ -0,0 +1,45 @@ +use crate::document::{Document, DocumentV0Getters}; +use crate::identity::convert_credits_to_duffs; +use crate::system_data_contracts::withdrawals_contract::v1::document_types::withdrawal; +use crate::withdrawal::WithdrawalTransactionIndex; +use crate::ProtocolError; +use dashcore::transaction::special_transaction::asset_unlock::qualified_asset_unlock::ASSET_UNLOCK_TX_SIZE; +use dashcore::transaction::special_transaction::asset_unlock::unqualified_asset_unlock::{ + AssetUnlockBasePayload, AssetUnlockBaseTransactionInfo, +}; +use dashcore::{ScriptBuf, TxOut}; +use platform_value::btreemap_extensions::BTreeValueMapHelper; + +impl Document { + pub(super) fn try_into_asset_unlock_base_transaction_info_v0( + &self, + transaction_index: WithdrawalTransactionIndex, + ) -> Result { + let properties = self.properties(); + + let output_script_bytes = properties.get_bytes(withdrawal::properties::OUTPUT_SCRIPT)?; + + let amount = properties.get_integer(withdrawal::properties::AMOUNT)?; + + let core_fee_per_byte: u32 = + properties.get_integer(withdrawal::properties::CORE_FEE_PER_BYTE)?; + + let output_script = ScriptBuf::from_bytes(output_script_bytes); + + let tx_out = TxOut { + value: convert_credits_to_duffs(amount)?, + script_pubkey: output_script, + }; + + Ok(AssetUnlockBaseTransactionInfo { + version: 1, + lock_time: 0, + output: vec![tx_out], + base_payload: AssetUnlockBasePayload { + version: 1, + index: transaction_index, + fee: ASSET_UNLOCK_TX_SIZE as u32 * core_fee_per_byte, + }, + }) + } +} diff --git a/packages/rs-dpp/src/withdrawal/mod.rs b/packages/rs-dpp/src/withdrawal/mod.rs index be31e49559..1aaac3052d 100644 --- a/packages/rs-dpp/src/withdrawal/mod.rs +++ b/packages/rs-dpp/src/withdrawal/mod.rs @@ -1,3 +1,6 @@ +#[cfg(feature = "system_contracts")] +mod document_try_into_asset_unlock_base_transaction_info; + use bincode::{Decode, Encode}; use serde_repr::{Deserialize_repr, Serialize_repr}; @@ -11,3 +14,9 @@ pub enum Pooling { IfAvailable = 1, Standard = 2, } + +/// Transaction index type +pub type WithdrawalTransactionIndex = u64; + +/// Simple type alias for withdrawal transaction with it's index +pub type WithdrawalTransactionIndexAndBytes = (WithdrawalTransactionIndex, Vec); diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 1e6fe7174f..6ca9d43b97 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "drive-abci" -version = "1.3.0" +version = "1.4.0-dev.1" authors = [ "Samuel Westrich ", "Ivan Shumkov ", diff --git a/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs b/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs index 9a59463bea..18252d0d45 100644 --- a/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs +++ b/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs @@ -163,10 +163,26 @@ where // Such state transitions must be invalidated by check tx, but they might // still be added to mempool due to inconsistency between check tx and tx processing // (fees calculation) or malicious proposer. - StateTransitionExecutionResult::UnpaidConsensusError(..) => TxAction::Removed, + StateTransitionExecutionResult::UnpaidConsensusError(consensus_error) => { + tracing::trace!( + "UnpaidConsensusError at height {}, round {}: {:?}", + request.height, + request.round, + consensus_error + ); + TxAction::Removed + } // We shouldn't include in the block any state transitions that produced an internal error // during execution - StateTransitionExecutionResult::InternalError(..) => TxAction::Removed, + StateTransitionExecutionResult::InternalError(error_message) => { + tracing::debug!( + "InternalError at height {}, round {}: {}", + request.height, + request.round, + error_message + ); + TxAction::Removed + } // State Transition was not executed as it reached the maximum time limit StateTransitionExecutionResult::NotExecuted(..) => TxAction::Delayed, }; diff --git a/packages/rs-drive-abci/src/config.rs b/packages/rs-drive-abci/src/config.rs index ad0cfdbce5..8e8f449aac 100644 --- a/packages/rs-drive-abci/src/config.rs +++ b/packages/rs-drive-abci/src/config.rs @@ -187,7 +187,7 @@ pub struct PlatformConfig { pub db_path: PathBuf, /// Path to store rejected / invalid items (like transactions). - /// Used mainly for debuggig. + /// Used mainly for debugging. /// /// If not set, rejected and invalid items will not be stored. pub rejections_path: Option, diff --git a/packages/rs-drive-abci/src/execution/engine/finalize_block_proposal/v0/mod.rs b/packages/rs-drive-abci/src/execution/engine/finalize_block_proposal/v0/mod.rs index c56272b61d..ecfc3d6edf 100644 --- a/packages/rs-drive-abci/src/execution/engine/finalize_block_proposal/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/engine/finalize_block_proposal/v0/mod.rs @@ -8,8 +8,6 @@ use dpp::block::block_info::BlockInfo; use dpp::block::extended_block_info::v0::ExtendedBlockInfoV0; use dpp::version::PlatformVersion; -use dpp::dashcore::bls_sig_utils::BLSSignature; - use tenderdash_abci::{ proto::{serializers::timestamp::ToMilis, types::BlockId as ProtoBlockId}, signatures::Hashable, @@ -19,8 +17,7 @@ use crate::abci::AbciError; use crate::error::Error; use crate::execution::types::block_execution_context::v0::{ - BlockExecutionContextV0Getters, BlockExecutionContextV0MutableGetters, - BlockExecutionContextV0OwnedGetters, + BlockExecutionContextV0Getters, BlockExecutionContextV0OwnedGetters, }; use crate::execution::types::block_execution_context::BlockExecutionContext; use crate::execution::types::block_state_info::v0::{ @@ -62,7 +59,7 @@ where pub(super) fn finalize_block_proposal_v0( &self, request_finalize_block: FinalizeBlockCleanedRequest, - mut block_execution_context: BlockExecutionContext, + block_execution_context: BlockExecutionContext, transaction: &Transaction, platform_version: &PlatformVersion, ) -> Result { @@ -74,7 +71,7 @@ where // Let's decompose the request let FinalizeBlockCleanedRequest { - commit: mut commit_info, + commit: commit_info, misbehavior: _, hash, height, @@ -143,16 +140,16 @@ where let expected_withdrawal_transactions = block_execution_context.unsigned_withdrawal_transactions(); - if !expected_withdrawal_transactions - .are_matching_with_vote_extensions(&commit_info.threshold_vote_extensions) - { + let Some(transaction_to_extension_matches) = expected_withdrawal_transactions + .verify_and_match_with_vote_extensions(&commit_info.threshold_vote_extensions) + else { validation_result.add_error(AbciError::VoteExtensionMismatchReceived { got: commit_info.threshold_vote_extensions, - expected: expected_withdrawal_transactions.into(), + expected: (&expected_withdrawal_transactions.clone()).into(), }); return Ok(validation_result.into()); - } + }; // Verify commit @@ -202,34 +199,9 @@ where to_commit_block_info.core_height = block_header.core_chain_locked_height; - // Append signatures and broadcast asset unlock transactions to Core - - // Drain withdrawal transaction instead of cloning - let unsigned_withdrawal_transactions = block_execution_context - .unsigned_withdrawal_transactions_mut() - .drain(); - - if !unsigned_withdrawal_transactions.is_empty() { - // Drain signatures instead of cloning - let signatures = commit_info - .threshold_vote_extensions - .drain(..) - .map(|vote_extension| { - let signature_bytes: [u8; 96] = - vote_extension.signature.try_into().map_err(|e| { - AbciError::BadRequestDataSize(format!( - "invalid votes extension signature size: {}", - hex::encode(e) - )) - })?; - - Ok(BLSSignature::from(signature_bytes)) - }) - .collect::>()?; - + if !transaction_to_extension_matches.is_empty() { self.append_signatures_and_broadcast_withdrawal_transactions( - unsigned_withdrawal_transactions, - signatures, + transaction_to_extension_matches, platform_version, )?; } diff --git a/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/v0/mod.rs b/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/v0/mod.rs index 398d4c111f..d190c5c055 100644 --- a/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/v0/mod.rs @@ -10,6 +10,7 @@ use drive::grovedb::Transaction; use crate::platform_types::cleaned_abci_messages::request_init_chain_cleaned_params; use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::platform_types::platform_state::PlatformState; +use crate::platform_types::validator_set::ValidatorSetExt; use dpp::version::PlatformVersion; use std::sync::Arc; use tenderdash_abci::proto::abci::{RequestInitChain, ResponseInitChain, ValidatorSetUpdate}; @@ -105,10 +106,7 @@ where ExecutionError::InitializationError("we should have at least one quorum"), )?; - ( - *validator_set_inner.0, - ValidatorSetUpdate::from(validator_set_inner.1), - ) + (*validator_set_inner.0, validator_set_inner.1.to_update()) }; initial_platform_state.set_current_validator_set_quorum_hash(quorum_hash); diff --git a/packages/rs-drive-abci/src/execution/engine/run_block_proposal/v0/mod.rs b/packages/rs-drive-abci/src/execution/engine/run_block_proposal/v0/mod.rs index 5a5d36780b..63e1437f7f 100644 --- a/packages/rs-drive-abci/src/execution/engine/run_block_proposal/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/engine/run_block_proposal/v0/mod.rs @@ -321,6 +321,7 @@ where // Corresponding withdrawal documents are changed from queued to pooled self.pool_withdrawals_into_transactions_queue( &block_info, + &last_committed_platform_state, Some(transaction), platform_version, )?; diff --git a/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/mod.rs index ebfe6c3fdf..af0e181b66 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/mod.rs @@ -1,4 +1,5 @@ mod v0; +mod v1; use crate::error::execution::ExecutionError; use crate::error::Error; @@ -52,9 +53,14 @@ where platform_state, block_execution_context, ), + 1 => self.validator_set_update_v1( + proposer_pro_tx_hash, + platform_state, + block_execution_context, + ), version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { method: "validator_set_update".to_string(), - known_versions: vec![0], + known_versions: vec![0, 1], received: version, })), } diff --git a/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/v0/mod.rs index efc6251880..9d713e04cd 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/v0/mod.rs @@ -11,6 +11,7 @@ use crate::platform_types::validator_set::v0::ValidatorSetV0Getters; use crate::rpc::core::CoreRPCLike; use itertools::Itertools; +use crate::platform_types::validator_set::ValidatorSetExt; use dpp::dashcore::hashes::Hash; use tenderdash_abci::proto::abci::ValidatorSetUpdate; @@ -92,7 +93,7 @@ where // we also need to perform a rotation if the validator set is being removed tracing::debug!( method = "validator_set_update_v0", - "rotation: new quorums not containing current quorum current {:?}, {}. quorum rotation expectedËš", + "rotation: new quorums not containing current quorum current {:?}, {}. quorum rotation expected", block_execution_context .block_platform_state() .validator_sets() @@ -144,7 +145,7 @@ where &quorum_hash, new_validator_set.members().len() ); - let validator_set_update = new_validator_set.into(); + let validator_set_update = new_validator_set.to_update(); block_execution_context .block_platform_state_mut() .set_next_validator_set_quorum_hash(Some(*quorum_hash)); @@ -163,7 +164,7 @@ where "rotation: all quorums changed, rotation to new quorum: {}", &quorum_hash ); - let validator_set_update = new_validator_set.into(); + let validator_set_update = new_validator_set.to_update(); let new_quorum_hash = *quorum_hash; block_execution_context .block_platform_state_mut() @@ -185,7 +186,7 @@ where method = "validator_set_update_v0", "validator set update without rotation" ); - Ok(Some(current_validator_set.into())) + Ok(Some(current_validator_set.to_update())) } else { tracing::debug!( method = "validator_set_update_v0", diff --git a/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/v1/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/v1/mod.rs new file mode 100644 index 0000000000..b7b8f1372f --- /dev/null +++ b/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/v1/mod.rs @@ -0,0 +1,217 @@ +use crate::error::execution::ExecutionError; +use crate::error::Error; +use crate::execution::types::block_execution_context::v0::{ + BlockExecutionContextV0Getters, BlockExecutionContextV0MutableGetters, +}; +use crate::execution::types::block_execution_context::BlockExecutionContext; +use crate::platform_types::platform::Platform; +use crate::platform_types::platform_state::v0::PlatformStateV0Methods; +use crate::platform_types::platform_state::PlatformState; +use crate::platform_types::validator_set::v0::ValidatorSetV0Getters; +use crate::rpc::core::CoreRPCLike; +use itertools::Itertools; + +use crate::platform_types::validator_set::ValidatorSetExt; +use dpp::dashcore::hashes::Hash; +use tenderdash_abci::proto::abci::ValidatorSetUpdate; + +impl Platform +where + C: CoreRPCLike, +{ + /// We need to validate against the platform state for rotation and not the block execution + /// context state + /// We introduced v1 because the end quorums could be rotating out, giving a small advantage + /// to proposers with a smaller pro_tx_hash + /// To understand this imagine we have proposers + /// `a b c d e f g h i j k` in quorum 24 + /// c is the current proposer + /// Quorum 24 no longer is valid + /// We jump to quorum 0. + /// a b and c just got paid, but the rest did not. + #[inline(always)] + pub(super) fn validator_set_update_v1( + &self, + proposer_pro_tx_hash: [u8; 32], + platform_state: &PlatformState, + block_execution_context: &mut BlockExecutionContext, + ) -> Result, Error> { + let mut perform_rotation = false; + + if let Some(validator_set) = block_execution_context + .block_platform_state() + .validator_sets() + .get(&platform_state.current_validator_set_quorum_hash()) + { + if let Some((last_member_pro_tx_hash, _)) = validator_set.members().last_key_value() { + // we should also perform a rotation if the validator set went through all quorum members + // this means we are at the last member of the quorum + if last_member_pro_tx_hash.as_byte_array() == &proposer_pro_tx_hash { + tracing::debug!( + method = "validator_set_update_v1", + "rotation: quorum finished as we hit last member {} of quorum {}. All known quorums are: [{}]. quorum rotation expected", + hex::encode(proposer_pro_tx_hash), + hex::encode(platform_state.current_validator_set_quorum_hash().as_byte_array()), + block_execution_context + .block_platform_state() + .validator_sets() + .keys() + .map(hex::encode).collect::>().join(" | "), + ); + perform_rotation = true; + } + } else { + // the validator set has no members, very weird, but let's just perform a rotation + tracing::debug!( + method = "validator_set_update_v1", + "rotation: validator set has no members", + ); + perform_rotation = true; + } + + // We should also perform a rotation if there are more than one quorum in the system + // and that the new proposer is on the same quorum and the last proposer but is before + // them in the list of proposers. + // This only works if Tenderdash goes through proposers properly + if &platform_state.last_committed_quorum_hash() + == platform_state + .current_validator_set_quorum_hash() + .as_byte_array() + && platform_state.last_committed_block_proposer_pro_tx_hash() > proposer_pro_tx_hash + && platform_state.validator_sets().len() > 1 + { + // 1 - We haven't changed quorums + // 2 - The new proposer is before the old proposer + // 3 - There are more than one quorum in the system + tracing::debug!( + method = "validator_set_update_v1", + "rotation: quorum finished as we hit last an earlier member {} than last block proposer {} for quorum {}. All known quorums are: [{}]. quorum rotation expected", + hex::encode(proposer_pro_tx_hash), + hex::encode(block_execution_context.block_platform_state().last_committed_block_proposer_pro_tx_hash()), + hex::encode(platform_state.current_validator_set_quorum_hash().as_byte_array()), + block_execution_context + .block_platform_state() + .validator_sets() + .keys() + .map(hex::encode).collect::>().join(" | "), + ); + perform_rotation = true; + } + } else { + // we also need to perform a rotation if the validator set is being removed + tracing::debug!( + method = "validator_set_update_v1", + "rotation: new quorums not containing current quorum current {:?}, {}. quorum rotation expected", + block_execution_context + .block_platform_state() + .validator_sets() + .keys() + .map(|quorum_hash| format!("{}", quorum_hash)), + &platform_state.current_validator_set_quorum_hash() + ); + perform_rotation = true; + } + + //todo: (maybe) perform a rotation if quorum health is low + + if perform_rotation { + // get the index of the previous quorum + let mut index = platform_state + .validator_sets() + .get_index_of(&platform_state.current_validator_set_quorum_hash()) + .ok_or(Error::Execution(ExecutionError::CorruptedCachedState( + format!("perform_rotation: current validator set quorum hash {} not in current known validator sets [{}] processing block {}", platform_state.current_validator_set_quorum_hash(), platform_state + .validator_sets().keys().map(|quorum_hash| quorum_hash.to_string()).join(" | "), + platform_state.last_committed_block_height() + 1, + ))))?; + // we should rotate the quorum + let quorum_count = platform_state.validator_sets().len(); + match quorum_count { + 0 => Err(Error::Execution(ExecutionError::CorruptedCachedState( + "no current quorums".to_string(), + ))), + 1 => Ok(None), // no rotation as we are the only quorum + count => { + let start_index = index; + let oldest_quorum_index_we_can_go_to = if count > 10 { + // if we have a lot of quorums (like on testnet and mainnet) + // we shouldn't start using the last ones as they could cycle out + count - 2 + } else { + count + }; + index = (index + 1) % oldest_quorum_index_we_can_go_to; + // We can't just take the next item because it might no longer be in the state + for _i in 0..oldest_quorum_index_we_can_go_to { + let (quorum_hash, _) = platform_state + .validator_sets() + .get_index(index) + .expect("expected next validator set"); + + // We still have it in the state + if let Some(new_validator_set) = block_execution_context + .block_platform_state() + .validator_sets() + .get(quorum_hash) + { + tracing::debug!( + method = "validator_set_update_v1", + "rotation: to new quorum: {} with {} members", + &quorum_hash, + new_validator_set.members().len() + ); + let validator_set_update = new_validator_set.to_update(); + block_execution_context + .block_platform_state_mut() + .set_next_validator_set_quorum_hash(Some(*quorum_hash)); + return Ok(Some(validator_set_update)); + } + index = (index + 1) % oldest_quorum_index_we_can_go_to; + if index == start_index { + break; + } + } + // All quorums changed + if let Some((quorum_hash, new_validator_set)) = block_execution_context + .block_platform_state() + .validator_sets() + .first() + { + tracing::debug!( + method = "validator_set_update_v1", + "rotation: all quorums changed, rotation to new quorum: {}", + &quorum_hash + ); + let validator_set_update = new_validator_set.to_update(); + let new_quorum_hash = *quorum_hash; + block_execution_context + .block_platform_state_mut() + .set_next_validator_set_quorum_hash(Some(new_quorum_hash)); + return Ok(Some(validator_set_update)); + } + tracing::debug!("no new quorums to choose from"); + Ok(None) + } + } + } else { + let current_validator_set = block_execution_context + .block_platform_state() + .current_validator_set()?; + if current_validator_set != platform_state.current_validator_set()? { + // Something changed, for example the IP of a validator changed, or someone's ban status + + tracing::debug!( + method = "validator_set_update_v1", + "validator set update without rotation" + ); + Ok(Some(current_validator_set.to_update())) + } else { + tracing::debug!( + method = "validator_set_update_v1", + "no validator set update", + ); + Ok(None) + } + } + } +} diff --git a/packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_quorum_info/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_quorum_info/v0/mod.rs index bcc65582d7..5ca6ce4070 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_quorum_info/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_quorum_info/v0/mod.rs @@ -7,7 +7,9 @@ use dashcore_rpc::json::{ExtendedQuorumListResult, QuorumType}; use std::collections::BTreeMap; use std::fmt::Display; -use crate::platform_types::validator_set::v0::{ValidatorSetV0, ValidatorSetV0Getters}; +use crate::platform_types::validator_set::v0::{ + ValidatorSetMethodsV0, ValidatorSetV0, ValidatorSetV0Getters, +}; use crate::platform_types::validator_set::ValidatorSet; use crate::rpc::core::CoreRPCLike; diff --git a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/append_signatures_and_broadcast_withdrawal_transactions/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/append_signatures_and_broadcast_withdrawal_transactions/mod.rs index de42c73bda..3601bd9640 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/append_signatures_and_broadcast_withdrawal_transactions/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/append_signatures_and_broadcast_withdrawal_transactions/mod.rs @@ -1,10 +1,11 @@ use crate::error::execution::ExecutionError; use crate::error::Error; use crate::platform_types::platform::Platform; -use crate::platform_types::withdrawal::unsigned_withdrawal_txs::v0::UnsignedWithdrawalTxs; use crate::rpc::core::CoreRPCLike; -use dpp::dashcore::bls_sig_utils::BLSSignature; +use dpp::dashcore::Transaction; use dpp::version::PlatformVersion; +use std::collections::BTreeMap; +use tenderdash_abci::proto::types::VoteExtension; mod v0; @@ -15,8 +16,7 @@ where /// Appends signatures to unsigned withdrawal transactions and broadcast them to Core pub(in crate::execution) fn append_signatures_and_broadcast_withdrawal_transactions( &self, - unsigned_withdrawal_transactions: UnsignedWithdrawalTxs, - signatures: Vec, + withdrawal_transactions_with_vote_extensions: BTreeMap<&Transaction, &VoteExtension>, platform_version: &PlatformVersion, ) -> Result<(), Error> { match platform_version @@ -26,8 +26,7 @@ where .append_signatures_and_broadcast_withdrawal_transactions { 0 => self.append_signatures_and_broadcast_withdrawal_transactions_v0( - unsigned_withdrawal_transactions, - signatures, + withdrawal_transactions_with_vote_extensions, ), version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { method: "append_signatures_and_broadcast_withdrawal_transactions".to_string(), diff --git a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/append_signatures_and_broadcast_withdrawal_transactions/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/append_signatures_and_broadcast_withdrawal_transactions/v0/mod.rs index 22a3c4d555..6d1deb5c82 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/append_signatures_and_broadcast_withdrawal_transactions/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/append_signatures_and_broadcast_withdrawal_transactions/v0/mod.rs @@ -1,7 +1,6 @@ use crate::error::execution::ExecutionError; use crate::error::Error; use crate::platform_types::platform::Platform; -use crate::platform_types::withdrawal::unsigned_withdrawal_txs::v0::UnsignedWithdrawalTxs; use crate::rpc::core::{ CoreRPCLike, CORE_RPC_ERROR_ASSET_UNLOCK_EXPIRED, CORE_RPC_ERROR_ASSET_UNLOCK_NO_ACTIVE_QUORUM, CORE_RPC_TX_ALREADY_IN_CHAIN, @@ -10,12 +9,14 @@ use dashcore_rpc::jsonrpc; use dashcore_rpc::Error as CoreRPCError; use dpp::dashcore::bls_sig_utils::BLSSignature; use dpp::dashcore::transaction::special_transaction::TransactionPayload::AssetUnlockPayloadType; -use dpp::dashcore::{consensus, Txid}; +use dpp::dashcore::{consensus, Transaction, Txid}; +use std::collections::{BTreeMap, HashMap}; use std::fs::{self, File}; use std::io::Write; use std::path::Path; use std::time::{SystemTime, UNIX_EPOCH}; +use tenderdash_abci::proto::types::VoteExtension; impl Platform where @@ -23,79 +24,93 @@ where { pub(super) fn append_signatures_and_broadcast_withdrawal_transactions_v0( &self, - unsigned_withdrawal_transactions: UnsignedWithdrawalTxs, - signatures: Vec, + withdrawal_transactions_with_vote_extensions: BTreeMap<&Transaction, &VoteExtension>, ) -> Result<(), Error> { - if unsigned_withdrawal_transactions.is_empty() { + if withdrawal_transactions_with_vote_extensions.is_empty() { return Ok(()); } - if unsigned_withdrawal_transactions.len() != signatures.len() { - return Err(Error::Execution(ExecutionError::CorruptedCodeExecution( - "number of signatures must match number of withdrawal transactions", - ))); - } - tracing::debug!( "Broadcasting {} withdrawal transactions", - unsigned_withdrawal_transactions.len(), + withdrawal_transactions_with_vote_extensions.len(), ); let mut transaction_submission_failures = vec![]; - for (mut transaction, signature) in - unsigned_withdrawal_transactions.into_iter().zip(signatures) - { - let Some(AssetUnlockPayloadType(mut payload)) = transaction.special_transaction_payload - else { - return Err(Error::Execution(ExecutionError::CorruptedCodeExecution( - "withdrawal transaction payload must be AssetUnlockPayloadType", + for (transaction_ref, vote_extension) in withdrawal_transactions_with_vote_extensions { + // Clone the transaction to get an owned, mutable transaction + let mut transaction = transaction_ref.clone(); + + // Extract the signature from the vote extension + let signature_bytes: [u8; 96] = vote_extension + .signature + .as_slice() + .try_into() + .map_err(|_| { + Error::Execution(ExecutionError::CorruptedCodeExecution( + "invalid votes extension signature size", + )) + })?; + + let signature = BLSSignature::from(signature_bytes); + + // Modify the transaction's payload + if let Some(AssetUnlockPayloadType(mut payload)) = + transaction.special_transaction_payload + { + // Assign the quorum signature + payload.quorum_sig = signature; + + // Assign the modified payload back to the transaction + transaction.special_transaction_payload = Some(AssetUnlockPayloadType(payload)); + } else { + return Err(Error::Execution(ExecutionError::CorruptedCachedState( + "withdrawal transaction payload must be AssetUnlockPayloadType".to_string(), ))); - }; - - payload.quorum_sig = signature; - - let index = payload.base.index; - - transaction.special_transaction_payload = Some(AssetUnlockPayloadType(payload)); + } + // Serialize the transaction let tx_bytes = consensus::serialize(&transaction); - // TODO: We need to broadcast all or none of the transactions (in case of error) - // will be fixed in upcoming PR + // Send the transaction match self.core_rpc.send_raw_transaction(&tx_bytes) { Ok(_) => { tracing::debug!( tx_id = transaction.txid().to_hex(), - index, - "Successfully broadcasted withdrawal transaction with index {}", - index + "Successfully broadcasted withdrawal transaction" ); } - // Ignore errors that can happen during blockchain synchronization. - // They will be logged with dashcore_rpc + // Handle specific errors Err(CoreRPCError::JsonRpc(jsonrpc::error::Error::Rpc(e))) - if e.code == CORE_RPC_TX_ALREADY_IN_CHAIN - || e.message == CORE_RPC_ERROR_ASSET_UNLOCK_NO_ACTIVE_QUORUM + if e.code == CORE_RPC_TX_ALREADY_IN_CHAIN => + { + // Transaction already in chain; no action needed + } + Err(CoreRPCError::JsonRpc(jsonrpc::error::Error::Rpc(e))) + if e.message == CORE_RPC_ERROR_ASSET_UNLOCK_NO_ACTIVE_QUORUM || e.message == CORE_RPC_ERROR_ASSET_UNLOCK_EXPIRED => { - // These will never work again + tracing::debug!( + tx_id = transaction.txid().to_string(), + "Asset unlock is expired or has no active quorum: {}", + e.message + ); + transaction_submission_failures.push((transaction.txid(), tx_bytes)); } - // Errors that can happen if we created invalid tx or Core isn't responding + // Handle other errors Err(e) => { tracing::warn!( tx_id = transaction.txid().to_string(), - index, - "Failed to broadcast asset unlock transaction {}: {}", - index, + "Failed to broadcast asset unlock transaction: {}", e ); - // These errors might allow the state transition to be broadcast in the future + // Collect failed transactions for potential future retries transaction_submission_failures.push((transaction.txid(), tx_bytes)); } } } + // Store transaction submission failures if let Some(ref rejections_path) = self.config.rejections_path { store_transaction_failures(transaction_submission_failures, rejections_path) .map_err(|e| Error::Execution(e.into()))?; diff --git a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/build_untied_withdrawal_transactions_from_documents/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/build_untied_withdrawal_transactions_from_documents/mod.rs index e4cd110298..0f0ff66a74 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/build_untied_withdrawal_transactions_from_documents/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/build_untied_withdrawal_transactions_from_documents/mod.rs @@ -2,13 +2,10 @@ use crate::error::execution::ExecutionError; use crate::error::Error; use crate::platform_types::platform::Platform; use crate::rpc::core::CoreRPCLike; +use dpp::block::block_info::BlockInfo; use dpp::document::Document; -use dpp::identifier::Identifier; use dpp::version::PlatformVersion; -use drive::drive::identity::withdrawals::{ - WithdrawalTransactionIndex, WithdrawalTransactionIndexAndBytes, -}; -use std::collections::HashMap; +use dpp::withdrawal::{WithdrawalTransactionIndex, WithdrawalTransactionIndexAndBytes}; mod v0; @@ -16,35 +13,41 @@ impl Platform where C: CoreRPCLike, { - /// Builds a list of Core transactions from withdrawal documents. This function is a version handler that - /// directs to specific version implementations of the `build_withdrawal_transactions_from_documents` function. + /// Builds a list of withdrawal transactions from the provided withdrawal documents. + /// Each withdrawal document is converted into a Core transaction, starting from the specified index. + /// The function encodes the transaction and updates the document with the transaction index, status, + /// updated time, and revision. /// /// # Arguments /// - /// * `documents` - A slice of `Document`. - /// * `drive_operation_types` - A mutable reference to `Vec`. - /// * `transaction` - A `TransactionArg` reference. - /// * `platform_version` - A `PlatformVersion` reference that dictates which version of - /// the method to call. + /// * `documents` - A mutable reference to a vector of `Document` representing the withdrawal requests. + /// * `start_index` - The starting index for the transaction, of type `WithdrawalTransactionIndex`. + /// * `block_info` - A reference to the `BlockInfo`, which provides the current block's timestamp. + /// * `platform_version` - A reference to the `PlatformVersion` that specifies the version of the platform being used. /// /// # Returns /// - /// * `Result, Error>` - Returns a HashMap containing withdrawal transactions if found, otherwise returns an `Error`. + /// * `Result, Error>` - On success, returns a vector of tuples containing the + /// transaction index and the encoded transaction bytes. On failure, returns an `Error`. pub(in crate::execution::platform_events::withdrawals) fn build_untied_withdrawal_transactions_from_documents( &self, - documents: &[Document], + documents: &mut Vec, start_index: WithdrawalTransactionIndex, + block_info: &BlockInfo, platform_version: &PlatformVersion, - ) -> Result, Error> { + ) -> Result, Error> { match platform_version .drive_abci .methods .withdrawals .build_untied_withdrawal_transactions_from_documents { - 0 => { - self.build_untied_withdrawal_transactions_from_documents_v0(documents, start_index) - } + 0 => self.build_untied_withdrawal_transactions_from_documents_v0( + documents, + start_index, + block_info, + platform_version, + ), version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { method: "build_untied_withdrawal_transactions_from_documents".to_string(), known_versions: vec![0], diff --git a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/build_untied_withdrawal_transactions_from_documents/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/build_untied_withdrawal_transactions_from_documents/v0/mod.rs index ea63771c63..2a1e5f8a74 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/build_untied_withdrawal_transactions_from_documents/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/build_untied_withdrawal_transactions_from_documents/v0/mod.rs @@ -1,28 +1,17 @@ -use std::collections::HashMap; - -use dashcore_rpc::dashcore::{ - blockdata::transaction::special_transaction::asset_unlock::{ - qualified_asset_unlock::ASSET_UNLOCK_TX_SIZE, - unqualified_asset_unlock::{AssetUnlockBasePayload, AssetUnlockBaseTransactionInfo}, - }, - consensus::Encodable, - ScriptBuf, TxOut, -}; -use dpp::document::{Document, DocumentV0Getters}; -use dpp::platform_value::btreemap_extensions::BTreeValueMapHelper; -use dpp::system_data_contracts::withdrawals_contract::v1::document_types::withdrawal; - -use drive::dpp::identifier::Identifier; -use drive::dpp::identity::convert_credits_to_duffs; -use drive::drive::identity::withdrawals::{ - WithdrawalTransactionIndex, WithdrawalTransactionIndexAndBytes, -}; +use dashcore_rpc::dashcore::consensus::Encodable; +use dpp::block::block_info::BlockInfo; +use dpp::data_contracts::withdrawals_contract; +use dpp::data_contracts::withdrawals_contract::v1::document_types::withdrawal; +use dpp::document::document_methods::DocumentMethodsV0; +use dpp::document::{Document, DocumentV0Setters}; +use dpp::withdrawal::{WithdrawalTransactionIndex, WithdrawalTransactionIndexAndBytes}; use crate::{ error::{execution::ExecutionError, Error}, platform_types::platform::Platform, rpc::core::CoreRPCLike, }; +use dpp::version::PlatformVersion; impl Platform where @@ -31,101 +20,72 @@ where /// Build list of Core transactions from withdrawal documents pub(super) fn build_untied_withdrawal_transactions_from_documents_v0( &self, - documents: &[Document], + documents: &mut Vec, start_index: WithdrawalTransactionIndex, - ) -> Result, Error> { - let mut withdrawals: HashMap = - HashMap::new(); - - for (i, document) in documents.iter().enumerate() { - let output_script_bytes = document - .properties() - .get_bytes(withdrawal::properties::OUTPUT_SCRIPT) - .map_err(|_| { - Error::Execution(ExecutionError::CorruptedCodeExecution( - "Can't get outputScript from withdrawal document", - )) - })?; - - let amount = document - .properties() - .get_integer(withdrawal::properties::AMOUNT) - .map_err(|_| { + block_info: &BlockInfo, + platform_version: &PlatformVersion, + ) -> Result, Error> { + documents + .iter_mut() + .enumerate() + .map(|(i, document)| { + let transaction_index = start_index + i as WithdrawalTransactionIndex; + + let withdrawal_transaction = document.try_into_asset_unlock_base_transaction_info( + transaction_index, + platform_version, + )?; + + let mut transaction_buffer: Vec = vec![]; + + withdrawal_transaction + .consensus_encode(&mut transaction_buffer) + .map_err(|_| { + Error::Execution(ExecutionError::CorruptedCodeExecution( + "Can't consensus encode a withdrawal transaction", + )) + })?; + + document.set_u64(withdrawal::properties::TRANSACTION_INDEX, transaction_index); + + document.set_u8( + withdrawal::properties::STATUS, + withdrawals_contract::WithdrawalStatus::POOLED as u8, + ); + + document.set_updated_at(Some(block_info.time_ms)); + + document.increment_revision().map_err(|_| { Error::Execution(ExecutionError::CorruptedCodeExecution( - "Can't get amount from withdrawal document", + "Could not increment document revision", )) })?; - let core_fee_per_byte: u32 = document - .properties() - .get_integer(withdrawal::properties::CORE_FEE_PER_BYTE) - .map_err(|_| { - Error::Execution(ExecutionError::CorruptedCodeExecution( - "Can't get coreFeePerByte from withdrawal document", - )) - })?; - - let output_script = ScriptBuf::from_bytes(output_script_bytes); - - let tx_out = TxOut { - value: convert_credits_to_duffs(amount)?, - script_pubkey: output_script, - }; - - let transaction_index = start_index + i as WithdrawalTransactionIndex; - - let withdrawal_transaction = AssetUnlockBaseTransactionInfo { - version: 1, - lock_time: 0, - output: vec![tx_out], - base_payload: AssetUnlockBasePayload { - version: 1, - index: transaction_index, - fee: ASSET_UNLOCK_TX_SIZE as u32 * core_fee_per_byte, - }, - }; - - let mut transaction_buffer: Vec = vec![]; - - withdrawal_transaction - .consensus_encode(&mut transaction_buffer) - .map_err(|_| { - Error::Execution(ExecutionError::CorruptedCodeExecution( - "Can't consensus encode a withdrawal transaction", - )) - })?; - - withdrawals.insert(document.id(), (transaction_index, transaction_buffer)); - } - - Ok(withdrawals) + Ok((transaction_index, transaction_buffer)) + }) + .collect() } } #[cfg(test)] mod tests { - - use dpp::withdrawal::Pooling; - use dpp::{ - data_contracts::withdrawals_contract, tests::fixtures::get_withdrawal_document_fixture, - }; + use dpp::tests::fixtures::get_withdrawal_document_fixture; use drive::util::test_helpers::setup::setup_document; mod build_withdrawal_transactions_from_documents { + use super::*; + use crate::test::helpers::setup::TestPlatformBuilder; + use dpp::block::block_info::BlockInfo; use dpp::data_contract::accessors::v0::DataContractV0Getters; use dpp::data_contracts::withdrawals_contract::v1::document_types::withdrawal; use dpp::identity::core_script::CoreScript; use dpp::platform_value::platform_value; use dpp::prelude::Identifier; + use dpp::system_data_contracts::withdrawals_contract::WithdrawalStatus; use dpp::system_data_contracts::{load_system_data_contract, SystemDataContract}; use dpp::version::PlatformVersion; - use drive::drive::identity::withdrawals::WithdrawalTransactionIndexAndBytes; + use dpp::withdrawal::Pooling; use drive::util::test_helpers::setup::setup_system_data_contract; - use itertools::Itertools; - - use crate::test::helpers::setup::TestPlatformBuilder; - - use super::*; #[test] fn test_build() { @@ -152,7 +112,7 @@ mod tests { "coreFeePerByte": 1u32, "pooling": Pooling::Never as u8, "outputScript": CoreScript::from_bytes((0..23).collect::>()), - "status": withdrawals_contract::WithdrawalStatus::POOLED as u8, + "status": WithdrawalStatus::POOLED as u8, "transactionIndex": 1u64, }), None, @@ -180,7 +140,7 @@ mod tests { "coreFeePerByte": 1u32, "pooling": Pooling::Never as u8, "outputScript": CoreScript::from_bytes((0..23).collect::>()), - "status": withdrawals_contract::WithdrawalStatus::POOLED as u8, + "status": WithdrawalStatus::POOLED as u8, "transactionIndex": 2u64, }), None, @@ -196,18 +156,21 @@ mod tests { Some(&transaction), ); - let documents = vec![document_1, document_2]; + let mut documents = vec![document_1, document_2]; + + let block_info = BlockInfo::default_with_time(50); let transactions = platform - .build_untied_withdrawal_transactions_from_documents_v0(&documents, 50) + .build_untied_withdrawal_transactions_from_documents_v0( + &mut documents, + 50, + &block_info, + platform_version, + ) .expect("to build transactions from documents"); assert_eq!( - transactions - .values() - .cloned() - .sorted() - .collect::>(), + transactions, vec![ ( 50, @@ -226,9 +189,6 @@ mod tests { ], ), ] - .into_iter() - .sorted() - .collect::>(), ); } } diff --git a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/dequeue_and_build_unsigned_withdrawal_transactions/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/dequeue_and_build_unsigned_withdrawal_transactions/v0/mod.rs index 33edd09927..c2506d4f7d 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/dequeue_and_build_unsigned_withdrawal_transactions/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/dequeue_and_build_unsigned_withdrawal_transactions/v0/mod.rs @@ -13,7 +13,7 @@ use dpp::version::PlatformVersion; use drive::dpp::system_data_contracts::withdrawals_contract; use drive::dpp::system_data_contracts::withdrawals_contract::v1::document_types::withdrawal; -use drive::drive::identity::withdrawals::WithdrawalTransactionIndex; +use dpp::withdrawal::WithdrawalTransactionIndex; use drive::query::TransactionArg; use drive::util::batch::DriveOperation; @@ -28,8 +28,6 @@ use dpp::errors::ProtocolError; use drive::config::DEFAULT_QUERY_LIMIT; -const WITHDRAWAL_TRANSACTIONS_QUERY_LIMIT: u16 = 16; - impl Platform where C: CoreRPCLike, @@ -44,9 +42,11 @@ where ) -> Result { let mut drive_operations: Vec = vec![]; - // Get 16 latest withdrawal transactions from the queue + // Get withdrawal_transactions_per_block_limit (normally 16) latest withdrawal transactions from the queue let untied_withdrawal_transactions = self.drive.dequeue_untied_withdrawal_transactions( - WITHDRAWAL_TRANSACTIONS_QUERY_LIMIT, + platform_version + .system_limits + .withdrawal_transactions_per_block_limit, transaction, &mut drive_operations, platform_version, diff --git a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/fetch_transactions_block_inclusion_status/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/fetch_transactions_block_inclusion_status/mod.rs index 0a4b17062e..726a86eef0 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/fetch_transactions_block_inclusion_status/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/fetch_transactions_block_inclusion_status/mod.rs @@ -4,7 +4,7 @@ use crate::platform_types::platform::Platform; use crate::rpc::core::CoreRPCLike; use dashcore_rpc::json::AssetUnlockStatus; use dpp::version::PlatformVersion; -use drive::drive::identity::withdrawals::WithdrawalTransactionIndex; +use dpp::withdrawal::WithdrawalTransactionIndex; use std::collections::BTreeMap; mod v0; diff --git a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/fetch_transactions_block_inclusion_status/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/fetch_transactions_block_inclusion_status/v0/mod.rs index 86433d8c03..d284be086d 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/fetch_transactions_block_inclusion_status/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/fetch_transactions_block_inclusion_status/v0/mod.rs @@ -1,9 +1,8 @@ +use crate::{error::Error, platform_types::platform::Platform, rpc::core::CoreRPCLike}; use dashcore_rpc::dashcore_rpc_json::AssetUnlockStatus; -use drive::drive::identity::withdrawals::WithdrawalTransactionIndex; +use dpp::withdrawal::WithdrawalTransactionIndex; use std::collections::BTreeMap; -use crate::{error::Error, platform_types::platform::Platform, rpc::core::CoreRPCLike}; - impl Platform where C: CoreRPCLike, diff --git a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/mod.rs index 910445fe32..66be57e5e0 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/mod.rs @@ -2,12 +2,14 @@ use crate::error::execution::ExecutionError; use crate::error::Error; use crate::platform_types::platform::Platform; +use crate::platform_types::platform_state::PlatformState; use crate::rpc::core::CoreRPCLike; use dpp::block::block_info::BlockInfo; use dpp::version::PlatformVersion; use drive::grovedb::TransactionArg; mod v0; +mod v1; impl Platform where @@ -29,6 +31,7 @@ where pub(in crate::execution) fn pool_withdrawals_into_transactions_queue( &self, block_info: &BlockInfo, + last_committed_platform_state: &PlatformState, transaction: TransactionArg, platform_version: &PlatformVersion, ) -> Result<(), Error> { @@ -39,13 +42,19 @@ where .pool_withdrawals_into_transactions_queue { 0 => self.pool_withdrawals_into_transactions_queue_v0( + block_info, + last_committed_platform_state, + transaction, + platform_version, + ), + 1 => self.pool_withdrawals_into_transactions_queue_v1( block_info, transaction, platform_version, ), version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { method: "pool_withdrawals_into_transactions_queue".to_string(), - known_versions: vec![0], + known_versions: vec![0, 1], received: version, })), } diff --git a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/v0/mod.rs index 9540d42f12..00f1c8a761 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/v0/mod.rs @@ -1,18 +1,16 @@ use dpp::block::block_info::BlockInfo; use dpp::data_contract::accessors::v0::DataContractV0Getters; -use dpp::document::document_methods::DocumentMethodsV0; -use dpp::document::{DocumentV0Getters, DocumentV0Setters}; use dpp::version::PlatformVersion; - -use drive::drive::identity::withdrawals::WithdrawalTransactionIndexAndBytes; use drive::grovedb::TransactionArg; use dpp::system_data_contracts::withdrawals_contract; use dpp::system_data_contracts::withdrawals_contract::v1::document_types::withdrawal; use drive::config::DEFAULT_QUERY_LIMIT; +use crate::platform_types::platform_state::v0::PlatformStateV0Methods; +use crate::platform_types::platform_state::PlatformState; use crate::{ error::{execution::ExecutionError, Error}, platform_types::platform::Platform, @@ -27,9 +25,25 @@ where pub(super) fn pool_withdrawals_into_transactions_queue_v0( &self, block_info: &BlockInfo, + last_committed_platform_state: &PlatformState, transaction: TransactionArg, platform_version: &PlatformVersion, ) -> Result<(), Error> { + // Currently Core only supports using the first 2 quorums (out of 24 for mainnet). + // For us, we just use the latest quorum to be extra safe. + let Some(position_of_current_quorum) = + last_committed_platform_state.current_validator_set_position_in_list_by_most_recent() + else { + tracing::warn!("Current quorum not in current validator set, not making withdrawals"); + return Ok(()); + }; + if position_of_current_quorum != 0 { + tracing::debug!( + "Current quorum is not most recent, it is in position {}, not making withdrawals", + position_of_current_quorum + ); + return Ok(()); + } let mut documents = self.drive.fetch_oldest_withdrawal_documents_by_status( withdrawals_contract::WithdrawalStatus::QUEUED.into(), DEFAULT_QUERY_LIMIT, @@ -45,46 +59,16 @@ where .drive .fetch_next_withdrawal_transaction_index(transaction, platform_version)?; - let untied_withdrawal_transactions = self - .build_untied_withdrawal_transactions_from_documents( - &documents, - start_transaction_index, - platform_version, - )?; - - for document in documents.iter_mut() { - let Some((transaction_index, _)) = untied_withdrawal_transactions.get(&document.id()) - else { - return Err(Error::Execution(ExecutionError::CorruptedCodeExecution( - "transactions must contain a transaction", - ))); - }; - - document.set_u64( - withdrawal::properties::TRANSACTION_INDEX, - *transaction_index, - ); - - document.set_u8( - withdrawal::properties::STATUS, - withdrawals_contract::WithdrawalStatus::POOLED as u8, - ); - - document.set_updated_at(Some(block_info.time_ms)); - - document.increment_revision().map_err(|_| { - Error::Execution(ExecutionError::CorruptedCodeExecution( - "Could not increment document revision", - )) - })?; - } - - let withdrawal_transactions: Vec = - untied_withdrawal_transactions.into_values().collect(); + let withdrawal_transactions = self.build_untied_withdrawal_transactions_from_documents( + &mut documents, + start_transaction_index, + block_info, + platform_version, + )?; let withdrawal_transactions_count = withdrawal_transactions.len(); - let mut drive_operations = Vec::new(); + let mut drive_operations = vec![]; self.drive .add_enqueue_untied_withdrawal_transaction_operations( @@ -153,6 +137,7 @@ mod tests { use drive::util::test_helpers::setup::{setup_document, setup_system_data_contract}; use crate::test::helpers::setup::TestPlatformBuilder; + use dpp::document::DocumentV0Getters; use dpp::platform_value::btreemap_extensions::BTreeValueMapHelper; use dpp::platform_value::platform_value; use dpp::system_data_contracts::load_system_data_contract; @@ -234,9 +219,12 @@ mod tests { Some(&transaction), ); + let platform_state = platform.state.load(); + platform .pool_withdrawals_into_transactions_queue_v0( &block_info, + &platform_state, Some(&transaction), platform_version, ) diff --git a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/v1/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/v1/mod.rs new file mode 100644 index 0000000000..34b3174933 --- /dev/null +++ b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/v1/mod.rs @@ -0,0 +1,251 @@ +use dpp::block::block_info::BlockInfo; + +use dpp::data_contract::accessors::v0::DataContractV0Getters; + +use dpp::version::PlatformVersion; +use drive::grovedb::TransactionArg; + +use dpp::system_data_contracts::withdrawals_contract; +use dpp::system_data_contracts::withdrawals_contract::v1::document_types::withdrawal; +use drive::config::DEFAULT_QUERY_LIMIT; + +use crate::{ + error::{execution::ExecutionError, Error}, + platform_types::platform::Platform, + rpc::core::CoreRPCLike, +}; + +impl Platform +where + C: CoreRPCLike, +{ + /// Pool withdrawal documents into transactions + pub(super) fn pool_withdrawals_into_transactions_queue_v1( + &self, + block_info: &BlockInfo, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result<(), Error> { + let mut documents = self.drive.fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::QUEUED.into(), + DEFAULT_QUERY_LIMIT, + transaction, + platform_version, + )?; + + if documents.is_empty() { + return Ok(()); + } + + let start_transaction_index = self + .drive + .fetch_next_withdrawal_transaction_index(transaction, platform_version)?; + + let withdrawal_transactions = self.build_untied_withdrawal_transactions_from_documents( + &mut documents, + start_transaction_index, + block_info, + platform_version, + )?; + + let withdrawal_transactions_count = withdrawal_transactions.len(); + + let mut drive_operations = vec![]; + + self.drive + .add_enqueue_untied_withdrawal_transaction_operations( + withdrawal_transactions, + &mut drive_operations, + platform_version, + )?; + + let end_transaction_index = start_transaction_index + withdrawal_transactions_count as u64; + + self.drive + .add_update_next_withdrawal_transaction_index_operation( + end_transaction_index, + &mut drive_operations, + platform_version, + )?; + + tracing::debug!( + "Pooled {} withdrawal documents into {} transactions with indices from {} to {}", + documents.len(), + withdrawal_transactions_count, + start_transaction_index, + end_transaction_index, + ); + + let withdrawals_contract = self.drive.cache.system_data_contracts.load_withdrawals(); + + self.drive.add_update_multiple_documents_operations( + &documents, + &withdrawals_contract, + withdrawals_contract + .document_type_for_name(withdrawal::NAME) + .map_err(|_| { + Error::Execution(ExecutionError::CorruptedCodeExecution( + "Can't fetch withdrawal data contract", + )) + })?, + &mut drive_operations, + &platform_version.drive, + )?; + + self.drive.apply_drive_operations( + drive_operations, + true, + block_info, + transaction, + platform_version, + None, + )?; + + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use dpp::block::epoch::Epoch; + use itertools::Itertools; + + use dpp::data_contracts::SystemDataContract; + use dpp::identifier::Identifier; + use dpp::identity::core_script::CoreScript; + use dpp::tests::fixtures::get_withdrawal_document_fixture; + use dpp::withdrawal::Pooling; + use drive::util::test_helpers::setup::{setup_document, setup_system_data_contract}; + + use crate::test::helpers::setup::TestPlatformBuilder; + use dpp::document::DocumentV0Getters; + use dpp::platform_value::btreemap_extensions::BTreeValueMapHelper; + use dpp::platform_value::platform_value; + use dpp::system_data_contracts::load_system_data_contract; + use dpp::version::PlatformVersion; + + #[test] + fn test_pooling() { + let platform_version = PlatformVersion::latest(); + let platform = TestPlatformBuilder::new() + .build_with_mock_rpc() + .set_initial_state_structure(); + + let transaction = platform.drive.grove.start_transaction(); + + let block_info = BlockInfo { + time_ms: 1, + height: 1, + core_height: 96, + epoch: Epoch::default(), + }; + + let data_contract = + load_system_data_contract(SystemDataContract::Withdrawals, platform_version) + .expect("to load system data contract"); + + setup_system_data_contract(&platform.drive, &data_contract, Some(&transaction)); + + let owner_id = Identifier::new([1u8; 32]); + + let document_1 = get_withdrawal_document_fixture( + &data_contract, + owner_id, + platform_value!({ + "amount": 1000u64, + "coreFeePerByte": 1u32, + "pooling": Pooling::Never as u8, + "outputScript": CoreScript::from_bytes((0..23).collect::>()), + "status": withdrawals_contract::WithdrawalStatus::QUEUED as u8, + "transactionIndex": 1u64, + }), + None, + platform_version.protocol_version, + ) + .expect("expected withdrawal document"); + + let document_type = data_contract + .document_type_for_name(withdrawal::NAME) + .expect("expected to get document type"); + + setup_document( + &platform.drive, + &document_1, + &data_contract, + document_type, + Some(&transaction), + ); + + let document_2 = get_withdrawal_document_fixture( + &data_contract, + owner_id, + platform_value!({ + "amount": 1000u64, + "coreFeePerByte": 1u32, + "pooling": Pooling::Never as u8, + "outputScript": CoreScript::from_bytes((0..23).collect::>()), + "status": withdrawals_contract::WithdrawalStatus::QUEUED as u8, + "transactionIndex": 2u64, + }), + None, + platform_version.protocol_version, + ) + .expect("expected withdrawal document"); + + setup_document( + &platform.drive, + &document_2, + &data_contract, + document_type, + Some(&transaction), + ); + + let platform_state = platform.state.load(); + + platform + .pool_withdrawals_into_transactions_queue_v0( + &block_info, + &platform_state, + Some(&transaction), + platform_version, + ) + .expect("to pool withdrawal documents into transactions"); + + let updated_documents = platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::POOLED.into(), + DEFAULT_QUERY_LIMIT, + Some(&transaction), + platform_version, + ) + .expect("to fetch withdrawal documents"); + + for (i, document) in updated_documents + .into_iter() + // Sort by index because updated_at is the same for all documents within batch + .sorted_by(|a, b| { + let a_index = a + .properties() + .get_u64(withdrawal::properties::TRANSACTION_INDEX) + .expect("to get transactionIndex"); + let b_index = b + .properties() + .get_u64(withdrawal::properties::TRANSACTION_INDEX) + .expect("to get transactionIndex"); + a_index.cmp(&b_index) + }) + .enumerate() + { + assert_eq!(document.revision(), Some(2)); + + let tx_index = document + .properties() + .get_u64(withdrawal::properties::TRANSACTION_INDEX) + .expect("to get transactionIndex"); + + assert_eq!(tx_index, i as u64); + } + } +} diff --git a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/update_broadcasted_withdrawal_statuses/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/update_broadcasted_withdrawal_statuses/v0/mod.rs index 0257f29351..2eba2e228c 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/withdrawals/update_broadcasted_withdrawal_statuses/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/withdrawals/update_broadcasted_withdrawal_statuses/v0/mod.rs @@ -11,8 +11,8 @@ use dpp::version::PlatformVersion; use itertools::Itertools; use std::collections::HashSet; +use dpp::withdrawal::WithdrawalTransactionIndex; use drive::config::DEFAULT_QUERY_LIMIT; -use drive::drive::identity::withdrawals::WithdrawalTransactionIndex; use drive::grovedb::Transaction; use drive::util::batch::DriveOperation; diff --git a/packages/rs-drive-abci/src/execution/types/block_execution_context/v0/mod.rs b/packages/rs-drive-abci/src/execution/types/block_execution_context/v0/mod.rs index ec71d6f20d..de6e1ddc33 100644 --- a/packages/rs-drive-abci/src/execution/types/block_execution_context/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/types/block_execution_context/v0/mod.rs @@ -1,32 +1,3 @@ -// MIT LICENSE -// -// Copyright (c) 2021 Dash Core Group -// -// Permission is hereby granted, free of charge, to any -// person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the -// Software without restriction, including without -// limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software -// is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice -// shall be included in all copies or substantial portions -// of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// - use crate::execution::types::block_state_info::BlockStateInfo; use crate::platform_types::epoch_info::EpochInfo; diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/common/validate_state_transition_identity_signed/v0/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/common/validate_state_transition_identity_signed/v0/mod.rs index 4e316a7af0..5d411c02a2 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/common/validate_state_transition_identity_signed/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/common/validate_state_transition_identity_signed/v0/mod.rs @@ -74,18 +74,12 @@ impl<'a> ValidateStateTransitionIdentitySignatureV0<'a> for StateTransition { let owner_id = self.owner_id(); - let security_levels = - self.security_level_requirement() + let allowed_purposes = + self.purpose_requirement() .ok_or(ProtocolError::CorruptedCodeExecution( - "state_transition does not have security level".to_string(), + "state_transition does not have a key purpose requirement".to_string(), ))?; - let purpose = self - .purpose_requirement() - .ok_or(ProtocolError::CorruptedCodeExecution( - "state_transition does not have a key purpose requirement".to_string(), - ))?; - let key_request = IdentityKeysRequest::new_specific_key_query(owner_id.as_bytes(), key_id); let maybe_partial_identity = match (request_identity_balance, request_identity_revision) { @@ -169,13 +163,19 @@ impl<'a> ValidateStateTransitionIdentitySignatureV0<'a> for StateTransition { return Ok(validation_result); } - if purpose != public_key.purpose() { + if !allowed_purposes.contains(&public_key.purpose()) { validation_result.add_error(SignatureError::InvalidSignaturePublicKeyPurposeError( - InvalidSignaturePublicKeyPurposeError::new(public_key.purpose(), purpose), + InvalidSignaturePublicKeyPurposeError::new(public_key.purpose(), allowed_purposes), )); return Ok(validation_result); } + let security_levels = self + .security_level_requirement(public_key.purpose()) + .ok_or(ProtocolError::CorruptedCodeExecution( + "state_transition does not have security level".to_string(), + ))?; + if !security_levels.contains(&public_key.security_level()) { validation_result.add_error( SignatureError::InvalidSignaturePublicKeySecurityLevelError( diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/mod.rs index 8e5f5155f2..f74cb36392 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/mod.rs @@ -31,10 +31,10 @@ impl StateTransitionActionTransformerV0 for IdentityCreditWithdrawalTransition { fn transform_into_action( &self, platform: &PlatformRef, - _block_info: &BlockInfo, + block_info: &BlockInfo, _validation_mode: ValidationMode, _execution_context: &mut StateTransitionExecutionContext, - _tx: TransactionArg, + tx: TransactionArg, ) -> Result, Error> { let platform_version = platform.state.current_platform_version()?; @@ -45,7 +45,7 @@ impl StateTransitionActionTransformerV0 for IdentityCreditWithdrawalTransition { .identity_credit_withdrawal_state_transition .transform_into_action { - 0 => self.transform_into_action_v0(platform), + 0 => self.transform_into_action_v0(platform, block_info, tx, platform_version), version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { method: "identity credit withdrawal transition: transform_into_action".to_string(), known_versions: vec![0], @@ -93,7 +93,7 @@ impl StateTransitionStateValidationV0 for IdentityCreditWithdrawalTransition { _action: Option, platform: &PlatformRef, _validation_mode: ValidationMode, - _block_info: &BlockInfo, + block_info: &BlockInfo, _execution_context: &mut StateTransitionExecutionContext, tx: TransactionArg, ) -> Result, Error> { @@ -106,7 +106,7 @@ impl StateTransitionStateValidationV0 for IdentityCreditWithdrawalTransition { .identity_credit_withdrawal_state_transition .state { - 0 => self.validate_state_v0(platform, tx), + 0 => self.validate_state_v0(platform, block_info, tx, platform_version), version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { method: "identity credit withdrawal transition: validate_state".to_string(), known_versions: vec![0], @@ -129,10 +129,14 @@ mod tests { use dpp::consensus::ConsensusError; use dpp::dash_to_credits; use dpp::identity::core_script::CoreScript; + use dpp::identity::KeyType::{ECDSA_HASH160, ECDSA_SECP256K1}; use dpp::serialization::PlatformSerializable; - use dpp::state_transition::identity_credit_withdrawal_transition::methods::IdentityCreditWithdrawalTransitionMethodsV0; + use dpp::state_transition::identity_credit_withdrawal_transition::methods::{ + IdentityCreditWithdrawalTransitionMethodsV0, PreferredKeyPurposeForSigningWithdrawal, + }; use dpp::state_transition::identity_credit_withdrawal_transition::IdentityCreditWithdrawalTransition; use dpp::withdrawal::Pooling; + use platform_version::version::v1::PROTOCOL_VERSION_1; use platform_version::version::PlatformVersion; use rand::prelude::StdRng; use rand::{Rng, SeedableRng}; @@ -152,6 +156,7 @@ mod tests { let mut platform = TestPlatformBuilder::new() .with_config(platform_config) + .with_initial_protocol_version(PROTOCOL_VERSION_1) .build_with_mock_rpc() .set_initial_state_structure(); @@ -161,6 +166,7 @@ mod tests { setup_identity_with_withdrawal_key_and_system_credits( &mut platform, rng.gen(), + ECDSA_SECP256K1, dash_to_credits!(0.5), ); @@ -170,16 +176,17 @@ mod tests { let credit_withdrawal_transition = IdentityCreditWithdrawalTransition::try_from_identity( &identity, - Some(&withdrawal_key), - CoreScript::random_p2pkh(&mut rng), + Some(CoreScript::random_p2pkh(&mut rng)), withdrawal_amount, Pooling::Never, 1, 0, signer, + Some(&withdrawal_key), + PreferredKeyPurposeForSigningWithdrawal::Any, 2, platform_version, - None, + Some(1), ) .expect("expected a credit withdrawal transition"); @@ -209,4 +216,235 @@ mod tests { )] ); } + + #[test] + fn test_identity_credit_withdrawal_with_withdrawal_address_creates_withdrawal_document() { + let platform_version = PlatformVersion::latest(); + let platform_config = PlatformConfig { + testing_configs: PlatformTestConfig { + disable_instant_lock_signature_verification: true, + ..Default::default() + }, + ..Default::default() + }; + + let mut rng = StdRng::seed_from_u64(567); + + let mut platform = TestPlatformBuilder::new() + .with_config(platform_config) + .with_latest_protocol_version() + .build_with_mock_rpc() + .set_genesis_state(); + + fast_forward_to_block(&platform, 1_200_000_000, 900, 42, 1, false); //next epoch + + let (identity, signer, _, withdrawal_key) = + setup_identity_with_withdrawal_key_and_system_credits( + &mut platform, + rng.gen(), + ECDSA_SECP256K1, + dash_to_credits!(0.5), + ); + + let platform_state = platform.state.load(); + + let withdrawal_amount = dash_to_credits!(0.1); + + let credit_withdrawal_transition = IdentityCreditWithdrawalTransition::try_from_identity( + &identity, + Some(CoreScript::random_p2pkh(&mut rng)), + withdrawal_amount, + Pooling::Never, + 1, + 0, + signer, + Some(&withdrawal_key), + PreferredKeyPurposeForSigningWithdrawal::Any, + 2, + platform_version, + None, + ) + .expect("expected a credit withdrawal transition"); + + let credit_withdrawal_transition_serialized_transition = credit_withdrawal_transition + .serialize_to_bytes() + .expect("expected documents batch serialized state transition"); + + let transaction = platform.drive.grove.start_transaction(); + + let processing_result = platform + .platform + .process_raw_state_transitions( + &vec![credit_withdrawal_transition_serialized_transition.clone()], + &platform_state, + &BlockInfo::default_with_time(1_200_001_000), + &transaction, + platform_version, + false, + None, + ) + .expect("expected to process state transition"); + + assert_matches!( + processing_result.execution_results().as_slice(), + [StateTransitionExecutionResult::SuccessfulExecution(..)] + ); + } + + #[test] + fn test_identity_credit_withdrawal_without_withdrawal_address_creates_withdrawal_document_when_signing_with_withdrawal_key( + ) { + let platform_version = PlatformVersion::latest(); + let platform_config = PlatformConfig { + testing_configs: PlatformTestConfig { + disable_instant_lock_signature_verification: true, + ..Default::default() + }, + ..Default::default() + }; + + let mut rng = StdRng::seed_from_u64(567); + + let mut platform = TestPlatformBuilder::new() + .with_config(platform_config) + .with_latest_protocol_version() + .build_with_mock_rpc() + .set_genesis_state(); + + fast_forward_to_block(&platform, 1_200_000_000, 900, 42, 1, false); //next epoch + + let (identity, signer, _, withdrawal_key) = + setup_identity_with_withdrawal_key_and_system_credits( + &mut platform, + rng.gen(), + ECDSA_HASH160, + dash_to_credits!(0.5), + ); + + let platform_state = platform.state.load(); + + let withdrawal_amount = dash_to_credits!(0.1); + + let credit_withdrawal_transition = IdentityCreditWithdrawalTransition::try_from_identity( + &identity, + None, + withdrawal_amount, + Pooling::Never, + 1, + 0, + signer, + Some(&withdrawal_key), + PreferredKeyPurposeForSigningWithdrawal::TransferOnly, + 2, + platform_version, + None, + ) + .expect("expected a credit withdrawal transition"); + + let credit_withdrawal_transition_serialized_transition = credit_withdrawal_transition + .serialize_to_bytes() + .expect("expected documents batch serialized state transition"); + + let transaction = platform.drive.grove.start_transaction(); + + let processing_result = platform + .platform + .process_raw_state_transitions( + &vec![credit_withdrawal_transition_serialized_transition.clone()], + &platform_state, + &BlockInfo::default_with_time(1_200_001_000), + &transaction, + platform_version, + false, + None, + ) + .expect("expected to process state transition"); + + assert_matches!( + processing_result.execution_results().as_slice(), + [StateTransitionExecutionResult::SuccessfulExecution(..)] + ); + } + + mod errors { + use super::*; + use dpp::consensus::state::state_error::StateError; + #[test] + fn test_credit_withdrawal_without_withdrawal_address_with_a_non_payable_transfer_key() { + let platform_version = PlatformVersion::latest(); + let platform_config = PlatformConfig { + testing_configs: PlatformTestConfig { + disable_instant_lock_signature_verification: true, + ..Default::default() + }, + ..Default::default() + }; + + let mut rng = StdRng::seed_from_u64(567); + + let mut platform = TestPlatformBuilder::new() + .with_config(platform_config) + .with_latest_protocol_version() + .build_with_mock_rpc() + .set_genesis_state(); + + fast_forward_to_block(&platform, 1_200_000_000, 900, 42, 1, false); //next epoch + + let (identity, signer, _, withdrawal_key) = + setup_identity_with_withdrawal_key_and_system_credits( + &mut platform, + rng.gen(), + ECDSA_SECP256K1, + dash_to_credits!(0.5), + ); + + let platform_state = platform.state.load(); + + let withdrawal_amount = dash_to_credits!(0.1); + + let credit_withdrawal_transition = + IdentityCreditWithdrawalTransition::try_from_identity( + &identity, + None, + withdrawal_amount, + Pooling::Never, + 1, + 0, + signer, + Some(&withdrawal_key), + PreferredKeyPurposeForSigningWithdrawal::TransferOnly, + 2, + platform_version, + None, + ) + .expect("expected a credit withdrawal transition"); + + let credit_withdrawal_transition_serialized_transition = credit_withdrawal_transition + .serialize_to_bytes() + .expect("expected documents batch serialized state transition"); + + let transaction = platform.drive.grove.start_transaction(); + + let processing_result = platform + .platform + .process_raw_state_transitions( + &vec![credit_withdrawal_transition_serialized_transition.clone()], + &platform_state, + &BlockInfo::default_with_time(1_200_001_000), + &transaction, + platform_version, + false, + None, + ) + .expect("expected to process state transition"); + assert_matches!( + processing_result.execution_results().as_slice(), + [StateTransitionExecutionResult::UnpaidConsensusError( + ConsensusError::StateError( + StateError::NoTransferKeyForCoreWithdrawalAvailableError(_) + ) + )] + ); + } + } } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/state/v0/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/state/v0/mod.rs index cecf5edb3d..87fe5892fe 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/state/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/state/v0/mod.rs @@ -1,15 +1,15 @@ -use crate::error::execution::ExecutionError; use crate::error::Error; use crate::platform_types::platform::PlatformRef; use crate::rpc::core::CoreRPCLike; +use dpp::block::block_info::BlockInfo; -use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use dpp::consensus::signature::IdentityNotFoundError; use dpp::consensus::state::identity::IdentityInsufficientBalanceError; use dpp::prelude::ConsensusValidationResult; use dpp::state_transition::identity_credit_withdrawal_transition::accessors::IdentityCreditWithdrawalTransitionAccessorsV0; use dpp::state_transition::identity_credit_withdrawal_transition::IdentityCreditWithdrawalTransition; +use dpp::version::PlatformVersion; use drive::grovedb::TransactionArg; use drive::state_transition_action::identity::identity_credit_withdrawal::IdentityCreditWithdrawalTransitionAction; use drive::state_transition_action::StateTransitionAction; @@ -18,12 +18,17 @@ pub(in crate::execution::validation::state_transition::state_transitions::identi fn validate_state_v0( &self, platform: &PlatformRef, + block_info: &BlockInfo, tx: TransactionArg, + platform_version: &PlatformVersion, ) -> Result, Error>; fn transform_into_action_v0( &self, platform: &PlatformRef, + block_info: &BlockInfo, + tx: TransactionArg, + platform_version: &PlatformVersion, ) -> Result, Error>; } @@ -33,9 +38,10 @@ impl IdentityCreditWithdrawalStateTransitionStateValidationV0 fn validate_state_v0( &self, platform: &PlatformRef, + block_info: &BlockInfo, tx: TransactionArg, + platform_version: &PlatformVersion, ) -> Result, Error> { - let platform_version = platform.state.current_platform_version()?; let maybe_existing_identity_balance = platform.drive.fetch_identity_balance( self.identity_id().to_buffer(), tx, @@ -59,27 +65,27 @@ impl IdentityCreditWithdrawalStateTransitionStateValidationV0 )); } - self.transform_into_action_v0(platform) + self.transform_into_action_v0(platform, block_info, tx, platform_version) } fn transform_into_action_v0( &self, platform: &PlatformRef, + block_info: &BlockInfo, + tx: TransactionArg, + platform_version: &PlatformVersion, ) -> Result, Error> { - let last_block_time = - platform - .state - .last_committed_block_time_ms() - .ok_or(Error::Execution(ExecutionError::StateNotInitialized( - "expected a last platform block during identity update validation", - )))?; - - Ok(ConsensusValidationResult::new_with_data( - IdentityCreditWithdrawalTransitionAction::from_identity_credit_withdrawal( + Ok( + IdentityCreditWithdrawalTransitionAction::try_from_identity_credit_withdrawal( + &platform.drive, + tx, self, - last_block_time, + block_info, + platform_version, ) - .into(), - )) + .map(|consensus_validation_result| { + consensus_validation_result.map(|withdrawal| withdrawal.into()) + })?, + ) } } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/structure/v1/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/structure/v1/mod.rs index b89b35655c..daaf9f7e3d 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/structure/v1/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/structure/v1/mod.rs @@ -8,10 +8,9 @@ use dpp::consensus::ConsensusError; use crate::error::Error; use dpp::state_transition::identity_credit_withdrawal_transition::accessors::IdentityCreditWithdrawalTransitionAccessorsV0; -use dpp::state_transition::identity_credit_withdrawal_transition::v0::{ - MIN_CORE_FEE_PER_BYTE, MIN_WITHDRAWAL_AMOUNT, +use dpp::state_transition::identity_credit_withdrawal_transition::{ + IdentityCreditWithdrawalTransition, MIN_CORE_FEE_PER_BYTE, MIN_WITHDRAWAL_AMOUNT, }; -use dpp::state_transition::identity_credit_withdrawal_transition::IdentityCreditWithdrawalTransition; use dpp::util::is_fibonacci_number::is_fibonacci_number; use dpp::validation::SimpleConsensusValidationResult; use dpp::withdrawal::Pooling; @@ -57,13 +56,15 @@ impl IdentityCreditWithdrawalStateTransitionStructureValidationV1 return Ok(result); } - // validate output_script types - if !self.output_script().is_p2pkh() && !self.output_script().is_p2sh() { - result.add_error( - InvalidIdentityCreditWithdrawalTransitionOutputScriptError::new( - self.output_script().clone(), - ), - ); + if let Some(output_script) = self.output_script() { + // validate output_script types + if !output_script.is_p2pkh() && !output_script.is_p2sh() { + result.add_error( + InvalidIdentityCreditWithdrawalTransitionOutputScriptError::new( + output_script.clone(), + ), + ); + } } Ok(result) diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs index 9ef53ddfb0..fe7d8095b8 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs @@ -5777,7 +5777,6 @@ mod tests { use crate::execution::validation::state_transition::tests::{ create_dpns_contract_name_contest, create_dpns_identity_name_contest_skip_creating_identities, - setup_identity_without_adding_it, }; use assert_matches::assert_matches; use dapi_grpc::platform::v0::get_contested_resource_vote_state_request::GetContestedResourceVoteStateRequestV0; @@ -9949,7 +9948,7 @@ mod tests { // The alpha document should not exist at all { - let (contenders, abstaining, locking, finished_vote_info) = get_vote_states( + let (contenders, _abstaining, _locking, finished_vote_info) = get_vote_states( &platform, &platform_state, &dpns_contract, @@ -10730,7 +10729,7 @@ mod tests { // The alpha document should not exist at all { - let (contenders, abstaining, locking, finished_vote_info) = get_vote_states( + let (contenders, _abstaining, _locking, finished_vote_info) = get_vote_states( &platform, &platform_state, &dpns_contract, diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs index 4c091f8ad3..51df74cde5 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs @@ -345,6 +345,7 @@ pub(in crate::execution) mod tests { pub(in crate::execution) fn setup_identity_with_withdrawal_key_and_system_credits( platform: &mut TempPlatform, seed: u64, + withdrawal_key_type: KeyType, credits: Credits, ) -> (Identity, SimpleSigner, IdentityPublicKey, IdentityPublicKey) { let platform_version = PlatformVersion::latest(); @@ -382,7 +383,7 @@ pub(in crate::execution) mod tests { &mut rng, Purpose::TRANSFER, SecurityLevel::CRITICAL, - KeyType::ECDSA_SECP256K1, + withdrawal_key_type, None, platform_version, ) diff --git a/packages/rs-drive-abci/src/platform_types/platform_state/mod.rs b/packages/rs-drive-abci/src/platform_types/platform_state/mod.rs index e937924c94..462ce2c327 100644 --- a/packages/rs-drive-abci/src/platform_types/platform_state/mod.rs +++ b/packages/rs-drive-abci/src/platform_types/platform_state/mod.rs @@ -25,6 +25,7 @@ use indexmap::IndexMap; use crate::config::PlatformConfig; use crate::error::execution::ExecutionError; use crate::platform_types::signature_verification_quorum_set::SignatureVerificationQuorumSet; +use crate::platform_types::validator_set::v0::ValidatorSetV0Getters; use dpp::block::block_info::BlockInfo; use dpp::fee::default_costs::CachedEpochIndexFeeVersions; use dpp::util::hash::hash_double; diff --git a/packages/rs-drive-abci/src/platform_types/platform_state/v0/mod.rs b/packages/rs-drive-abci/src/platform_types/platform_state/v0/mod.rs index 61bc6b8d7d..f9fa9d6deb 100644 --- a/packages/rs-drive-abci/src/platform_types/platform_state/v0/mod.rs +++ b/packages/rs-drive-abci/src/platform_types/platform_state/v0/mod.rs @@ -20,10 +20,10 @@ use dpp::block::extended_block_info::v0::ExtendedBlockInfoV0Getters; use dpp::version::{PlatformVersion, TryIntoPlatformVersioned}; use crate::config::PlatformConfig; -use crate::platform_types::platform_state::PlatformState; use crate::platform_types::signature_verification_quorum_set::{ SignatureVerificationQuorumSet, SignatureVerificationQuorumSetForSaving, }; +use crate::platform_types::validator_set::v0::ValidatorSetV0Getters; use dpp::fee::default_costs::CachedEpochIndexFeeVersions; use itertools::Itertools; use std::collections::BTreeMap; @@ -345,6 +345,32 @@ pub trait PlatformStateV0Methods { /// Returns the quorum hash of the current validator set. fn current_validator_set_quorum_hash(&self) -> QuorumHash; + /// Get validator sets sorted by their core height by most recent order coming first + fn validator_sets_sorted_by_core_height_by_most_recent(&self) -> Vec<&ValidatorSet> { + // Get the validator sets and collect them into a vector for sorting + let mut validator_sets: Vec<&ValidatorSet> = self.validator_sets().values().collect(); + + // Sort the validator sets by core height in descending order + validator_sets.sort_by(|a, b| b.core_height().cmp(&a.core_height())); + + validator_sets + } + + /// Where is the current validator set in the list + fn current_validator_set_position_in_list_by_most_recent(&self) -> Option { + // Get the current quorum hash + let current_quorum_hash = self.current_validator_set_quorum_hash(); + + // Get the validator sets by post recent + let validator_sets = self.validator_sets_sorted_by_core_height_by_most_recent(); + + // Find the position of the current validator set in the sorted list + validator_sets + .iter() + .position(|&validator_set| validator_set.quorum_hash() == ¤t_quorum_hash) + .map(|position| position as u16) // Convert position to u16 + } + /// Returns the quorum hash of the next validator set, if it exists. fn next_validator_set_quorum_hash(&self) -> &Option; diff --git a/packages/rs-drive-abci/src/platform_types/validator/mod.rs b/packages/rs-drive-abci/src/platform_types/validator/mod.rs index 3ad5264d5d..10144bf53f 100644 --- a/packages/rs-drive-abci/src/platform_types/validator/mod.rs +++ b/packages/rs-drive-abci/src/platform_types/validator/mod.rs @@ -1,114 +1,3 @@ -use crate::platform_types::validator::v0::{ValidatorV0, ValidatorV0Getters, ValidatorV0Setters}; -use dashcore_rpc::dashcore::{ProTxHash, PubkeyHash}; -use dpp::bls_signatures::PublicKey as BlsPublicKey; -use serde::{Deserialize, Serialize}; - /// Version 0 pub mod v0; - -/// A validator in the context of a quorum -#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] -pub enum Validator { - /// Version 0 - V0(ValidatorV0), -} - -impl ValidatorV0Getters for Validator { - fn pro_tx_hash(&self) -> &ProTxHash { - match self { - Validator::V0(v0) => v0.pro_tx_hash(), - } - } - - fn public_key(&self) -> &Option { - match self { - Validator::V0(v0) => v0.public_key(), - } - } - - fn node_ip(&self) -> &String { - match self { - Validator::V0(v0) => v0.node_ip(), - } - } - - fn node_id(&self) -> &PubkeyHash { - match self { - Validator::V0(v0) => v0.node_id(), - } - } - - fn core_port(&self) -> u16 { - match self { - Validator::V0(v0) => v0.core_port(), - } - } - - fn platform_http_port(&self) -> u16 { - match self { - Validator::V0(v0) => v0.platform_http_port(), - } - } - - fn platform_p2p_port(&self) -> u16 { - match self { - Validator::V0(v0) => v0.platform_p2p_port(), - } - } - - fn is_banned(&self) -> bool { - match self { - Validator::V0(v0) => v0.is_banned(), - } - } -} - -impl ValidatorV0Setters for Validator { - fn set_pro_tx_hash(&mut self, pro_tx_hash: ProTxHash) { - match self { - Validator::V0(v0) => v0.set_pro_tx_hash(pro_tx_hash), - } - } - - fn set_public_key(&mut self, public_key: Option) { - match self { - Validator::V0(v0) => v0.set_public_key(public_key), - } - } - - fn set_node_ip(&mut self, node_ip: String) { - match self { - Validator::V0(v0) => v0.set_node_ip(node_ip), - } - } - - fn set_node_id(&mut self, node_id: PubkeyHash) { - match self { - Validator::V0(v0) => v0.set_node_id(node_id), - } - } - - fn set_core_port(&mut self, core_port: u16) { - match self { - Validator::V0(v0) => v0.set_core_port(core_port), - } - } - - fn set_platform_http_port(&mut self, platform_http_port: u16) { - match self { - Validator::V0(v0) => v0.set_platform_http_port(platform_http_port), - } - } - - fn set_platform_p2p_port(&mut self, platform_p2p_port: u16) { - match self { - Validator::V0(v0) => v0.set_platform_p2p_port(platform_p2p_port), - } - } - - fn set_is_banned(&mut self, is_banned: bool) { - match self { - Validator::V0(v0) => v0.set_is_banned(is_banned), - } - } -} +pub use dpp::core_types::validator::*; diff --git a/packages/rs-drive-abci/src/platform_types/validator/v0/mod.rs b/packages/rs-drive-abci/src/platform_types/validator/v0/mod.rs index 665c48c3dc..433fe506bf 100644 --- a/packages/rs-drive-abci/src/platform_types/validator/v0/mod.rs +++ b/packages/rs-drive-abci/src/platform_types/validator/v0/mod.rs @@ -1,52 +1,21 @@ use crate::platform_types::platform_state::v0::PlatformStateV0Methods; -use dashcore_rpc::dashcore::hashes::Hash; -use dashcore_rpc::dashcore::{ProTxHash, PubkeyHash}; -use dashcore_rpc::dashcore_rpc_json::{DMNState, MasternodeListItem}; -use std::fmt::{Debug, Formatter}; - use crate::platform_types::platform_state::PlatformState; +use dashcore_rpc::json::{DMNState, MasternodeListItem}; use dpp::bls_signatures::PublicKey as BlsPublicKey; -use serde::{Deserialize, Serialize}; - -/// A validator in the context of a quorum -#[derive(Clone, Serialize, Deserialize, Eq, PartialEq)] -pub struct ValidatorV0 { - /// The proTxHash - pub pro_tx_hash: ProTxHash, - /// The public key share of this validator for this quorum - pub public_key: Option, - /// The node address - pub node_ip: String, - /// The node id - pub node_id: PubkeyHash, - /// Core port - pub core_port: u16, - /// Http port - pub platform_http_port: u16, - /// Tenderdash port - pub platform_p2p_port: u16, - /// Is the validator banned - pub is_banned: bool, -} - -impl Debug for ValidatorV0 { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - f.debug_struct("ValidatorV0") - .field("pro_tx_hash", &self.pro_tx_hash.to_string()) - .field("public_key", &self.public_key) - .field("node_ip", &self.node_ip) - .field("node_id", &self.node_id) - .field("core_port", &self.core_port) - .field("platform_http_port", &self.platform_http_port) - .field("platform_p2p_port", &self.platform_p2p_port) - .field("is_banned", &self.is_banned) - .finish() - } +pub use dpp::core_types::validator::v0::*; +use dpp::dashcore::hashes::Hash; +use dpp::dashcore::{ProTxHash, PubkeyHash}; +pub(crate) trait NewValidatorIfMasternodeInState { + fn new_validator_if_masternode_in_state( + pro_tx_hash: ProTxHash, + public_key: Option, + state: &PlatformState, + ) -> Option; } -impl ValidatorV0 { +impl NewValidatorIfMasternodeInState for ValidatorV0 { /// Makes a validator if the masternode is in the list and is valid - pub fn new_validator_if_masternode_in_state( + fn new_validator_if_masternode_in_state( pro_tx_hash: ProTxHash, public_key: Option, state: &PlatformState, @@ -80,111 +49,3 @@ impl ValidatorV0 { }) } } - -/// Traits to get properties of a validator. -pub trait ValidatorV0Getters { - /// Returns the proTxHash of the validator. - fn pro_tx_hash(&self) -> &ProTxHash; - /// Returns the public key share of this validator for this quorum. - fn public_key(&self) -> &Option; - /// Returns the node address of the validator. - fn node_ip(&self) -> &String; - /// Returns the node id of the validator. - fn node_id(&self) -> &PubkeyHash; - /// Returns the core port of the validator. - fn core_port(&self) -> u16; - /// Returns the Http port of the validator. - fn platform_http_port(&self) -> u16; - /// Returns the Tenderdash port of the validator. - fn platform_p2p_port(&self) -> u16; - /// Returns the status of the validator whether it's banned or not. - fn is_banned(&self) -> bool; -} - -/// Traits to set properties of a validator. -pub trait ValidatorV0Setters { - /// Sets the proTxHash of the validator. - fn set_pro_tx_hash(&mut self, pro_tx_hash: ProTxHash); - /// Sets the public key share of this validator for this quorum. - fn set_public_key(&mut self, public_key: Option); - /// Sets the node address of the validator. - fn set_node_ip(&mut self, node_ip: String); - /// Sets the node id of the validator. - fn set_node_id(&mut self, node_id: PubkeyHash); - /// Sets the core port of the validator. - fn set_core_port(&mut self, core_port: u16); - /// Sets the Http port of the validator. - fn set_platform_http_port(&mut self, platform_http_port: u16); - /// Sets the Tenderdash port of the validator. - fn set_platform_p2p_port(&mut self, platform_p2p_port: u16); - /// Sets the status of the validator whether it's banned or not. - fn set_is_banned(&mut self, is_banned: bool); -} - -impl ValidatorV0Getters for ValidatorV0 { - fn pro_tx_hash(&self) -> &ProTxHash { - &self.pro_tx_hash - } - - fn public_key(&self) -> &Option { - &self.public_key - } - - fn node_ip(&self) -> &String { - &self.node_ip - } - - fn node_id(&self) -> &PubkeyHash { - &self.node_id - } - - fn core_port(&self) -> u16 { - self.core_port - } - - fn platform_http_port(&self) -> u16 { - self.platform_http_port - } - - fn platform_p2p_port(&self) -> u16 { - self.platform_p2p_port - } - - fn is_banned(&self) -> bool { - self.is_banned - } -} - -impl ValidatorV0Setters for ValidatorV0 { - fn set_pro_tx_hash(&mut self, pro_tx_hash: ProTxHash) { - self.pro_tx_hash = pro_tx_hash; - } - - fn set_public_key(&mut self, public_key: Option) { - self.public_key = public_key; - } - - fn set_node_ip(&mut self, node_ip: String) { - self.node_ip = node_ip; - } - - fn set_node_id(&mut self, node_id: PubkeyHash) { - self.node_id = node_id; - } - - fn set_core_port(&mut self, core_port: u16) { - self.core_port = core_port; - } - - fn set_platform_http_port(&mut self, platform_http_port: u16) { - self.platform_http_port = platform_http_port; - } - - fn set_platform_p2p_port(&mut self, platform_p2p_port: u16) { - self.platform_p2p_port = platform_p2p_port; - } - - fn set_is_banned(&mut self, is_banned: bool) { - self.is_banned = is_banned; - } -} diff --git a/packages/rs-drive-abci/src/platform_types/validator_set/mod.rs b/packages/rs-drive-abci/src/platform_types/validator_set/mod.rs index 5dd9adb1f8..414fbe0c8f 100644 --- a/packages/rs-drive-abci/src/platform_types/validator_set/mod.rs +++ b/packages/rs-drive-abci/src/platform_types/validator_set/mod.rs @@ -1,114 +1,27 @@ -use crate::platform_types::validator::v0::ValidatorV0; -use crate::platform_types::validator_set::v0::{ - ValidatorSetV0, ValidatorSetV0Getters, ValidatorSetV0Setters, -}; -use dashcore_rpc::dashcore::{ProTxHash, QuorumHash}; -use dpp::bls_signatures::PublicKey as BlsPublicKey; -use serde::{Deserialize, Serialize}; -use std::collections::BTreeMap; +use crate::platform_types::validator_set::v0::ValidatorSetMethodsV0; use tenderdash_abci::proto::abci::ValidatorSetUpdate; -/// Version 0 -pub mod v0; - -/// The validator set is only slightly different from a quorum as it does not contain non valid -/// members -#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] -pub enum ValidatorSet { - /// Version 0 - V0(ValidatorSetV0), -} - -impl ValidatorSetV0Getters for ValidatorSet { - fn quorum_hash(&self) -> &QuorumHash { - match self { - ValidatorSet::V0(v0) => v0.quorum_hash(), - } - } +pub use dpp::core_types::validator_set::*; - fn quorum_index(&self) -> Option { - match self { - ValidatorSet::V0(v0) => v0.quorum_index(), - } - } - - fn core_height(&self) -> u32 { - match self { - ValidatorSet::V0(v0) => v0.core_height(), - } - } - - fn members(&self) -> &BTreeMap { - match self { - ValidatorSet::V0(v0) => v0.members(), - } - } - - fn members_mut(&mut self) -> &mut BTreeMap { - match self { - ValidatorSet::V0(v0) => v0.members_mut(), - } - } - - fn members_owned(self) -> BTreeMap { - match self { - ValidatorSet::V0(v0) => v0.members_owned(), - } - } +/// v0 +pub mod v0; - fn threshold_public_key(&self) -> &BlsPublicKey { - match self { - ValidatorSet::V0(v0) => v0.threshold_public_key(), - } - } +pub(crate) trait ValidatorSetExt { + fn to_update(&self) -> ValidatorSetUpdate; + #[allow(unused)] + fn to_update_owned(self) -> ValidatorSetUpdate; } -impl ValidatorSetV0Setters for ValidatorSet { - fn set_quorum_hash(&mut self, quorum_hash: QuorumHash) { - match self { - ValidatorSet::V0(v0) => v0.set_quorum_hash(quorum_hash), - } - } - - fn set_quorum_index(&mut self, index: Option) { - match self { - ValidatorSet::V0(v0) => v0.set_quorum_index(index), - } - } - - fn set_core_height(&mut self, core_height: u32) { +impl ValidatorSetExt for ValidatorSet { + fn to_update(&self) -> ValidatorSetUpdate { match self { - ValidatorSet::V0(v0) => v0.set_core_height(core_height), + ValidatorSet::V0(v0) => v0.to_update(), } } - fn set_members(&mut self, members: BTreeMap) { + fn to_update_owned(self) -> ValidatorSetUpdate { match self { - ValidatorSet::V0(v0) => v0.set_members(members), - } - } - - fn set_threshold_public_key(&mut self, threshold_public_key: BlsPublicKey) { - match self { - ValidatorSet::V0(v0) => v0.set_threshold_public_key(threshold_public_key), - } - } -} - -/// In this case we are changing to this validator set from another validator set and there are no -/// changes -impl From for ValidatorSetUpdate { - fn from(value: ValidatorSet) -> Self { - match value { - ValidatorSet::V0(v0) => v0.into(), - } - } -} - -impl From<&ValidatorSet> for ValidatorSetUpdate { - fn from(value: &ValidatorSet) -> Self { - match value { - ValidatorSet::V0(v0) => v0.into(), + ValidatorSet::V0(v0) => v0.to_update_owned(), } } } diff --git a/packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs b/packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs index 7574a5d31d..f7141d1ff4 100644 --- a/packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs +++ b/packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs @@ -1,62 +1,38 @@ use crate::error::execution::ExecutionError; use crate::error::Error; -use crate::platform_types::validator::v0::ValidatorV0; use dashcore_rpc::dashcore::hashes::Hash; -use dashcore_rpc::dashcore::{ProTxHash, QuorumHash}; +use dashcore_rpc::dashcore::ProTxHash; use crate::platform_types::platform_state::PlatformState; +use crate::platform_types::validator::v0::NewValidatorIfMasternodeInState; use dashcore_rpc::json::QuorumInfoResult; use dpp::bls_signatures::PublicKey as BlsPublicKey; -use serde::{Deserialize, Serialize}; +use dpp::core_types::validator::v0::ValidatorV0; +pub use dpp::core_types::validator_set::v0::*; use std::collections::BTreeMap; -use std::fmt::{Debug, Formatter}; use tenderdash_abci::proto::abci::ValidatorSetUpdate; use tenderdash_abci::proto::crypto::public_key::Sum::Bls12381; use tenderdash_abci::proto::{abci, crypto}; -/// The validator set is only slightly different from a quorum as it does not contain non valid -/// members -#[derive(Clone, Serialize, Deserialize, Eq, PartialEq)] -pub struct ValidatorSetV0 { - /// The quorum hash - pub quorum_hash: QuorumHash, - /// Rotation quorum index is available only for DIP24 quorums - pub quorum_index: Option, - /// Active height - pub core_height: u32, - /// The list of masternodes - pub members: BTreeMap, - /// The threshold quorum public key - pub threshold_public_key: BlsPublicKey, -} +pub(crate) trait ValidatorSetMethodsV0 { + #[allow(unused)] + fn update_difference(&self, rhs: &ValidatorSetV0) -> Result; -impl Debug for ValidatorSetV0 { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - f.debug_struct("ValidatorSetV0") - .field("quorum_hash", &self.quorum_hash.to_string()) - .field("core_height", &self.core_height) - .field( - "members", - &self - .members - .iter() - .map(|(k, v)| (k.to_string(), v)) - .collect::>(), - ) - .field("threshold_public_key", &self.threshold_public_key) - .finish() - } + fn to_update(&self) -> ValidatorSetUpdate; + fn to_update_owned(self) -> ValidatorSetUpdate; + /// Try to create a quorum from info from the Masternode list (given with state), + /// and for information return for quorum members + fn try_from_quorum_info_result( + value: QuorumInfoResult, + state: &PlatformState, + ) -> Result; } -impl ValidatorSetV0 { +impl ValidatorSetMethodsV0 for ValidatorSetV0 { /// For changes between two validator sets, we take the new (rhs) element if is different /// for every validator - #[allow(dead_code)] - pub(crate) fn update_difference( - &self, - rhs: &ValidatorSetV0, - ) -> Result { + fn update_difference(&self, rhs: &ValidatorSetV0) -> Result { if self.quorum_hash != rhs.quorum_hash { return Err(Error::Execution(ExecutionError::CorruptedCachedState( format!( @@ -127,7 +103,7 @@ impl ValidatorSetV0 { } }), power: 100, - pro_tx_hash: reverse(pro_tx_hash.as_byte_array()), + pro_tx_hash: pro_tx_hash.as_byte_array().to_vec(), node_address, })) } @@ -159,7 +135,7 @@ impl ValidatorSetV0 { } }), power: 100, - pro_tx_hash: reverse(&pro_tx_hash.to_byte_array()), + pro_tx_hash: pro_tx_hash.to_byte_array().to_vec(), node_address, })) } @@ -174,35 +150,21 @@ impl ValidatorSetV0 { threshold_public_key: Some(crypto::PublicKey { sum: Some(Bls12381(self.threshold_public_key.to_bytes().to_vec())), }), - quorum_hash: reverse(&self.quorum_hash.to_byte_array()), + quorum_hash: self.quorum_hash.to_byte_array().to_vec(), }) } -} - -/// Reverse bytes -/// -/// TODO: This is a workaround for reversed data returned by dashcore_rpc (little endian / big endian handling issue). -/// We need to decide on a consistent approach to endianness and follow it. -fn reverse(data: &[u8]) -> Vec { - // data.reverse(); - data.to_vec() -} - -/// In this case we are changing to this validator set from another validator set and there are no -/// changes -impl From for ValidatorSetUpdate { - fn from(value: ValidatorSetV0) -> Self { + fn to_update(&self) -> ValidatorSetUpdate { let ValidatorSetV0 { quorum_hash, members: validator_set, threshold_public_key, .. - } = value; + } = self; ValidatorSetUpdate { validator_updates: validator_set - .into_values() - .filter_map(|validator| { + .iter() + .filter_map(|(_, validator)| { let ValidatorV0 { pro_tx_hash, public_key, @@ -212,7 +174,8 @@ impl From for ValidatorSetUpdate { is_banned, .. } = validator; - if is_banned { + + if *is_banned { return None; } let node_address = format!( @@ -221,13 +184,12 @@ impl From for ValidatorSetUpdate { node_ip, platform_p2p_port ); - Some(abci::ValidatorUpdate { - pub_key: public_key.map(|public_key| crypto::PublicKey { + pub_key: public_key.as_ref().map(|public_key| crypto::PublicKey { sum: Some(Bls12381(public_key.to_bytes().to_vec())), }), power: 100, - pro_tx_hash: reverse(&pro_tx_hash.to_byte_array()), + pro_tx_hash: pro_tx_hash.to_byte_array().to_vec(), node_address, }) }) @@ -235,23 +197,21 @@ impl From for ValidatorSetUpdate { threshold_public_key: Some(crypto::PublicKey { sum: Some(Bls12381(threshold_public_key.to_bytes().to_vec())), }), - quorum_hash: reverse(&quorum_hash.to_byte_array()), + quorum_hash: quorum_hash.to_byte_array().to_vec(), } } -} -impl From<&ValidatorSetV0> for ValidatorSetUpdate { - fn from(value: &ValidatorSetV0) -> Self { + fn to_update_owned(self) -> ValidatorSetUpdate { let ValidatorSetV0 { quorum_hash, members: validator_set, threshold_public_key, .. - } = value; + } = self; ValidatorSetUpdate { validator_updates: validator_set - .iter() - .filter_map(|(_, validator)| { + .into_values() + .filter_map(|validator| { let ValidatorV0 { pro_tx_hash, public_key, @@ -261,8 +221,7 @@ impl From<&ValidatorSetV0> for ValidatorSetUpdate { is_banned, .. } = validator; - - if *is_banned { + if is_banned { return None; } let node_address = format!( @@ -271,12 +230,13 @@ impl From<&ValidatorSetV0> for ValidatorSetUpdate { node_ip, platform_p2p_port ); + Some(abci::ValidatorUpdate { - pub_key: public_key.as_ref().map(|public_key| crypto::PublicKey { + pub_key: public_key.map(|public_key| crypto::PublicKey { sum: Some(Bls12381(public_key.to_bytes().to_vec())), }), power: 100, - pro_tx_hash: reverse(&pro_tx_hash.to_byte_array()), + pro_tx_hash: pro_tx_hash.to_byte_array().to_vec(), node_address, }) }) @@ -284,15 +244,13 @@ impl From<&ValidatorSetV0> for ValidatorSetUpdate { threshold_public_key: Some(crypto::PublicKey { sum: Some(Bls12381(threshold_public_key.to_bytes().to_vec())), }), - quorum_hash: reverse(&quorum_hash.to_byte_array()), + quorum_hash: quorum_hash.to_byte_array().to_vec(), } } -} -impl ValidatorSetV0 { /// Try to create a quorum from info from the Masternode list (given with state), /// and for information return for quorum members - pub fn try_from_quorum_info_result( + fn try_from_quorum_info_result( value: QuorumInfoResult, state: &PlatformState, ) -> Result { @@ -350,87 +308,3 @@ impl ValidatorSetV0 { }) } } - -/// Trait providing getter methods for `ValidatorSetV0` struct -pub trait ValidatorSetV0Getters { - /// Returns the quorum hash of the validator set. - fn quorum_hash(&self) -> &QuorumHash; - /// Returns rotation quorum index. It's available only for DIP24 quorums - fn quorum_index(&self) -> Option; - /// Returns the active height of the validator set. - fn core_height(&self) -> u32; - /// Returns the members of the validator set. - fn members(&self) -> &BTreeMap; - /// Returns the members of the validator set. - fn members_mut(&mut self) -> &mut BTreeMap; - /// Returns the members of the validator set. - fn members_owned(self) -> BTreeMap; - /// Returns the threshold public key of the validator set. - fn threshold_public_key(&self) -> &BlsPublicKey; -} - -/// Trait providing setter methods for `ValidatorSetV0` struct -pub trait ValidatorSetV0Setters { - /// Sets the quorum hash of the validator set. - fn set_quorum_hash(&mut self, quorum_hash: QuorumHash); - /// Sets the quorum index of the validator set. - fn set_quorum_index(&mut self, index: Option); - /// Sets the active height of the validator set. - fn set_core_height(&mut self, core_height: u32); - /// Sets the members of the validator set. - fn set_members(&mut self, members: BTreeMap); - /// Sets the threshold public key of the validator set. - fn set_threshold_public_key(&mut self, threshold_public_key: BlsPublicKey); -} - -impl ValidatorSetV0Getters for ValidatorSetV0 { - fn quorum_hash(&self) -> &QuorumHash { - &self.quorum_hash - } - - fn quorum_index(&self) -> Option { - self.quorum_index - } - - fn core_height(&self) -> u32 { - self.core_height - } - - fn members(&self) -> &BTreeMap { - &self.members - } - - fn members_mut(&mut self) -> &mut BTreeMap { - &mut self.members - } - - fn members_owned(self) -> BTreeMap { - self.members - } - - fn threshold_public_key(&self) -> &BlsPublicKey { - &self.threshold_public_key - } -} - -impl ValidatorSetV0Setters for ValidatorSetV0 { - fn set_quorum_hash(&mut self, quorum_hash: QuorumHash) { - self.quorum_hash = quorum_hash; - } - - fn set_quorum_index(&mut self, index: Option) { - self.quorum_index = index; - } - - fn set_core_height(&mut self, core_height: u32) { - self.core_height = core_height; - } - - fn set_members(&mut self, members: BTreeMap) { - self.members = members; - } - - fn set_threshold_public_key(&mut self, threshold_public_key: BlsPublicKey) { - self.threshold_public_key = threshold_public_key; - } -} diff --git a/packages/rs-drive-abci/src/platform_types/withdrawal/unsigned_withdrawal_txs/v0/mod.rs b/packages/rs-drive-abci/src/platform_types/withdrawal/unsigned_withdrawal_txs/v0/mod.rs index 0d61d4e471..1143c0aa09 100644 --- a/packages/rs-drive-abci/src/platform_types/withdrawal/unsigned_withdrawal_txs/v0/mod.rs +++ b/packages/rs-drive-abci/src/platform_types/withdrawal/unsigned_withdrawal_txs/v0/mod.rs @@ -1,8 +1,10 @@ //! Withdrawal transactions definitions and processing + use dpp::dashcore::consensus::Encodable; use dpp::dashcore::hashes::Hash; use dpp::dashcore::transaction::special_transaction::TransactionPayload::AssetUnlockPayloadType; use dpp::dashcore::{Transaction, VarInt}; +use std::collections::{BTreeMap, HashMap}; use std::fmt::Display; use tenderdash_abci::proto::types::VoteExtension; use tenderdash_abci::proto::{abci::ExtendVoteExtension, types::VoteExtensionType}; @@ -48,19 +50,64 @@ impl UnsignedWithdrawalTxs { } /// Verifies that the collection of unsigned withdrawal transactions matches the given votes extensions - /// created based on these transactions - pub fn are_matching_with_vote_extensions(&self, other: &[VoteExtension]) -> bool { + /// created based on these transactions. + /// Returns a mapping from transactions to their corresponding vote extensions if they match, or `None` if they don't. + pub fn verify_and_match_with_vote_extensions<'a>( + &'a self, + other: &'a [VoteExtension], + ) -> Option> { if self.0.len() != other.len() { - return false; - }; + return None; + } - !self.0.iter().zip(other.iter()).any(|(tx, vote_extension)| { + // Build a map from sign_request_id to VoteExtension + let mut vote_extension_map = HashMap::new(); + for vote_extension in other { + // Ensure that each signature is 96 bytes (size of a bls sig) + if vote_extension.signature.len() != 96 { + return None; + } + // Ensure sign_request_id is Some + if let Some(sign_request_id) = &vote_extension.sign_request_id { + vote_extension_map.insert(sign_request_id.clone(), vote_extension); + } else { + // If sign_request_id is None, we cannot match, return None + return None; + } + } + + let mut tx_to_vote_extension_map = BTreeMap::new(); + + // For each transaction, check if a matching vote extension exists + for tx in &self.0 { let extend_vote_extension = tx_to_extend_vote_extension(tx); + let sign_request_id = match &extend_vote_extension.sign_request_id { + Some(id) => id, + None => { + // If sign_request_id is None, we cannot match, return None + return None; + } + }; + + match vote_extension_map.get(sign_request_id) { + Some(vote_extension) => { + if vote_extension.r#type != extend_vote_extension.r#type + || vote_extension.extension != extend_vote_extension.extension + { + return None; + } else { + // All good, insert into map + tx_to_vote_extension_map.insert(tx, *vote_extension); + } + } + None => { + // No matching vote extension found + return None; + } + } + } - vote_extension.r#type != extend_vote_extension.r#type - || vote_extension.sign_request_id != extend_vote_extension.sign_request_id - || vote_extension.extension != extend_vote_extension.extension - }) + Some(tx_to_vote_extension_map) } } @@ -112,7 +159,7 @@ impl From<&UnsignedWithdrawalTxs> for Vec { } } -fn tx_to_extend_vote_extension(tx: &Transaction) -> ExtendVoteExtension { +pub(crate) fn tx_to_extend_vote_extension(tx: &Transaction) -> ExtendVoteExtension { let request_id = make_extend_vote_request_id(tx); let extension = tx.txid().as_byte_array().to_vec(); diff --git a/packages/rs-drive-abci/src/query/service.rs b/packages/rs-drive-abci/src/query/service.rs index 218b1f6f69..54e51348c0 100644 --- a/packages/rs-drive-abci/src/query/service.rs +++ b/packages/rs-drive-abci/src/query/service.rs @@ -15,12 +15,13 @@ use dapi_grpc::platform::v0::{ GetContestedResourceIdentityVotesResponse, GetContestedResourceVoteStateRequest, GetContestedResourceVoteStateResponse, GetContestedResourceVotersForIdentityRequest, GetContestedResourceVotersForIdentityResponse, GetContestedResourcesRequest, - GetContestedResourcesResponse, GetDataContractHistoryRequest, GetDataContractHistoryResponse, - GetDataContractRequest, GetDataContractResponse, GetDataContractsRequest, - GetDataContractsResponse, GetDocumentsRequest, GetDocumentsResponse, GetEpochsInfoRequest, - GetEpochsInfoResponse, GetEvonodesProposedEpochBlocksByIdsRequest, - GetEvonodesProposedEpochBlocksByRangeRequest, GetEvonodesProposedEpochBlocksResponse, - GetIdentitiesBalancesRequest, GetIdentitiesBalancesResponse, GetIdentitiesContractKeysRequest, + GetContestedResourcesResponse, GetCurrentQuorumsInfoRequest, GetCurrentQuorumsInfoResponse, + GetDataContractHistoryRequest, GetDataContractHistoryResponse, GetDataContractRequest, + GetDataContractResponse, GetDataContractsRequest, GetDataContractsResponse, + GetDocumentsRequest, GetDocumentsResponse, GetEpochsInfoRequest, GetEpochsInfoResponse, + GetEvonodesProposedEpochBlocksByIdsRequest, GetEvonodesProposedEpochBlocksByRangeRequest, + GetEvonodesProposedEpochBlocksResponse, GetIdentitiesBalancesRequest, + GetIdentitiesBalancesResponse, GetIdentitiesContractKeysRequest, GetIdentitiesContractKeysResponse, GetIdentityBalanceAndRevisionRequest, GetIdentityBalanceAndRevisionResponse, GetIdentityBalanceRequest, GetIdentityBalanceResponse, GetIdentityByPublicKeyHashRequest, GetIdentityByPublicKeyHashResponse, @@ -596,6 +597,18 @@ impl PlatformService for QueryService { ) .await } + + async fn get_current_quorums_info( + &self, + request: Request, + ) -> Result, Status> { + self.handle_blocking_query( + request, + Platform::::query_current_quorums_info, + "query_current_quorums_info", + ) + .await + } } fn query_error_into_status(error: QueryError) -> Status { diff --git a/packages/rs-drive-abci/src/query/system/current_quorums_info/mod.rs b/packages/rs-drive-abci/src/query/system/current_quorums_info/mod.rs new file mode 100644 index 0000000000..85ac929687 --- /dev/null +++ b/packages/rs-drive-abci/src/query/system/current_quorums_info/mod.rs @@ -0,0 +1,59 @@ +mod v0; + +use crate::error::query::QueryError; +use crate::error::Error; +use crate::platform_types::platform::Platform; +use crate::platform_types::platform_state::PlatformState; +use crate::query::QueryValidationResult; +use dapi_grpc::platform::v0::get_current_quorums_info_request::Version as RequestVersion; +use dapi_grpc::platform::v0::get_current_quorums_info_response::Version as ResponseVersion; +use dapi_grpc::platform::v0::{GetCurrentQuorumsInfoRequest, GetCurrentQuorumsInfoResponse}; +use dpp::version::PlatformVersion; + +impl Platform { + /// Querying of current quorums info + pub fn query_current_quorums_info( + &self, + GetCurrentQuorumsInfoRequest { version }: GetCurrentQuorumsInfoRequest, + platform_state: &PlatformState, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let Some(version) = version else { + return Ok(QueryValidationResult::new_with_error( + QueryError::DecodingError( + "could not decode current quorums info request".to_string(), + ), + )); + }; + + let feature_version_bounds = &platform_version + .drive_abci + .query + .system + .current_quorums_info; + + let feature_version = match &version { + RequestVersion::V0(_) => 0, + }; + if !feature_version_bounds.check_version(feature_version) { + return Ok(QueryValidationResult::new_with_error( + QueryError::UnsupportedQueryVersion( + "current_quorums_info".to_string(), + feature_version_bounds.min_version, + feature_version_bounds.max_version, + platform_version.protocol_version, + feature_version, + ), + )); + } + match version { + RequestVersion::V0(request_v0) => { + let result = self.query_current_quorums_info_v0(request_v0, platform_state)?; + + Ok(result.map(|response_v0| GetCurrentQuorumsInfoResponse { + version: Some(ResponseVersion::V0(response_v0)), + })) + } + } + } +} diff --git a/packages/rs-drive-abci/src/query/system/current_quorums_info/v0/mod.rs b/packages/rs-drive-abci/src/query/system/current_quorums_info/v0/mod.rs new file mode 100644 index 0000000000..f512f4b8f0 --- /dev/null +++ b/packages/rs-drive-abci/src/query/system/current_quorums_info/v0/mod.rs @@ -0,0 +1,68 @@ +use crate::error::Error; +use crate::platform_types::platform::Platform; +use crate::platform_types::platform_state::v0::PlatformStateV0Methods; +use crate::platform_types::platform_state::PlatformState; +use crate::platform_types::validator_set::v0::ValidatorSetV0Getters; +use crate::query::QueryValidationResult; +use dapi_grpc::platform::v0::get_current_quorums_info_request::GetCurrentQuorumsInfoRequestV0; +use dapi_grpc::platform::v0::get_current_quorums_info_response::{ + GetCurrentQuorumsInfoResponseV0, ValidatorSetV0, ValidatorV0, +}; +use dpp::dashcore::hashes::Hash; + +impl Platform { + pub(super) fn query_current_quorums_info_v0( + &self, + GetCurrentQuorumsInfoRequestV0 {}: GetCurrentQuorumsInfoRequestV0, + platform_state: &PlatformState, + ) -> Result, Error> { + // Get all validator sets sorted by core height + let validator_sets_sorted = + platform_state.validator_sets_sorted_by_core_height_by_most_recent(); + + // Collect the validator sets in the desired format + let validator_sets: Vec = validator_sets_sorted + .iter() + .map(|validator_set| { + // Map each ProTxHash to a ValidatorV0 object + let members: Vec = validator_set + .members() + .iter() + .map(|(pro_tx_hash, validator)| ValidatorV0 { + pro_tx_hash: pro_tx_hash.as_byte_array().to_vec(), + node_ip: validator.node_ip.clone(), + is_banned: validator.is_banned, + }) + .collect(); + + // Construct a ValidatorSetV0 object + ValidatorSetV0 { + quorum_hash: validator_set.quorum_hash().as_byte_array().to_vec(), + core_height: validator_set.core_height(), + members, + threshold_public_key: validator_set.threshold_public_key().to_bytes().to_vec(), + } + }) + .collect(); + + // Get the current proposer index and current quorum index, if applicable + let current_quorum_index = platform_state.current_validator_set_quorum_hash(); + let last_committed_block_proposer_pro_tx_hash = + platform_state.last_committed_block_proposer_pro_tx_hash(); + + // Construct the response + let response = GetCurrentQuorumsInfoResponseV0 { + quorum_hashes: validator_sets_sorted + .iter() + .map(|validator_set| validator_set.quorum_hash().as_byte_array().to_vec()) + .collect(), + validator_sets, + last_block_proposer: last_committed_block_proposer_pro_tx_hash.to_vec(), + current_quorum_hash: current_quorum_index.as_byte_array().to_vec(), + metadata: Some(self.response_metadata_v0(platform_state)), + }; + + // Return the response wrapped in a QueryValidationResult + Ok(QueryValidationResult::new_with_data(response)) + } +} diff --git a/packages/rs-drive-abci/src/query/system/mod.rs b/packages/rs-drive-abci/src/query/system/mod.rs index 8eb018a513..6eecfed910 100644 --- a/packages/rs-drive-abci/src/query/system/mod.rs +++ b/packages/rs-drive-abci/src/query/system/mod.rs @@ -1,3 +1,4 @@ +mod current_quorums_info; mod epoch_infos; mod path_elements; mod status; diff --git a/packages/rs-drive-abci/src/query/system/path_elements/mod.rs b/packages/rs-drive-abci/src/query/system/path_elements/mod.rs index 1a91523602..cf056e84b2 100644 --- a/packages/rs-drive-abci/src/query/system/path_elements/mod.rs +++ b/packages/rs-drive-abci/src/query/system/path_elements/mod.rs @@ -20,7 +20,7 @@ impl Platform { ) -> Result, Error> { let Some(version) = version else { return Ok(QueryValidationResult::new_with_error( - QueryError::DecodingError("could not decode epoch info request".to_string()), + QueryError::DecodingError("could not decode path elements".to_string()), )); }; diff --git a/packages/rs-drive-abci/src/query/system/total_credits_in_platform/mod.rs b/packages/rs-drive-abci/src/query/system/total_credits_in_platform/mod.rs index 1bb352103f..f0d126b0d0 100644 --- a/packages/rs-drive-abci/src/query/system/total_credits_in_platform/mod.rs +++ b/packages/rs-drive-abci/src/query/system/total_credits_in_platform/mod.rs @@ -22,7 +22,7 @@ impl Platform { ) -> Result, Error> { let Some(version) = version else { return Ok(QueryValidationResult::new_with_error( - QueryError::DecodingError("could not decode epoch info request".to_string()), + QueryError::DecodingError("could not decode total credits in platform".to_string()), )); }; diff --git a/packages/rs-drive-abci/tests/strategy_tests/main.rs b/packages/rs-drive-abci/tests/strategy_tests/main.rs index f42f791ebb..21d269d6be 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/main.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/main.rs @@ -30,6 +30,7 @@ mod strategy; mod upgrade_fork_tests; mod verify_state_transitions; mod voting_tests; +mod withdrawal_tests; pub type BlockHeight = u64; @@ -43,15 +44,13 @@ fn asset_unlock_index(tx: &Transaction) -> u64 { #[cfg(test)] mod tests { use super::*; - use crate::execution::{continue_chain_for_strategy, run_chain_for_strategy, GENESIS_TIME_MS}; + use crate::execution::{continue_chain_for_strategy, run_chain_for_strategy}; use crate::query::QueryStrategy; use crate::strategy::{FailureStrategy, MasternodeListChangesStrategy}; use dashcore_rpc::dashcore::hashes::Hash; use dashcore_rpc::dashcore::BlockHash; - use dashcore_rpc::dashcore_rpc_json::AssetUnlockStatus; - use dashcore_rpc::json::{AssetUnlockStatusResult, QuorumType}; + use dashcore_rpc::json::QuorumType; use dpp::block::extended_block_info::v0::ExtendedBlockInfoV0Getters; - use std::sync::{Arc, Mutex}; use strategy_tests::operations::DocumentAction::{ DocumentActionReplaceRandom, DocumentActionTransferRandom, }; @@ -61,21 +60,15 @@ mod tests { use strategy_tests::{IdentityInsertInfo, StartIdentities}; use crate::strategy::CoreHeightIncrease::RandomCoreHeightIncrease; - use dpp::dashcore::bls_sig_utils::BLSSignature; use dpp::dashcore::ChainLock; - use dpp::dashcore::Txid; use dpp::data_contract::accessors::v0::{DataContractV0Getters, DataContractV0Setters}; use dpp::data_contract::document_type::random_document::{ DocumentFieldFillSize, DocumentFieldFillType, }; use dpp::identity::accessors::IdentityGettersV0; use dpp::identity::identity_public_key::accessors::v0::IdentityPublicKeyGettersV0; - use dpp::system_data_contracts::withdrawals_contract; use dpp::tests::json_document::json_document_to_created_contract; use dpp::util::hash::hash_to_hex_string; - use dpp::version::PlatformVersion; - use drive::config::DEFAULT_QUERY_LIMIT; - use drive::drive::identity::withdrawals::WithdrawalTransactionIndex; use drive_abci::config::{ ChainLockConfig, ExecutionConfig, InstantLockConfig, PlatformTestConfig, ValidatorSetConfig, }; @@ -92,6 +85,7 @@ mod tests { }; use dpp::identity::{Identity, KeyType, Purpose, SecurityLevel}; use dpp::state_transition::StateTransition; + use platform_version::version::PlatformVersion; use simple_signer::signer::SimpleSigner; use strategy_tests::transitions::create_state_transitions_for_identities; use tenderdash_abci::Application; @@ -3224,609 +3218,6 @@ mod tests { })); } - #[test] - #[ignore] - fn run_chain_top_up_and_withdraw_from_identities() { - let platform_version = PlatformVersion::latest(); - let strategy = NetworkStrategy { - strategy: Strategy { - start_contracts: vec![], - operations: vec![ - Operation { - op_type: OperationType::IdentityTopUp, - frequency: Frequency { - times_per_block_range: 1..4, - chance_per_block: None, - }, - }, - Operation { - op_type: OperationType::IdentityWithdrawal, - frequency: Frequency { - times_per_block_range: 1..4, - chance_per_block: None, - }, - }, - ], - start_identities: StartIdentities::default(), - identity_inserts: IdentityInsertInfo { - frequency: Frequency { - times_per_block_range: 1..2, - chance_per_block: None, - }, - start_keys: 3, - extra_keys: [( - Purpose::TRANSFER, - [(SecurityLevel::CRITICAL, vec![KeyType::ECDSA_SECP256K1])].into(), - )] - .into(), - }, - identity_contract_nonce_gaps: None, - signer: None, - }, - total_hpmns: 100, - extra_normal_mns: 0, - validator_quorum_count: 24, - chain_lock_quorum_count: 24, - upgrading_info: None, - - proposer_strategy: Default::default(), - rotate_quorums: false, - failure_testing: None, - query_testing: None, - // because we can add an identity and withdraw from it in the same block - // the result would be different from what would be expected - verify_state_transition_results: false, - ..Default::default() - }; - let config = PlatformConfig { - validator_set: ValidatorSetConfig::default_100_67(), - chain_lock: ChainLockConfig::default_100_67(), - instant_lock: InstantLockConfig::default_100_67(), - execution: ExecutionConfig { - verify_sum_trees: true, - - ..Default::default() - }, - block_spacing_ms: 3000, - testing_configs: PlatformTestConfig::default_minimal_verifications(), - ..Default::default() - }; - - let mut platform = TestPlatformBuilder::new() - .with_config(config.clone()) - .build_with_mock_rpc(); - - platform - .core_rpc - .expect_send_raw_transaction() - .returning(move |_| Ok(Txid::all_zeros())); - - struct CoreState { - asset_unlock_statuses: BTreeMap, - chain_lock: ChainLock, - } - - let mut chain_locked_height = 1; - - // Have to go with a complicated shared object for the core state because we need to change - // rpc response along the way but we can't mutate `platform.core_rpc` later - // because platform reference is moved into the AbciApplication. - let shared_core_state = Arc::new(Mutex::new(CoreState { - asset_unlock_statuses: BTreeMap::new(), - chain_lock: ChainLock { - block_height: chain_locked_height, - block_hash: BlockHash::from_byte_array([1; 32]), - signature: BLSSignature::from([2; 96]), - }, - })); - - // Set up Core RPC responses - { - let core_state = shared_core_state.clone(); - - platform - .core_rpc - .expect_get_asset_unlock_statuses() - .returning(move |indices, _| { - Ok(indices - .iter() - .map(|index| { - core_state - .lock() - .unwrap() - .asset_unlock_statuses - .get(index) - .cloned() - .unwrap() - }) - .collect()) - }); - - let core_state = shared_core_state.clone(); - platform - .core_rpc - .expect_get_best_chain_lock() - .returning(move || Ok(core_state.lock().unwrap().chain_lock.clone())); - } - - // Run first two blocks: - // - Block 1: creates identity - // - Block 2: tops up identity and initiates withdrawals - let ( - ChainExecutionOutcome { - abci_app, - proposers, - validator_quorums: quorums, - current_validator_quorum_hash: current_quorum_hash, - current_proposer_versions, - end_time_ms, - identity_nonce_counter, - identity_contract_nonce_counter, - instant_lock_quorums, - .. - }, - last_block_pooled_withdrawals_amount, - ) = { - let outcome = run_chain_for_strategy( - &mut platform, - 2, - strategy.clone(), - config.clone(), - 1, - &mut None, - ); - - // Withdrawal transactions are not populated to block execution context yet - assert_eq!(outcome.withdrawals.len(), 0); - - // Withdrawal documents with pooled status should exist. - let withdrawal_documents_pooled = outcome - .abci_app - .platform - .drive - .fetch_oldest_withdrawal_documents_by_status( - withdrawals_contract::WithdrawalStatus::POOLED.into(), - DEFAULT_QUERY_LIMIT, - None, - platform_version, - ) - .unwrap(); - assert!(!withdrawal_documents_pooled.is_empty()); - let pooled_withdrawals = withdrawal_documents_pooled.len(); - - (outcome, pooled_withdrawals) - }; - - // Run block 3 - // Should broadcast previously pooled withdrawals to core - let ChainExecutionOutcome { - abci_app, - proposers, - validator_quorums: quorums, - current_validator_quorum_hash: current_quorum_hash, - current_proposer_versions, - end_time_ms, - withdrawals: last_block_withdrawals, - identity_nonce_counter, - identity_contract_nonce_counter, - instant_lock_quorums, - .. - } = { - let outcome = continue_chain_for_strategy( - abci_app, - ChainExecutionParameters { - block_start: 3, - core_height_start: 1, - block_count: 1, - proposers, - validator_quorums: quorums, - current_validator_quorum_hash: current_quorum_hash, - current_proposer_versions: Some(current_proposer_versions), - current_identity_nonce_counter: identity_nonce_counter, - current_identity_contract_nonce_counter: identity_contract_nonce_counter, - current_votes: BTreeMap::default(), - start_time_ms: GENESIS_TIME_MS, - current_time_ms: end_time_ms, - instant_lock_quorums, - current_identities: Vec::new(), - }, - strategy.clone(), - config.clone(), - StrategyRandomness::SeedEntropy(2), - ); - - // Withdrawal documents with pooled status should exist. - let withdrawal_documents_broadcasted = outcome - .abci_app - .platform - .drive - .fetch_oldest_withdrawal_documents_by_status( - withdrawals_contract::WithdrawalStatus::BROADCASTED.into(), - DEFAULT_QUERY_LIMIT, - None, - platform_version, - ) - .unwrap(); - - // In this block all previously pooled withdrawals should be broadcasted - assert_eq!( - outcome.withdrawals.len(), - last_block_pooled_withdrawals_amount - ); - assert_eq!( - withdrawal_documents_broadcasted.len(), - last_block_pooled_withdrawals_amount - ); - - outcome - }; - - // Update core state before running next block. - // Asset unlocks broadcasted in the last block should have Unknown status - { - let mut core_state = shared_core_state.lock().unwrap(); - last_block_withdrawals.iter().for_each(|tx| { - let index = asset_unlock_index(tx); - - core_state.asset_unlock_statuses.insert( - index, - AssetUnlockStatusResult { - index, - status: AssetUnlockStatus::Unknown, - }, - ); - }); - } - - // Run block 4 - // Should change pooled status to broadcasted - let last_block_broadcasted_withdrawals_amount = last_block_withdrawals.len(); - let ( - ChainExecutionOutcome { - abci_app, - proposers, - validator_quorums: quorums, - current_validator_quorum_hash: current_quorum_hash, - current_proposer_versions, - end_time_ms, - withdrawals: last_block_withdrawals, - identity_nonce_counter, - identity_contract_nonce_counter, - instant_lock_quorums, - .. - }, - last_block_broadcased_withdrawals_amount, - ) = { - let outcome = continue_chain_for_strategy( - abci_app, - ChainExecutionParameters { - block_start: 4, - core_height_start: 1, - block_count: 1, - proposers, - validator_quorums: quorums, - current_validator_quorum_hash: current_quorum_hash, - current_proposer_versions: Some(current_proposer_versions), - current_identity_nonce_counter: identity_nonce_counter, - current_identity_contract_nonce_counter: identity_contract_nonce_counter, - current_votes: BTreeMap::default(), - start_time_ms: GENESIS_TIME_MS, - current_time_ms: end_time_ms + 1000, - instant_lock_quorums, - current_identities: Vec::new(), - }, - strategy.clone(), - config.clone(), - StrategyRandomness::SeedEntropy(3), - ); - - let withdrawal_documents_pooled = outcome - .abci_app - .platform - .drive - .fetch_oldest_withdrawal_documents_by_status( - withdrawals_contract::WithdrawalStatus::POOLED.into(), - DEFAULT_QUERY_LIMIT, - None, - platform_version, - ) - .unwrap(); - - let withdrawal_documents_broadcasted = outcome - .abci_app - .platform - .drive - .fetch_oldest_withdrawal_documents_by_status( - withdrawals_contract::WithdrawalStatus::BROADCASTED.into(), - DEFAULT_QUERY_LIMIT, - None, - platform_version, - ) - .unwrap(); - - // In this block we should have new withdrawals pooled - assert!(!withdrawal_documents_pooled.is_empty()); - - // And extra withdrawals broadcasted - let withdrawals_broadcasted_expected = - last_block_broadcasted_withdrawals_amount + outcome.withdrawals.len(); - assert_eq!( - withdrawal_documents_broadcasted.len(), - withdrawals_broadcasted_expected - ); - - (outcome, withdrawal_documents_broadcasted.len()) - }; - - // Update core state for newly broadcasted transactions - { - let mut core_state = shared_core_state.lock().unwrap(); - - // First, set all previously broadcasted transactions to Chainlocked - core_state - .asset_unlock_statuses - .iter_mut() - .for_each(|(index, status_result)| { - // Do not settle yet transactions that were broadcasted in the last block - status_result.index = *index; - status_result.status = AssetUnlockStatus::Chainlocked; - }); - - // Then increase chainlocked height, so that withdrawals for chainlocked transactions - // could be completed in the next block - // TODO: do we need this var? - chain_locked_height += 1; - core_state.chain_lock.block_height = chain_locked_height; - - // Then set all newly broadcasted transactions to Unknown - last_block_withdrawals.iter().for_each(|tx| { - let index = asset_unlock_index(tx); - - core_state.asset_unlock_statuses.insert( - index, - AssetUnlockStatusResult { - index, - status: AssetUnlockStatus::Unknown, - }, - ); - }); - - drop(core_state); - } - - // Run block 5 - // Previously broadcasted transactions should be settled after block 5, - // and their corresponding statuses should be changed to COMPLETED - let ( - ChainExecutionOutcome { - abci_app, - proposers, - validator_quorums: quorums, - current_validator_quorum_hash: current_quorum_hash, - current_proposer_versions, - end_time_ms, - withdrawals: last_block_withdrawals, - identity_nonce_counter, - identity_contract_nonce_counter, - instant_lock_quorums, - .. - }, - last_block_withdrawals_completed_amount, - ) = { - let outcome = continue_chain_for_strategy( - abci_app, - ChainExecutionParameters { - block_start: 5, - core_height_start: 1, - block_count: 1, - proposers, - validator_quorums: quorums, - current_validator_quorum_hash: current_quorum_hash, - current_proposer_versions: Some(current_proposer_versions), - current_identity_nonce_counter: identity_nonce_counter, - current_identity_contract_nonce_counter: identity_contract_nonce_counter, - current_votes: BTreeMap::default(), - start_time_ms: GENESIS_TIME_MS, - current_time_ms: end_time_ms + 1000, - instant_lock_quorums, - current_identities: Vec::new(), - }, - strategy.clone(), - config.clone(), - StrategyRandomness::SeedEntropy(4), - ); - - let withdrawal_documents_pooled = outcome - .abci_app - .platform - .drive - .fetch_oldest_withdrawal_documents_by_status( - withdrawals_contract::WithdrawalStatus::POOLED.into(), - DEFAULT_QUERY_LIMIT, - None, - platform_version, - ) - .unwrap(); - - let withdrawal_documents_broadcasted = outcome - .abci_app - .platform - .drive - .fetch_oldest_withdrawal_documents_by_status( - withdrawals_contract::WithdrawalStatus::BROADCASTED.into(), - DEFAULT_QUERY_LIMIT, - None, - platform_version, - ) - .unwrap(); - - let withdrawal_documents_completed = outcome - .abci_app - .platform - .drive - .fetch_oldest_withdrawal_documents_by_status( - withdrawals_contract::WithdrawalStatus::COMPLETE.into(), - DEFAULT_QUERY_LIMIT, - None, - platform_version, - ) - .unwrap(); - - // In this block we should have new withdrawals pooled - assert!(!withdrawal_documents_pooled.is_empty()); - - // And some withdrawals completed - let withdrawals_completed_expected = - // Withdrawals issued on {previous_block - 1} considered completed - last_block_broadcased_withdrawals_amount - last_block_withdrawals.len(); - assert_eq!( - withdrawal_documents_completed.len(), - withdrawals_completed_expected - ); - - // And extra withdrawals broadcasted - let withdrawals_broadcasted_expected = - // Withdrawals issued on previous block + withdrawals from this block are still in broadcasted state - last_block_withdrawals.len() + outcome.withdrawals.len(); - - assert_eq!( - withdrawal_documents_broadcasted.len(), - withdrawals_broadcasted_expected - ); - - (outcome, withdrawal_documents_completed.len()) - }; - - // Update state of the core before proceeding to the next block - { - // Simulate transactions being added to the core mempool - let mut core_state = shared_core_state.lock().unwrap(); - - let number_of_blocks_before_expiration: u32 = 48; - chain_locked_height += number_of_blocks_before_expiration; - - core_state.chain_lock.block_height = chain_locked_height; - - last_block_withdrawals.iter().for_each(|tx| { - let index = asset_unlock_index(tx); - - core_state.asset_unlock_statuses.insert( - index, - AssetUnlockStatusResult { - index, - status: AssetUnlockStatus::Unknown, - }, - ); - }); - } - - // Run block 6. - // Tests withdrawal expiration - let ChainExecutionOutcome { .. } = { - let outcome = continue_chain_for_strategy( - abci_app, - ChainExecutionParameters { - block_start: 6, - core_height_start: 1, - block_count: 1, - proposers, - validator_quorums: quorums, - current_validator_quorum_hash: current_quorum_hash, - current_proposer_versions: Some(current_proposer_versions), - current_identity_nonce_counter: identity_nonce_counter, - current_identity_contract_nonce_counter: identity_contract_nonce_counter, - current_votes: BTreeMap::default(), - start_time_ms: GENESIS_TIME_MS, - current_time_ms: end_time_ms + 1000, - instant_lock_quorums, - current_identities: Vec::new(), - }, - strategy.clone(), - config.clone(), - StrategyRandomness::SeedEntropy(5), - ); - - let withdrawal_documents_pooled = outcome - .abci_app - .platform - .drive - .fetch_oldest_withdrawal_documents_by_status( - withdrawals_contract::WithdrawalStatus::POOLED.into(), - DEFAULT_QUERY_LIMIT, - None, - platform_version, - ) - .unwrap(); - - let withdrawal_documents_broadcasted = outcome - .abci_app - .platform - .drive - .fetch_oldest_withdrawal_documents_by_status( - withdrawals_contract::WithdrawalStatus::BROADCASTED.into(), - DEFAULT_QUERY_LIMIT, - None, - platform_version, - ) - .unwrap(); - - let withdrawal_documents_completed = outcome - .abci_app - .platform - .drive - .fetch_oldest_withdrawal_documents_by_status( - withdrawals_contract::WithdrawalStatus::COMPLETE.into(), - DEFAULT_QUERY_LIMIT, - None, - platform_version, - ) - .unwrap(); - - let withdrawal_documents_expired = outcome - .abci_app - .platform - .drive - .fetch_oldest_withdrawal_documents_by_status( - withdrawals_contract::WithdrawalStatus::EXPIRED.into(), - DEFAULT_QUERY_LIMIT, - None, - platform_version, - ) - .unwrap(); - - // In this block we should have new withdrawals pooled - assert!(!withdrawal_documents_pooled.is_empty()); - - // Amount of completed withdrawals stays the same as in the last block - assert_eq!( - withdrawal_documents_completed.len(), - last_block_withdrawals_completed_amount - ); - - // And some withdrawals got expired - let withdrawals_expired_expected = - // Withdrawals issued on {previous_block - 1}, but not chainlocked yet, considered expired - last_block_broadcased_withdrawals_amount - last_block_withdrawals.len(); - - assert_eq!( - withdrawal_documents_expired.len(), - withdrawals_expired_expected - ); - - // And extra withdrawals broadcasted - let withdrawals_broadcasted_expected = - // Withdrawals issued on previous block + withdrawals from this block are still in broadcasted state - last_block_withdrawals.len() + outcome.withdrawals.len(); - - assert_eq!( - withdrawal_documents_broadcasted.len(), - withdrawals_broadcasted_expected - ); - - outcome - }; - } - #[test] fn run_chain_rotation_is_deterministic_1_block() { let strategy = NetworkStrategy { diff --git a/packages/rs-drive-abci/tests/strategy_tests/withdrawal_tests.rs b/packages/rs-drive-abci/tests/strategy_tests/withdrawal_tests.rs new file mode 100644 index 0000000000..6113c15474 --- /dev/null +++ b/packages/rs-drive-abci/tests/strategy_tests/withdrawal_tests.rs @@ -0,0 +1,643 @@ +mod tests { + use crate::asset_unlock_index; + use crate::execution::{continue_chain_for_strategy, run_chain_for_strategy, GENESIS_TIME_MS}; + use crate::strategy::{ + ChainExecutionOutcome, ChainExecutionParameters, NetworkStrategy, StrategyRandomness, + }; + use assert_matches::assert_matches; + use dashcore_rpc::dashcore_rpc_json::{AssetUnlockStatus, AssetUnlockStatusResult}; + use dpp::dashcore::bls_sig_utils::BLSSignature; + use dpp::dashcore::hashes::Hash; + use dpp::dashcore::{BlockHash, ChainLock, Txid}; + use dpp::data_contracts::withdrawals_contract; + use dpp::identity::{KeyType, Purpose, SecurityLevel}; + use dpp::withdrawal::WithdrawalTransactionIndex; + use drive::config::DEFAULT_QUERY_LIMIT; + use drive_abci::config::{ + ChainLockConfig, ExecutionConfig, InstantLockConfig, PlatformConfig, PlatformTestConfig, + ValidatorSetConfig, + }; + use drive_abci::test::helpers::setup::TestPlatformBuilder; + use platform_version::version::mocks::v3_test::TEST_PLATFORM_V3; + use platform_version::version::PlatformVersion; + use std::collections::BTreeMap; + use std::sync::{Arc, Mutex}; + use strategy_tests::frequency::Frequency; + use strategy_tests::operations::{Operation, OperationType}; + use strategy_tests::{IdentityInsertInfo, StartIdentities, Strategy}; + + struct CoreState { + asset_unlock_statuses: BTreeMap, + chain_lock: ChainLock, + } + + #[test] + fn run_chain_top_up_and_withdraw_from_identities() { + // TEST_PLATFORM_V3 is like v4, but without the single quorum can sign withdrawals restriction + let platform_version = PlatformVersion::get(TEST_PLATFORM_V3.protocol_version) + .expect("expected to get platform version"); + let strategy = NetworkStrategy { + strategy: Strategy { + start_contracts: vec![], + operations: vec![ + Operation { + op_type: OperationType::IdentityTopUp, + frequency: Frequency { + times_per_block_range: 1..4, + chance_per_block: None, + }, + }, + Operation { + op_type: OperationType::IdentityWithdrawal, + frequency: Frequency { + times_per_block_range: 1..4, + chance_per_block: None, + }, + }, + ], + start_identities: StartIdentities::default(), + identity_inserts: IdentityInsertInfo { + frequency: Frequency { + times_per_block_range: 1..2, + chance_per_block: None, + }, + start_keys: 3, + extra_keys: [( + Purpose::TRANSFER, + [(SecurityLevel::CRITICAL, vec![KeyType::ECDSA_SECP256K1])].into(), + )] + .into(), + }, + identity_contract_nonce_gaps: None, + signer: None, + }, + total_hpmns: 100, + extra_normal_mns: 0, + validator_quorum_count: 24, + chain_lock_quorum_count: 24, + upgrading_info: None, + + proposer_strategy: Default::default(), + rotate_quorums: false, + failure_testing: None, + query_testing: None, + // because we can add an identity and withdraw from it in the same block + // the result would be different from what would be expected + verify_state_transition_results: false, + ..Default::default() + }; + let config = PlatformConfig { + validator_set: ValidatorSetConfig::default_100_67(), + chain_lock: ChainLockConfig::default_100_67(), + instant_lock: InstantLockConfig::default_100_67(), + execution: ExecutionConfig { + verify_sum_trees: true, + + ..Default::default() + }, + block_spacing_ms: 3000, + initial_protocol_version: TEST_PLATFORM_V3.protocol_version, + testing_configs: PlatformTestConfig::default_minimal_verifications(), + ..Default::default() + }; + + let mut platform = TestPlatformBuilder::new() + .with_config(config.clone()) + .build_with_mock_rpc(); + + platform + .core_rpc + .expect_send_raw_transaction() + .returning(move |_| Ok(Txid::all_zeros())); + + let mut chain_locked_height = 1; + + // Have to go with a complicated shared object for the core state because we need to change + // rpc response along the way but we can't mutate `platform.core_rpc` later + // because platform reference is moved into the AbciApplication. + let shared_core_state = Arc::new(Mutex::new(CoreState { + asset_unlock_statuses: BTreeMap::new(), + chain_lock: ChainLock { + block_height: chain_locked_height, + block_hash: BlockHash::from_byte_array([1; 32]), + signature: BLSSignature::from([2; 96]), + }, + })); + + // Set up Core RPC responses + { + let core_state = shared_core_state.clone(); + + platform + .core_rpc + .expect_get_asset_unlock_statuses() + .returning(move |indices, _| { + Ok(indices + .iter() + .map(|index| { + core_state + .lock() + .unwrap() + .asset_unlock_statuses + .get(index) + .cloned() + .unwrap() + }) + .collect()) + }); + + let core_state = shared_core_state.clone(); + platform + .core_rpc + .expect_get_best_chain_lock() + .returning(move || Ok(core_state.lock().unwrap().chain_lock.clone())); + } + + // Run first two blocks: + // - Block 1: creates identity + // - Block 2: tops up identity and initiates withdrawals + let ( + ChainExecutionOutcome { + abci_app, + proposers, + validator_quorums: quorums, + current_validator_quorum_hash: current_quorum_hash, + current_proposer_versions, + end_time_ms, + identity_nonce_counter, + identity_contract_nonce_counter, + instant_lock_quorums, + .. + }, + last_block_pooled_withdrawals_amount, + ) = { + let outcome = run_chain_for_strategy( + &mut platform, + 2, + strategy.clone(), + config.clone(), + 1, + &mut None, + ); + + for tx_results_per_block in outcome.state_transition_results_per_block.values() { + for (state_transition, result) in tx_results_per_block { + assert_eq!( + result.code, 0, + "state transition got code {} : {:?}", + result.code, state_transition + ); + } + } + + // Withdrawal transactions are not populated to block execution context yet + assert_eq!(outcome.withdrawals.len(), 0); + + // Withdrawal documents with pooled status should exist. + let withdrawal_documents_pooled = outcome + .abci_app + .platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::POOLED.into(), + DEFAULT_QUERY_LIMIT, + None, + platform_version, + ) + .unwrap(); + assert!(!withdrawal_documents_pooled.is_empty()); + let pooled_withdrawals = withdrawal_documents_pooled.len(); + + (outcome, pooled_withdrawals) + }; + + // Run block 3 + // Should broadcast previously pooled withdrawals to core + let ChainExecutionOutcome { + abci_app, + proposers, + validator_quorums: quorums, + current_validator_quorum_hash: current_quorum_hash, + current_proposer_versions, + end_time_ms, + withdrawals: last_block_withdrawals, + identity_nonce_counter, + identity_contract_nonce_counter, + instant_lock_quorums, + .. + } = { + let outcome = continue_chain_for_strategy( + abci_app, + ChainExecutionParameters { + block_start: 3, + core_height_start: 1, + block_count: 1, + proposers, + validator_quorums: quorums, + current_validator_quorum_hash: current_quorum_hash, + current_proposer_versions: Some(current_proposer_versions), + current_identity_nonce_counter: identity_nonce_counter, + current_identity_contract_nonce_counter: identity_contract_nonce_counter, + current_votes: BTreeMap::default(), + start_time_ms: GENESIS_TIME_MS, + current_time_ms: end_time_ms, + instant_lock_quorums, + current_identities: Vec::new(), + }, + strategy.clone(), + config.clone(), + StrategyRandomness::SeedEntropy(2), + ); + + // Withdrawal documents with pooled status should exist. + let withdrawal_documents_broadcasted = outcome + .abci_app + .platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::BROADCASTED.into(), + DEFAULT_QUERY_LIMIT, + None, + platform_version, + ) + .unwrap(); + + // In this block all previously pooled withdrawals should be broadcasted + assert_eq!( + outcome.withdrawals.len(), + last_block_pooled_withdrawals_amount + ); + assert_eq!( + withdrawal_documents_broadcasted.len(), + last_block_pooled_withdrawals_amount + ); + + outcome + }; + + // Update core state before running next block. + // Asset unlocks broadcasted in the last block should have Unknown status + { + let mut core_state = shared_core_state.lock().unwrap(); + last_block_withdrawals.iter().for_each(|tx| { + let index = asset_unlock_index(tx); + + core_state.asset_unlock_statuses.insert( + index, + AssetUnlockStatusResult { + index, + status: AssetUnlockStatus::Unknown, + }, + ); + }); + } + + // Run block 4 + // Should change pooled status to broadcasted + let last_block_broadcasted_withdrawals_amount = last_block_withdrawals.len(); + let ( + ChainExecutionOutcome { + abci_app, + proposers, + validator_quorums: quorums, + current_validator_quorum_hash: current_quorum_hash, + current_proposer_versions, + end_time_ms, + withdrawals: last_block_withdrawals, + identity_nonce_counter, + identity_contract_nonce_counter, + instant_lock_quorums, + .. + }, + last_block_broadcased_withdrawals_amount, + ) = { + let outcome = continue_chain_for_strategy( + abci_app, + ChainExecutionParameters { + block_start: 4, + core_height_start: 1, + block_count: 1, + proposers, + validator_quorums: quorums, + current_validator_quorum_hash: current_quorum_hash, + current_proposer_versions: Some(current_proposer_versions), + current_identity_nonce_counter: identity_nonce_counter, + current_identity_contract_nonce_counter: identity_contract_nonce_counter, + current_votes: BTreeMap::default(), + start_time_ms: GENESIS_TIME_MS, + current_time_ms: end_time_ms + 1000, + instant_lock_quorums, + current_identities: Vec::new(), + }, + strategy.clone(), + config.clone(), + StrategyRandomness::SeedEntropy(3), + ); + + let withdrawal_documents_pooled = outcome + .abci_app + .platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::POOLED.into(), + DEFAULT_QUERY_LIMIT, + None, + platform_version, + ) + .unwrap(); + + let withdrawal_documents_broadcasted = outcome + .abci_app + .platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::BROADCASTED.into(), + DEFAULT_QUERY_LIMIT, + None, + platform_version, + ) + .unwrap(); + + // In this block we should have new withdrawals pooled + assert!(!withdrawal_documents_pooled.is_empty()); + + // And extra withdrawals broadcasted + let withdrawals_broadcasted_expected = + last_block_broadcasted_withdrawals_amount + outcome.withdrawals.len(); + assert_eq!( + withdrawal_documents_broadcasted.len(), + withdrawals_broadcasted_expected + ); + + (outcome, withdrawal_documents_broadcasted.len()) + }; + + // Update core state for newly broadcasted transactions + { + let mut core_state = shared_core_state.lock().unwrap(); + + // First, set all previously broadcasted transactions to Chainlocked + core_state + .asset_unlock_statuses + .iter_mut() + .for_each(|(index, status_result)| { + // Do not settle yet transactions that were broadcasted in the last block + status_result.index = *index; + status_result.status = AssetUnlockStatus::Chainlocked; + }); + + // Then increase chainlocked height, so that withdrawals for chainlocked transactions + // could be completed in the next block + // TODO: do we need this var? + chain_locked_height += 1; + core_state.chain_lock.block_height = chain_locked_height; + + // Then set all newly broadcasted transactions to Unknown + last_block_withdrawals.iter().for_each(|tx| { + let index = asset_unlock_index(tx); + + core_state.asset_unlock_statuses.insert( + index, + AssetUnlockStatusResult { + index, + status: AssetUnlockStatus::Unknown, + }, + ); + }); + + drop(core_state); + } + + // Run block 5 + // Previously broadcasted transactions should be settled after block 5, + // and their corresponding statuses should be changed to COMPLETED + let ( + ChainExecutionOutcome { + abci_app, + proposers, + validator_quorums: quorums, + current_validator_quorum_hash: current_quorum_hash, + current_proposer_versions, + end_time_ms, + withdrawals: last_block_withdrawals, + identity_nonce_counter, + identity_contract_nonce_counter, + instant_lock_quorums, + .. + }, + last_block_withdrawals_completed_amount, + ) = { + let outcome = continue_chain_for_strategy( + abci_app, + ChainExecutionParameters { + block_start: 5, + core_height_start: 1, + block_count: 1, + proposers, + validator_quorums: quorums, + current_validator_quorum_hash: current_quorum_hash, + current_proposer_versions: Some(current_proposer_versions), + current_identity_nonce_counter: identity_nonce_counter, + current_identity_contract_nonce_counter: identity_contract_nonce_counter, + current_votes: BTreeMap::default(), + start_time_ms: GENESIS_TIME_MS, + current_time_ms: end_time_ms + 1000, + instant_lock_quorums, + current_identities: Vec::new(), + }, + strategy.clone(), + config.clone(), + StrategyRandomness::SeedEntropy(4), + ); + + let withdrawal_documents_pooled = outcome + .abci_app + .platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::POOLED.into(), + DEFAULT_QUERY_LIMIT, + None, + platform_version, + ) + .unwrap(); + + let withdrawal_documents_broadcasted = outcome + .abci_app + .platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::BROADCASTED.into(), + DEFAULT_QUERY_LIMIT, + None, + platform_version, + ) + .unwrap(); + + let withdrawal_documents_completed = outcome + .abci_app + .platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::COMPLETE.into(), + DEFAULT_QUERY_LIMIT, + None, + platform_version, + ) + .unwrap(); + + // In this block we should have new withdrawals pooled + assert!(!withdrawal_documents_pooled.is_empty()); + + // And some withdrawals completed + let withdrawals_completed_expected = + // Withdrawals issued on {previous_block - 1} considered completed + last_block_broadcased_withdrawals_amount - last_block_withdrawals.len(); + assert_eq!( + withdrawal_documents_completed.len(), + withdrawals_completed_expected + ); + + // And extra withdrawals broadcasted + let withdrawals_broadcasted_expected = + // Withdrawals issued on previous block + withdrawals from this block are still in broadcasted state + last_block_withdrawals.len() + outcome.withdrawals.len(); + + assert_eq!( + withdrawal_documents_broadcasted.len(), + withdrawals_broadcasted_expected + ); + + (outcome, withdrawal_documents_completed.len()) + }; + + // Update state of the core before proceeding to the next block + { + // Simulate transactions being added to the core mempool + let mut core_state = shared_core_state.lock().unwrap(); + + let number_of_blocks_before_expiration: u32 = 48; + chain_locked_height += number_of_blocks_before_expiration; + + core_state.chain_lock.block_height = chain_locked_height; + + last_block_withdrawals.iter().for_each(|tx| { + let index = asset_unlock_index(tx); + + core_state.asset_unlock_statuses.insert( + index, + AssetUnlockStatusResult { + index, + status: AssetUnlockStatus::Unknown, + }, + ); + }); + } + + // Run block 6. + // Tests withdrawal expiration + let ChainExecutionOutcome { .. } = { + let outcome = continue_chain_for_strategy( + abci_app, + ChainExecutionParameters { + block_start: 6, + core_height_start: 1, + block_count: 1, + proposers, + validator_quorums: quorums, + current_validator_quorum_hash: current_quorum_hash, + current_proposer_versions: Some(current_proposer_versions), + current_identity_nonce_counter: identity_nonce_counter, + current_identity_contract_nonce_counter: identity_contract_nonce_counter, + current_votes: BTreeMap::default(), + start_time_ms: GENESIS_TIME_MS, + current_time_ms: end_time_ms + 1000, + instant_lock_quorums, + current_identities: Vec::new(), + }, + strategy.clone(), + config.clone(), + StrategyRandomness::SeedEntropy(5), + ); + + let withdrawal_documents_pooled = outcome + .abci_app + .platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::POOLED.into(), + DEFAULT_QUERY_LIMIT, + None, + platform_version, + ) + .unwrap(); + + let withdrawal_documents_broadcasted = outcome + .abci_app + .platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::BROADCASTED.into(), + DEFAULT_QUERY_LIMIT, + None, + platform_version, + ) + .unwrap(); + + let withdrawal_documents_completed = outcome + .abci_app + .platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::COMPLETE.into(), + DEFAULT_QUERY_LIMIT, + None, + platform_version, + ) + .unwrap(); + + let withdrawal_documents_expired = outcome + .abci_app + .platform + .drive + .fetch_oldest_withdrawal_documents_by_status( + withdrawals_contract::WithdrawalStatus::EXPIRED.into(), + DEFAULT_QUERY_LIMIT, + None, + platform_version, + ) + .unwrap(); + + // In this block we should have new withdrawals pooled + assert!(!withdrawal_documents_pooled.is_empty()); + + // Amount of completed withdrawals stays the same as in the last block + assert_eq!( + withdrawal_documents_completed.len(), + last_block_withdrawals_completed_amount + ); + + // And some withdrawals got expired + let withdrawals_expired_expected = + // Withdrawals issued on {previous_block - 1}, but not chainlocked yet, considered expired + last_block_broadcased_withdrawals_amount - last_block_withdrawals.len(); + + assert_eq!( + withdrawal_documents_expired.len(), + withdrawals_expired_expected + ); + + // And extra withdrawals broadcasted + let withdrawals_broadcasted_expected = + // Withdrawals issued on previous block + withdrawals from this block are still in broadcasted state + last_block_withdrawals.len() + outcome.withdrawals.len(); + + assert_eq!( + withdrawal_documents_broadcasted.len(), + withdrawals_broadcasted_expected + ); + + outcome + }; + } +} diff --git a/packages/rs-drive-proof-verifier/Cargo.toml b/packages/rs-drive-proof-verifier/Cargo.toml index 13dee4bfd7..325ed65235 100644 --- a/packages/rs-drive-proof-verifier/Cargo.toml +++ b/packages/rs-drive-proof-verifier/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "drive-proof-verifier" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true @@ -28,6 +28,7 @@ dpp = { path = "../rs-dpp", features = [ "bls-signatures", "document-value-conversion", "extended-document", + "core-types-serialization", ], default-features = false } bincode = { version = "2.0.0-rc.3", features = ["serde"], optional = true } platform-serialization-derive = { path = "../rs-platform-serialization-derive", optional = true } diff --git a/packages/rs-drive-proof-verifier/src/lib.rs b/packages/rs-drive-proof-verifier/src/lib.rs index 7e28b6691f..dfa6e41443 100644 --- a/packages/rs-drive-proof-verifier/src/lib.rs +++ b/packages/rs-drive-proof-verifier/src/lib.rs @@ -13,7 +13,10 @@ pub use proof::{FromProof, Length}; #[cfg(feature = "mocks")] pub use provider::MockContextProvider; pub use provider::{ContextProvider, DataContractProvider}; +/// From Request pub mod from_request; +/// Implementation of unproved verification +pub mod unproved; // Needed for #[derive(PlatformSerialize, PlatformDeserialize)] #[cfg(feature = "mocks")] diff --git a/packages/rs-drive-proof-verifier/src/proof.rs b/packages/rs-drive-proof-verifier/src/proof.rs index f3a256e301..57dec66d31 100644 --- a/packages/rs-drive-proof-verifier/src/proof.rs +++ b/packages/rs-drive-proof-verifier/src/proof.rs @@ -368,33 +368,13 @@ impl FromProof for IdentityPublicKeys { } }; - let key_request = match parse_key_request_type(&request_type)? { - KeyRequestType::SpecificKeys(specific_keys) => { - IdentityKeysRequest::new_specific_keys_query(&identity_id, specific_keys) - } - KeyRequestType::AllKeys => IdentityKeysRequest::new_all_keys_query(&identity_id, None), - KeyRequestType::SearchKey(criteria) => IdentityKeysRequest { - identity_id, - request_type: KeyRequestType::SearchKey(criteria), - limit, - offset, - }, - KeyRequestType::ContractBoundKey(id, purpose, kind) => IdentityKeysRequest { - identity_id, - request_type: KeyRequestType::ContractBoundKey(id, purpose, kind), - limit, - offset, - }, - KeyRequestType::ContractDocumentTypeBoundKey(id, s, purpose, kind) => { - IdentityKeysRequest { - identity_id, - request_type: KeyRequestType::ContractDocumentTypeBoundKey( - id, s, purpose, kind, - ), - limit, - offset, - } - } + let request_type = parse_key_request_type(&request_type)?; + + let key_request = IdentityKeysRequest { + identity_id, + request_type, + limit, + offset, }; tracing::debug!(?identity_id, "checking proof of identity keys"); diff --git a/packages/rs-drive-proof-verifier/src/types.rs b/packages/rs-drive-proof-verifier/src/types.rs index 1a6fe75d88..d28ba69302 100644 --- a/packages/rs-drive-proof-verifier/src/types.rs +++ b/packages/rs-drive-proof-verifier/src/types.rs @@ -28,6 +28,8 @@ use drive::grovedb::Element; use std::collections::{BTreeMap, BTreeSet}; use dpp::block::block_info::BlockInfo; +use dpp::core_types::validator_set::ValidatorSet; +use dpp::dashcore::QuorumHash; use dpp::voting::vote_info_storage::contested_document_vote_poll_winner_info::ContestedDocumentVotePollWinnerInfo; use drive::grovedb::query_result_type::Path; #[cfg(feature = "mocks")] @@ -325,6 +327,74 @@ pub struct ContestedVote(ContestedDocumentResourceVotePoll, ResourceVoteChoice); /// Votes casted by some identity. pub type ResourceVotesByIdentity = RetrievedObjects; +/// Represents the current state of quorums in the platform. +/// +/// This struct holds various information related to the current quorums, +/// including the list of quorum hashes, the current active quorum hash, +/// and details about the validators and their statuses. +/// +/// # Fields +/// +/// - `quorum_hashes`: A list of 32-byte hashes representing the active quorums. +/// - `current_quorum_hash`: A 32-byte hash identifying the currently active quorum. +/// This is the quorum that is currently responsible for platform operations. +/// - `validator_sets`: A collection of [`ValidatorSet`] structs, each representing +/// a set of validators for different quorums. This provides detailed information +/// about the members of each quorum. +/// - `last_block_proposer`: A vector of bytes representing the identity of the last +/// block proposer. This is typically the ProTxHash of the masternode that proposed +/// the most recent platform block. +/// - `last_platform_block_height`: The height of the most recent platform block. +/// This indicates the latest block height at the platform level, which may differ +/// from the core blockchain height. +/// - `last_core_block_height`: The height of the most recent core blockchain block +/// associated with the platform. This is the height of the blockchain where the +/// platform block was anchored. +/// +/// # Derives +/// +/// - `Debug`: Provides a debug representation of the `CurrentQuorumsInfo` struct, useful +/// for logging and debugging purposes. +/// - `Clone`: Allows the `CurrentQuorumsInfo` struct to be cloned, creating a deep copy +/// of its contents. +/// +/// # Conditional Derives +/// +/// When the `mocks` feature is enabled, the following derives and attributes are applied: +/// +/// - `Encode`: Allows the struct to be serialized into a binary format using the `bincode` crate. +/// - `Decode`: Allows the struct to be deserialized from a binary format using the `bincode` crate. +/// - `PlatformSerialize`: Enables serialization of the struct using the platform-specific +/// serialization format. +/// - `PlatformDeserialize`: Enables deserialization of the struct using the platform-specific +/// deserialization format. +/// - `platform_serialize(unversioned)`: Specifies that the struct should be serialized +/// without including a version field in the serialized data. +/// +/// This structure is typically used in scenarios where the state of the current quorums +/// needs to be accessed, for example, when validating or proposing new blocks, or when +/// determining the active set of validators. +#[derive(Debug, Clone)] +#[cfg_attr( + feature = "mocks", + derive(Encode, Decode, PlatformSerialize, PlatformDeserialize), + platform_serialize(unversioned) +)] +pub struct CurrentQuorumsInfo { + /// A list of 32-byte hashes representing the active quorums. + pub quorum_hashes: Vec<[u8; 32]>, + /// A 32-byte hash identifying the currently active quorum. + pub current_quorum_hash: [u8; 32], + /// A collection of [`ValidatorSet`] structs, each representing a set of validators for different quorums. + pub validator_sets: Vec, + /// A vector of bytes representing the identity of the last block proposer. + pub last_block_proposer: [u8; 32], + /// The height of the most recent platform block. + pub last_platform_block_height: u64, + /// The height of the most recent core blockchain block associated with the platform. + pub last_core_block_height: u32, +} + /// Prefunded specialized balance. #[derive(Debug, derive_more::From, Copy, Clone)] #[cfg_attr( diff --git a/packages/rs-drive-proof-verifier/src/unproved.rs b/packages/rs-drive-proof-verifier/src/unproved.rs new file mode 100644 index 0000000000..c2f30c6452 --- /dev/null +++ b/packages/rs-drive-proof-verifier/src/unproved.rs @@ -0,0 +1,275 @@ +use crate::types::CurrentQuorumsInfo; +use crate::Error; +use dapi_grpc::platform::v0::ResponseMetadata; +use dapi_grpc::platform::v0::{self as platform}; +use dpp::bls_signatures::PublicKey as BlsPublicKey; +use dpp::core_types::validator::v0::ValidatorV0; +use dpp::core_types::validator_set::v0::ValidatorSetV0; +use dpp::core_types::validator_set::ValidatorSet; +use dpp::dashcore::hashes::Hash; +use dpp::dashcore::{Network, ProTxHash, PubkeyHash, QuorumHash}; +use dpp::version::PlatformVersion; +use std::collections::BTreeMap; + +/// Trait for parsing unproved responses from the Platform. +/// +/// This trait defines methods for extracting data from responses received from the Platform +/// without the need for cryptographic proof validation. It is primarily used for scenarios where +/// the proof data is not available or not required, and only the data itself is needed. +/// +/// ## Associated Types +/// +/// - `Request`: The type of the request sent to the server. This represents the format of the +/// data that the platform expects when making a query. +/// - `Response`: The type of the response received from the server. This represents the format of +/// the data returned by the platform after executing the query. +/// +/// ## Methods +/// +/// - `maybe_from_unproved`: Parses the response to retrieve the requested object, if any. +/// - `maybe_from_unproved_with_metadata`: Parses the response to retrieve the requested object +/// along with response metadata, if any. +/// - `from_unproved`: Retrieves the requested object from the response, returning an error if the +/// object is not found. +/// - `from_unproved_with_metadata`: Retrieves the requested object from the response along with +/// metadata, returning an error if the object is not found. +/// +/// ``` +pub trait FromUnproved { + /// Request type for which this trait is implemented. + type Request; + /// Response type for which this trait is implemented. + type Response; + + /// Parse the received response and retrieve the requested object, if any. + /// + /// # Arguments + /// + /// * `request`: The request sent to the server. + /// * `response`: The response received from the server. + /// * `network`: The network we are using (Mainnet/Testnet/Devnet/Regtest). + /// * `platform_version`: The platform version that should be used. + /// + /// # Returns + /// + /// * `Ok(Some(object))` when the requested object was found in the response. + /// * `Ok(None)` when the requested object was not found. + /// * `Err(Error)` when parsing fails or data is invalid. + fn maybe_from_unproved, O: Into>( + request: I, + response: O, + network: Network, + platform_version: &PlatformVersion, + ) -> Result, Error> + where + Self: Sized, + { + Self::maybe_from_unproved_with_metadata(request, response, network, platform_version) + .map(|maybe_result| maybe_result.0) + } + + /// Parse the received response and retrieve the requested object along with metadata, if any. + /// + /// # Arguments + /// + /// * `request`: The request sent to the server. + /// * `response`: The response received from the server. + /// * `network`: The network we are using (Mainnet/Testnet/Devnet/Regtest). + /// * `platform_version`: The platform version that should be used. + /// + /// # Returns + /// + /// * `Ok((Some(object), metadata))` when the requested object was found. + /// * `Ok((None, metadata))` when the requested object was not found. + /// * `Err(Error)` when parsing fails or data is invalid. + fn maybe_from_unproved_with_metadata, O: Into>( + request: I, + response: O, + network: Network, + platform_version: &PlatformVersion, + ) -> Result<(Option, ResponseMetadata), Error> + where + Self: Sized; + + /// Retrieve the requested object from the response. + /// + /// # Arguments + /// + /// * `request`: The request sent to the server. + /// * `response`: The response received from the server. + /// * `network`: The network we are using. + /// * `platform_version`: The platform version that should be used. + /// + /// # Returns + /// + /// * `Ok(object)` when the requested object was found. + /// * `Err(Error::NotFound)` when the requested object was not found. + /// * `Err(Error)` when parsing fails or data is invalid. + fn from_unproved, O: Into>( + request: I, + response: O, + network: Network, + platform_version: &PlatformVersion, + ) -> Result + where + Self: Sized, + { + Self::maybe_from_unproved(request, response, network, platform_version)? + .ok_or(Error::NotFound) + } + + /// Retrieve the requested object from the response along with metadata. + /// + /// # Arguments + /// + /// * `request`: The request sent to the server. + /// * `response`: The response received from the server. + /// * `network`: The network we are using. + /// * `platform_version`: The platform version that should be used. + /// + /// # Returns + /// + /// * `Ok((object, metadata))` when the requested object was found. + /// * `Err(Error::NotFound)` when the requested object was not found. + /// * `Err(Error)` when parsing fails or data is invalid. + fn from_unproved_with_metadata, O: Into>( + request: I, + response: O, + network: Network, + platform_version: &PlatformVersion, + ) -> Result<(Self, ResponseMetadata), Error> + where + Self: Sized, + { + let (main_item, response_metadata) = + Self::maybe_from_unproved_with_metadata(request, response, network, platform_version)?; + Ok((main_item.ok_or(Error::NotFound)?, response_metadata)) + } +} + +impl FromUnproved for CurrentQuorumsInfo { + type Request = platform::GetCurrentQuorumsInfoRequest; + type Response = platform::GetCurrentQuorumsInfoResponse; + + fn maybe_from_unproved_with_metadata, O: Into>( + _request: I, + response: O, + _network: Network, + _platform_version: &PlatformVersion, + ) -> Result<(Option, ResponseMetadata), Error> + where + Self: Sized, + { + // Convert the response into a GetCurrentQuorumsInfoResponse + let response: platform::GetCurrentQuorumsInfoResponse = response.into(); + + // Extract metadata from the response + let metadata = match &response.version { + Some(platform::get_current_quorums_info_response::Version::V0(ref v0)) => { + v0.metadata.clone() + } + None => None, + } + .ok_or(Error::EmptyResponseMetadata)?; + + // Parse response based on the version field + let info = match response.version.ok_or(Error::EmptyVersion)? { + platform::get_current_quorums_info_response::Version::V0(v0) => { + // Extract quorum hashes + let quorum_hashes = v0 + .quorum_hashes + .into_iter() + .map(|q_hash| { + let mut q_hash_array = [0u8; 32]; + if q_hash.len() != 32 { + return Err(Error::ProtocolError { + error: "Invalid quorum_hash length".to_string(), + }); + } + q_hash_array.copy_from_slice(&q_hash); + Ok(q_hash_array) + }) + .collect::, Error>>()?; + + // Extract current quorum hash + let mut current_quorum_hash = [0u8; 32]; + if v0.current_quorum_hash.len() != 32 { + return Err(Error::ProtocolError { + error: "Invalid current_quorum_hash length".to_string(), + }); + } + current_quorum_hash.copy_from_slice(&v0.current_quorum_hash); + + let mut last_block_proposer = [0u8; 32]; + if v0.last_block_proposer.len() != 32 { + return Err(Error::ProtocolError { + error: "Invalid last_block_proposer length".to_string(), + }); + } + last_block_proposer.copy_from_slice(&v0.last_block_proposer); + + // Extract validator sets + let validator_sets = + v0.validator_sets + .into_iter() + .map(|vs| { + // Parse the ValidatorSetV0 + let mut quorum_hash = [0u8; 32]; + quorum_hash.copy_from_slice(&vs.quorum_hash); + + // Parse ValidatorV0 members into a BTreeMap + let members = vs + .members + .into_iter() + .map(|member| { + let pro_tx_hash = ProTxHash::from_slice(&member.pro_tx_hash) + .map_err(|_| Error::ProtocolError { + error: "Invalid ProTxHash format".to_string(), + })?; + let validator = ValidatorV0 { + pro_tx_hash, + public_key: None, // Assuming it's not provided here + node_ip: member.node_ip, + node_id: PubkeyHash::from_slice(&[0; 32]).unwrap(), // Placeholder, since not provided + core_port: 0, // Placeholder, since not provided + platform_http_port: 0, // Placeholder, since not provided + platform_p2p_port: 0, // Placeholder, since not provided + is_banned: member.is_banned, + }; + Ok((pro_tx_hash, validator)) + }) + .collect::, Error>>()?; + + Ok(ValidatorSet::V0(ValidatorSetV0 { + quorum_hash: QuorumHash::from_slice(quorum_hash.as_slice()) + .map_err(|_| Error::ProtocolError { + error: "Invalid Quorum Hash format".to_string(), + })?, + quorum_index: None, // Assuming it's not provided here + core_height: vs.core_height, + members, + threshold_public_key: BlsPublicKey::from_bytes( + &vs.threshold_public_key, + ) + .map_err(|_| Error::ProtocolError { + error: "Invalid BlsPublicKey format".to_string(), + })?, + })) + }) + .collect::, Error>>()?; + + // Create the CurrentQuorumsInfo struct + Ok::(CurrentQuorumsInfo { + quorum_hashes, + current_quorum_hash, + validator_sets, + last_block_proposer, + last_platform_block_height: metadata.height, + last_core_block_height: metadata.core_chain_locked_height, + }) + } + }?; + + Ok((Some(info), metadata)) + } +} diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index bc9eb09c3f..15c207cc23 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "drive" description = "Dash drive built on top of GroveDB" -version = "1.3.0" +version = "1.4.0-dev.1" authors = [ "Samuel Westrich ", "Ivan Shumkov ", diff --git a/packages/rs-drive/src/drive/identity/key/fetch/fetch_identity_keys/v0/mod.rs b/packages/rs-drive/src/drive/identity/key/fetch/fetch_identity_keys/v0/mod.rs index d9a4edf0fa..877634eec0 100644 --- a/packages/rs-drive/src/drive/identity/key/fetch/fetch_identity_keys/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/key/fetch/fetch_identity_keys/v0/mod.rs @@ -1,5 +1,6 @@ use crate::drive::identity::key::fetch::KeyRequestType::{ - AllKeys, ContractBoundKey, ContractDocumentTypeBoundKey, SearchKey, SpecificKeys, + AllKeys, ContractBoundKey, ContractDocumentTypeBoundKey, RecentWithdrawalKeys, SearchKey, + SpecificKeys, }; use crate::drive::identity::key::fetch::{ IdentityKeysRequest, IdentityPublicKeyResult, KeyKindRequestType, @@ -79,10 +80,11 @@ impl Drive { T::try_from_path_key_optional(result, platform_version) } ContractBoundKey(_, _, KeyKindRequestType::AllKeysOfKindRequest) - | ContractDocumentTypeBoundKey(_, _, _, KeyKindRequestType::AllKeysOfKindRequest) => { + | ContractDocumentTypeBoundKey(_, _, _, KeyKindRequestType::AllKeysOfKindRequest) + | RecentWithdrawalKeys => { let path_query = key_request.into_path_query(); - let (result, _) = self.grove_get_raw_path_query( + let (result, _) = self.grove_get_path_query( &path_query, transaction, QueryPathKeyElementTrioResultType, diff --git a/packages/rs-drive/src/drive/identity/key/fetch/mod.rs b/packages/rs-drive/src/drive/identity/key/fetch/mod.rs index 4567278c78..248e7cd904 100644 --- a/packages/rs-drive/src/drive/identity/key/fetch/mod.rs +++ b/packages/rs-drive/src/drive/identity/key/fetch/mod.rs @@ -22,6 +22,7 @@ use { }; // Conditional imports for the feature "server" +use crate::drive::identity::identity_transfer_keys_path_vec; #[cfg(feature = "server")] use { crate::error::{drive::DriveError, fee::FeeError, identity::IdentityError, Error}, @@ -74,6 +75,8 @@ pub enum KeyRequestType { SpecificKeys(Vec), /// Search for keys on an identity SearchKey(BTreeMap>), + /// Recent withdrawal keys + RecentWithdrawalKeys, /// Search for contract bound keys ContractBoundKey([u8; 32], Purpose, KeyKindRequestType), /// Search for contract bound keys @@ -655,7 +658,9 @@ impl IdentityKeysRequest { .fee_version .processing .fetch_single_identity_key_processing_cost), - SearchKey(_search) => todo!(), + SearchKey(_) => Err(Error::Fee(FeeError::OperationNotAllowed( + "You can not get costs for requesting search key", + ))), ContractBoundKey(_, _, key_kind) | ContractDocumentTypeBoundKey(_, _, _, key_kind) => { match key_kind { CurrentKeyOfKindRequest => { @@ -670,6 +675,11 @@ impl IdentityKeysRequest { ))), } } + KeyRequestType::RecentWithdrawalKeys => Ok(self.limit.unwrap_or(10) as Credits + * platform_version + .fee_version + .processing + .fetch_single_identity_key_processing_cost), } } @@ -927,6 +937,19 @@ impl IdentityKeysRequest { }, } } + KeyRequestType::RecentWithdrawalKeys => { + let query_keys_path = identity_transfer_keys_path_vec(&identity_id); + let mut query = Query::new_with_direction(false); + query.insert_all(); + PathQuery { + path: query_keys_path, + query: SizedQuery { + query, + limit, + offset, + }, + } + } } } diff --git a/packages/rs-drive/src/drive/identity/mod.rs b/packages/rs-drive/src/drive/identity/mod.rs index 65928b5ecb..1922e74b88 100644 --- a/packages/rs-drive/src/drive/identity/mod.rs +++ b/packages/rs-drive/src/drive/identity/mod.rs @@ -259,7 +259,6 @@ pub(crate) fn identity_query_keys_purpose_tree_path_vec( /// identity query keys security level tree path vec #[cfg(feature = "server")] -/// Identity query keys security level tree path vec pub(crate) fn identity_query_keys_security_level_tree_path_vec( identity_id: &[u8], security_level: SecurityLevel, @@ -288,7 +287,6 @@ pub(crate) fn identity_query_keys_for_direct_searchable_reference_full_tree_path ] } -/// identity query keys full tree path #[cfg(feature = "server")] /// Identity query keys full tree path pub(crate) fn identity_query_keys_for_authentication_full_tree_path<'a>( @@ -304,6 +302,28 @@ pub(crate) fn identity_query_keys_for_authentication_full_tree_path<'a>( ] } +/// Identity query keys for transfer full tree path +#[cfg(feature = "server")] +pub fn identity_transfer_keys_tree_path(identity_id: &[u8]) -> [&[u8]; 5] { + [ + Into::<&[u8; 1]>::into(RootTree::Identities), + identity_id, + Into::<&[u8; 1]>::into(IdentityRootStructure::IdentityTreeKeyReferences), + Into::<&[u8; 1]>::into(Purpose::TRANSFER), + Into::<&[u8; 1]>::into(SecurityLevel::CRITICAL), + ] +} + +/// Identity query keys for transfer full tree path as vec +pub fn identity_transfer_keys_path_vec(identity_id: &[u8]) -> Vec> { + vec![ + vec![RootTree::Identities as u8], + identity_id.to_vec(), + vec![IdentityRootStructure::IdentityTreeKeyReferences as u8], + vec![Purpose::TRANSFER as u8], + ] +} + /// The root structure of identities #[cfg(any(feature = "server", feature = "verify"))] #[repr(u8)] diff --git a/packages/rs-drive/src/drive/identity/withdrawals/document/find_withdrawal_documents_by_status_and_transaction_indices/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/document/find_withdrawal_documents_by_status_and_transaction_indices/mod.rs index a3545ad539..d4214a53e7 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/document/find_withdrawal_documents_by_status_and_transaction_indices/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/document/find_withdrawal_documents_by_status_and_transaction_indices/mod.rs @@ -1,11 +1,11 @@ mod v0; -use crate::drive::identity::withdrawals::WithdrawalTransactionIndex; use crate::drive::Drive; use crate::error::drive::DriveError; use crate::error::Error; use dpp::data_contracts::withdrawals_contract; use dpp::document::Document; +use dpp::withdrawal::WithdrawalTransactionIndex; use grovedb::TransactionArg; use platform_version::version::PlatformVersion; diff --git a/packages/rs-drive/src/drive/identity/withdrawals/document/find_withdrawal_documents_by_status_and_transaction_indices/v0/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/document/find_withdrawal_documents_by_status_and_transaction_indices/v0/mod.rs index 0d0dda43ed..b04bc85b5b 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/document/find_withdrawal_documents_by_status_and_transaction_indices/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/document/find_withdrawal_documents_by_status_and_transaction_indices/v0/mod.rs @@ -1,5 +1,4 @@ use crate::drive::document::query::QueryDocumentsOutcomeV0Methods; -use crate::drive::identity::withdrawals::WithdrawalTransactionIndex; use crate::drive::Drive; use crate::error::Error; use crate::query::{DriveDocumentQuery, InternalClauses, OrderClause, WhereClause}; @@ -8,6 +7,7 @@ use dpp::data_contracts::withdrawals_contract; use dpp::data_contracts::withdrawals_contract::v1::document_types::withdrawal; use dpp::document::Document; use dpp::platform_value::Value; +use dpp::withdrawal::WithdrawalTransactionIndex; use grovedb::TransactionArg; use indexmap::IndexMap; use platform_version::version::PlatformVersion; @@ -97,7 +97,6 @@ impl Drive { #[cfg(test)] mod tests { use crate::config::DEFAULT_QUERY_LIMIT; - use crate::drive::identity::withdrawals::WithdrawalTransactionIndex; use crate::util::test_helpers::setup::{ setup_document, setup_drive_with_initial_state_structure, setup_system_data_contract, }; @@ -110,6 +109,7 @@ mod tests { use dpp::tests::fixtures::get_withdrawal_document_fixture; use dpp::version::PlatformVersion; use dpp::withdrawal::Pooling; + use dpp::withdrawal::WithdrawalTransactionIndex; use super::*; diff --git a/packages/rs-drive/src/drive/identity/withdrawals/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/mod.rs index 57f26a5b5e..1571e0e230 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/mod.rs @@ -5,8 +5,3 @@ pub mod document; pub mod paths; /// Functions related to withdrawal transactions pub mod transaction; - -/// Simple type alias for withdrawal transaction with it's index -pub type WithdrawalTransactionIndexAndBytes = (WithdrawalTransactionIndex, Vec); -/// Transaction index type -pub type WithdrawalTransactionIndex = u64; diff --git a/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/add_update_next_withdrawal_transaction_index_operation/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/add_update_next_withdrawal_transaction_index_operation/mod.rs index 5554f8a4f6..59c820433d 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/add_update_next_withdrawal_transaction_index_operation/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/add_update_next_withdrawal_transaction_index_operation/mod.rs @@ -1,10 +1,10 @@ mod v0; -use crate::drive::identity::withdrawals::WithdrawalTransactionIndex; use crate::drive::Drive; use crate::error::drive::DriveError; use crate::error::Error; use crate::util::batch::DriveOperation; +use dpp::withdrawal::WithdrawalTransactionIndex; use platform_version::version::PlatformVersion; impl Drive { diff --git a/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/add_update_next_withdrawal_transaction_index_operation/v0/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/add_update_next_withdrawal_transaction_index_operation/v0/mod.rs index 4c162fd5ea..fb4b7f39c0 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/add_update_next_withdrawal_transaction_index_operation/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/add_update_next_withdrawal_transaction_index_operation/v0/mod.rs @@ -1,7 +1,7 @@ -use crate::drive::identity::withdrawals::WithdrawalTransactionIndex; use crate::drive::Drive; use crate::util::batch::drive_op_batch::WithdrawalOperationType; use crate::util::batch::DriveOperation; +use dpp::withdrawal::WithdrawalTransactionIndex; impl Drive { pub(super) fn add_update_next_withdrawal_transaction_index_operation_v0( diff --git a/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/fetch_next_withdrawal_transaction_index/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/fetch_next_withdrawal_transaction_index/mod.rs index c3ae1dae3c..bc8268b257 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/fetch_next_withdrawal_transaction_index/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/fetch_next_withdrawal_transaction_index/mod.rs @@ -1,7 +1,7 @@ -use crate::drive::identity::withdrawals::WithdrawalTransactionIndex; use crate::drive::Drive; use crate::error::drive::DriveError; use crate::error::Error; +use dpp::withdrawal::WithdrawalTransactionIndex; use grovedb::TransactionArg; use platform_version::version::PlatformVersion; diff --git a/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/fetch_next_withdrawal_transaction_index/v0/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/fetch_next_withdrawal_transaction_index/v0/mod.rs index bdc01546dd..e0ca52ed8b 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/fetch_next_withdrawal_transaction_index/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/transaction/index/fetch_next_withdrawal_transaction_index/v0/mod.rs @@ -1,8 +1,8 @@ use crate::drive::identity::withdrawals::paths::WITHDRAWAL_TRANSACTIONS_NEXT_INDEX_KEY; -use crate::drive::identity::withdrawals::WithdrawalTransactionIndex; use crate::drive::{Drive, RootTree}; use crate::error::drive::DriveError; use crate::error::Error; +use dpp::withdrawal::WithdrawalTransactionIndex; use grovedb::{Element, TransactionArg}; use platform_version::version::PlatformVersion; diff --git a/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/add_enqueue_untied_withdrawal_transaction_operations/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/add_enqueue_untied_withdrawal_transaction_operations/mod.rs index d0e8168790..1b6a52728c 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/add_enqueue_untied_withdrawal_transaction_operations/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/add_enqueue_untied_withdrawal_transaction_operations/mod.rs @@ -1,8 +1,8 @@ -use crate::drive::identity::withdrawals::WithdrawalTransactionIndexAndBytes; use crate::drive::Drive; use crate::error::drive::DriveError; use crate::error::Error; use crate::util::batch::DriveOperation; +use dpp::withdrawal::WithdrawalTransactionIndexAndBytes; use platform_version::version::PlatformVersion; mod v0; diff --git a/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/add_enqueue_untied_withdrawal_transaction_operations/v0/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/add_enqueue_untied_withdrawal_transaction_operations/v0/mod.rs index b14f505218..a9d8a604e2 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/add_enqueue_untied_withdrawal_transaction_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/add_enqueue_untied_withdrawal_transaction_operations/v0/mod.rs @@ -1,7 +1,7 @@ -use crate::drive::identity::withdrawals::WithdrawalTransactionIndexAndBytes; use crate::drive::Drive; use crate::util::batch::drive_op_batch::WithdrawalOperationType; use crate::util::batch::DriveOperation; +use dpp::withdrawal::WithdrawalTransactionIndexAndBytes; impl Drive { pub(super) fn add_enqueue_untied_withdrawal_transaction_operations_v0( diff --git a/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/dequeue_untied_withdrawal_transactions/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/dequeue_untied_withdrawal_transactions/mod.rs index 3fadfcc5c8..3423114aaf 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/dequeue_untied_withdrawal_transactions/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/dequeue_untied_withdrawal_transactions/mod.rs @@ -1,10 +1,10 @@ mod v0; -use crate::drive::identity::withdrawals::WithdrawalTransactionIndexAndBytes; use crate::drive::Drive; use crate::error::drive::DriveError; use crate::error::Error; use crate::util::batch::DriveOperation; +use dpp::withdrawal::WithdrawalTransactionIndexAndBytes; use grovedb::TransactionArg; use platform_version::version::PlatformVersion; diff --git a/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/dequeue_untied_withdrawal_transactions/v0/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/dequeue_untied_withdrawal_transactions/v0/mod.rs index a89b788b10..6edeaa9822 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/dequeue_untied_withdrawal_transactions/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/dequeue_untied_withdrawal_transactions/v0/mod.rs @@ -1,13 +1,11 @@ use crate::drive::identity::withdrawals::paths::get_withdrawal_transactions_queue_path_vec; -use crate::drive::identity::withdrawals::{ - WithdrawalTransactionIndex, WithdrawalTransactionIndexAndBytes, -}; use crate::drive::Drive; use crate::error::drive::DriveError; use crate::error::Error; use crate::query::{Query, QueryItem}; use crate::util::batch::drive_op_batch::WithdrawalOperationType; use crate::util::batch::DriveOperation; +use dpp::withdrawal::{WithdrawalTransactionIndex, WithdrawalTransactionIndexAndBytes}; use grovedb::query_result_type::QueryResultType; use grovedb::{Element, PathQuery, SizedQuery, TransactionArg}; use platform_version::version::PlatformVersion; @@ -22,7 +20,7 @@ impl Drive { drive_operation_types: &mut Vec, platform_version: &PlatformVersion, ) -> Result, Error> { - let mut query = Query::new(); + let mut query = Query::new_with_direction(true); query.insert_item(QueryItem::RangeFull(RangeFull)); @@ -39,7 +37,7 @@ impl Drive { .grove .query_raw( &path_query, - transaction.is_some(), + true, true, true, QueryResultType::QueryKeyElementPairResultType, diff --git a/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/mod.rs b/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/mod.rs index 85621a35e4..e519f56bd5 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/mod.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/mod.rs @@ -5,15 +5,13 @@ pub mod dequeue_untied_withdrawal_transactions; #[cfg(test)] mod tests { - use crate::drive::identity::withdrawals::{ - WithdrawalTransactionIndex, WithdrawalTransactionIndexAndBytes, - }; use crate::util::batch::DriveOperation; use dpp::block::block_info::BlockInfo; use dpp::block::epoch::Epoch; use crate::util::test_helpers::setup::setup_drive_with_initial_state_structure; use dpp::version::PlatformVersion; + use dpp::withdrawal::{WithdrawalTransactionIndex, WithdrawalTransactionIndexAndBytes}; #[test] fn test_enqueue_and_dequeue() { diff --git a/packages/rs-drive/src/state_transition_action/identity/identity_credit_withdrawal/transformer.rs b/packages/rs-drive/src/state_transition_action/identity/identity_credit_withdrawal/transformer.rs index 6ea2449408..5f619841bb 100644 --- a/packages/rs-drive/src/state_transition_action/identity/identity_credit_withdrawal/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/identity/identity_credit_withdrawal/transformer.rs @@ -1,20 +1,43 @@ +use crate::drive::Drive; +use crate::error::Error; use crate::state_transition_action::identity::identity_credit_withdrawal::v0::IdentityCreditWithdrawalTransitionActionV0; use crate::state_transition_action::identity::identity_credit_withdrawal::IdentityCreditWithdrawalTransitionAction; +use dpp::block::block_info::BlockInfo; use dpp::state_transition::identity_credit_withdrawal_transition::IdentityCreditWithdrawalTransition; +use dpp::validation::ConsensusValidationResult; +use grovedb::TransactionArg; +use platform_version::version::PlatformVersion; impl IdentityCreditWithdrawalTransitionAction { - /// from - pub fn from_identity_credit_withdrawal( + /// try from an identity credit withdrawal + pub fn try_from_identity_credit_withdrawal( + drive: &Drive, + tx: TransactionArg, identity_credit_withdrawal: &IdentityCreditWithdrawalTransition, - creation_time_ms: u64, - ) -> Self { + block_info: &BlockInfo, + platform_version: &PlatformVersion, + ) -> Result, Error> { match identity_credit_withdrawal { IdentityCreditWithdrawalTransition::V0(v0) => { - IdentityCreditWithdrawalTransitionActionV0::from_identity_credit_withdrawal( - v0, - creation_time_ms, + Ok(ConsensusValidationResult::new_with_data( + IdentityCreditWithdrawalTransitionActionV0::from_identity_credit_withdrawal_v0( + v0, + block_info.time_ms, + ) + .into(), + )) + } + IdentityCreditWithdrawalTransition::V1(v1) => { + IdentityCreditWithdrawalTransitionActionV0::try_from_identity_credit_withdrawal_v1( + drive, + tx, + v1, + block_info, + platform_version, ) - .into() + .map(|consensus_validation_result| { + consensus_validation_result.map(|withdrawal| withdrawal.into()) + }) } } } diff --git a/packages/rs-drive/src/state_transition_action/identity/identity_credit_withdrawal/v0/transformer.rs b/packages/rs-drive/src/state_transition_action/identity/identity_credit_withdrawal/v0/transformer.rs index 742476740c..8da24e5759 100644 --- a/packages/rs-drive/src/state_transition_action/identity/identity_credit_withdrawal/v0/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/identity/identity_credit_withdrawal/v0/transformer.rs @@ -1,14 +1,33 @@ +use crate::drive::identity::key::fetch::{ + IdentityKeysRequest, KeyIDIdentityPublicKeyPairBTreeMap, KeyRequestType, +}; +use crate::drive::Drive; +use crate::error::Error; use crate::state_transition_action::identity::identity_credit_withdrawal::v0::IdentityCreditWithdrawalTransitionActionV0; +use dpp::block::block_info::BlockInfo; +use dpp::consensus::state::identity::identity_public_key_is_disabled_error::IdentityPublicKeyIsDisabledError; +use dpp::consensus::state::identity::missing_transfer_key_error::MissingTransferKeyError; +use dpp::consensus::state::identity::no_transfer_key_for_core_withdrawal_available_error::NoTransferKeyForCoreWithdrawalAvailableError; +use dpp::consensus::state::state_error::StateError; +use dpp::consensus::ConsensusError; use dpp::data_contracts::withdrawals_contract; use dpp::data_contracts::withdrawals_contract::v1::document_types::withdrawal; use dpp::document::{Document, DocumentV0}; +use dpp::identity::core_script::CoreScript; +use dpp::identity::hash::IdentityPublicKeyHashMethodsV0; +use dpp::identity::identity_public_key::accessors::v0::IdentityPublicKeyGettersV0; +use dpp::identity::IdentityPublicKey; use dpp::platform_value::platform_value; +use dpp::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; use dpp::state_transition::state_transitions::identity::identity_credit_withdrawal_transition::v0::IdentityCreditWithdrawalTransitionV0; +use dpp::validation::ConsensusValidationResult; use dpp::withdrawal::Pooling; +use grovedb::TransactionArg; +use platform_version::version::PlatformVersion; impl IdentityCreditWithdrawalTransitionActionV0 { /// from identity credit withdrawal - pub fn from_identity_credit_withdrawal( + pub fn from_identity_credit_withdrawal_v0( identity_credit_withdrawal: &IdentityCreditWithdrawalTransitionV0, creation_time_ms: u64, ) -> Self { @@ -57,4 +76,121 @@ impl IdentityCreditWithdrawalTransitionActionV0 { user_fee_increase: identity_credit_withdrawal.user_fee_increase, } } + + /// from identity credit withdrawal v1 + pub fn try_from_identity_credit_withdrawal_v1( + drive: &Drive, + tx: TransactionArg, + identity_credit_withdrawal: &IdentityCreditWithdrawalTransitionV1, + block_info: &BlockInfo, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let output_script_bytes = if let Some(output_script) = + &identity_credit_withdrawal.output_script + { + output_script.to_bytes() + } else { + let key_request = IdentityKeysRequest { + identity_id: identity_credit_withdrawal.identity_id.to_buffer(), + request_type: KeyRequestType::RecentWithdrawalKeys, + limit: None, + offset: None, + }; + let key: Option = + drive.fetch_identity_keys(key_request, tx, platform_version)?; + let Some(mut key) = key else { + return Ok(ConsensusValidationResult::new_with_error( + ConsensusError::StateError(StateError::MissingTransferKeyError( + MissingTransferKeyError::new(identity_credit_withdrawal.identity_id), + )), + )); + }; + if key.is_disabled() { + // The first key is disabled, let's look at some more withdrawal keys to find one that isn't disabled + let after_first_key_request = IdentityKeysRequest { + identity_id: identity_credit_withdrawal.identity_id.to_buffer(), + request_type: KeyRequestType::RecentWithdrawalKeys, + limit: Some(5), + offset: Some(1), + }; + let other_keys: KeyIDIdentityPublicKeyPairBTreeMap = + drive.fetch_identity_keys(after_first_key_request, tx, platform_version)?; + + if let Some(found_non_disabled_key) = other_keys + .values() + .rev() + .find(|identity_public_key| !identity_public_key.is_disabled()) + .cloned() + { + key = found_non_disabled_key + } else { + return Ok(ConsensusValidationResult::new_with_error( + ConsensusError::StateError(StateError::IdentityPublicKeyIsDisabledError( + IdentityPublicKeyIsDisabledError::new(key.id()), + )), + )); + } + } + if !key.key_type().is_core_address_key_type() { + return Ok(ConsensusValidationResult::new_with_error( + ConsensusError::StateError( + StateError::NoTransferKeyForCoreWithdrawalAvailableError( + NoTransferKeyForCoreWithdrawalAvailableError::new( + identity_credit_withdrawal.identity_id, + ), + ), + ), + )); + } + // We should get the withdrawal address + CoreScript::new_p2pkh(key.public_key_hash()?).to_bytes() + }; + + let mut entropy = Vec::new(); + entropy.extend_from_slice(&identity_credit_withdrawal.nonce.to_be_bytes()); + entropy.extend_from_slice(output_script_bytes.as_slice()); + + let document_id = Document::generate_document_id_v0( + &withdrawals_contract::ID, + &identity_credit_withdrawal.identity_id, + withdrawal::NAME, + &entropy, + ); + + let document_data = platform_value!({ + withdrawal::properties::AMOUNT: identity_credit_withdrawal.amount, + withdrawal::properties::CORE_FEE_PER_BYTE: identity_credit_withdrawal.core_fee_per_byte, + // TODO(withdrawals): replace with actual value from state transition once pooling is done + withdrawal::properties::POOLING: Pooling::Never, + withdrawal::properties::OUTPUT_SCRIPT: output_script_bytes, + withdrawal::properties::STATUS: withdrawals_contract::WithdrawalStatus::QUEUED, + }); + + let withdrawal_document = DocumentV0 { + id: document_id, + owner_id: identity_credit_withdrawal.identity_id, + properties: document_data.into_btree_string_map().unwrap(), + revision: Some(1), + created_at: Some(block_info.time_ms), + updated_at: Some(block_info.time_ms), + transferred_at: None, + created_at_block_height: None, + updated_at_block_height: None, + transferred_at_block_height: None, + created_at_core_block_height: None, + updated_at_core_block_height: None, + transferred_at_core_block_height: None, + } + .into(); + + Ok(ConsensusValidationResult::new_with_data( + IdentityCreditWithdrawalTransitionActionV0 { + identity_id: identity_credit_withdrawal.identity_id, + nonce: identity_credit_withdrawal.nonce, + prepared_withdrawal_document: withdrawal_document, + amount: identity_credit_withdrawal.amount, + user_fee_increase: identity_credit_withdrawal.user_fee_increase, + }, + )) + } } diff --git a/packages/rs-drive/src/state_transition_action/system/bump_identity_nonce_action/transformer.rs b/packages/rs-drive/src/state_transition_action/system/bump_identity_nonce_action/transformer.rs index 674fb61d3b..ae5afef5ff 100644 --- a/packages/rs-drive/src/state_transition_action/system/bump_identity_nonce_action/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/system/bump_identity_nonce_action/transformer.rs @@ -137,22 +137,14 @@ impl BumpIdentityNonceAction { pub fn from_identity_credit_withdrawal_transition( value: IdentityCreditWithdrawalTransition, ) -> Self { - match value { - IdentityCreditWithdrawalTransition::V0(v0) => { - BumpIdentityNonceActionV0::from_identity_credit_withdrawal(v0).into() - } - } + BumpIdentityNonceActionV0::from_identity_credit_withdrawal(value).into() } /// from borrowed identity withdrawal pub fn from_borrowed_identity_credit_withdrawal_transition( value: &IdentityCreditWithdrawalTransition, ) -> Self { - match value { - IdentityCreditWithdrawalTransition::V0(v0) => { - BumpIdentityNonceActionV0::from_borrowed_identity_credit_withdrawal(v0).into() - } - } + BumpIdentityNonceActionV0::from_borrowed_identity_credit_withdrawal(value).into() } /// from identity withdrawal action diff --git a/packages/rs-drive/src/state_transition_action/system/bump_identity_nonce_action/v0/transformer.rs b/packages/rs-drive/src/state_transition_action/system/bump_identity_nonce_action/v0/transformer.rs index 99cb834032..8c5520f7d7 100644 --- a/packages/rs-drive/src/state_transition_action/system/bump_identity_nonce_action/v0/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/system/bump_identity_nonce_action/v0/transformer.rs @@ -6,8 +6,10 @@ use crate::state_transition_action::system::bump_identity_nonce_action::BumpIden use dpp::data_contract::accessors::v0::DataContractV0Getters; use dpp::state_transition::data_contract_create_transition::DataContractCreateTransitionV0; use dpp::state_transition::identity_credit_transfer_transition::v0::IdentityCreditTransferTransitionV0; -use dpp::state_transition::identity_credit_withdrawal_transition::v0::IdentityCreditWithdrawalTransitionV0; +use dpp::state_transition::identity_credit_withdrawal_transition::accessors::IdentityCreditWithdrawalTransitionAccessorsV0; +use dpp::state_transition::identity_credit_withdrawal_transition::IdentityCreditWithdrawalTransition; use dpp::state_transition::identity_update_transition::v0::IdentityUpdateTransitionV0; +use dpp::state_transition::StateTransitionLike; impl BumpIdentityNonceActionV0 { /// from identity update @@ -199,34 +201,22 @@ impl BumpIdentityNonceActionV0 { } /// from identity credit withdrawal - pub fn from_identity_credit_withdrawal(value: IdentityCreditWithdrawalTransitionV0) -> Self { - let IdentityCreditWithdrawalTransitionV0 { - identity_id, - nonce, - user_fee_increase, - .. - } = value; + pub fn from_identity_credit_withdrawal(value: IdentityCreditWithdrawalTransition) -> Self { BumpIdentityNonceActionV0 { - identity_id, - identity_nonce: nonce, - user_fee_increase, + identity_id: value.identity_id(), + identity_nonce: value.nonce(), + user_fee_increase: value.user_fee_increase(), } } /// from borrowed identity credit withdrawal pub fn from_borrowed_identity_credit_withdrawal( - value: &IdentityCreditWithdrawalTransitionV0, + value: &IdentityCreditWithdrawalTransition, ) -> Self { - let IdentityCreditWithdrawalTransitionV0 { - identity_id, - nonce, - user_fee_increase, - .. - } = value; BumpIdentityNonceActionV0 { - identity_id: *identity_id, - identity_nonce: *nonce, - user_fee_increase: *user_fee_increase, + identity_id: value.identity_id(), + identity_nonce: value.nonce(), + user_fee_increase: value.user_fee_increase(), } } diff --git a/packages/rs-drive/src/util/batch/drive_op_batch/withdrawals.rs b/packages/rs-drive/src/util/batch/drive_op_batch/withdrawals.rs index 972f6be00e..7ad820d601 100644 --- a/packages/rs-drive/src/util/batch/drive_op_batch/withdrawals.rs +++ b/packages/rs-drive/src/util/batch/drive_op_batch/withdrawals.rs @@ -4,20 +4,17 @@ use crate::drive::identity::withdrawals::paths::{ get_withdrawal_root_path_vec, get_withdrawal_transactions_queue_path, get_withdrawal_transactions_queue_path_vec, WITHDRAWAL_TRANSACTIONS_NEXT_INDEX_KEY, }; -use crate::drive::identity::withdrawals::{ - WithdrawalTransactionIndex, WithdrawalTransactionIndexAndBytes, -}; use crate::util::grove_operations::BatchDeleteApplyType; use crate::util::object_size_info::PathKeyElementInfo; use crate::{drive::Drive, error::Error, fees::op::LowLevelDriveOperation}; use dpp::block::block_info::BlockInfo; +use super::DriveLowLevelOperationConverter; use dpp::version::PlatformVersion; +use dpp::withdrawal::{WithdrawalTransactionIndex, WithdrawalTransactionIndexAndBytes}; use grovedb::Element; use grovedb::{batch::KeyInfoPath, EstimatedLayerInformation, TransactionArg}; -use super::DriveLowLevelOperationConverter; - /// Operations for Withdrawals #[derive(Clone, Debug)] pub enum WithdrawalOperationType { diff --git a/packages/rs-json-schema-compatibility-validator/Cargo.toml b/packages/rs-json-schema-compatibility-validator/Cargo.toml index 0ddeeaa080..d31332bb20 100644 --- a/packages/rs-json-schema-compatibility-validator/Cargo.toml +++ b/packages/rs-json-schema-compatibility-validator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "json-schema-compatibility-validator" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true authors = ["Ivan Shumkov "] diff --git a/packages/rs-platform-serialization-derive/Cargo.toml b/packages/rs-platform-serialization-derive/Cargo.toml index 686826fcba..f18ea08c61 100644 --- a/packages/rs-platform-serialization-derive/Cargo.toml +++ b/packages/rs-platform-serialization-derive/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-serialization-derive" authors = ["Samuel Westrich "] description = "Bincode serialization and deserialization derivations" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-platform-serialization/Cargo.toml b/packages/rs-platform-serialization/Cargo.toml index bde609eb8f..89f2c732de 100644 --- a/packages/rs-platform-serialization/Cargo.toml +++ b/packages/rs-platform-serialization/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-serialization" authors = ["Samuel Westrich "] description = "Bincode based serialization and deserialization" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-platform-value-convertible/Cargo.toml b/packages/rs-platform-value-convertible/Cargo.toml index 194bbdba60..245855ba13 100644 --- a/packages/rs-platform-value-convertible/Cargo.toml +++ b/packages/rs-platform-value-convertible/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-value-convertible" authors = ["Samuel Westrich "] description = "Convertion to and from platform values" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-platform-value/Cargo.toml b/packages/rs-platform-value/Cargo.toml index c4208cff92..604a4dae4b 100644 --- a/packages/rs-platform-value/Cargo.toml +++ b/packages/rs-platform-value/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-value" authors = ["Samuel Westrich "] description = "A simple value module" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 6a3c78b897..267c427514 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-version" authors = ["Samuel Westrich "] description = "Versioning library for Platform" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-platform-version/src/version/dpp_versions.rs b/packages/rs-platform-version/src/version/dpp_versions.rs index e168d8aa95..b42befd472 100644 --- a/packages/rs-platform-version/src/version/dpp_versions.rs +++ b/packages/rs-platform-version/src/version/dpp_versions.rs @@ -265,6 +265,7 @@ pub struct DocumentMethodVersions { pub hash: FeatureVersion, pub get_raw_for_contract: FeatureVersion, pub get_raw_for_document_type: FeatureVersion, + pub try_into_asset_unlock_base_transaction_info: FeatureVersion, } #[derive(Clone, Debug, Default)] diff --git a/packages/rs-platform-version/src/version/drive_abci_versions.rs b/packages/rs-platform-version/src/version/drive_abci_versions.rs index bf80179c09..3d60df5736 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions.rs @@ -67,6 +67,7 @@ pub struct DriveAbciQuerySystemVersions { pub version_upgrade_state: FeatureVersionBounds, pub version_upgrade_vote_status: FeatureVersionBounds, pub epoch_infos: FeatureVersionBounds, + pub current_quorums_info: FeatureVersionBounds, pub partial_status: FeatureVersionBounds, pub path_elements: FeatureVersionBounds, pub total_credits_in_platform: FeatureVersionBounds, diff --git a/packages/rs-platform-version/src/version/limits.rs b/packages/rs-platform-version/src/version/limits.rs index 7035d6ae7c..207cde0d1e 100644 --- a/packages/rs-platform-version/src/version/limits.rs +++ b/packages/rs-platform-version/src/version/limits.rs @@ -4,4 +4,5 @@ pub struct SystemLimits { pub max_field_value_size: u32, pub max_state_transition_size: u64, pub max_transitions_in_documents_batch: u16, + pub withdrawal_transactions_per_block_limit: u16, } diff --git a/packages/rs-platform-version/src/version/mocks/v2_test.rs b/packages/rs-platform-version/src/version/mocks/v2_test.rs index a23140000b..bb83ecba96 100644 --- a/packages/rs-platform-version/src/version/mocks/v2_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v2_test.rs @@ -982,6 +982,11 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { max_version: 0, default_current_version: 0, }, + current_quorums_info: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, partial_status: FeatureVersionBounds { min_version: 0, max_version: 0, @@ -1236,6 +1241,7 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { hash: 0, get_raw_for_contract: 0, get_raw_for_document_type: 0, + try_into_asset_unlock_base_transaction_info: 0, }, }, identity_versions: IdentityVersions { @@ -1273,6 +1279,7 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { max_field_value_size: 5000, max_state_transition_size: 20000, max_transitions_in_documents_batch: 1, + withdrawal_transactions_per_block_limit: 4, }, consensus: ConsensusVersions { tenderdash_consensus_version: 0, diff --git a/packages/rs-platform-version/src/version/mocks/v3_test.rs b/packages/rs-platform-version/src/version/mocks/v3_test.rs index 919a6add8c..d136677129 100644 --- a/packages/rs-platform-version/src/version/mocks/v3_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v3_test.rs @@ -168,35 +168,6 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { remove_from_system_credits_operations: 0, calculate_total_credits_balance: 0, }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, document: DriveDocumentMethodVersions { query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, delete: DriveDocumentDeleteMethodVersions { @@ -269,10 +240,10 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { cleanup: DriveVoteCleanupMethodVersions { remove_specific_vote_references_given_by_identity: 0, remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 0, + remove_contested_resource_vote_poll_end_date_query_operations: 1, remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 0, - remove_contested_resource_vote_poll_contenders_operations: 0, + remove_contested_resource_vote_poll_documents_operations: 1, + remove_contested_resource_vote_poll_contenders_operations: 1, remove_contested_resource_top_level_index_operations: 0, remove_contested_resource_info_operations: 0, }, @@ -522,6 +493,35 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { apply_batch_low_level_drive_operations: 0, apply_batch_grovedb_operations: 0, }, + state_transitions: DriveStateTransitionMethodVersions { + operations: DriveStateTransitionOperationMethodVersions { + finalization_tasks: 0, + contracts: DriveDataContractOperationMethodVersions { + finalization_tasks: 0, + }, + }, + convert_to_high_level_operations: + DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { + data_contract_create_transition: 0, + data_contract_update_transition: 0, + document_create_transition: 0, + document_delete_transition: 0, + document_purchase_transition: 0, + document_replace_transition: 0, + document_transfer_transition: 0, + document_update_price_transition: 0, + documents_batch_transition: 0, + identity_create_transition: 0, + identity_credit_transfer_transition: 0, + identity_credit_withdrawal_transition: 0, + identity_top_up_transition: 0, + identity_update_transition: 0, + masternode_vote_transition: 0, + bump_identity_data_contract_nonce: 0, + bump_identity_nonce: 0, + partially_use_asset_lock: 0, + }, + }, batch_operations: DriveBatchOperationsMethodVersion { convert_drive_operations_to_grove_operations: 0, apply_drive_operations: 0, @@ -634,9 +634,9 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { }, }, protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { - check_for_desired_protocol_upgrade: 0, + check_for_desired_protocol_upgrade: 1, upgrade_protocol_version_on_epoch_change: 0, - protocol_version_upgrade_percentage_needed: 75, + protocol_version_upgrade_percentage_needed: 67, }, block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { add_process_epoch_change_operations: 0, @@ -667,7 +667,7 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { build_untied_withdrawal_transactions_from_documents: 0, dequeue_and_build_unsigned_withdrawal_transactions: 0, fetch_transactions_block_inclusion_status: 0, - pool_withdrawals_into_transactions_queue: 0, + pool_withdrawals_into_transactions_queue: 1, update_broadcasted_withdrawal_statuses: 0, append_signatures_and_broadcast_withdrawal_transactions: 0, }, @@ -750,7 +750,7 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { }, identity_credit_withdrawal_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), + basic_structure: Some(1), advanced_structure: None, identity_signatures: None, advanced_minimum_balance_pre_check: Some(0), @@ -822,7 +822,7 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { document_transfer_transition_structure_validation: 0, document_purchase_transition_structure_validation: 0, document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 0, + document_create_transition_state_validation: 1, document_delete_transition_state_validation: 0, document_replace_transition_state_validation: 0, document_transfer_transition_state_validation: 0, @@ -874,6 +874,11 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { max_version: 0, default_current_version: 0, }, + identities_contract_keys: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, identity_nonce: FeatureVersionBounds { min_version: 0, max_version: 0, @@ -904,11 +909,6 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { max_version: 0, default_current_version: 0, }, - identities_contract_keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, }, validator_queries: DriveAbciQueryValidatorVersions { proposed_block_counts_by_evonode_ids: FeatureVersionBounds { @@ -982,6 +982,11 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { max_version: 0, default_current_version: 0, }, + current_quorums_info: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, partial_status: FeatureVersionBounds { min_version: 0, max_version: 0, @@ -1132,7 +1137,7 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { state_transition_conversion_versions: StateTransitionConversionVersions { identity_to_identity_create_transition: 0, identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 0, + identity_to_identity_withdrawal_transition: 1, identity_to_identity_create_transition_with_signer: 0, }, state_transition_method_versions: StateTransitionMethodVersions { @@ -1236,6 +1241,7 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { hash: 0, get_raw_for_contract: 0, get_raw_for_document_type: 0, + try_into_asset_unlock_base_transaction_info: 0, }, }, identity_versions: IdentityVersions { @@ -1272,11 +1278,12 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { fee_version: FEE_VERSION1, system_limits: SystemLimits { estimated_contract_max_serialized_size: 16384, - max_field_value_size: 5000, - max_state_transition_size: 20000, + max_field_value_size: 5120, //5 KiB + max_state_transition_size: 20480, //20 KiB max_transitions_in_documents_batch: 1, + withdrawal_transactions_per_block_limit: 4, }, consensus: ConsensusVersions { - tenderdash_consensus_version: 0, + tenderdash_consensus_version: 1, }, }; diff --git a/packages/rs-platform-version/src/version/mod.rs b/packages/rs-platform-version/src/version/mod.rs index d7346a7097..9ee6257751 100644 --- a/packages/rs-platform-version/src/version/mod.rs +++ b/packages/rs-platform-version/src/version/mod.rs @@ -1,5 +1,5 @@ mod protocol_version; -use crate::version::v3::PROTOCOL_VERSION_3; +use crate::version::v4::PROTOCOL_VERSION_4; pub use protocol_version::*; mod consensus_versions; @@ -15,8 +15,9 @@ pub mod patches; pub mod v1; pub mod v2; pub mod v3; +pub mod v4; pub type ProtocolVersion = u32; -pub const LATEST_VERSION: ProtocolVersion = PROTOCOL_VERSION_3; +pub const LATEST_VERSION: ProtocolVersion = PROTOCOL_VERSION_4; pub const INITIAL_PROTOCOL_VERSION: ProtocolVersion = 1; diff --git a/packages/rs-platform-version/src/version/protocol_version.rs b/packages/rs-platform-version/src/version/protocol_version.rs index 607a267844..c6af2ec88c 100644 --- a/packages/rs-platform-version/src/version/protocol_version.rs +++ b/packages/rs-platform-version/src/version/protocol_version.rs @@ -18,6 +18,7 @@ use crate::version::consensus_versions::ConsensusVersions; use crate::version::limits::SystemLimits; use crate::version::v2::PLATFORM_V2; use crate::version::v3::PLATFORM_V3; +use crate::version::v4::PLATFORM_V4; use crate::version::ProtocolVersion; pub use versioned_feature_core::*; @@ -41,7 +42,8 @@ pub struct PlatformVersion { pub system_limits: SystemLimits, } -pub const PLATFORM_VERSIONS: &[PlatformVersion] = &[PLATFORM_V1, PLATFORM_V2, PLATFORM_V3]; +pub const PLATFORM_VERSIONS: &[PlatformVersion] = + &[PLATFORM_V1, PLATFORM_V2, PLATFORM_V3, PLATFORM_V4]; #[cfg(feature = "mock-versions")] // We use OnceLock to be able to modify the version mocks @@ -49,9 +51,8 @@ pub static PLATFORM_TEST_VERSIONS: OnceLock> = OnceLock::ne #[cfg(feature = "mock-versions")] const DEFAULT_PLATFORM_TEST_VERSIONS: &[PlatformVersion] = &[TEST_PLATFORM_V2, TEST_PLATFORM_V3]; -pub const LATEST_PLATFORM_VERSION: &PlatformVersion = &PLATFORM_V3; +pub const LATEST_PLATFORM_VERSION: &PlatformVersion = &PLATFORM_V4; -/// For V3 release we want to do an emergency version upgrade pub const DESIRED_PLATFORM_VERSION: &PlatformVersion = LATEST_PLATFORM_VERSION; impl PlatformVersion { diff --git a/packages/rs-platform-version/src/version/v1.rs b/packages/rs-platform-version/src/version/v1.rs index 325336c52f..b9d9eda464 100644 --- a/packages/rs-platform-version/src/version/v1.rs +++ b/packages/rs-platform-version/src/version/v1.rs @@ -981,6 +981,11 @@ pub const PLATFORM_V1: PlatformVersion = PlatformVersion { max_version: 0, default_current_version: 0, }, + current_quorums_info: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, partial_status: FeatureVersionBounds { min_version: 0, max_version: 0, @@ -1235,6 +1240,7 @@ pub const PLATFORM_V1: PlatformVersion = PlatformVersion { hash: 0, get_raw_for_contract: 0, get_raw_for_document_type: 0, + try_into_asset_unlock_base_transaction_info: 0, }, }, identity_versions: IdentityVersions { @@ -1274,6 +1280,7 @@ pub const PLATFORM_V1: PlatformVersion = PlatformVersion { max_field_value_size: 5120, //5 KiB max_state_transition_size: 20480, //20 KiB max_transitions_in_documents_batch: 1, + withdrawal_transactions_per_block_limit: 4, }, consensus: ConsensusVersions { tenderdash_consensus_version: 0, diff --git a/packages/rs-platform-version/src/version/v2.rs b/packages/rs-platform-version/src/version/v2.rs index 5ed8d2d3e3..2f80cedf64 100644 --- a/packages/rs-platform-version/src/version/v2.rs +++ b/packages/rs-platform-version/src/version/v2.rs @@ -981,6 +981,11 @@ pub const PLATFORM_V2: PlatformVersion = PlatformVersion { max_version: 0, default_current_version: 0, }, + current_quorums_info: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, partial_status: FeatureVersionBounds { min_version: 0, max_version: 0, @@ -1235,6 +1240,7 @@ pub const PLATFORM_V2: PlatformVersion = PlatformVersion { hash: 0, get_raw_for_contract: 0, get_raw_for_document_type: 0, + try_into_asset_unlock_base_transaction_info: 0, }, }, identity_versions: IdentityVersions { @@ -1274,6 +1280,7 @@ pub const PLATFORM_V2: PlatformVersion = PlatformVersion { max_field_value_size: 5120, //5 KiB max_state_transition_size: 20480, //20 KiB max_transitions_in_documents_batch: 1, + withdrawal_transactions_per_block_limit: 4, }, consensus: ConsensusVersions { tenderdash_consensus_version: 0, diff --git a/packages/rs-platform-version/src/version/v3.rs b/packages/rs-platform-version/src/version/v3.rs index cb608a3b3c..314e17aa19 100644 --- a/packages/rs-platform-version/src/version/v3.rs +++ b/packages/rs-platform-version/src/version/v3.rs @@ -988,6 +988,11 @@ pub const PLATFORM_V3: PlatformVersion = PlatformVersion { max_version: 0, default_current_version: 0, }, + current_quorums_info: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, partial_status: FeatureVersionBounds { min_version: 0, max_version: 0, @@ -1138,7 +1143,7 @@ pub const PLATFORM_V3: PlatformVersion = PlatformVersion { state_transition_conversion_versions: StateTransitionConversionVersions { identity_to_identity_create_transition: 0, identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 0, + identity_to_identity_withdrawal_transition: 1, identity_to_identity_create_transition_with_signer: 0, }, state_transition_method_versions: StateTransitionMethodVersions { @@ -1242,6 +1247,7 @@ pub const PLATFORM_V3: PlatformVersion = PlatformVersion { hash: 0, get_raw_for_contract: 0, get_raw_for_document_type: 0, + try_into_asset_unlock_base_transaction_info: 0, }, }, identity_versions: IdentityVersions { @@ -1281,6 +1287,7 @@ pub const PLATFORM_V3: PlatformVersion = PlatformVersion { max_field_value_size: 5120, //5 KiB max_state_transition_size: 20480, //20 KiB max_transitions_in_documents_batch: 1, + withdrawal_transactions_per_block_limit: 4, }, consensus: ConsensusVersions { tenderdash_consensus_version: 1, diff --git a/packages/rs-platform-version/src/version/v4.rs b/packages/rs-platform-version/src/version/v4.rs new file mode 100644 index 0000000000..86c62b8e8f --- /dev/null +++ b/packages/rs-platform-version/src/version/v4.rs @@ -0,0 +1,1290 @@ +use crate::version::consensus_versions::ConsensusVersions; +use crate::version::contracts::SystemDataContractVersions; +use crate::version::dpp_versions::{ + AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, + DPPVersion, DataContractMethodVersions, DataContractValidationVersions, + DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, + DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, + DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, + DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, + IdentityKeyTypeMethodVersions, IdentityTransitionAssetLockVersions, IdentityTransitionVersions, + IdentityVersions, JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, + RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, + StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, + VotingValidationVersions, VotingVersions, +}; +use crate::version::drive_abci_versions::{ + DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, + DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, + DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, + DriveAbciCoreInstantSendLockMethodVersions, + DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, + DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, + DriveAbciFeePoolOutwardsDistributionMethodVersions, + DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, + DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, + DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, + DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, + DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, + DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, + DriveAbciStateTransitionCommonValidationVersions, + DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, + DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, + DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, + DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, + DriveAbciVotingMethodVersions, PenaltyAmounts, +}; +use crate::version::drive_versions::{ + DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, + DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, + DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, + DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, + DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, + DriveCreditPoolPendingEpochRefundsMethodVersions, + DriveCreditPoolStorageFeeDistributionPoolMethodVersions, + DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, + DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, + DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, + DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, + DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, + DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, + DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, + DriveGroveCostMethodVersions, DriveGroveMethodVersions, + DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, + DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, + DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, + DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, + DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, + DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, + DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, + DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, + DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, + DriveIdentityWithdrawalTransactionIndexMethodVersions, + DriveIdentityWithdrawalTransactionMethodVersions, + DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, + DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, + DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, + DriveProtocolUpgradeVersions, DriveProveMethodVersions, + DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, + DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, + DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, + DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, + DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, + DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, + DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, + DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, + DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, + DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, +}; +use crate::version::fee::v1::FEE_VERSION1; +use crate::version::limits::SystemLimits; +use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; +use crate::version::{PlatformArchitectureVersion, ProtocolVersion}; +use grovedb_version::version::v1::GROVE_V1; + +pub const PROTOCOL_VERSION_4: ProtocolVersion = 4; + +/// This version introduces withdrawals. + +pub const PLATFORM_V4: PlatformVersion = PlatformVersion { + protocol_version: PROTOCOL_VERSION_4, + proofs: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + drive: DriveVersion { + structure: DriveStructureVersion { + document_indexes: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_indexes: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + pools: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + methods: DriveMethodVersions { + initialization: DriveInitializationMethodVersions { + create_initial_state_structure: 0, + }, + credit_pools: DriveCreditPoolMethodVersions { + epochs: DriveCreditPoolEpochsMethodVersions { + get_epochs_infos: 0, + get_epochs_protocol_versions: 0, + prove_epochs_infos: 0, + get_epoch_fee_multiplier: 0, + get_epoch_processing_credits_for_distribution: 0, + get_epoch_storage_credits_for_distribution: 0, + get_epoch_total_credits_for_distribution: 0, + get_storage_credits_for_distribution_for_epochs_in_range: 0, + get_epoch_start_time: 0, + get_epoch_start_block_core_height: 0, + get_epoch_start_block_height: 0, + get_first_epoch_start_block_info_between_epochs: 0, + fetch_epoch_proposers: 0, + prove_epoch_proposers: 0, + get_epochs_proposer_block_count: 0, + add_update_pending_epoch_refunds_operations: 0, + is_epochs_proposers_tree_empty: 0, + }, + pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { + add_delete_pending_epoch_refunds_except_specified: 0, + fetch_and_add_pending_epoch_refunds_to_collection: 0, + fetch_pending_epoch_refunds: 0, + add_update_pending_epoch_refunds_operations: 0, + }, + storage_fee_distribution_pool: + DriveCreditPoolStorageFeeDistributionPoolMethodVersions { + get_storage_fees_from_distribution_pool: 0, + }, + unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { + get_unpaid_epoch_index: 0, + }, + }, + protocol_upgrade: DriveProtocolUpgradeVersions { + clear_version_information: 0, + fetch_versions_with_counter: 0, + fetch_proved_versions_with_counter: 0, + fetch_validator_version_votes: 0, + fetch_proved_validator_version_votes: 0, + remove_validators_proposed_app_versions: 0, + update_validator_proposed_app_version: 0, + }, + prove: DriveProveMethodVersions { + prove_elements: 0, + prove_multiple_state_transition_results: 0, + }, + balances: DriveBalancesMethodVersions { + add_to_system_credits: 0, + add_to_system_credits_operations: 0, + remove_from_system_credits: 0, + remove_from_system_credits_operations: 0, + calculate_total_credits_balance: 0, + }, + document: DriveDocumentMethodVersions { + query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, + delete: DriveDocumentDeleteMethodVersions { + add_estimation_costs_for_remove_document_to_primary_storage: 0, + delete_document_for_contract: 0, + delete_document_for_contract_id: 0, + delete_document_for_contract_apply_and_add_to_operations: 0, + remove_document_from_primary_storage: 0, + remove_reference_for_index_level_for_contract_operations: 0, + remove_indices_for_index_level_for_contract_operations: 0, + remove_indices_for_top_index_level_for_contract_operations: 0, + delete_document_for_contract_id_with_named_type_operations: 0, + delete_document_for_contract_with_named_type_operations: 0, + delete_document_for_contract_operations: 0, + }, + insert: DriveDocumentInsertMethodVersions { + add_document: 0, + add_document_for_contract: 0, + add_document_for_contract_apply_and_add_to_operations: 0, + add_document_for_contract_operations: 0, + add_document_to_primary_storage: 0, + add_indices_for_index_level_for_contract_operations: 0, + add_indices_for_top_index_level_for_contract_operations: 0, + add_reference_for_index_level_for_contract_operations: 0, + }, + insert_contested: DriveDocumentInsertContestedMethodVersions { + add_contested_document: 0, + add_contested_document_for_contract: 0, + add_contested_document_for_contract_apply_and_add_to_operations: 0, + add_contested_document_for_contract_operations: 0, + add_contested_document_to_primary_storage: 0, + add_contested_indices_for_contract_operations: 0, + add_contested_reference_and_vote_subtree_to_document_operations: 0, + add_contested_vote_subtree_for_non_identities_operations: 0, + }, + update: DriveDocumentUpdateMethodVersions { + add_update_multiple_documents_operations: 0, + update_document_for_contract: 0, + update_document_for_contract_apply_and_add_to_operations: 0, + update_document_for_contract_id: 0, + update_document_for_contract_operations: 0, + update_document_with_serialization_for_contract: 0, + update_serialized_document_for_contract: 0, + }, + estimation_costs: DriveDocumentEstimationCostsMethodVersions { + add_estimation_costs_for_add_document_to_primary_storage: 0, + add_estimation_costs_for_add_contested_document_to_primary_storage: 0, + stateless_delete_of_non_tree_for_costs: 0, + }, + index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { + validate_document_uniqueness: 0, + validate_document_create_transition_action_uniqueness: 0, + validate_document_replace_transition_action_uniqueness: 0, + validate_document_transfer_transition_action_uniqueness: 0, + validate_document_purchase_transition_action_uniqueness: 0, + validate_document_update_price_transition_action_uniqueness: 0, + validate_uniqueness_of_data: 0, + }, + }, + vote: DriveVoteMethodVersions { + insert: DriveVoteInsertMethodVersions { + register_identity_vote: 0, + }, + contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { + register_contested_resource_identity_vote: 0, + insert_stored_info_for_contested_resource_vote_poll: 0, + register_identity_vote: 0, + add_vote_poll_end_date_query_operations: 0, + }, + cleanup: DriveVoteCleanupMethodVersions { + remove_specific_vote_references_given_by_identity: 0, + remove_specific_votes_given_by_identity: 0, + remove_contested_resource_vote_poll_end_date_query_operations: 1, + remove_contested_resource_vote_poll_votes_operations: 0, + remove_contested_resource_vote_poll_documents_operations: 1, + remove_contested_resource_vote_poll_contenders_operations: 1, + remove_contested_resource_top_level_index_operations: 0, + remove_contested_resource_info_operations: 0, + }, + setup: DriveVoteSetupMethodVersions { + add_initial_vote_tree_main_structure_operations: 0, + }, + storage_form: DriveVoteStorageFormMethodVersions { + resolve_with_contract: 0, + }, + fetch: DriveVoteFetchMethodVersions { + fetch_identities_voting_for_contenders: 0, + fetch_contested_document_vote_poll_stored_info: 0, + fetch_identity_contested_resource_vote: 0, + }, + }, + contract: DriveContractMethodVersions { + prove: DriveContractProveMethodVersions { + prove_contract: 0, + prove_contract_history: 0, + prove_contracts: 0, + }, + apply: DriveContractApplyMethodVersions { + apply_contract: 0, + apply_contract_with_serialization: 0, + }, + insert: DriveContractInsertMethodVersions { + add_contract_to_storage: 0, + insert_contract: 0, + }, + update: DriveContractUpdateMethodVersions { update_contract: 0 }, + costs: DriveContractCostsMethodVersions { + add_estimation_costs_for_contract_insertion: 0, + }, + get: DriveContractGetMethodVersions { + fetch_contract: 0, + fetch_contract_with_history: 0, + get_cached_contract_with_fetch_info: 0, + get_contract_with_fetch_info: 0, + get_contracts_with_fetch_info: 0, + }, + }, + fees: DriveFeesMethodVersions { calculate_fee: 0 }, + estimated_costs: DriveEstimatedCostsMethodVersions { + add_estimation_costs_for_levels_up_to_contract: 0, + add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, + add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, + add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, + }, + asset_lock: DriveAssetLockMethodVersions { + add_asset_lock_outpoint: 0, + add_estimation_costs_for_adding_asset_lock: 0, + fetch_asset_lock_outpoint_info: 0, + }, + verify: DriveVerifyMethodVersions { + contract: DriveVerifyContractMethodVersions { + verify_contract: 0, + verify_contract_history: 0, + }, + document: DriveVerifyDocumentMethodVersions { + verify_proof: 0, + verify_proof_keep_serialized: 0, + verify_start_at_document_in_proof: 0, + }, + identity: DriveVerifyIdentityMethodVersions { + verify_full_identities_by_public_key_hashes: 0, + verify_full_identity_by_identity_id: 0, + verify_full_identity_by_public_key_hash: 0, + verify_identity_balance_for_identity_id: 0, + verify_identity_balances_for_identity_ids: 0, + verify_identity_id_by_public_key_hash: 0, + verify_identity_ids_by_public_key_hashes: 0, + verify_identity_keys_by_identity_id: 0, + verify_identity_nonce: 0, + verify_identity_contract_nonce: 0, + verify_identities_contract_keys: 0, + verify_identity_revision_for_identity_id: 0, + }, + single_document: DriveVerifySingleDocumentMethodVersions { + verify_proof: 0, + verify_proof_keep_serialized: 0, + }, + system: DriveVerifySystemMethodVersions { + verify_epoch_infos: 0, + verify_epoch_proposers: 0, + verify_elements: 0, + verify_total_credits_in_system: 0, + verify_upgrade_state: 0, + verify_upgrade_vote_status: 0, + }, + voting: DriveVerifyVoteMethodVersions { + verify_masternode_vote: 0, + verify_start_at_contender_in_proof: 0, + verify_vote_poll_votes_proof: 0, + verify_identity_votes_given_proof: 0, + verify_vote_poll_vote_state_proof: 0, + verify_contests_proof: 0, + verify_vote_polls_by_end_date_proof: 0, + verify_specialized_balance: 0, + }, + state_transition: DriveVerifyStateTransitionMethodVersions { + verify_state_transition_was_executed_with_proof: 0, + }, + }, + identity: DriveIdentityMethodVersions { + fetch: DriveIdentityFetchMethodVersions { + public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { + fetch_full_identities_by_unique_public_key_hashes: 0, + fetch_full_identity_by_unique_public_key_hash: 0, + fetch_identity_id_by_unique_public_key_hash: 0, + fetch_identity_ids_by_non_unique_public_key_hash: 0, + fetch_identity_ids_by_unique_public_key_hashes: 0, + fetch_serialized_full_identity_by_unique_public_key_hash: 0, + has_any_of_unique_public_key_hashes: 0, + has_non_unique_public_key_hash: 0, + has_non_unique_public_key_hash_already_for_identity: 0, + has_unique_public_key_hash: 0, + }, + attributes: DriveIdentityFetchAttributesMethodVersions { + revision: 0, + nonce: 0, + identity_contract_nonce: 0, + balance: 0, + balance_include_debt: 0, + negative_balance: 0, + }, + partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { + fetch_identity_revision_with_keys: 0, + fetch_identity_balance_with_keys: 0, + fetch_identity_balance_with_keys_and_revision: 0, + fetch_identity_with_balance: 0, + fetch_identity_keys: 0, + }, + full_identity: DriveIdentityFetchFullIdentityMethodVersions { + fetch_full_identity: Some(0), + fetch_full_identities: Some(0), + }, + }, + prove: DriveIdentityProveMethodVersions { + full_identity: 0, + full_identities: 0, + identity_nonce: 0, + identity_contract_nonce: 0, + identities_contract_keys: 0, + prove_full_identities_by_unique_public_key_hashes: 0, + prove_full_identity_by_unique_public_key_hash: 0, + prove_identity_id_by_unique_public_key_hash: 0, + prove_identity_ids_by_unique_public_key_hashes: 0, + }, + keys: DriveIdentityKeysMethodVersions { + fetch: DriveIdentityKeysFetchMethodVersions { + fetch_all_current_identity_keys: 0, + fetch_all_identity_keys: 0, + fetch_identities_all_keys: 0, + fetch_identity_keys: 0, + fetch_identities_contract_keys: 0, + }, + prove: DriveIdentityKeysProveMethodVersions { + prove_identities_all_keys: 0, + prove_identity_keys: 0, + }, + insert: DriveIdentityKeysInsertMethodVersions { + create_key_tree_with_keys: 0, + create_new_identity_key_query_trees: 0, + insert_key_searchable_references: 0, + insert_key_to_storage: 0, + insert_new_non_unique_key: 0, + insert_new_unique_key: 0, + replace_key_in_storage: 0, + }, + insert_key_hash_identity_reference: + DriveIdentityKeyHashesToIdentityInsertMethodVersions { + add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, + add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, + insert_non_unique_public_key_hash_reference_to_identity: 0, + insert_reference_to_non_unique_key: 0, + insert_reference_to_unique_key: 0, + insert_unique_public_key_hash_reference_to_identity: 0, + }, + }, + update: DriveIdentityUpdateMethodVersions { + update_identity_revision: 0, + merge_identity_nonce: 0, + update_identity_negative_credit_operation: 0, + initialize_identity_revision: 0, + disable_identity_keys: 0, + re_enable_identity_keys: 0, + add_new_non_unique_keys_to_identity: 0, + add_new_unique_keys_to_identity: 0, + add_new_keys_to_identity: 0, + insert_identity_balance: 0, + initialize_negative_identity_balance: 0, + add_to_identity_balance: 0, + add_to_previous_balance: 0, + apply_balance_change_from_fee_to_identity: 0, + remove_from_identity_balance: 0, + refresh_identity_key_reference_operations: 0, + }, + insert: DriveIdentityInsertMethodVersions { + add_new_identity: 0, + }, + contract_info: DriveIdentityContractInfoMethodVersions { + add_potential_contract_info_for_contract_bounded_key: 0, + refresh_potential_contract_info_key_references: 0, + merge_identity_contract_nonce: 0, + }, + cost_estimation: DriveIdentityCostEstimationMethodVersions { + for_authentication_keys_security_level_in_key_reference_tree: 0, + for_balances: 0, + for_contract_info: 0, + for_contract_info_group: 0, + for_contract_info_group_keys: 0, + for_contract_info_group_key_purpose: 0, + for_keys_for_identity_id: 0, + for_negative_credit: 0, + for_purpose_in_key_reference_tree: 0, + for_root_key_reference_tree: 0, + for_update_revision: 0, + }, + withdrawals: DriveIdentityWithdrawalMethodVersions { + document: DriveIdentityWithdrawalDocumentMethodVersions { + fetch_oldest_withdrawal_documents_by_status: 0, + find_up_to_100_withdrawal_documents_by_status_and_transaction_indices: 0, + }, + transaction: DriveIdentityWithdrawalTransactionMethodVersions { + index: DriveIdentityWithdrawalTransactionIndexMethodVersions { + fetch_next_withdrawal_transaction_index: 0, + add_update_next_withdrawal_transaction_index_operation: 0, + }, + queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { + add_enqueue_untied_withdrawal_transaction_operations: 0, + dequeue_untied_withdrawal_transactions: 0, + }, + }, + }, + }, + platform_system: DrivePlatformSystemMethodVersions { + estimation_costs: DriveSystemEstimationCostsMethodVersions { + for_total_system_credits_update: 0, + }, + }, + operations: DriveOperationsMethodVersion { + rollback_transaction: 0, + drop_cache: 0, + commit_transaction: 0, + apply_partial_batch_low_level_drive_operations: 0, + apply_partial_batch_grovedb_operations: 0, + apply_batch_low_level_drive_operations: 0, + apply_batch_grovedb_operations: 0, + }, + state_transitions: DriveStateTransitionMethodVersions { + operations: DriveStateTransitionOperationMethodVersions { + finalization_tasks: 0, + contracts: DriveDataContractOperationMethodVersions { + finalization_tasks: 0, + }, + }, + convert_to_high_level_operations: + DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { + data_contract_create_transition: 0, + data_contract_update_transition: 0, + document_create_transition: 0, + document_delete_transition: 0, + document_purchase_transition: 0, + document_replace_transition: 0, + document_transfer_transition: 0, + document_update_price_transition: 0, + documents_batch_transition: 0, + identity_create_transition: 0, + identity_credit_transfer_transition: 0, + identity_credit_withdrawal_transition: 0, + identity_top_up_transition: 0, + identity_update_transition: 0, + masternode_vote_transition: 0, + bump_identity_data_contract_nonce: 0, + bump_identity_nonce: 0, + partially_use_asset_lock: 0, + }, + }, + batch_operations: DriveBatchOperationsMethodVersion { + convert_drive_operations_to_grove_operations: 0, + apply_drive_operations: 0, + }, + platform_state: DrivePlatformStateMethodVersions { + fetch_platform_state_bytes: 0, + store_platform_state_bytes: 0, + }, + fetch: DriveFetchMethodVersions { fetch_elements: 0 }, + prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { + fetch_single: 0, + prove_single: 0, + add_prefunded_specialized_balance: 0, + add_prefunded_specialized_balance_operations: 0, + deduct_from_prefunded_specialized_balance: 0, + deduct_from_prefunded_specialized_balance_operations: 0, + estimated_cost_for_prefunded_specialized_balance_update: 0, + }, + }, + grove_methods: DriveGroveMethodVersions { + basic: DriveGroveBasicMethodVersions { + grove_insert: 0, + grove_insert_empty_tree: 0, + grove_insert_empty_sum_tree: 0, + grove_insert_if_not_exists: 0, + grove_clear: 0, + grove_delete: 0, + grove_get_raw: 0, + grove_get_raw_optional: 0, + grove_get_raw_value_u64_from_encoded_var_vec: 0, + grove_get: 0, + grove_get_path_query_serialized_results: 0, + grove_get_path_query_serialized_or_sum_results: 0, + grove_get_path_query: 0, + grove_get_path_query_with_optional: 0, + grove_get_raw_path_query_with_optional: 0, + grove_get_raw_path_query: 0, + grove_get_proved_path_query: 0, + grove_get_proved_path_query_with_conditional: 0, + grove_get_sum_tree_total_value: 0, + grove_has_raw: 0, + }, + batch: DriveGroveBatchMethodVersions { + batch_insert_empty_tree: 0, + batch_insert_empty_tree_if_not_exists: 0, + batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, + batch_insert: 0, + batch_insert_if_not_exists: 0, + batch_insert_if_changed_value: 0, + batch_replace: 0, + batch_delete: 0, + batch_remove_raw: 0, + batch_delete_up_tree_while_empty: 0, + batch_refresh_reference: 0, + }, + apply: DriveGroveApplyMethodVersions { + grove_apply_operation: 0, + grove_apply_batch: 0, + grove_apply_partial_batch: 0, + }, + costs: DriveGroveCostMethodVersions { + grove_batch_operations_costs: 0, + }, + }, + grove_version: GROVE_V1, + }, + platform_architecture: PlatformArchitectureVersion { + data_contract_factory_structure_version: 0, + document_factory_structure_version: 0, + }, + drive_abci: DriveAbciVersion { + structs: DriveAbciStructureVersions { + platform_state_structure: 0, + platform_state_for_saving_structure: 0, + state_transition_execution_context: 0, + commit: 0, + masternode: 0, + signature_verification_quorum_set: 0, + }, + methods: DriveAbciMethodVersions { + engine: DriveAbciEngineMethodVersions { + init_chain: 0, + check_tx: 0, + run_block_proposal: 0, + finalize_block_proposal: 0, + consensus_params_update: 0, + }, + initialization: DriveAbciInitializationMethodVersions { + initial_core_height_and_time: 0, + create_genesis_state: 0, + }, + core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { + update_core_info: 0, + update_masternode_list: 0, + update_quorum_info: 0, + masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { + get_voter_identity_key: 0, + get_operator_identity_keys: 0, + get_owner_identity_withdrawal_key: 0, + get_voter_identifier_from_masternode_list_item: 0, + get_operator_identifier_from_masternode_list_item: 0, + create_operator_identity: 0, + create_owner_identity: 0, + create_voter_identity: 0, + disable_identity_keys: 0, + update_masternode_identities: 0, + update_operator_identity: 0, + update_owner_withdrawal_address: 0, + update_voter_identity: 0, + }, + }, + protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { + check_for_desired_protocol_upgrade: 1, + upgrade_protocol_version_on_epoch_change: 0, + protocol_version_upgrade_percentage_needed: 67, + }, + block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { + add_process_epoch_change_operations: 0, + process_block_fees: 0, + }, + core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { + choose_quorum: 0, + verify_chain_lock: 0, + verify_chain_lock_locally: 0, + verify_chain_lock_through_core: 0, + make_sure_core_is_synced_to_chain_lock: 0, + recent_block_count_amount: 2, + }, + core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { + verify_recent_signature_locally: 0, + }, + fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { + add_distribute_block_fees_into_pools_operations: 0, + add_distribute_storage_fee_to_epochs_operations: 0, + }, + fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { + add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, + add_epoch_pool_to_proposers_payout_operations: 0, + find_oldest_epoch_needing_payment: 0, + fetch_reward_shares_list_for_masternode: 0, + }, + withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { + build_untied_withdrawal_transactions_from_documents: 0, + dequeue_and_build_unsigned_withdrawal_transactions: 0, + fetch_transactions_block_inclusion_status: 0, + pool_withdrawals_into_transactions_queue: 0, + update_broadcasted_withdrawal_statuses: 0, + append_signatures_and_broadcast_withdrawal_transactions: 0, + }, + voting: DriveAbciVotingMethodVersions { + keep_record_of_finished_contested_resource_vote_poll: 0, + clean_up_after_vote_poll_end: 0, + clean_up_after_contested_resources_vote_poll_end: 0, + check_for_ended_vote_polls: 0, + tally_votes_for_contested_document_resource_vote_poll: 0, + award_document_to_winner: 0, + delay_vote_poll: 0, + run_dao_platform_events: 0, + remove_votes_for_removed_masternodes: 0, + }, + state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { + execute_event: 0, + process_raw_state_transitions: 0, + decode_raw_state_transitions: 0, + validate_fees_of_event: 0, + }, + epoch: DriveAbciEpochMethodVersions { + gather_epoch_info: 0, + get_genesis_time: 0, + }, + block_start: DriveAbciBlockStartMethodVersions { + clear_drive_block_cache: 0, + }, + block_end: DriveAbciBlockEndMethodVersions { + update_state_cache: 0, + update_drive_cache: 0, + validator_set_update: 1, + }, + platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { + fetch_platform_state: 0, + store_platform_state: 0, + }, + }, + validation_and_processing: DriveAbciValidationVersions { + state_transitions: DriveAbciStateTransitionValidationVersions { + common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { + asset_locks: DriveAbciAssetLockValidationVersions { + fetch_asset_lock_transaction_output_sync: 0, + verify_asset_lock_is_not_spent_and_has_enough_balance: 0, + }, + validate_identity_public_key_contract_bounds: 0, + validate_identity_public_key_ids_dont_exist_in_state: 0, + validate_identity_public_key_ids_exist_in_state: 0, + validate_state_transition_identity_signed: 0, + validate_unique_identity_public_key_hashes_in_state: 0, + validate_master_key_uniqueness: 0, + validate_simple_pre_check_balance: 0, + }, + max_asset_lock_usage_attempts: 16, + identity_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition: + DriveAbciStateTransitionValidationVersion { + basic_structure: Some(1), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_credit_transfer_state_transition: + DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: Some(0), + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + documents_batch_state_transition: + DriveAbciDocumentsStateTransitionValidationVersions { + balance_pre_check: 0, + basic_structure: 0, + advanced_structure: 0, + state: 0, + revision: 0, + transform_into_action: 0, + data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { + bindings: 0, + triggers: DriveAbciValidationDataTriggerVersions { + create_contact_request_data_trigger: 0, + create_domain_data_trigger: 0, + create_identity_data_trigger: 0, + create_feature_flag_data_trigger: 0, + create_masternode_reward_shares_data_trigger: 0, + delete_withdrawal_data_trigger: 0, + reject_data_trigger: 0, + }, + }, + is_allowed: 0, + document_create_transition_structure_validation: 0, + document_delete_transition_structure_validation: 0, + document_replace_transition_structure_validation: 0, + document_transfer_transition_structure_validation: 0, + document_purchase_transition_structure_validation: 0, + document_update_price_transition_structure_validation: 0, + document_create_transition_state_validation: 1, + document_delete_transition_state_validation: 0, + document_replace_transition_state_validation: 0, + document_transfer_transition_state_validation: 0, + document_purchase_transition_state_validation: 0, + document_update_price_transition_state_validation: 0, + }, + }, + process_state_transition: 0, + state_transition_to_execution_event_for_check_tx: 0, + penalties: PenaltyAmounts { + identity_id_not_correct: 50000000, + unique_key_already_present: 10000000, + validation_of_added_keys_structure_failure: 10000000, + validation_of_added_keys_proof_of_possession_failure: 50000000, + }, + event_constants: DriveAbciValidationConstants { + maximum_vote_polls_to_process: 2, + maximum_contenders_to_consider: 100, + }, + }, + query: DriveAbciQueryVersions { + max_returned_elements: 100, + response_metadata: 0, + proofs_query: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_query: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { + balance: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + identity_based_queries: DriveAbciQueryIdentityVersions { + identity: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + keys: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identities_contract_keys: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_nonce: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_contract_nonce: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + balance: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identities_balances: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + balance_and_revision: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_by_public_key_hash: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + validator_queries: DriveAbciQueryValidatorVersions { + proposed_block_counts_by_evonode_ids: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + proposed_block_counts_by_range: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + data_contract_based_queries: DriveAbciQueryDataContractVersions { + data_contract: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + data_contract_history: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + data_contracts: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + voting_based_queries: DriveAbciQueryVotingVersions { + vote_polls_by_end_date_query: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resource_vote_state: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resource_voters_for_identity: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resource_identity_vote_status: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resources: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + system: DriveAbciQuerySystemVersions { + version_upgrade_state: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + version_upgrade_vote_status: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + epoch_infos: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + current_quorums_info: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + partial_status: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + path_elements: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + total_credits_in_platform: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + }, + }, + dpp: DPPVersion { + costs: CostVersions { + signature_verify: 0, + }, + validation: DPPValidationVersions { + json_schema_validator: JsonSchemaValidatorVersions { + new: 0, + validate: 0, + compile: 0, + compile_and_validate: 0, + }, + data_contract: DataContractValidationVersions { + validate: 0, + validate_config_update: 0, + validate_index_definitions: 0, + validate_index_naming_duplicates: 0, + validate_not_defined_properties: 0, + validate_property_definition: 0, + }, + document_type: DocumentTypeValidationVersions { + validate_update: 0, + contested_index_limit: 1, + unique_index_limit: 10, + }, + voting: VotingValidationVersions { + allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms + allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes + votes_allowed_per_masternode: 5, + }, + }, + state_transition_serialization_versions: StateTransitionSerializationVersions { + identity_public_key_in_creation: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_create_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_update_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_top_up_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_credit_withdrawal_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_credit_transfer_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + masternode_vote_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contract_create_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contract_update_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + documents_batch_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_base_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_create_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_replace_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_delete_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_transfer_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_update_price_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_purchase_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + }, + state_transition_conversion_versions: StateTransitionConversionVersions { + identity_to_identity_create_transition: 0, + identity_to_identity_top_up_transition: 0, + identity_to_identity_withdrawal_transition: 1, + identity_to_identity_create_transition_with_signer: 0, + }, + state_transition_method_versions: StateTransitionMethodVersions { + public_key_in_creation_methods: PublicKeyInCreationMethodVersions { + from_public_key_signed_with_private_key: 0, + from_public_key_signed_external: 0, + hash: 0, + duplicated_key_ids_witness: 0, + duplicated_keys_witness: 0, + validate_identity_public_keys_structure: 0, + }, + }, + state_transitions: StateTransitionVersions { + documents: DocumentTransitionVersions { + documents_batch_transition: DocumentsBatchTransitionVersions { + validation: DocumentsBatchTransitionValidationVersions { + find_duplicates_by_id: 0, + validate_base_structure: 0, + }, + }, + }, + identities: IdentityTransitionVersions { + max_public_keys_in_creation: 6, + asset_locks: IdentityTransitionAssetLockVersions { + required_asset_lock_duff_balance_for_processing_start_for_identity_create: + 200000, + required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: + 50000, + validate_asset_lock_transaction_structure: 0, + validate_instant_asset_lock_proof_structure: 0, + }, + }, + }, + contract_versions: ContractVersions { + max_serialized_size: 65000, + contract_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contract_structure_version: 0, + created_data_contract_structure: 0, + config: 0, + methods: DataContractMethodVersions { + validate_document: 0, + validate_update: 0, + schema: 0, + }, + document_type_versions: DocumentTypeVersions { + index_versions: DocumentTypeIndexVersions { + index_levels_from_indices: 0, + }, + class_method_versions: DocumentTypeClassMethodVersions { + try_from_schema: 0, + create_document_types_from_document_schemas: 0, + }, + structure_version: 0, + schema: DocumentTypeSchemaVersions { + enrich_with_base_schema: 0, + find_identifier_and_binary_paths: 0, + validate_max_depth: 0, + max_depth: 256, + recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { + traversal_validator: 0, + }, + validate_schema_compatibility: 0, + }, + methods: DocumentTypeMethodVersions { + create_document_from_data: 0, + create_document_with_prevalidated_properties: 0, + prefunded_voting_balance_for_document: 0, + contested_vote_poll_for_document: 0, + estimated_size: 0, + index_for_types: 0, + max_size: 0, + serialize_value_for_key: 0, + deserialize_value_for_key: 0, + }, + }, + }, + document_versions: DocumentVersions { + document_structure_version: 0, + document_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_cbor_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + extended_document_structure_version: 0, + extended_document_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_method_versions: DocumentMethodVersions { + is_equal_ignoring_timestamps: 0, + hash: 0, + get_raw_for_contract: 0, + get_raw_for_document_type: 0, + try_into_asset_unlock_base_transaction_info: 0, + }, + }, + identity_versions: IdentityVersions { + identity_structure_version: 0, + identity_key_structure_version: 0, + identity_key_type_method_versions: IdentityKeyTypeMethodVersions { + random_public_key_data: 0, + random_public_and_private_key_data: 0, + }, + }, + voting_versions: VotingVersions { + default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks + default_vote_poll_time_duration_test_network_ms: 5_400_000, //90 minutes + contested_document_vote_poll_stored_info_version: 0, + }, + asset_lock_versions: AssetLockVersions { + reduced_asset_lock_value: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + methods: DPPMethodVersions { + epoch_core_reward_credits_for_distribution: 0, + }, + }, + system_data_contracts: SystemDataContractVersions { + withdrawals: 1, + dpns: 1, + dashpay: 1, + masternode_reward_shares: 1, + feature_flags: 1, + }, + fee_version: FEE_VERSION1, + system_limits: SystemLimits { + estimated_contract_max_serialized_size: 16384, + max_field_value_size: 5120, //5 KiB + max_state_transition_size: 20480, //20 KiB + max_transitions_in_documents_batch: 1, + withdrawal_transactions_per_block_limit: 4, + }, + consensus: ConsensusVersions { + tenderdash_consensus_version: 1, + }, +}; diff --git a/packages/rs-platform-versioning/Cargo.toml b/packages/rs-platform-versioning/Cargo.toml index 79efc913f0..5e7d26322d 100644 --- a/packages/rs-platform-versioning/Cargo.toml +++ b/packages/rs-platform-versioning/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-versioning" authors = ["Samuel Westrich "] description = "Version derivation" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index 6ce80dd127..8934df17dc 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dash-sdk" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" [dependencies] diff --git a/packages/rs-sdk/src/lib.rs b/packages/rs-sdk/src/lib.rs index 14b65a58c2..e09eb4d3bb 100644 --- a/packages/rs-sdk/src/lib.rs +++ b/packages/rs-sdk/src/lib.rs @@ -73,6 +73,7 @@ pub mod sdk; pub use error::Error; pub use sdk::{RequestSettings, Sdk, SdkBuilder}; +pub use dashcore_rpc; pub use dpp; pub use rs_dapi_client as dapi_client; diff --git a/packages/rs-sdk/src/platform.rs b/packages/rs-sdk/src/platform.rs index 4766201620..aab3d2153a 100644 --- a/packages/rs-sdk/src/platform.rs +++ b/packages/rs-sdk/src/platform.rs @@ -11,6 +11,7 @@ mod document_query; mod fetch; pub mod fetch_current_no_parameters; mod fetch_many; +mod fetch_unproved; mod identities_contract_keys_query; mod query; pub mod transition; diff --git a/packages/rs-sdk/src/platform/fetch_unproved.rs b/packages/rs-sdk/src/platform/fetch_unproved.rs new file mode 100644 index 0000000000..d25fc86b50 --- /dev/null +++ b/packages/rs-sdk/src/platform/fetch_unproved.rs @@ -0,0 +1,75 @@ +use crate::error::Error; +use crate::platform::proto; +use crate::Sdk; +use dapi_grpc::platform::v0::get_current_quorums_info_request::GetCurrentQuorumsInfoRequestV0; +use dapi_grpc::platform::v0::{self as platform_proto}; +use drive_proof_verifier::unproved::FromUnproved; +use rs_dapi_client::{transport::TransportRequest, DapiRequest, RequestSettings}; +use std::fmt::Debug; + +#[async_trait::async_trait] +pub trait FetchUnproved +where + Self: Sized + Debug, +{ + /// Type of request used to fetch data from Platform. + type Request: TransportRequest; + + /// Fetch unproved data from the Platform. + /// + /// ## Parameters + /// - `sdk`: An instance of [Sdk]. + /// + /// ## Returns + /// Returns: + /// * `Ok(Some(Self))` when object is found. + /// * `Ok(None)` when object is not found. + /// * [`Err(Error)`](Error) when an error occurs. + async fn fetch_unproved(sdk: &Sdk) -> Result, Error> { + Self::fetch_unproved_with_settings(sdk, RequestSettings::default()).await + } + + /// Fetch unproved data from the Platform with custom settings. + /// + /// ## Parameters + /// - `sdk`: An instance of [Sdk]. + /// - `settings`: Request settings for the connection to Platform. + /// + /// ## Returns + /// Returns: + /// * `Ok(Some(Self))` when object is found. + /// * `Ok(None)` when object is not found. + /// * [`Err(Error)`](Error) when an error occurs. + async fn fetch_unproved_with_settings( + sdk: &Sdk, + settings: RequestSettings, + ) -> Result, Error>; +} + +#[async_trait::async_trait] +impl FetchUnproved for drive_proof_verifier::types::CurrentQuorumsInfo { + type Request = platform_proto::GetCurrentQuorumsInfoRequest; + + async fn fetch_unproved_with_settings( + sdk: &Sdk, + settings: RequestSettings, + ) -> Result, Error> { + // Create the request from the query + let request = Self::Request { + version: Some(proto::get_current_quorums_info_request::Version::V0( + GetCurrentQuorumsInfoRequestV0 {}, + )), + }; + + // Execute the request using the Sdk instance + let response = request.clone().execute(sdk, settings).await?; + + // Parse the response into a CurrentQuorumsInfo object along with metadata + match Self::maybe_from_unproved_with_metadata(request, response, sdk.network, sdk.version()) + { + Ok((Some(info), _metadata)) => Ok(Some(info)), + Ok((None, _metadata)) => Ok(None), + Err(err) => Err(err.into()), + } + } +} diff --git a/packages/rs-sdk/src/platform/transition/withdraw_from_identity.rs b/packages/rs-sdk/src/platform/transition/withdraw_from_identity.rs index 1dbff8c3ea..db06f29a2a 100644 --- a/packages/rs-sdk/src/platform/transition/withdraw_from_identity.rs +++ b/packages/rs-sdk/src/platform/transition/withdraw_from_identity.rs @@ -1,4 +1,3 @@ -use dapi_grpc::platform::VersionedGrpcResponse; use dpp::dashcore::Address; use dpp::identity::accessors::IdentityGettersV0; @@ -7,19 +6,15 @@ use dpp::identity::signer::Signer; use dpp::identity::Identity; use dpp::prelude::UserFeeIncrease; -use dpp::state_transition::identity_credit_withdrawal_transition::IdentityCreditWithdrawalTransition; -use drive_proof_verifier::error::ContextProviderError; -use drive_proof_verifier::DataContractProvider; - -use crate::platform::block_info_from_metadata::block_info_from_metadata; -use crate::platform::transition::broadcast_request::BroadcastRequestForStateTransition; +use crate::platform::transition::broadcast::BroadcastStateTransition; use crate::platform::transition::put_settings::PutSettings; use crate::{Error, Sdk}; -use dpp::state_transition::identity_credit_withdrawal_transition::methods::IdentityCreditWithdrawalTransitionMethodsV0; +use dpp::state_transition::identity_credit_withdrawal_transition::methods::{ + IdentityCreditWithdrawalTransitionMethodsV0, PreferredKeyPurposeForSigningWithdrawal, +}; +use dpp::state_transition::identity_credit_withdrawal_transition::IdentityCreditWithdrawalTransition; use dpp::state_transition::proof_result::StateTransitionProofResult; use dpp::withdrawal::Pooling; -use drive::drive::Drive; -use rs_dapi_client::{DapiRequest, RequestSettings}; #[async_trait::async_trait] pub trait WithdrawFromIdentity { @@ -27,7 +22,7 @@ pub trait WithdrawFromIdentity { async fn withdraw( &self, sdk: &Sdk, - address: Address, + address: Option
, amount: u64, core_fee_per_byte: Option, user_fee_increase: Option, @@ -41,7 +36,7 @@ impl WithdrawFromIdentity for Identity { async fn withdraw( &self, sdk: &Sdk, - address: Address, + address: Option
, amount: u64, core_fee_per_byte: Option, user_fee_increase: Option, @@ -49,52 +44,28 @@ impl WithdrawFromIdentity for Identity { settings: Option, ) -> Result { let new_identity_nonce = sdk.get_identity_nonce(self.id(), true, settings).await?; + let script = address.map(|address| CoreScript::new(address.script_pubkey())); let state_transition = IdentityCreditWithdrawalTransition::try_from_identity( self, - None, - CoreScript::new(address.script_pubkey()), + script, amount, Pooling::Never, core_fee_per_byte.unwrap_or(1), user_fee_increase.unwrap_or_default(), signer, + None, + PreferredKeyPurposeForSigningWithdrawal::TransferPreferred, new_identity_nonce, sdk.version(), None, )?; - let request = state_transition.broadcast_request_for_state_transition()?; - - request - .clone() - .execute(sdk, settings.unwrap_or_default().request_settings) - .await?; - - let request = state_transition.wait_for_state_transition_result_request()?; - - let response = request.execute(sdk, RequestSettings::default()).await?; - - let block_info = block_info_from_metadata(response.metadata()?)?; - - let proof = response.proof_owned()?; - let context_provider = - sdk.context_provider() - .ok_or(Error::from(ContextProviderError::Config( - "Context provider not initialized".to_string(), - )))?; - - let (_, result) = Drive::verify_state_transition_was_executed_with_proof( - &state_transition, - &block_info, - proof.grovedb_proof.as_slice(), - &context_provider.as_contract_lookup_fn(), - sdk.version(), - )?; + let result = state_transition.broadcast_and_wait(sdk, None).await?; match result { StateTransitionProofResult::VerifiedPartialIdentity(identity) => { identity.balance.ok_or(Error::DapiClientError( - "expected an identity balance".to_string(), + "expected an identity balance after withdrawal".to_string(), )) } _ => Err(Error::DapiClientError("proved a non identity".to_string())), diff --git a/packages/simple-signer/Cargo.toml b/packages/simple-signer/Cargo.toml index ae119ef3a2..95a68d598a 100644 --- a/packages/simple-signer/Cargo.toml +++ b/packages/simple-signer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "simple-signer" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true diff --git a/packages/simple-signer/src/signer.rs b/packages/simple-signer/src/signer.rs index f8f8f92f3b..448e1a5c9c 100644 --- a/packages/simple-signer/src/signer.rs +++ b/packages/simple-signer/src/signer.rs @@ -106,4 +106,11 @@ impl Signer for SimpleSigner { )), } } + + fn can_sign_with(&self, identity_public_key: &IdentityPublicKey) -> bool { + self.private_keys + .get(identity_public_key) + .or_else(|| self.private_keys_in_creation.get(identity_public_key)) + .is_some() + } } diff --git a/packages/strategy-tests/Cargo.toml b/packages/strategy-tests/Cargo.toml index bd389a0c35..e353ddf2b5 100644 --- a/packages/strategy-tests/Cargo.toml +++ b/packages/strategy-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "strategy-tests" -version = "1.3.0" +version = "1.4.0-dev.1" authors = [ "Samuel Westrich ", "Ivan Shumkov ", diff --git a/packages/strategy-tests/src/transitions.rs b/packages/strategy-tests/src/transitions.rs index 5a456afa3a..7b0f3d92c4 100644 --- a/packages/strategy-tests/src/transitions.rs +++ b/packages/strategy-tests/src/transitions.rs @@ -22,10 +22,6 @@ use dpp::state_transition::identity_create_transition::IdentityCreateTransition; use dpp::state_transition::identity_credit_transfer_transition::v0::IdentityCreditTransferTransitionV0; use dpp::ProtocolError; -use dpp::state_transition::identity_credit_withdrawal_transition::v0::{ - IdentityCreditWithdrawalTransitionV0, MIN_CORE_FEE_PER_BYTE, -}; - use dpp::native_bls::NativeBlsModule; use dpp::state_transition::identity_topup_transition::methods::IdentityTopUpTransitionMethodsV0; use dpp::state_transition::identity_topup_transition::IdentityTopUpTransition; @@ -40,6 +36,9 @@ use simple_signer::signer::SimpleSigner; use crate::KeyMaps; use dpp::dashcore::transaction::special_transaction::asset_lock::AssetLockPayload; use dpp::dashcore::transaction::special_transaction::TransactionPayload; +use dpp::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; +use dpp::state_transition::identity_credit_withdrawal_transition::MIN_CORE_FEE_PER_BYTE; +use rand::Rng; use std::collections::{BTreeMap, HashSet}; use std::str::FromStr; @@ -448,26 +447,32 @@ pub fn create_identity_update_transition_disable_keys( Some(state_transition) } -/// Creates a state transition for an identity's credit withdrawal. +/// Creates a state transition for an identity's credit withdrawal, with a potential +/// output address based on the identity's capabilities. /// -/// This function generates a state transition representing the withdrawal of credits from an identity. -/// The withdrawal amount is set to 0.001 Dash. The function first bumps the revision -/// of the identity and then constructs the withdrawal transition. Subsequently, it's signed using the -/// identity's authentication key for validity and authenticity. +/// This function generates a state transition representing the withdrawal of credits from +/// an identity. It first checks if the identity has a suitable withdrawal address. If so, +/// there is a 50% chance that the withdrawal will be sent to the identity's transfer key. +/// Otherwise, it will create a withdrawal transition with a random output address. /// /// # Parameters /// - `identity`: A mutable reference to the identity making the withdrawal. +/// - `identity_nonce_counter`: A mutable reference to a BTreeMap that tracks the nonce for +/// each identity, ensuring unique transaction identifiers. /// - `signer`: A mutable reference to the signer used to create the cryptographic signature for /// the state transition. -/// - `rng`: A mutable reference to a random number generator, used for generating the random Pay-To-Script-Hash (P2SH). +/// - `rng`: A mutable reference to a random number generator, used for generating the random +/// Pay-To-Script-Hash (P2SH) when creating a withdrawal with an output address. /// /// # Returns -/// - `StateTransition`: The constructed and signed state transition representing the identity's credit withdrawal. +/// - `StateTransition`: The constructed state transition representing the identity's credit +/// withdrawal. /// /// # Examples /// ```ignore /// let withdrawal_transition = create_identity_withdrawal_transition( /// &mut identity, +/// &mut identity_nonce_counter, /// &mut signer, /// &mut rng, /// ); @@ -475,9 +480,152 @@ pub fn create_identity_update_transition_disable_keys( /// /// # Panics /// This function may panic under the following conditions: +/// - If the identity does not have a suitable withdrawal address or key for signing. +pub fn create_identity_withdrawal_transition( + identity: &mut Identity, + identity_nonce_counter: &mut BTreeMap, + signer: &mut SimpleSigner, + rng: &mut StdRng, +) -> StateTransition { + let has_withdrawal_address = identity + .get_first_public_key_matching( + Purpose::TRANSFER, + HashSet::from([SecurityLevel::CRITICAL]), + HashSet::from([KeyType::ECDSA_HASH160, KeyType::BIP13_SCRIPT_HASH]), + false, + ) + .is_some(); + if has_withdrawal_address && rng.gen_bool(0.5) { + // We can send it to the withdrawal address + create_identity_withdrawal_transition_sent_to_identity_transfer_key( + identity, + identity_nonce_counter, + signer, + ) + } else { + create_identity_withdrawal_transition_with_output_address( + identity, + identity_nonce_counter, + signer, + rng, + ) + } +} + +/// Creates a state transition for an identity's credit withdrawal directed to its +/// transfer key. +/// +/// This function generates a state transition representing the withdrawal of credits from +/// an identity. The withdrawal amount is set to 0.001 Dash. It increments the identity's +/// nonce and constructs the withdrawal transition. The transition is then signed using the +/// identity's authentication key for validity and authenticity. +/// +/// # Parameters +/// - `identity`: A mutable reference to the identity making the withdrawal. +/// - `identity_nonce_counter`: A mutable reference to a BTreeMap that tracks the nonce for +/// each identity, ensuring unique transaction identifiers. +/// - `signer`: A mutable reference to the signer used to create the cryptographic signature for +/// the state transition. +/// +/// # Returns +/// - `StateTransition`: The constructed and signed state transition representing the identity's +/// credit withdrawal directed to its transfer key. +/// +/// # Examples +/// ```ignore +/// let withdrawal_transition = create_identity_withdrawal_transition_sent_to_identity_transfer_key( +/// &mut identity, +/// &mut identity_nonce_counter, +/// &mut signer, +/// ); +/// ``` +/// +/// # Panics +/// This function may panic under the following conditions: /// - If the identity does not have a suitable authentication key for signing. /// - If there's an error during the signing process. -pub fn create_identity_withdrawal_transition( +pub fn create_identity_withdrawal_transition_sent_to_identity_transfer_key( + identity: &mut Identity, + identity_nonce_counter: &mut BTreeMap, + signer: &mut SimpleSigner, +) -> StateTransition { + let nonce = identity_nonce_counter.entry(identity.id()).or_default(); + *nonce += 1; + let mut withdrawal: StateTransition = IdentityCreditWithdrawalTransitionV1 { + identity_id: identity.id(), + amount: 1000000, // 1 duff + core_fee_per_byte: MIN_CORE_FEE_PER_BYTE, + pooling: Pooling::Never, + output_script: None, + nonce: *nonce, + user_fee_increase: 0, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + + let identity_public_key = identity + .get_first_public_key_matching( + Purpose::AUTHENTICATION, + HashSet::from([SecurityLevel::MASTER]), + HashSet::from([ + KeyType::ECDSA_SECP256K1, + KeyType::BLS12_381, + KeyType::ECDSA_HASH160, + KeyType::BIP13_SCRIPT_HASH, + KeyType::EDDSA_25519_HASH160, + ]), + false, + ) + .expect("expected to get a signing key"); + + withdrawal + .sign_external( + identity_public_key, + signer, + None::, + ) + .expect("expected to sign withdrawal"); + + withdrawal +} + +/// Creates a state transition for an identity's credit withdrawal directed to a specified +/// output address. +/// +/// This function generates a state transition representing the withdrawal of credits from +/// an identity. The withdrawal amount is set to 0.001 Dash. It increments the identity's +/// nonce and constructs the withdrawal transition, which includes a random P2SH output address. +/// The transition is then signed using the identity's transfer key for validity and authenticity. +/// +/// # Parameters +/// - `identity`: A mutable reference to the identity making the withdrawal. +/// - `identity_nonce_counter`: A mutable reference to a BTreeMap that tracks the nonce for +/// each identity, ensuring unique transaction identifiers. +/// - `signer`: A mutable reference to the signer used to create the cryptographic signature for +/// the state transition. +/// - `rng`: A mutable reference to a random number generator, used for generating the random +/// Pay-To-Script-Hash (P2SH). +/// +/// # Returns +/// - `StateTransition`: The constructed and signed state transition representing the identity's +/// credit withdrawal directed to the specified output address. +/// +/// # Examples +/// ```ignore +/// let withdrawal_transition = create_identity_withdrawal_transition_with_output_address( +/// &mut identity, +/// &mut identity_nonce_counter, +/// &mut signer, +/// &mut rng, +/// ); +/// ``` +/// +/// # Panics +/// This function may panic under the following conditions: +/// - If the identity does not have a suitable transfer key for signing. +/// - If there's an error during the signing process. +pub fn create_identity_withdrawal_transition_with_output_address( identity: &mut Identity, identity_nonce_counter: &mut BTreeMap, signer: &mut SimpleSigner, @@ -485,12 +633,12 @@ pub fn create_identity_withdrawal_transition( ) -> StateTransition { let nonce = identity_nonce_counter.entry(identity.id()).or_default(); *nonce += 1; - let mut withdrawal: StateTransition = IdentityCreditWithdrawalTransitionV0 { + let mut withdrawal: StateTransition = IdentityCreditWithdrawalTransitionV1 { identity_id: identity.id(), amount: 1000000, // 1 duff core_fee_per_byte: MIN_CORE_FEE_PER_BYTE, pooling: Pooling::Never, - output_script: CoreScript::random_p2sh(rng), + output_script: Some(CoreScript::random_p2sh(rng)), nonce: *nonce, user_fee_increase: 0, signature_public_key_id: 0, diff --git a/packages/wallet-lib/package.json b/packages/wallet-lib/package.json index 8a06a6a1f7..c4caf8e961 100644 --- a/packages/wallet-lib/package.json +++ b/packages/wallet-lib/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/wallet-lib", - "version": "8.3.0", + "version": "8.4.0-dev.1", "description": "Light wallet library for Dash", "main": "src/index.js", "unpkg": "dist/wallet-lib.min.js", diff --git a/packages/wasm-dpp/Cargo.toml b/packages/wasm-dpp/Cargo.toml index dc0588bdd7..194e64f1a6 100644 --- a/packages/wasm-dpp/Cargo.toml +++ b/packages/wasm-dpp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasm-dpp" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true authors = ["Anton Suprunchuk "] diff --git a/packages/wasm-dpp/package.json b/packages/wasm-dpp/package.json index c5f3d58d87..2b9d361397 100644 --- a/packages/wasm-dpp/package.json +++ b/packages/wasm-dpp/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/wasm-dpp", - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "The JavaScript implementation of the Dash Platform Protocol", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/wasm-dpp/src/document/state_transition/document_batch_transition/mod.rs b/packages/wasm-dpp/src/document/state_transition/document_batch_transition/mod.rs index 8904162c21..d0ebb9ae56 100644 --- a/packages/wasm-dpp/src/document/state_transition/document_batch_transition/mod.rs +++ b/packages/wasm-dpp/src/document/state_transition/document_batch_transition/mod.rs @@ -1,4 +1,4 @@ -use dpp::identity::KeyID; +use dpp::identity::{KeyID, Purpose}; use dpp::{ prelude::Identifier, @@ -346,12 +346,22 @@ impl DocumentsBatchTransitionWasm { } #[wasm_bindgen(js_name=getKeySecurityLevelRequirement)] - pub fn get_security_level_requirement(&self) -> js_sys::Array { + pub fn get_security_level_requirement(&self, purpose: u8) -> Result { + // Convert the integer to a Purpose enum + let purpose_enum = match Purpose::try_from(purpose) { + Ok(purpose) => purpose, + Err(_) => { + return Err(JsValue::from_str( + "Invalid purpose value, expected a number between 0 and 5.", + )) + } + }; + let array = js_sys::Array::new(); - for security_level in self.0.security_level_requirement() { + for security_level in self.0.security_level_requirement(purpose_enum) { array.push(&JsValue::from(security_level as u32)); } - array + Ok(array) } // AbstractStateTransition methods diff --git a/packages/wasm-dpp/src/errors/consensus/basic/invalid_signature_public_key_purpose_error.rs b/packages/wasm-dpp/src/errors/consensus/basic/invalid_signature_public_key_purpose_error.rs index 835d9559a8..f81b0a4e87 100644 --- a/packages/wasm-dpp/src/errors/consensus/basic/invalid_signature_public_key_purpose_error.rs +++ b/packages/wasm-dpp/src/errors/consensus/basic/invalid_signature_public_key_purpose_error.rs @@ -23,8 +23,12 @@ impl InvalidSignaturePublicKeyPurposeErrorWasm { } #[wasm_bindgen(js_name=getKeyPurposeRequirement)] - pub fn get_allowed_key_purpose(&self) -> u8 { - self.inner.allowed_key_purpose() as u8 + pub fn get_allowed_key_purposes(&self) -> js_sys::Array { + let array = js_sys::Array::new(); + for purpose in self.inner.allowed_key_purposes() { + array.push(&JsValue::from(*purpose as u8)); + } + array } #[wasm_bindgen(js_name=getCode)] diff --git a/packages/wasm-dpp/src/errors/consensus/basic/wrong_public_key_purpose_error.rs b/packages/wasm-dpp/src/errors/consensus/basic/wrong_public_key_purpose_error.rs index ff07e99701..4f9e9205af 100644 --- a/packages/wasm-dpp/src/errors/consensus/basic/wrong_public_key_purpose_error.rs +++ b/packages/wasm-dpp/src/errors/consensus/basic/wrong_public_key_purpose_error.rs @@ -23,8 +23,12 @@ impl WrongPublicKeyPurposeErrorWasm { } #[wasm_bindgen(js_name=getKeyPurposeRequirement)] - pub fn get_key_purpose_requirement(&self) -> u8 { - self.inner.key_purpose_requirement() as u8 + pub fn get_allowed_key_purposes(&self) -> js_sys::Array { + let array = js_sys::Array::new(); + for purpose in self.inner.allowed_key_purposes() { + array.push(&JsValue::from(*purpose as u8)); + } + array } #[wasm_bindgen(js_name=getCode)] diff --git a/packages/wasm-dpp/src/errors/consensus/consensus_error.rs b/packages/wasm-dpp/src/errors/consensus/consensus_error.rs index 0d4019fc7c..642dce93fc 100644 --- a/packages/wasm-dpp/src/errors/consensus/consensus_error.rs +++ b/packages/wasm-dpp/src/errors/consensus/consensus_error.rs @@ -74,6 +74,8 @@ use dpp::consensus::state::document::document_incorrect_purchase_price_error::Do use dpp::consensus::state::document::document_not_for_sale_error::DocumentNotForSaleError; use dpp::consensus::state::identity::identity_public_key_already_exists_for_unique_contract_bounds_error::IdentityPublicKeyAlreadyExistsForUniqueContractBoundsError; use dpp::consensus::state::identity::master_public_key_update_error::MasterPublicKeyUpdateError; +use dpp::consensus::state::identity::missing_transfer_key_error::MissingTransferKeyError; +use dpp::consensus::state::identity::no_transfer_key_for_core_withdrawal_available_error::NoTransferKeyForCoreWithdrawalAvailableError; use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_insufficient_error::PrefundedSpecializedBalanceInsufficientError; use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_not_found_error::PrefundedSpecializedBalanceNotFoundError; use dpp::consensus::state::voting::masternode_incorrect_voter_identity_id_error::MasternodeIncorrectVoterIdentityIdError; @@ -296,6 +298,12 @@ pub fn from_state_error(state_error: &StateError) -> JsValue { StateError::DocumentContestDocumentWithSameIdAlreadyPresentError(e) => { generic_consensus_error!(DocumentContestDocumentWithSameIdAlreadyPresentError, e).into() } + StateError::MissingTransferKeyError(e) => { + generic_consensus_error!(MissingTransferKeyError, e).into() + } + StateError::NoTransferKeyForCoreWithdrawalAvailableError(e) => { + generic_consensus_error!(NoTransferKeyForCoreWithdrawalAvailableError, e).into() + } } } diff --git a/packages/wasm-dpp/src/identity/state_transition/identity_credit_withdrawal_transition/to_object.rs b/packages/wasm-dpp/src/identity/state_transition/identity_credit_withdrawal_transition/to_object.rs index b0dc0002c8..d805f7f018 100644 --- a/packages/wasm-dpp/src/identity/state_transition/identity_credit_withdrawal_transition/to_object.rs +++ b/packages/wasm-dpp/src/identity/state_transition/identity_credit_withdrawal_transition/to_object.rs @@ -23,7 +23,7 @@ pub struct ToObject { pub amount: u64, pub core_fee_per_byte: u32, pub pooling: Pooling, - pub output_script: CoreScript, + pub output_script: Option, pub nonce: IdentityNonce, pub signature: Option>, pub signature_public_key_id: Option, diff --git a/packages/wasm-dpp/src/identity/state_transition/identity_credit_withdrawal_transition/transition.rs b/packages/wasm-dpp/src/identity/state_transition/identity_credit_withdrawal_transition/transition.rs index 9d75149519..3de33cb834 100644 --- a/packages/wasm-dpp/src/identity/state_transition/identity_credit_withdrawal_transition/transition.rs +++ b/packages/wasm-dpp/src/identity/state_transition/identity_credit_withdrawal_transition/transition.rs @@ -114,14 +114,16 @@ impl IdentityCreditWithdrawalTransitionWasm { } #[wasm_bindgen(js_name=getOutputScript)] - pub fn get_output_script(&self) -> Buffer { - Buffer::from_bytes(self.0.output_script().as_bytes()) + pub fn get_output_script(&self) -> Option { + self.0 + .output_script() + .map(|core_script| Buffer::from_bytes(core_script.as_bytes())) } #[wasm_bindgen(js_name=setOutputScript)] - pub fn set_output_script(&mut self, output_script: Vec) { + pub fn set_output_script(&mut self, output_script: Option>) { self.0 - .set_output_script(CoreScript::from_bytes(output_script)); + .set_output_script(output_script.map(CoreScript::from_bytes)); } #[wasm_bindgen(js_name=getNonce)] @@ -153,6 +155,7 @@ impl IdentityCreditWithdrawalTransitionWasm { let version = match self.0 { IdentityCreditWithdrawalTransition::V0(_) => "0", + IdentityCreditWithdrawalTransition::V1(_) => "1", }; js_sys::Reflect::set(&js_object, &"$version".to_owned().into(), &version.into())?; @@ -205,12 +208,15 @@ impl IdentityCreditWithdrawalTransitionWasm { &JsValue::from_f64((object.pooling as u8) as f64), )?; - let output_script = Buffer::from_bytes(object.output_script.as_bytes()); - js_sys::Reflect::set( - &js_object, - &"outputScript".to_owned().into(), - &output_script.into(), - )?; + if let Some(output_script) = object.output_script { + let output_script = Buffer::from_bytes(output_script.as_bytes()); + + js_sys::Reflect::set( + &js_object, + &"outputScript".to_owned().into(), + &output_script.into(), + )?; + } js_sys::Reflect::set( &js_object, @@ -243,6 +249,7 @@ impl IdentityCreditWithdrawalTransitionWasm { let version = match self.0 { IdentityCreditWithdrawalTransition::V0(_) => "0", + IdentityCreditWithdrawalTransition::V1(_) => "1", }; js_sys::Reflect::set(&js_object, &"$version".to_owned().into(), &version.into())?; @@ -297,16 +304,16 @@ impl IdentityCreditWithdrawalTransitionWasm { &JsValue::from_f64((object.pooling as u8) as f64), )?; - let output_script = platform_value::string_encoding::encode( - object.output_script.as_bytes(), - Encoding::Base64, - ); + if let Some(output_script) = object.output_script { + let output_script = + platform_value::string_encoding::encode(output_script.as_bytes(), Encoding::Base64); - js_sys::Reflect::set( - &js_object, - &"outputScript".to_owned().into(), - &output_script.into(), - )?; + js_sys::Reflect::set( + &js_object, + &"outputScript".to_owned().into(), + &output_script.into(), + )?; + } js_sys::Reflect::set( &js_object, diff --git a/packages/withdrawals-contract/Cargo.toml b/packages/withdrawals-contract/Cargo.toml index 2408bb012f..357bc6d42f 100644 --- a/packages/withdrawals-contract/Cargo.toml +++ b/packages/withdrawals-contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "withdrawals-contract" description = "Witdrawals data contract schema and tools" -version = "1.3.0" +version = "1.4.0-dev.1" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/withdrawals-contract/package.json b/packages/withdrawals-contract/package.json index c34500ef87..749f7e7070 100644 --- a/packages/withdrawals-contract/package.json +++ b/packages/withdrawals-contract/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/withdrawals-contract", - "version": "1.3.0", + "version": "1.4.0-dev.1", "description": "Data Contract to manipulate and track withdrawals", "scripts": { "build": "",