Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check inheritance tree consistency #2727

Merged
merged 7 commits into from Jun 18, 2021

Conversation

Amxx
Copy link
Collaborator

@Amxx Amxx commented Jun 17, 2021

In order to build contracts out of modules, it must be possible to linearize the inheritance tree.
One way to check that this will always be possible is to ensure that there exists an ordering of the contract that matches the inheritance patterns.

This PR adds a script that verifies such an ordering exist by building a graph of dependency relative orders and verifying that this graph is acyclic.

This script can be run with npm run test:inheritance, and is added to the CI workflow

Note that, when contracts are modified and recompiled, the old manifest in artifacts/build-info must be deleted.

@Amxx Amxx force-pushed the checks/contractInheritanceTree branch from 825fdb7 to 89a5c8a Compare June 17, 2021 22:44
Copy link
Contributor

@frangio frangio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@frangio frangio enabled auto-merge (squash) June 18, 2021 15:07
@frangio frangio merged commit 4d0f8c1 into OpenZeppelin:master Jun 18, 2021
@Amxx Amxx deleted the checks/contractInheritanceTree branch June 18, 2021 16:52
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.

None yet

2 participants