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

Simplify contract manager #169

Merged
merged 2 commits into from
Jul 6, 2018

Conversation

ulope
Copy link
Contributor

@ulope ulope commented Jul 5, 2018

This is a small refactor of the ContractManager in preparation for raiden-network/raiden#1550. Also fixes #125.

Copy link
Contributor

@palango palango left a comment

Choose a reason for hiding this comment

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

Looks good. Left some small comments.

for contracts_dir in self._contracts_source_dirs.values():
res = compile_files(
[str(file) for file in contracts_dir.glob('*.sol')],
output_values=('abi', 'bin', 'ast'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why we added the AST in the first place. @pcppcp any idea? We can remove this otherwise.

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure, maybe some weird solc behavior that required enabling this option.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ulope Can you check if it works without ast?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, it's 'required' (i.e. crashes when ast isn't included) by py-solc.
Filed an issue for it.

raise Exception('Could not compile the contract. Check that solc is available.')
raise RuntimeError(
'Could not compile the contract. Check that solc is available.',
) from FileNotFoundError
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't that be or does it work your was as well?

         except FileNotFoundError as e:
            raise Exception('Could not compile the contract. Check that solc is available.')
            raise RuntimeError(
                'Could not compile the contract. Check that solc is available.',
            ) from e

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Err, yeah... thanks for noticing.

@loredanacirstea loredanacirstea merged commit c49924a into raiden-network:master Jul 6, 2018
@ulope ulope deleted the refactor_contractmgr branch July 6, 2018 14:57
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.

Importing contract_manager shouldn't have side effects
4 participants