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

Allow debug configs to be added to launch.json from the Invocation Panel. Fixes #45 #109

Merged
merged 5 commits into from
Feb 25, 2020

Conversation

djnicholson
Copy link
Member

No description provided.

@devhawk
Copy link
Contributor

devhawk commented Feb 18, 2020

testing this PR with https://github.com/ngdseattle/cneo-sample/, the contract appears twice in the Invoke COntract UI even though there is only one compiled AVM file in the workspace

image

@devhawk
Copy link
Contributor

devhawk commented Feb 18, 2020

How do you associate UTXO assets with a contract invocation?

@devhawk
Copy link
Contributor

devhawk commented Feb 18, 2020

Adding a launch configuration blows away any comments that have been added to the launch.json file. (like this one)

Copy link
Contributor

@devhawk devhawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left several comments that need to be addressed

@devhawk devhawk assigned djnicholson and unassigned devhawk Feb 18, 2020
@djnicholson
Copy link
Member Author

testing this PR with https://github.com/ngdseattle/cneo-sample/, the contract appears twice in the Invoke COntract UI even though there is only one compiled AVM file in the workspace

image

I think maybe you have a different version of the contract (same methods but different hash) deployed. This is being detected from the Neo Express JSON file and shown along side the one detected from the AVM. Should I show the contract hash in the UI to make this more obvious?

We should resolve neo-project/neo-express#31 and neo-project/neo-express#20 to make the end-to-end experience better.

@djnicholson
Copy link
Member Author

How do you associate UTXO assets with a contract invocation?

I haven't done that yet (and I left #46 to reflect that there are still debug options we do not support).

We need some design thought around this one, for example:

  • Is it Ok for the user to just specify an amount (e.g. "20 NEO") or do we need to build some sort of UTXO picker where they pick specific UTXOs (and possible specify change)
  • How should we determine what UTXOs are available? If Neo Express is already running it is easy (we make RPC calls). If Neo Express is not running do we start it? What if the user also picked a checkpoint?

@djnicholson
Copy link
Member Author

Adding a launch configuration blows away any comments that have been added to the launch.json file. (like this one)

I'm using the VS Code API to change the launch.json file (see addToLaunchJson in invocationPanel.ts). I decided this was better than doing JSON.stringify(JSON.parse(...)) as this only blows away comments within the configurations array (other comments in the file are left alone). If we want comments within the array to be safe then I need to find a JSON parsing/serialization library that is comment-aware.

@djnicholson djnicholson assigned devhawk and unassigned djnicholson Feb 20, 2020
@djnicholson djnicholson requested a review from devhawk February 20, 2020 13:04
@devhawk
Copy link
Contributor

devhawk commented Feb 25, 2020

I think maybe you have a different version of the contract (same methods but different hash) deployed. This is being detected from the Neo Express JSON file and shown along side the one detected from the AVM. Should I show the contract hash in the UI to make this more obvious?

That was it - the hash in my .abi.json file doesn't match the hash in the neo-express.json file.

No, let's figure out the end-to-end w/ express better before tackling this edge case

@devhawk
Copy link
Contributor

devhawk commented Feb 25, 2020

How do you associate UTXO assets with a contract invocation?

I haven't done that yet (and I left #46 to reflect that there are still debug options we do not support).

OK, I'm good with leaving this for #46

We need some design thought around this one, for example:

  • Is it Ok for the user to just specify an amount (e.g. "20 NEO") or do we need to build some sort of UTXO picker where they pick specific UTXOs (and possible specify change)

I would prefer specifying the amount and using getunspents to figure out the specific UTXOs

  • How should we determine what UTXOs are available? If Neo Express is already running it is easy (we make RPC calls). If Neo Express is not running do we start it? What if the user also picked a checkpoint?

There's no way for devtracker to get the UTXO info if neo-express isn't running. we could add a command line switch for neo-express to dump the valid UTXOs for an account like get coins but offline. Let's address as part of the larger end-to-end

@devhawk
Copy link
Contributor

devhawk commented Feb 25, 2020

I'm still worried about the comments getting blown away, but am approving for now. Can we open an issue to track fixing the comment issue?

@devhawk devhawk removed their assignment Feb 25, 2020
@djnicholson
Copy link
Member Author

I'm still worried about the comments getting blown away, but am approving for now. Can we open an issue to track fixing the comment issue?

#118

@djnicholson djnicholson merged commit 883d251 into master Feb 25, 2020
@djnicholson djnicholson deleted the debugconfig branch February 25, 2020 21:39
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