Skip to content

getRequired should not be in charge of resetting currentSpend #14

@joshuahannan

Description

@joshuahannan

Ideally, function names should be aligned as much as possible with the semantics of their implementation. In the case of getRequired, the function doesn’t only get the number of required confirmations for a transaction, but is also in charge of resetting currentSpend values. The word “get”, used in the function’s name implies that it simply reads or calculates a value, without changing the contract’s state.
Consider extracting the currentSpend resetting functionality into a different function, and calling it independently. This would in turn allow getRequired’s visibility to be changed to view.

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