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.

Use weight constants:: in the weight template #11215

@ggwpez

Description

@ggwpez

The weight template currently outputs something like (x as Weight) which is semantically not very clear.
Changing this to (x * constants::WEIGHT_PER_NANOS) with the correct units would be much better.

One possible approach:

  • Write a function that correctly formats the weight, eg. 38_000_000 becomes 38_000 * WEIGHT_PER_NANOS
  • PS: Better call this function directly from the template

WEIGHT_PER_NANOS is probably the only one that we can use, as it would otherwise use float point multiplication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    J0-enhancementAn additional feature request.U3-nice_to_haveIssue is worth doing eventually.Z1-easyCan be fixed primarily by duplicating and adapting code by an intermediate coderZ6-mentorAn easy task where a mentor is available. Please indicate in the issue who the mentor could be.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions