frangio / hardhat-exposed

Automatically expose internal Solidity functions for smart contract testing.
82 stars 13 forks source link

Expose setters for mappings/arrays #23

Closed benzo-diazepine closed 1 year ago

benzo-diazepine commented 1 year ago

The title says everything. There are many cases where I need to test a specific function which relies on values set in mappings/arrays, I know I can write internal setters myself, but leaving it in the final contract code does not look very good in my opinion, would it be possible to include setters?

frangio commented 1 year ago

I know I can write internal setters myself, but leaving it in the final contract code does not look very good in my opinion

One thing you can do is write an intermediate contract with setters and use the exposed version of that intermediate contract.