Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(platform)!: total credits on platform query and fix for reward distribution #2032

Merged
merged 31 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ea2a5ad
start work
QuantumExplorer Aug 1, 2024
78964fc
cleanup
QuantumExplorer Aug 1, 2024
deb7ceb
more work
QuantumExplorer Aug 2, 2024
456149e
total credits on platform
QuantumExplorer Aug 2, 2024
a360569
added JS dapi client for get total credits on platform
QuantumExplorer Aug 2, 2024
276e75f
dealth with core subsidy issue
QuantumExplorer Aug 4, 2024
c16685e
fmt
QuantumExplorer Aug 4, 2024
1f10ed5
fixes
QuantumExplorer Aug 4, 2024
461bc1b
work on subsidy
QuantumExplorer Aug 4, 2024
2ffb6d7
more work
QuantumExplorer Aug 4, 2024
7db6c30
small fix
QuantumExplorer Aug 5, 2024
3c41e7e
chore: pass network option to Drive ABCI (#2037)
shumkov Aug 5, 2024
edde351
fix: invalid network alias deserializer
shumkov Aug 5, 2024
6a28efd
chore(dashmate): set epoch time 20 mins for local
shumkov Aug 5, 2024
345d1f0
more fixes
QuantumExplorer Aug 5, 2024
845550a
updated sdk
QuantumExplorer Aug 5, 2024
32c4fa4
Merge branch 'feat/totalCreditsOnPlatformQuery' of github.com:dashpay…
QuantumExplorer Aug 5, 2024
5b5ebe8
fixes
QuantumExplorer Aug 5, 2024
0c709ab
fixes
QuantumExplorer Aug 5, 2024
bc606d7
more work
QuantumExplorer Aug 7, 2024
7f1b86a
Merge branch 'v1.1-dev' into feat/totalCreditsOnPlatformQuery
QuantumExplorer Aug 7, 2024
c9a8857
more fixes
QuantumExplorer Aug 7, 2024
8f00f99
version working
QuantumExplorer Aug 7, 2024
6742e55
set to mainnet
QuantumExplorer Aug 8, 2024
a25cdb8
another fix
QuantumExplorer Aug 12, 2024
d0c3976
off by 1
QuantumExplorer Aug 12, 2024
17766d0
fmt
QuantumExplorer Aug 12, 2024
6e57d50
fix: incorrect version in migrations
shumkov Aug 13, 2024
976cd11
Merge branch 'v1.1-dev' into feat/totalCreditsOnPlatformQuery
shumkov Aug 13, 2024
b383e80
Merge branch 'v1.1-dev' into feat/totalCreditsOnPlatformQuery
shumkov Aug 13, 2024
c3ab250
Merge branch 'v1.1-dev' into feat/totalCreditsOnPlatformQuery
shumkov Aug 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/dapi-grpc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
// Derive features for versioned messages
//
// "GetConsensusParamsRequest" is excluded as this message does not support proofs
const VERSIONED_REQUESTS: [&str; 25] = [
const VERSIONED_REQUESTS: [&str; 26] = [
"GetDataContractHistoryRequest",
"GetDataContractRequest",
"GetDataContractsRequest",
Expand All @@ -73,10 +73,11 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
"GetContestedResourceVotersForIdentityRequest",
"GetContestedResourceIdentityVotesRequest",
"GetVotePollsByEndDateRequest",
"GetTotalCreditsInPlatformRequest",
];

// "GetConsensusParamsResponse" is excluded as this message does not support proofs
const VERSIONED_RESPONSES: [&str; 26] = [
const VERSIONED_RESPONSES: [&str; 27] = [
"GetDataContractHistoryResponse",
"GetDataContractResponse",
"GetDataContractsResponse",
Expand All @@ -103,6 +104,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
"GetContestedResourceVotersForIdentityResponse",
"GetContestedResourceIdentityVotesResponse",
"GetVotePollsByEndDateResponse",
"GetTotalCreditsInPlatformResponse",
];

check_unique(&VERSIONED_REQUESTS).expect("VERSIONED_REQUESTS");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,37 @@ org.dash.platform.dapi.v0.PlatformOuterClass.GetPrefundedSpecializedBalanceRespo
return getGetPrefundedSpecializedBalanceMethod;
}

private static volatile io.grpc.MethodDescriptor<org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest,
org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse> getGetTotalCreditsInPlatformMethod;

@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "getTotalCreditsInPlatform",
requestType = org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest.class,
responseType = org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest,
org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse> getGetTotalCreditsInPlatformMethod() {
io.grpc.MethodDescriptor<org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest, org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse> getGetTotalCreditsInPlatformMethod;
if ((getGetTotalCreditsInPlatformMethod = PlatformGrpc.getGetTotalCreditsInPlatformMethod) == null) {
synchronized (PlatformGrpc.class) {
if ((getGetTotalCreditsInPlatformMethod = PlatformGrpc.getGetTotalCreditsInPlatformMethod) == null) {
PlatformGrpc.getGetTotalCreditsInPlatformMethod = getGetTotalCreditsInPlatformMethod =
io.grpc.MethodDescriptor.<org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest, org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "getTotalCreditsInPlatform"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse.getDefaultInstance()))
.setSchemaDescriptor(new PlatformMethodDescriptorSupplier("getTotalCreditsInPlatform"))
.build();
}
}
}
return getGetTotalCreditsInPlatformMethod;
}

