Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Weight trait and WeightInfo implementation should be compatible.  #7028

@kianenigma

Description

@kianenigma

Currently, they are not if we have unused parameters. The trait definition will have the unused parameters while the impl will not.

I don't have a preference, but they should be consistent.

I see that currently it is problematic because in the function generating the trait you don't do the analysis, so you donno if a component is used or not. I would just remove the --weight-trait flag and always write the trait and impl together.
then we can actually have tests that ensure what they produce compiles.

Currently as @shawntabrizi said the trait definition is just a helper and it should be manually tweaked. I think it can and should be fully automatic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    J0-enhancementAn additional feature request.

    Type

    No type

    Projects

    Status

    Archive

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions