You need to sign in or sign up before continuing.
Commit 3c982c58 authored by Quentin Hamitouche's avatar Quentin Hamitouche

Fix index signature errors

parent eb3cfb5e
No related merge requests found
......@@ -113,19 +113,19 @@ export class ContractService {
this.contract = new ethers.Contract(this.contractAddress, VOTING_ABI, this.signer);
// Récupérer le propriétaire du contrat
const owner = await this.contract.owner();
const owner = await this.contract['owner']();
const account = this.accountSubject.getValue();
this.isOwnerSubject.next(account?.toLowerCase() === owner.toLowerCase());
// Récupérer le statut actuel du workflow
const status = await this.contract.workflowStatus();
const status = await this.contract['workflowStatus']();
this.currentStatusSubject.next(status.toString());
// Vérifier si l'utilisateur est un électeur inscrit
try {
if (account) {
const voter = await this.contract.getVoter(account);
const voter = await this.contract['getVoter'](account);
this.isVoterSubject.next(voter.isRegistered);
} else {
this.isVoterSubject.next(false);
......@@ -192,7 +192,8 @@ export class ContractService {
throw new Error('Contrat non initialisé');
}
const tx = await this.contract.registerVoter(voterAddress);
const tx = await this.contract[
'registerVoter'](voterAddress);
await tx.wait();
this.loadingSubject.next(false);
......@@ -212,7 +213,7 @@ export class ContractService {
throw new Error('Contrat non initialisé');
}
const tx = await this.contract.startProposalsRegistration(durationInMinutes);
const tx = await this.contract['startProposalsRegistration'](durationInMinutes);
await tx.wait();
this.loadingSubject.next(false);
......@@ -232,7 +233,7 @@ export class ContractService {
throw new Error('Contrat non initialisé');
}
const tx = await this.contract.endProposalsRegistration();
const tx = await this.contract['endProposalsRegistration']();
await tx.wait();
this.loadingSubject.next(false);
......@@ -252,7 +253,7 @@ export class ContractService {
throw new Error('Contrat non initialisé');
}
const tx = await this.contract.registerProposal(description);
const tx = await this.contract['registerProposal'](description);
await tx.wait();
this.loadingSubject.next(false);
......@@ -272,7 +273,7 @@ export class ContractService {
throw new Error('Contrat non initialisé');
}
const tx = await this.contract.startVotingSession(durationInMinutes);
const tx = await this.contract['startVotingSession'](durationInMinutes);
await tx.wait();
this.loadingSubject.next(false);
......@@ -292,7 +293,7 @@ export class ContractService {
throw new Error('Contrat non initialisé');
}
const tx = await this.contract.endVotingSession();
const tx = await this.contract['endVotingSession']();
await tx.wait();
this.loadingSubject.next(false);
......@@ -312,7 +313,7 @@ export class ContractService {
throw new Error('Contrat non initialisé');
}
const tx = await this.contract.vote(proposalId);
const tx = await this.contract['vote'](proposalId);
await tx.wait();
this.loadingSubject.next(false);
......@@ -332,7 +333,7 @@ export class ContractService {
throw new Error('Contrat non initialisé');
}
const tx = await this.contract.delegateVoteTo(delegateAddress);
const tx = await this.contract['delegateVoteTo'](delegateAddress);
await tx.wait();
this.loadingSubject.next(false);
......@@ -352,7 +353,7 @@ export class ContractService {
throw new Error('Contrat non initialisé');
}
const tx = await this.contract.tallyVotes();
const tx = await this.contract['tallyVotes']();
await tx.wait();
this.loadingSubject.next(false);
......@@ -369,11 +370,11 @@ export class ContractService {
throw new Error('Contrat non initialisé');
}
const count = await this.contract.getProposalsCount();
const count = await this.contract['getProposalsCount']();
const proposals = [];
for (let i = 0; i < count; i++) {
const proposal = await this.contract.getProposal(i);
const proposal = await this.contract['getProposal'](i);
proposals.push({
id: i,
description: proposal.description,
......@@ -395,7 +396,7 @@ export class ContractService {
throw new Error('Contrat non initialisé');
}
const voter = await this.contract.getVoter(address);
const voter = await this.contract['getVoter'](address);
return {
isRegistered: voter.isRegistered,
hasVoted: voter.hasVoted,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment