-
Notifications
You must be signed in to change notification settings - Fork 27
Support network option in addition to providerUrl when debugging #261
Conversation
|
Hi @xhulz thanks for taking care of this. Maybe I'm missing something here, but if we remove the Sorry in advance if this is a premature comment, just wanted to make sure we are on right track. |
|
Hey @acuarica, you are right, I forgot this detail. I'll make these changes and push them again. Thank you! |
|
Hey @acuarica, @kevinbluer and @michaeljohnbennett Now the debug is working using this logic: https://gist.github.com/gnidan/4579216299fac7a41c51e0e370e8ddc2 and based on this documentation: #260 Any question lmk Thank you |
|
Hey @xhulz, I've been doing some testing. Now I get an error when the debug network is not declared in the Truffle config file. In this instance, the |
acuarica
left a comment
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.
Looking good. Left some changes what we might want to consider.
One more question, do you know why there are so many changes in yarn.lock (in writing down this here because GH does not allow me to put comments when diff is large).
Wow, weird. I'll get the last version. Thank you for let me know @acuarica :) |
|
Hey @acuarica, I dunno why, but it seems the yarn.lock loose its styling. Check this out: i just rolled back the last version Thank you for that! |
| /** | ||
| * Retrieves the chain id of the `providerUrl`. | ||
| * | ||
| * @param providerUrl the url to get chain id from. | ||
| * @returns the chain id of the given `providerUrl`. | ||
| */ | ||
| private getNetworkId(providerUrl: string) { | ||
| const services = TreeManager.getItem(ItemType.LOCAL_SERVICE); | ||
|
|
||
| if (!services || !services.getChildren()) { | ||
| return undefined; | ||
| } | ||
|
|
||
| const projects = services.getChildren() as LocalProject[]; | ||
| const project = projects.find((project) => { | ||
| const network = project.getChildren().at(0) as LocalNetworkNode; | ||
| return `${network.url.protocol}//${network.url.host}` === providerUrl; | ||
| }); | ||
|
|
||
| return project ? getChainId(project.options.forkedNetwork) : undefined; | ||
| } | ||
|
|
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.
This is great! By removing all the TreeManager related code within the Debugger we make it less brittle.
acuarica
left a comment
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.
lgtm, thanks again for this!
|
Hey @acuarica! Thanks for helping me with this :) I appreciate it Cheers! |
|
Need to convert as draft since we've got some problems with the truffle/environment + webpack |
acuarica
left a comment
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.
lgtm
Co-authored-by: Luis Mastrangelo <[email protected]>


PR description
Ref: #260
Hey @kevinbluer @acuarica,
I'm working on this POC using
truffle/environmentas Nick suggested yesterday, and the things seems to be working fine. As I'm getting theproviderfromtruffle/environmentI've removed it from theSearchParams.@kevinbluer, as we said, it's a draft PR in order to do some tests before taking some decision.
@michaeljohnbennett for visibility
Documentation
doc-change-requiredlabel to this PR if documentation updates are required.