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

Change use of getcontext() to fresh Context() #1310

Merged

Conversation

charles-cooper
Copy link
Collaborator

What I did

Fix brownie interaction with vyper for (unreleased, probably) 0.3.1 vyper.

How I did it

vyperlang/vyper#2479 disabled changes to the
global decimal context to preserve compile-time constant semantics.
This commit changes use of the global getcontext to a local context. It
shouldn't change the behavior of the current code (since it didn't depend
on modifying the global context, just having a local Context with the
correct precision).

How to verify it

Check out with vyper HEAD. Check that brownie no longer throws an exception.

Checklist

  • I have confirmed that my PR passes all linting checks
  • I have included test cases
  • I have updated the documentation
  • I have added an entry to the changelog

vyperlang/vyper#2479 disabled changes to the
global decimal context to preserve compile-time constant semantics.
This commit changes use of the global getcontext to a local context. It
shouldn't change the behavior of the current code (since it didn't depend
on modifying the global context, just having a local Context with the
correct precision).
previous commit made the change to getcontext to be local. but this is
only correct if vyper is imported (which sets context precision). this
commit sets the context precision correctly in the case where vyper is
not imported.
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.

2 participants