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

fix(dapi): getTotalCreditsOnPlatform missing parts #2059

Merged
merged 37 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 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
b70c5bd
initial commit
owl352 Aug 12, 2024
f1d1209
names fix
owl352 Aug 12, 2024
4e66480
Merge branch 'v1.1-dev' into feat/totalCreditsOnPlatformQuery
pshenmic Aug 14, 2024
9371b87
fix response
owl352 Aug 14, 2024
14a8ea7
names fix
owl352 Aug 14, 2024
27ea677
name fix
owl352 Aug 14, 2024
36ad576
names fix
owl352 Aug 14, 2024
f7a4063
facade fix
owl352 Aug 14, 2024
be5db01
Merge remote-tracking branch 'dashpay/v1.1-dev' into feat/totalCredit…
owl352 Aug 14, 2024
258cfb2
fix response
owl352 Aug 14, 2024
727f405
chore(dapi): lint fix
pshenmic Aug 14, 2024
047783c
chore(dapi): lint fix
pshenmic Aug 14, 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
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ const {
GetIdentityNonceResponse: PBJSGetIdentityNonceResponse,
GetIdentityKeysRequest: PBJSGetIdentityKeysRequest,
GetIdentityKeysResponse: PBJSGetIdentityKeysResponse,
GetTotalCreditsInPlatformRequest: PBJSGetTotalCreditsInPlatformRequest,
GetTotalCreditsInPlatformResponse: PBJSGetTotalCreditsInPlatformResponse,
},
},
},
Expand All @@ -82,6 +84,7 @@ const {
GetIdentityContractNonceResponse: ProtocGetIdentityContractNonceResponse,
GetIdentityNonceResponse: ProtocGetIdentityNonceResponse,
GetIdentityKeysResponse: ProtocGetIdentityKeysResponse,
GetTotalCreditsInPlatformResponse: ProtocGetTotalCreditsInPlatformResponse,
} = require('./platform_protoc');

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

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

this.protocolVersion = undefined;
}

Expand Down Expand Up @@ -690,6 +697,35 @@ class PlatformPromiseClient {
);
}

getTotalCreditsInPlatform(
getTotalCreditsInPlatformRequest,
metadata = {},
options = {},
) {
if (!isObject(metadata)) {
throw new Error('metadata must be an object');
}

return this.client.getTotalCreditsInPlatform(
getTotalCreditsInPlatformRequest,
convertObjectToMetadata(metadata),
{
interceptors: [
jsonToProtobufInterceptorFactory(
jsonToProtobufFactory(
ProtocGetTotalCreditsInPlatformResponse,
PBJSGetTotalCreditsInPlatformResponse,
),
protobufToJsonFactory(
PBJSGetTotalCreditsInPlatformRequest,
),
),
],
...options,
},
);
}

/**
* @param {string} protocolVersion
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const getProtocolVersionUpgradeStateFactory = require('./getProtocolVersionUpgra
const getIdentityContractNonceFactory = require('./getIdentityContractNonce/getIdentityContractNonceFactory');
const getIdentityNonceFactory = require('./getIdentityNonce/getIdentityNonceFactory');
const getIdentityKeysFactory = require('./getIdentityKeys/getIdentityKeysFactory');
const getTotalCreditsInPlatformFactory = require('./getTotalCreditsInPlatform/getTotalCreditsInPlatformFactory');

class PlatformMethodsFacade {
/**
Expand All @@ -36,6 +37,7 @@ class PlatformMethodsFacade {
this.getIdentityContractNonce = getIdentityContractNonceFactory(grpcTransport);
this.getIdentityNonce = getIdentityNonceFactory(grpcTransport);
this.getIdentityKeys = getIdentityKeysFactory(grpcTransport);
this.getTotalCreditsInPlatform = getTotalCreditsInPlatformFactory(grpcTransport);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class GetTotalCreditsInPlatformResponse extends AbstractResponse {
*/
static createFromProto(proto) {
// eslint-disable-next-line
const totalCreditsInPlatform = proto.getV0().getTotalCreditsInPlatform();
const totalCreditsInPlatform = proto.getV0().getCredits();
const { metadata, proof } = AbstractResponse.createMetadataAndProofFromProto(
proto,
);
Expand Down
Loading