Skip to content

Commit

Permalink
refactor(connector-corda): consolidate transaction invocation API hyp…
Browse files Browse the repository at this point in the history
…erledger-cacti#611

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed May 7, 2021
1 parent 0cca558 commit c47e9b1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ApiPluginLedgerConnectorCordaServiceImpl(
// org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.InvokeContractV1Response["returnValue"]->
// net.corda.client.jackson.internal.StxJson["wire"]->net.corda.client.jackson.internal.WireTransactionJson["outputs"])]
// with root cause
return InvokeContractV1Response(id.toString(), progress, (returnValue as SignedTransaction).id)
return InvokeContractV1Response(true, id.toString(), (returnValue as SignedTransaction).id, progress)
}

// FIXME - make it clear in the documentation that this deployment endpoint is not recommended for production
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ import javax.validation.Valid

/**
*
* @param id The net.corda.core.flows.StateMachineRunId value returned by the flow execution.
* @param success
* @param callOutput
* @param transactionId The net.corda.core.flows.StateMachineRunId value returned by the flow execution.
* @param progress An array of strings representing the aggregated stream of progress updates provided by a *tracked* flow invocation. If the flow invocation was not tracked, this array is still returned, but as empty.
* @param returnValue
*/
data class InvokeContractV1Response(

@get:Size(min=1,max=1024)
@field:JsonProperty("id", required = true) val id: kotlin.String,

@field:JsonProperty("progress", required = true) val progress: kotlin.collections.List<kotlin.String>,
@field:JsonProperty("success", required = true) val success: kotlin.Boolean,

@field:Valid
@field:JsonProperty("returnValue") val returnValue: kotlin.Any? = null
@field:JsonProperty("callOutput", required = true) val callOutput: kotlin.Any,

@get:Size(min=1,max=1024)
@field:JsonProperty("transactionId", required = true) val transactionId: kotlin.String,

@field:JsonProperty("progress") val progress: kotlin.collections.List<kotlin.String>? = null
) {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,14 +472,19 @@
"InvokeContractV1Response": {
"type": "object",
"required": [
"id",
"progress"
"success",
"transactionId",
"callOutput"
],
"properties": {
"returnValue": {
"success": {
"type": "boolean",
"nullable": false
},
"callOutput": {
"type": "object"
},
"id": {
"transactionId": {
"type": "string",
"description": "The net.corda.core.flows.StateMachineRunId value returned by the flow execution.",
"minLength": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,24 +360,30 @@ export interface InvokeContractV1Request {
* @interface InvokeContractV1Response
*/
export interface InvokeContractV1Response {
/**
*
* @type {boolean}
* @memberof InvokeContractV1Response
*/
success: boolean;
/**
*
* @type {object}
* @memberof InvokeContractV1Response
*/
returnValue?: object;
callOutput: object;
/**
* The net.corda.core.flows.StateMachineRunId value returned by the flow execution.
* @type {string}
* @memberof InvokeContractV1Response
*/
id: string;
transactionId: string;
/**
* An array of strings representing the aggregated stream of progress updates provided by a *tracked* flow invocation. If the flow invocation was not tracked, this array is still returned, but as empty.
* @type {Array<string>}
* @memberof InvokeContractV1Response
*/
progress: Array<string>;
progress?: Array<string>;
}
/**
*
Expand Down

0 comments on commit c47e9b1

Please sign in to comment.