Skip to content

types: is a Proposal with Height == 0 valid? #2210

@cason

Description

@cason

A Proposal with height 0 is considered valid, see:

if p.Height < 0 {
return errors.New("negative Height")
}

The associated test unit only tests height -1, see:

{"Invalid Height", func(p *Proposal) { p.Height = -1 }, true},

But as @sergio-mena pointed out in #2206 (comment):

          I checked the validation function and it's true it allows for height 0, but is it a bug? I searched around and never saw the height being set to 0, neither in production nor in tests (maybe I missed it)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P:tech-debtPriority: Technical debt that needs to be paid off to enable us to move faster, reliablyhygieneAny work relating to code legibility/hygiene to make it easier to read

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions