Skip to content

Commit

Permalink
Fixes bugs caused by new proposalID
Browse files Browse the repository at this point in the history
  • Loading branch information
emmdim committed Nov 3, 2023
1 parent 50efffb commit 48a7cd9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/js-client/src/internal/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export interface IGaslessVotingClientMethods {
proposalId: string,
tryExecutio: boolean
): AsyncGenerator<ApproveTallyStepValue>;
execute(
executeProposal(
proposalId: string
): AsyncGenerator<ExecuteProposalStepValue>;
pinMetadata(params: ProposalMetadata): Promise<string>;
Expand All @@ -97,7 +97,7 @@ export interface IGaslessVotingClientEstimation {
results: bigint[][]
): Promise<GasFeeEstimation>;
approve(proposalId: string): Promise<GasFeeEstimation>;
execute(proposalId: string): Promise<GasFeeEstimation>;
executeProposal(proposalId: string): Promise<GasFeeEstimation>;
// Add any estimation methods that you need
}
export interface IGaslessVotingClientEncoding {
Expand Down
5 changes: 2 additions & 3 deletions packages/js-client/src/internal/modules/estimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export class GaslessVotingClientEstimation
signer
);


const estimatedGasFee = await gaslessVotingContract.estimateGas.setTally(
id,
results
Expand All @@ -116,7 +115,7 @@ export class GaslessVotingClientEstimation
);

const proposalFromSC = toGaslessVotingProposal(
await gaslessVotingContract.getProposal(proposalId)
await gaslessVotingContract.getProposal(id)
);
const vochainProposal = await this.vocdoniSDK.fetchElection(
proposalFromSC.vochainProposalId
Expand Down Expand Up @@ -145,7 +144,7 @@ export class GaslessVotingClientEstimation
* @return {*} {Promise<GasFeeEstimation>}
* @memberof GaslessVotingClientEstimation
*/
public async execute(
public async executeProposal(
proposalId: string
): Promise<GasFeeEstimation> {
const signer = this.web3.getConnectedSigner();
Expand Down
8 changes: 4 additions & 4 deletions packages/js-client/src/internal/modules/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export class GaslessVotingClientMethods
);

const proposalFromSC = toGaslessVotingProposal(
await gaslessVotingContract.getProposal(proposalId)
await gaslessVotingContract.getProposal(id)
);
const vochainProposal = await this.vocdoniSDK.fetchElection(
proposalFromSC.vochainProposalId
Expand All @@ -519,7 +519,7 @@ export class GaslessVotingClientMethods

if (proposalFromSC.approvers.length == 0) {
return this.setTally(
encodeProposalId(pluginAddress,id),
proposalId,
vochainResultsToSCResults(vochainProposal)
);
}
Expand Down Expand Up @@ -552,7 +552,7 @@ export class GaslessVotingClientMethods
signer
);

let tx = await gaslessVotingContract.setTally(proposalId, results);
let tx = await gaslessVotingContract.setTally(id, results);

yield {
key: ApproveTallyStep.EXECUTING,
Expand Down Expand Up @@ -614,7 +614,7 @@ export class GaslessVotingClientMethods
* @return {*} {AsyncGenerator<ExecuteProposalStepValue>}
* @memberof GaslessVotingClientMethods
*/
public async *execute(
public async *executeProposal(
proposalId: string
): AsyncGenerator<ExecuteProposalStepValue> {
const { pluginAddress, id } = decodeProposalId(proposalId);
Expand Down

0 comments on commit 48a7cd9

Please sign in to comment.