-
Notifications
You must be signed in to change notification settings - Fork 76
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.
Looks good to me! We should create another issue for adding watch_mode to the NRE
I don't think this patches the issue, since the script in the original issue uses i suggest raising an exception after unregistration on tx failure, and let users handle that exception from the script. what do you think? some better version of: if watch_mode is not None:
tx_status = await status(tx_hash, network, watch_mode)
if tx_status.status.is_rejected:
deployments.unregister(address, network, alias, abi=register_abi)
raise Exception("could not deploy") |
The script tested with EDIT: IMO we need to take the time to think of a strong design (extensible and maintainable) for integrating exceptions for NRE, not only into status, but the rest of the commands. |
this doesn't patch the issue because users can still pass agree on solid design, we're in strong debt. but picking between hotfixes, I lean towards a not-thoroughly-designed exception that removing the feature for good -- waiting for txs is very useful when scripting. |
Ohh, true, I didn't think it through.
Ok, I will check this issue first before continuing with what I'm working on. |
I was checking the code trying to implement a fairly quick fix from this suggestion, but we can't just raise an exception from the places we currently check status because this flow is also used for CLI (I would need to implement a pattern for exception handling in CLI to allow this, which is not a small fix, and is also not the best design to raise an exception from NRE IMO). I can't think of a good approach to fix this that is small enough with the current design :(.
I agree that hot fixes like this will make this worse, but I don't think we can properly handle the issue without following a proper design (not a small fix). IMO, any quick fix we can come up with is going to be one of these patches/hotfixes you mention. I'd suggest handling this properly even if is not part of this fix-release (and for now either remove the watch_mode from NRE, or ignore it until is properly fixed). Any suggestion on how to handle this properly in a quick fix is welcome of course. |
Fixes #308
Check this comment for context.