Skip to content

[Macro] Add init decorator so that init methods require that the subcontract state is None #92

@willemneal

Description

@willemneal
          I think I understand  - `&mut self` here opens us up to the possibility that the internal state of the singleton can be overwritten. 

Are you saying that you want to redesign this so that users aren't able to get themselves into that situation by initializing a contract with a state of None. And then other methods require that the state is Some? Otherwise it will indicate that the contract hasn't been initialized.

That all makes sense to me!

Originally posted by @elizabethengelman in #91 (comment)

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