private static volatile io.grpc.MethodDescriptor<org.dash.platform.dapi.v0.PlatformOuterClass.GetPathElementsRequest,
org.dash.platform.dapi.v0.PlatformOuterClass.GetPathElementsResponse> getGetPathElementsMethod;

Expand Down Expand Up @@ -1059,6 +1090,13 @@ public void getPrefundedSpecializedBalance(org.dash.platform.dapi.v0.PlatformOut
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPrefundedSpecializedBalanceMethod(), responseObserver);
}

/**
*/
public void getTotalCreditsInPlatform(org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest request,
io.grpc.stub.StreamObserver<org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTotalCreditsInPlatformMethod(), responseObserver);
}

/**
*/
public void getPathElements(org.dash.platform.dapi.v0.PlatformOuterClass.GetPathElementsRequest request,
Expand Down Expand Up @@ -1243,6 +1281,13 @@ public void getPathElements(org.dash.platform.dapi.v0.PlatformOuterClass.GetPath
org.dash.platform.dapi.v0.PlatformOuterClass.GetPrefundedSpecializedBalanceRequest,
org.dash.platform.dapi.v0.PlatformOuterClass.GetPrefundedSpecializedBalanceResponse>(
this, METHODID_GET_PREFUNDED_SPECIALIZED_BALANCE)))
.addMethod(
getGetTotalCreditsInPlatformMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest,
org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse>(
this, METHODID_GET_TOTAL_CREDITS_IN_PLATFORM)))
.addMethod(
getGetPathElementsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
Expand Down Expand Up @@ -1483,6 +1528,14 @@ public void getPrefundedSpecializedBalance(org.dash.platform.dapi.v0.PlatformOut
getChannel().newCall(getGetPrefundedSpecializedBalanceMethod(), getCallOptions()), request, responseObserver);
}

/**
*/
public void getTotalCreditsInPlatform(org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest request,
io.grpc.stub.StreamObserver<org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetTotalCreditsInPlatformMethod(), getCallOptions()), request, responseObserver);
}

/**
*/
public void getPathElements(org.dash.platform.dapi.v0.PlatformOuterClass.GetPathElementsRequest request,
Expand Down Expand Up @@ -1696,6 +1749,13 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.GetPrefundedSpecializedBalan
getChannel(), getGetPrefundedSpecializedBalanceMethod(), getCallOptions(), request);
}

/**
*/
public org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse getTotalCreditsInPlatform(org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetTotalCreditsInPlatformMethod(), getCallOptions(), request);
}

/**
*/
public org.dash.platform.dapi.v0.PlatformOuterClass.GetPathElementsResponse getPathElements(org.dash.platform.dapi.v0.PlatformOuterClass.GetPathElementsRequest request) {
Expand Down Expand Up @@ -1933,6 +1993,14 @@ public com.google.common.util.concurrent.ListenableFuture<org.dash.platform.dapi
getChannel().newCall(getGetPrefundedSpecializedBalanceMethod(), getCallOptions()), request);
}

/**
*/
public com.google.common.util.concurrent.ListenableFuture<org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse> getTotalCreditsInPlatform(
org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetTotalCreditsInPlatformMethod(), getCallOptions()), request);
}

/**
*/
public com.google.common.util.concurrent.ListenableFuture<org.dash.platform.dapi.v0.PlatformOuterClass.GetPathElementsResponse> getPathElements(
Expand Down Expand Up @@ -1967,7 +2035,8 @@ public com.google.common.util.concurrent.ListenableFuture<org.dash.platform.dapi
private static final int METHODID_GET_CONTESTED_RESOURCE_IDENTITY_VOTES = 22;
private static final int METHODID_GET_VOTE_POLLS_BY_END_DATE = 23;
private static final int METHODID_GET_PREFUNDED_SPECIALIZED_BALANCE = 24;
private static final int METHODID_GET_PATH_ELEMENTS = 25;
private static final int METHODID_GET_TOTAL_CREDITS_IN_PLATFORM = 25;
private static final int METHODID_GET_PATH_ELEMENTS = 26;

private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
Expand Down Expand Up @@ -2086,6 +2155,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserv
serviceImpl.getPrefundedSpecializedBalance((org.dash.platform.dapi.v0.PlatformOuterClass.GetPrefundedSpecializedBalanceRequest) request,
(io.grpc.stub.StreamObserver<org.dash.platform.dapi.v0.PlatformOuterClass.GetPrefundedSpecializedBalanceResponse>) responseObserver);
break;
case METHODID_GET_TOTAL_CREDITS_IN_PLATFORM:
serviceImpl.getTotalCreditsInPlatform((org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformRequest) request,
(io.grpc.stub.StreamObserver<org.dash.platform.dapi.v0.PlatformOuterClass.GetTotalCreditsInPlatformResponse>) responseObserver);
break;
case METHODID_GET_PATH_ELEMENTS:
serviceImpl.getPathElements((org.dash.platform.dapi.v0.PlatformOuterClass.GetPathElementsRequest) request,
(io.grpc.stub.StreamObserver<org.dash.platform.dapi.v0.PlatformOuterClass.GetPathElementsResponse>) responseObserver);
Expand Down Expand Up @@ -2176,6 +2249,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
.addMethod(getGetContestedResourceIdentityVotesMethod())
.addMethod(getGetVotePollsByEndDateMethod())
.addMethod(getGetPrefundedSpecializedBalanceMethod())
.addMethod(getGetTotalCreditsInPlatformMethod())
.addMethod(getGetPathElementsMethod())
.build();
}
Expand Down
Loading
Loading