Skip to content

BUG: Test failures for ElectionFactory.createElection due to function signature mismatch (ethers v6) #216

@Esar1212

Description

@Esar1212

Is there an existing issue for this?

  • I have searched the existing issues

Issue Description ✍️

📌 Describe the Bug

On a fresh local setup, the test suite fails consistently when invoking ElectionFactory.createElection.

The failure appears to be caused by a mismatch between the Solidity function signature and the arguments used in the tests, which is surfaced when using ethers v6 (strict ABI fragment resolution).

🚨 Actual Behavior

Running the test suite results in the following error:

Error: no matching fragment (operation="fragment", key="createElection")

This error occurs across multiple test cases related to election creation and deletion.

The failure is triggered when tests attempt to call createElection without supplying all required parameters defined in the contract ABI.

🎯 Expected Behavior

The createElection function should be invoked with arguments that correctly match its Solidity signature, allowing the test suite to execute successfully without ABI resolution errors.

💡 Suggestions

Possible resolutions:

i) Update tests to pass a valid Election.Candidate[] argument, or

ii) Adjust the factory interface if the intended API has changed.

This issue is surfaced clearly when using ethers v6, which enforces strict ABI fragment matching.

I would be happy to work on a fix once aligned with the maintainers on the intended behavior.

Record

  • I have synced all my node versions as mentioned in the project
  • I am using the same version of npm as is the project
  • My current branch is in sync with the development branch
  • I want to work on this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions