Skip to content

Add option to list modules in export codegen#49

Open
benber86 wants to merge 1 commit intoAlbertoCentonze:mainfrom
benber86:feat/display_modules
Open

Add option to list modules in export codegen#49
benber86 wants to merge 1 commit intoAlbertoCentonze:mainfrom
benber86:feat/display_modules

Conversation

@benber86
Copy link

When trying to move from importing __interface__ to explicit imports, if a contract relies on a lot of module, it can be unclear what function is coming from an underlying module and what is defined in the contract. This PR adds an argument to codegen exports so that if an exported function is coming from a module, the module's name will be displayed as a comment next to it.

For instance in the scrvusd_oracle contract in the tests:

> natrix codegen exports tests/contracts/scrvusd_oracle/scrvusd_oracle.vy --display-modules

# NOTE: Always double-check the generated exports
exports: (
    scrvusd_oracle.max_acceleration,
    scrvusd_oracle.owner,  # ownable
    scrvusd_oracle.price_v0,
    scrvusd_oracle.price_v1,
    scrvusd_oracle.prover,
    scrvusd_oracle.raw_price,
    scrvusd_oracle.renounce_ownership,  # ownable
    scrvusd_oracle.set_max_acceleration,
    scrvusd_oracle.set_prover,
    scrvusd_oracle.transfer_ownership,  # ownable
    scrvusd_oracle.update_price,
    scrvusd_oracle.version
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant