feat: libs: add Promise.resolve in getGovProposalTally

In the getGovProposalTally method, added `Promise.resolve` to the adapter function to ensure it returns a Promise.
This resolves the TypeScript error related to the return type mismatch.

Signed-off-by: Salman Wahib <sxlmnwb@nodex.one>
This commit is contained in:
Salman Wahib
2024-01-31 12:03:48 +00:00
parent 4c53591e85
commit 4e0606b8ab
2 changed files with 17 additions and 3 deletions
+5 -3
View File
@@ -162,13 +162,15 @@ export class CosmosRestClient extends BaseRestClient<RequestRegistry> {
}
async getGovProposalTally(proposal_id: string) {
return this.request(this.registry.gov_proposals_tally, { proposal_id }, undefined, (source: any) => {
return {tally: {
return Promise.resolve({ tally: {
yes: source.tally.yes || source.tally.yes_count,
abstain: source.tally.abstain || source.tally.abstain_count,
no: source.tally.no || source.tally.no_count,
no_with_veto: source.tally.no_with_veto || source.tally.no_with_veto_count,
}};
});
},
});
}
);
}
async getGovProposalVotes(proposal_id: string, page?: PageRequest) {
if(!page) page = new PageRequest()