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

Failed Curl Request in Cicero-server package #742

Closed
K-Kumar-01 opened this issue May 24, 2022 · 2 comments · Fixed by #743
Closed

Failed Curl Request in Cicero-server package #742

K-Kumar-01 opened this issue May 24, 2022 · 2 comments · Fixed by #743

Comments

@K-Kumar-01
Copy link
Contributor

K-Kumar-01 commented May 24, 2022

Bug Report 🐛

Currently, the request for draft and trigger mentioned in the documentation for cicero-server is failing.

Screenshots

Screenshot from 2022-05-24 06-12-49
Screenshot from 2022-05-24 06-17-45

Expected Behavior

The requests should pass without any error and result in a successful execution with status code 200.

Current Behavior

The error displayed in the above image is shown. Cross-checking with cicero-cli on same data gave the same error.
The data passed in the documentation seems to be incorrect.

Possible Solution

Update the documentation to use proper data.
Sample data for proper draft request.

{
  "$class": "org.accordproject.latedeliveryandpenalty.LateDeliveryAndPenaltyContract",
  "buyer": "resource:org.accordproject.party.Party#Steve",
  "seller": "resource:org.accordproject.party.Party#Dan",
  "forceMajeure": true,
  "penaltyDuration": {
    "$class": "org.accordproject.time.Duration",
    "amount": 2,
    "unit": "days"
  },
  "penaltyPercentage": 10.5,
  "capPercentage": 55,
  "termination": {
    "$class": "org.accordproject.time.Duration",
    "amount": 15,
    "unit": "days"
  },
  "fractionalPart": "days",
  "contractId": "c538755a-6c9e-43ff-8767-f8915d0336a0",
  "$identifier": "c538755a-6c9e-43ff-8767-f8915d0336a0"
}

Steps to Reproduce

  1. Use Postman/Insomnia or a direct curl request for draft
  2. Repeat the procedure for trigger

Context (Environment)

Desktop

  • OS: [e.g. macOS] Zorin OS

Detailed Description

Data Passed:

{
    "$class": "org.accordproject.latedeliveryandpenalty.LateDeliveryAndPenaltyContract",
    "contractId": "ecd6257e-2ffe-4ef1-8a5c-38ca9084a829",
    "buyer": {
        "$class": "org.accordproject.cicero.contract.AccordParty",
        "partyId": "Dan"
    },
    "seller": {
        "$class": "org.accordproject.cicero.contract.AccordParty",
        "partyId": "Steve"
    },
    "forceMajeure": true,
    "penaltyDuration": {
        "$class": "org.accordproject.time.Duration",
        "amount": 9,
        "unit": "days"
    },
    "penaltyPercentage": 1000.5,
    "capPercentage": 88,
    "termination": {
        "$class": "org.accordproject.time.Duration",
        "amount": 5,
        "unit": "weeks"
    },
    "fractionalPart": "days"
}

Proposed Data:

{
  "$class": "org.accordproject.latedeliveryandpenalty.LateDeliveryAndPenaltyContract",
  "buyer": "resource:org.accordproject.party.Party#Steve",
  "seller": "resource:org.accordproject.party.Party#Dan",
  "forceMajeure": true,
  "penaltyDuration": {
    "$class": "org.accordproject.time.Duration",
    "amount": 2,
    "unit": "days"
  },
  "penaltyPercentage": 10.5,
  "capPercentage": 55,
  "termination": {
    "$class": "org.accordproject.time.Duration",
    "amount": 15,
    "unit": "days"
  },
  "fractionalPart": "days",
  "contractId": "c538755a-6c9e-43ff-8767-f8915d0336a0",
  "$identifier": "c538755a-6c9e-43ff-8767-f8915d0336a0"
}

Here, on seeing we find that buyer and seller both are passed as objects in the former request and strings in the latter one.
This is what is creating this issue.

Possible Implementation

Updating the documenation should work.

Would you like to work on the issue?

Yes

@dselman
Copy link
Contributor

dselman commented May 24, 2022

Thanks for the bug report - looks great. Would you like to submit a PR to fix the docs?

@K-Kumar-01
Copy link
Contributor Author

Thanks for the bug report - looks great. Would you like to submit a PR to fix the docs?

Yes I would love to work.
I will submit a PR by tomorrow for the same.

K-Kumar-01 added a commit to K-Kumar-01/cicero that referenced this issue May 25, 2022
mttrbrts pushed a commit that referenced this issue May 26, 2022
mehmettokgoz pushed a commit to mehmettokgoz/cicero that referenced this issue Sep 24, 2022
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 a pull request may close this issue.

2 participants