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

Add external contract calling functionality #335

Merged
merged 10 commits into from Sep 29, 2017

Conversation

Projects
None yet
3 participants
@DavidKnott
Contributor

DavidKnott commented Sep 7, 2017

- What I did

I added the ability to call external contracts in response to #297.

- How I did it

I did this by allowing existing contracts to be referenced using:

    class insert_contract_name():
        _insert_existing_external_functions_you_need_to_call_here

To understand the formatting further look in my tests/test_parser.py. @fubuloubu @JackieXu I got this functionality working (it still has some hiccups). When you have a second would you mind taking a look?

- How to verify it

I added tests in tests/test_parser.py

- Description for the changelog

Add external contract calling functionality

- Cute Animal Picture

image

@fubuloubu

I would like to see these tests in their own file. This is large feature and is going to need lots more through testing.

Additionally, I would like to see this feature morph into a type instead (e.g. foo: external or foo: contract, then list expected method type signatures), but this works for now.

Show outdated Hide outdated tests/test_parser.py Outdated
Show outdated Hide outdated tests/test_parser.py Outdated
Show outdated Hide outdated tests/test_parser.py Outdated
Show outdated Hide outdated tests/test_parser.py Outdated
@JackieXu

It seems bytes is broken?

Show outdated Hide outdated tests/test_parser.py Outdated
Show outdated Hide outdated viper/parser.py Outdated
@DavidKnott

This comment has been minimized.

Show comment
Hide comment
@DavidKnott

DavidKnott Sep 8, 2017

Contributor

@fubuloubu I broke the tests out into a separate file and added the additional tests you suggested. I'd like to implement the contract data type functionality we talked about in another PR to make it easier to review.

@JackieXu I fixed the test I broke in test_parser.py, it was a silly mistake.

If either of you see any other tests that should be made or better ways to do things please let me know.

Contributor

DavidKnott commented Sep 8, 2017

@fubuloubu I broke the tests out into a separate file and added the additional tests you suggested. I'd like to implement the contract data type functionality we talked about in another PR to make it easier to review.

@JackieXu I fixed the test I broke in test_parser.py, it was a silly mistake.

If either of you see any other tests that should be made or better ways to do things please let me know.

@DavidKnott DavidKnott changed the title from W.I.P. Add external contract calling functionality to Add external contract calling functionality Sep 21, 2017

Show outdated Hide outdated viper/parser.py Outdated
Show outdated Hide outdated viper/parser.py Outdated
Show outdated Hide outdated viper/parser.py Outdated

@DavidKnott DavidKnott merged commit ad0d623 into ethereum:master Sep 29, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 90.4%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment