0

I'm finding it difficult figuring out the cause of this hiccup. When I create an instance of a contract, the hooks are populated, but after calling an endpoint, the hooks list becomes empty.

Status of Contract Instance before endpoint invocation:

{
    "cicCurrentState": {
        "observableState": null,
        "logs": [],
        "hooks": [
            {
                "rqID": 2,
                "itID": 1,
                "rqRequest": {
                    "aeMetadata": null,
                    "aeDescription": {
                        "getEndpointDescription": "cancel-ob"
                    }
                }
            },
            {
                "rqID": 1,
                "itID": 1,
                "rqRequest": {
                    "aeMetadata": null,
                    "aeDescription": {
                        "getEndpointDescription": "create-ob"
                    }
                }
            }
        ],
        "err": null,
        "lastLogs": []
    },
    "cicContract": {
        "unContractInstanceId": "a39797ac-bbb6-449b-a389-35b096882df6"
    },
    "cicDefinition": "OB",
    "cicWallet": {
        "getWallet": 2
    }
}

After endpoint invocation:

{
    "cicCurrentState": {
        "observableState": {
            "ttCurrencySymbol": {
                "unCurrencySymbol": "dffa71c3c512fe6ab8c0d72651a6122fb5d11042ef53d7131a47ca2c"
            },
            "ttOutRef": {
                "txOutRefIdx": 1,
                "txOutRefId": {
                    "getTxId": "b135806142f3d020fc68e9e72fa6e8e7c8fce34b2a0f17fd23b633641f58944a"
                }
            }
        },
        "logs": [
            {
                "_logMessageContent": "OB sent ",
                "_logLevel": "Info"
            }
        ],
        "hooks": [],
        "err": null,
        "lastLogs": []
    },
    "cicContract": {
        "unContractInstanceId": "a39797ac-bbb6-449b-a389-35b096882df6"
    },
    "cicDefinition": "OB",
    "cicWallet": {
        "getWallet": 2
    }
}

After calling the endpoint, a ThreadToken is returned, but all hooks are gone, thereby rendering the instance useless.

Example of what happens when an endpoint is called:

EndpointCallError (EndpointNotAvailable (ContractInstanceId {unContractInstanceId = a39797ac-bbb6-449b-a389-35b096882df6}) (EndpointDescription {getEndpointDescription = "cancel-ob"}))
1
  • Endpoints will become unavailable for a given contract instance id when falling of the happy path (e.g. redeemer not validating). I see that you have no errors recorded though. How do you have your endpoints hooked up and how did you test this behavior?
    – Matthias Sieber
    Oct 5 at 16:30
0

It turns out the contract being called from the ContractInstance has a delay that listens for change of state of a StateMachine until a certain deadline and hence hadn't completely executed the contract, which would consequently enable it publish the hooks and other details relating to the contract.

Calling an endpoint from the same ContractInstance led to the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.