-
Notifications
You must be signed in to change notification settings - Fork 138
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
Add support to retrieve the observable events from the contracts in a given Clarinet project #1410
Comments
The Sabby, Scott, for putting together this new issue with refined scope. @sabbyanandan So we have two ways of handling this: Include the events in the packaged deployment planThe platform is already using this feature. Could be useful to know the events of a deployed contract (or a contract soon to be deployed). Get the events from the clarinet-sdkThe platform isn't using the clarinet-sdk at the moment, but it could be a really great addition. It might be easier to use for contracts that are being edited. We could even imagine implementing it in the front in the future (or now if that makes sense, even though the SDK is meant to be used in node.js and not the front end at the moment). |
This is going to be really cool, I feel like it could go along with @lgalabru's suggestion during our demos last week about showing an inline tooltip in the code to highlight events and provide shortcuts for creating chainhooks, similar to the function calling tooltips: Either approach (packaged deploy plan vs clarinet-sdk) could work, but we'd probably need to do more research on the clarinet-sdk/WASM approach if we want to go that route. In the linked issue:
This would depend on the |
Probably not much, a bit of refactoring and some webpack config, it's probably something like 2 days of work, but let's say it's an implementation details. More importantly, don't expect Map(8) {
'add' => [
Map(2) {
'event_type' => 'print',
'print' => Map(1) { 'data_type' => Map(1) { 'type' => 'uint' } }
},
Map(1) { 'event_type' => 'transfer_stx_event' }
],
'call-multiply' => [],
'get-count' => [],
'increment' => [ Map(1) { 'event_type' => 'transfer_stx_event' } ],
'transfer-100' => [ Map(1) { 'event_type' => 'transfer_stx_event' } ],
'withdraw' => [ Map(1) { 'event_type' => 'transfer_stx_event' } ]
} It'll be easy enough to change that, but we need to defined what would be the ideal format for your needs. |
@hugocaillard Re: including the line, it will depend on the UX we want. But yes I think including the line would be awesome and would let us do some really cool things with the UX. |
Could we world on the UX first and then on the implementation? |
@hugocaillard Agreed, I think that makes the most sense. @sabbyanandan let's nail down exactly what we want for the UX on this first, so that any changes needed on the Clarinet side will work for what we need. Will MAD or Ginny be working on this one, and can we follow up with them? |
I will draw some wireframes. And we will engage with MAD afterward. And @hugocaillard, we don't need a strict UX flow nailed to get to the bottom of getting a list of observable event streams. All we need is a list of those things for a given contract, and that is all! How you present it and where is up to you, and of course, that is the implementation detail. As far as there is an API or if it is available in the deployment manifest, anything works, but preferably whichever is the easiest lift so we can put it out there and experiment rapidly. All the said, for now, please internalize the problem stated in the description, and attempt solving it. |
@sabbyanandan Earlier in the thread, Hugo was asking if we need line numbers included in the returned data. We would only need that if we want to display contextual tooltips inline with the code in the UI. We may not need completely finalized designs, but I believe that we do need a general idea of what we envision for the UX so that the Clarinet team can accomplish the task in a way that solves our need. |
💯 And the line number thing is just an example of why we need to this general idea |
From Sabby:
The rest of additional context is at https://github.com/hirosystems/platform/issues/546, and I am skipping it for brevity here.
Old ticket: #1034
/cc @sabbyanandan
The text was updated successfully, but these errors were encountered: