-
Notifications
You must be signed in to change notification settings - Fork 272
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
Fix missing provider_uri #2626
Fix missing provider_uri #2626
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good eye!
Thanks for noticing @piotr-roslaniec :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kickass. Two greens and two reds.
Welcome aboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First PR, Welcome! 👏🏻
@@ -69,7 +69,7 @@ | |||
|
|||
# Then, there was bob. Bob learns about the | |||
# rest of the network from the seednode. | |||
bob = Bob(domain=TESTNET) | |||
bob = Bob(domain=TESTNET, provider_uri=PROVIDER_URI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a design goal, Bob can operate entirely offchain without an ethereum provider connection. If this is a required parameter, we'll need to take a deeper look and make it optional!
nucypher/characters/base.py
Outdated
@@ -84,6 +84,7 @@ def __init__(self, | |||
signer: Signer = None, | |||
registry: BaseContractRegistry = None, | |||
include_self_in_the_state: bool = False, | |||
is_offchain: bool = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm - this kwarg becomes a bit superfluous IMO since it doesn't affect any other character's construction. Alternately, I suggest relocating provider_uri
into each Character
subclass init.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But because Bob is the only character that works without provider_uri
we still want to raise ValueError('Provider URI is required to init a decentralized character.')
in the character's respective init, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I that's what I'm thinking! 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @piotr-roslaniec!
Type of PR:
Bugfix
Required reviews:
1
What this does:
Fixes
ValueError: Provider URI is required to init a decentralized character.
thrown onBob()
andAlice()
constructors.