getTally method

Future<FinalTallyResult> getTally(
  1. double proposalID
)

Implementation

Future<FinalTallyResult> getTally(double proposalID) async {
  String root =
      "${TerraClientConfiguration.blockchainResourcePath}${CosmosBaseConstants.COSMOS_GOV_PROPOSALS}/$proposalID/${CosmosGovConstants.TALLY}";

  var response =
      await apiRequester.getAsync<ProposalsResponseContainerValueJSON>(root);
  if (response.successful!) {
    var results =
        ProposalsResponseContainerValueJSON.fromJson(response.result!);

    return FinalTallyResult.fromJSON(results.final_tally_result);
  }

  throw Exception("");
}