Skip to content

Commit

Permalink
SERVICES-2603: remove wrapper method getVoteEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
mad2sm0key committed Jan 10, 2025
1 parent e6dec84 commit 101710e
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/modules/governance/services/governance.compute.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Address } from '@multiversx/sdk-core/out';
import { decimalToHex } from '../../../utils/token.converters';
import { toVoteType } from '../../../utils/governance';
import { ElasticSearchEventsService } from 'src/services/elastic-search/services/es.events.service';
import { RawElasticEventType } from 'src/services/elastic-search/entities/raw.elastic.event';

@Injectable()
export class GovernanceComputeService {
Expand All @@ -31,10 +30,10 @@ export class GovernanceComputeService {
return cachedVoteType.vote;
}

const voteEvents = await this.getVoteEvents(
const voteEvents = await this.elasticEventsService.getGovernanceVotes(
scAddress,
userAddress,
proposalId,
Address.fromString(userAddress).hex(),
decimalToHex(proposalId),
);

let voteType = VoteType.NotVoted;
Expand Down Expand Up @@ -72,16 +71,4 @@ export class GovernanceComputeService {
): Promise<{ proposalId: number; vote: VoteType }[]> {
return [];
}

private async getVoteEvents(
scAddress: string,
callerAddress: string,
proposalId: number,
): Promise<RawElasticEventType[]> {
return await this.elasticEventsService.getGovernanceVotes(
scAddress,
Address.fromString(callerAddress).hex(),
decimalToHex(proposalId),
);
}
}

0 comments on commit 101710e

Please sign in to comment.