snarkVM icon indicating copy to clipboard operation
snarkVM copied to clipboard

[Proposal] Consider removing pass-through methods

Open facundoolano opened this issue 3 years ago • 0 comments

💥 Proposal

A pass-through method is one that does nothing except pass its arguments to another method, usually with the same API as the pass-through method. This increases the interface complexity of a module, without increasing the total functionality of the system.

There are some instances of this in the codebase, for example the ledger contains and iterators modules. Those modules, in addition to defining methods separated from their struct, just define pass-through methods to access the same method in some of the ledger fields. As far as I can tell those methods even though public aren't being accessed outside the ledger impl; as an example, favoring self.program_ids() not only requires augmenting the interface complexity and the total amount of code, but actually provides less information than when calling its implementation directly: self.transactions.program_ids()

facundoolano avatar Sep 17 '22 16:09 facundoolano