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

HTTP JSON API should return more information in command submissions #2925

Closed
da-tanabe opened this issue Sep 16, 2019 · 4 comments
Closed

HTTP JSON API should return more information in command submissions #2925

da-tanabe opened this issue Sep 16, 2019 · 4 comments
Assignees
Labels
component/json-api HTTP JSON API component/ledger Sandbox and Ledger API team/ledger-clients Related to the Ledger Clients team's components.

Comments

@da-tanabe
Copy link
Contributor

Current HTTP JSON API only returns the last create event for an exercise, which may or may not be the most relevant thing for it to return.

It should either return nothing (because we decide we don't want it to) or all events for which the submitting party is a stakeholder. The choice of returning the last create contract event seems too arbitrary.

@leo-da leo-da added this to the HTTP JSON API Maintenance milestone Sep 16, 2019
@leo-da leo-da added the component/ledger Sandbox and Ledger API label Sep 16, 2019
@leo-da
Copy link
Contributor

leo-da commented Sep 26, 2019

NOTE: "active" changed to "created"

/command/exercise returns archived and active contracts (can actually return multiple archived and active):

    {
        "status": 200,
        "result": [
            {
                "archived": {
                    "workflowId": "Alice Workflow",
                    "contractId": "#56:0",
                    "templateId": {
                        "packageId": "ac3a64908d9f6b4453329b3d7d8ddea44c83f4f5469de5f7ae19158c69bf8473",
                        "moduleName": "Iou",
                        "entityName": "Iou"
                    },
                    "witnessParties": [
                        "Alice"
                    ]
                }
            },
            {
                "active": {
                    "observers": [],
                    "agreementText": "",
                    "signatories": [
                        "Alice"
                    ],
                    "contractId": "#301:1",
                    "templateId": {
                        "packageId": "ac3a64908d9f6b4453329b3d7d8ddea44c83f4f5469de5f7ae19158c69bf8473",
                        "moduleName": "Iou",
                        "entityName": "IouTransfer"
                    },
                    "witnessParties": [
                        "Alice"
                    ],
                    "argument": {
                        "iou": {
                            "observers": [],
                            "issuer": "Alice",
                            "amount": "999.99",
                            "currency": "USD",
                            "owner": "Alice"
                        },
                        "newOwner": "Alice"
                    },
                    "workflowId": "Alice Workflow"
                }
            }
        ]
    }

@leo-da leo-da self-assigned this Sep 26, 2019
@leo-da leo-da closed this as completed Sep 26, 2019
@lima-da
Copy link
Contributor

lima-da commented Sep 27, 2019

@leo-da This looks great!
Just one little thing, Is it possible to make "active:" to be "created:" instead? "created" versus "archived" makes more sense to me. let me know your thoughts.

@leo-da
Copy link
Contributor

leo-da commented Sep 27, 2019

changing it to "created" after chatting with @bame-da

@leo-da
Copy link
Contributor

leo-da commented Sep 27, 2019

The output is:

    {
        "status": 200,
        "result": [
            {
                "archived": {
                    "workflowId": "Alice Workflow",
                    "contractId": "#56:0",
                    "templateId": {
                        "packageId": "ac3a64908d9f6b4453329b3d7d8ddea44c83f4f5469de5f7ae19158c69bf8473",
                        "moduleName": "Iou",
                        "entityName": "Iou"
                    },
                    "witnessParties": [
                        "Alice"
                    ]
                }
            },
            {
                "created": {
                    "observers": [],
                    "agreementText": "",
                    "signatories": [
                        "Alice"
                    ],
                    "contractId": "#301:1",
                    "templateId": {
                        "packageId": "ac3a64908d9f6b4453329b3d7d8ddea44c83f4f5469de5f7ae19158c69bf8473",
                        "moduleName": "Iou",
                        "entityName": "IouTransfer"
                    },
                    "witnessParties": [
                        "Alice"
                    ],
                    "argument": {
                        "iou": {
                            "observers": [],
                            "issuer": "Alice",
                            "amount": "999.99",
                            "currency": "USD",
                            "owner": "Alice"
                        },
                        "newOwner": "Alice"
                    },
                    "workflowId": "Alice Workflow"
                }
            }
        ]
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/json-api HTTP JSON API component/ledger Sandbox and Ledger API team/ledger-clients Related to the Ledger Clients team's components.
Projects
None yet
Development

No branches or pull requests

4 participants