frangio / hardhat-exposed

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

Add support for implicit constructors #28

Closed Amxx closed 1 year ago

Amxx commented 1 year ago

Fixes #27

Amxx commented 1 year ago

In core.ts:makeConstructor, the initializedParentIds set contains an ID that is not part of the parents contracts ...

frangio commented 1 year ago

In core.ts:makeConstructor, the initializedParentIds set contains an ID that is not part of the parents contracts ...

Probably because it includes all modifiers:

https://github.com/frangio/hardhat-exposed/blob/f919eb905076dd70a271f5377f26fc66982a13e3/src/core.ts#L237

This is fine because we only care about the "set complement" of initializedParentIds, but the variable name is misleading.

Amxx commented 1 year ago

What I see is that in my example there is 1 parentsWithConstructor that isn't part of the initializedParentIds. So it gets in the uninitializedParents and exposed in the constructor when it should not.