input-output-hk / marlowe-ts-sdk

Marlowe TypeScript SDK
https://marlowe.iohk.io/
Apache License 2.0
22 stars 11 forks source link

PLT-9263: Balancing issue when creating open roles based contract #168

Closed nhenin closed 8 months ago

nhenin commented 8 months ago

When executing this e2e tests : https://github.com/input-output-hk/marlowe-ts-sdk/blob/main/packages/runtime/lifecycle/test/examples/swap.ada.token.e2e.spec.ts and using in the test configuration a v0.0.6 runtime instance, we have observed this kind of issue :

## !! [Error occured while Executing the Tests : {
    "message": "Request failed with status code 500",
    "name": "AxiosError",
    "stack": "AxiosError: Request failed with status code 500\n    at settle (/home/nhenin/dev/marlowe/ts-sdk/node_modules/axios/lib/core/settle.js:19:12)\n    at IncomingMessage.handleStreamEnd (/home/nhenin/dev/marlowe/ts-sdk/node_modules/axios/lib/adapters/http.js:585:11)\n    at IncomingMessage.emit (node:events:526:35)\n    at endReadableNT (node:internal/streams/readable:1359:12)\n    at processTicksAndRejections (node:internal/process/task_queues:82:21)",
    "config": {
        "transitional": {
            "silentJSONParsing": true,
            "forcedJSONParsing": true,
            "clarifyTimeoutError": false
        },
        "adapter": [
            "xhr",
            "http"
        ],
        "timeout": 0,
        "xsrfCookieName": "XSRF-TOKEN",
        "xsrfHeaderName": "X-XSRF-TOKEN",
        "maxContentLength": -1,
        "maxBodyLength": -1,
        "env": {},
        "headers": {
            "Accept": "application/vendor.iog.marlowe-runtime.apply-inputs-tx-json",
            "Content-Type": "application/json",
            "X-Change-Address": "addr_test1qrrxc29uk9flvaep0kdlwzw3e0lnckqjsttznq6ns2ldlrshjke6a9na3lme97mdfq37njgvrpu30xv58fyjjtdkqr0shzk8hq",
            "X-Address": "addr_test1qrrxc29uk9flvaep0kdlwzw3e0lnckqjsttznq6ns2ldlrshjke6a9na3lme97mdfq37njgvrpu30xv58fyjjtdkqr0shzk8hq",
            "X-Collateral-UTxO": "",
            "User-Agent": "axios/1.6.2",
            "Content-Length": "264",
            "Accept-Encoding": "gzip, compress, deflate, br"
        },
        "baseURL": "https://marlowe-preprod-patch6-rt-webserver-aromatic-sympathy-0f0880.us1.demeter.run/",
        "method": "post",
        "url": "/contracts/c26bba9434eb1873e50062dea3e626617003289c99ee4cf05d4fed127f9a32b9%231/transactions",
        "data": "{\"inputs\":[{\"input_from_party\":{\"role_token\":\"buyer\"},\"that_deposits\":10,\"of_token\":{\"currency_symbol\":\"7e104263690566078aebbc5fdd4ed50313fa35ebb51cbfc71fd3dd3f\",\"token_name\":\"tokenB\"},\"into_account\":{\"role_token\":\"buyer\"}}],\"version\":\"v1\",\"tags\":{},\"metadata\":{}}"
    },
    "code": "ERR_BAD_RESPONSE",
    "status": 500
}] !!
## !! [Details : {
    "details": {
        "contents": "TxBodyScriptExecutionError [(ScriptWitnessIndexTxIn 0,ScriptErrorEvaluationFailed (CekError An error has occurred:  User error:\nThe machine terminated because of an error, either from a built-in function or from an explicit use of 'error'.) [])]",
        "tag": "BalancingError"
    },
    "errorCode": "BalancingError",
    "message": "BalancingError \"TxBodyScriptExecutionError [(ScriptWitnessIndexTxIn 0,ScriptErrorEvaluationFailed (CekError An error has occurred:  User error:\\nThe machine terminated because of an error, either from a built-in function or from an explicit use of 'error'.) [])]\""
}] !!