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

JSON API: Rename events field of exercise response from "contracts" to "events" #4385

Closed
hurryabit opened this issue Feb 4, 2020 · 2 comments · Fixed by #4436
Closed

JSON API: Rename events field of exercise response from "contracts" to "events" #4385

hurryabit opened this issue Feb 4, 2020 · 2 comments · Fixed by #4436

Comments

@hurryabit
Copy link
Contributor

@hurryabit hurryabit commented Feb 4, 2020

Currently, the result obtained from the /commands/exercise endpoint looks like

{
    "status": 200,
    "result": {
        "exerciseResult": "#201:1",
        "contracts": [ E1, E2, ... ]
    }
}

The field name contracts is quite misleading since this array does not only contain created events (aka contracts) but also archived events. Thus, we should rename this field to events. This will also be in line with the change in #4384.

@leo-da

This comment has been minimized.

Copy link
Contributor

@leo-da leo-da commented Feb 4, 2020

Contracts can be created or archived:
"contracts" :[ {"created": {...}, {"archived": {...}}]

I assumed we don't want to mention events and transactions in the JSON API.

@hurryabit

This comment has been minimized.

Copy link
Contributor Author

@hurryabit hurryabit commented Feb 4, 2020

I agree that contracts can be created and archived. But that doesn't mean that the creation of a contract is a contract nor is the archival of a contract a contract itself. Both are events that happen to contracts (or actions you can do with them). That's why I think the word contracts is misleading and events describes the intent of the field better.

The documentation of JSON API will have to talk about events at some point. There are exactly two events in the life of a contract: its birth, the created event, and its death, the archived event.

There's no need (and no desire) to talk about transactions. But events make sense even without transactions and are significantly simpler than the latter.

Let's please rename this field to events.

S11001001 added a commit that referenced this issue Feb 6, 2020
CHANGELOG_BEGIN
- [JSON API - Experimental] Exercise response field "contracts" renamed to "events".
  See `issue #4385 <https://github.com/digital-asset/daml/issues/4385>`_.
CHANGELOG_END
@mergify mergify bot closed this in #4436 Feb 6, 2020
mergify bot pushed a commit that referenced this issue Feb 6, 2020
* rename "contracts" to "events" in JSON API exercise response

CHANGELOG_BEGIN
- [JSON API - Experimental] Exercise response field "contracts" renamed to "events".
  See `issue #4385 <https://github.com/digital-asset/daml/issues/4385>`_.
CHANGELOG_END

* more events in doc

- pointed out by @leo-da; thanks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.