defi-wonderland / smock

The Solidity mocking library
MIT License
319 stars 40 forks source link

Support for enum in mapping with setVariable #145

Open ltyu opened 2 years ago

ltyu commented 2 years ago

Is your feature request related to a problem? Please describe. I am unable to usemyMock.setVariable with enums. See example below:

enum ProposalState {
    VOTING,
    QUEUED,
    EXECUTED,
    FAILED
}

struct Proposal {
    uint256 id;
    ProposalState state;
}

mapping(uint => Proposal) public proposals;

When i try to run

await collectorDAO.setVariable("proposals", { 456 : { state: 1 }});

I get Error: unknown unsupported type inplace enum CollectorDAO.ProposalState

Describe the solution you'd like Support for enum setting

rungwe commented 1 year ago

I am facing the same problem

nknavkal commented 9 months ago

me too