Skip to content

fix: resolve courts() return type misalignment in populateCourts script #2317

@coderabbitai

Description

@coderabbitai

Summary

The contracts/scripts/populateCourts.ts script currently uses @ts-expect-error suppressions to work around a misalignment between the expected way to access additional court parameters (e.g., hiddenVotes, jurorsForCourtJump) from the courts() return type and the actual runtime shape.

Context

The following @ts-expect-error comments were added as a temporary workaround to allow the check-types script to pass:

// @ts-expect-error populateCourts additionalCourtParams types
// Currently, there seems to be a misalignment between the expected way to access additional court params and the actual way to access them.
// This comment allows the check-types script to pass, but the script needs updating to deal with current `courts()` return type.

These suppressions affect access to courtPresent.hiddenVotes and courtPresent.jurorsForCourtJump in the court update loop.

Action Required

Investigate and fix the type mismatch between the TypeChain-generated KlerosCore.courts() return type and the actual fields being accessed in the script, removing the @ts-expect-error suppressions once the types are properly aligned.

References

/cc @kyrers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions