A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sc-forks/solidity-coverage/issues/281 below:

Instrument public storage variable getters · Issue #281 · sc-forks/solidity-coverage · GitHub

Solidity public state variables have getter functions automatically generated for them, making them part of the public API of a contract. Testing that they exist and can be used is therefore important, since it helps prevent regression bugs (e.g. the variable becoming private). It'd be great if solidity-coverage reported which of these getters are being called during testing, so that the ones without them can be quickly identified and the test suite improved.

I'm not too familiar with how code is instrumented, but my basic understanding is that the source is mutated and events are added between statements. If solidity-coverage indeed works on auto-modified code, then this feature could probably be supported by making the original state variable internal instead of public (so that inheritance and overrides still work) with a new name (e.g. prefixed by the line number?), and adding a public view function with the same name as the original variable, returning it.

come-maiz, cgewecke and frangiocgewecke and ealmansi


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4