Skip to content

Commit

Permalink
Add view and seqno to /tx response (#2215)
Browse files Browse the repository at this point in the history
* add view, seqno to /tx

* update schemas

Co-authored-by: Amaury Chamayou <amchamay@microsoft.com>
  • Loading branch information
letmaik and achamayou committed Feb 24, 2021
1 parent 6c2eb4c commit 3a978f9
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 1 deletion.
8 changes: 8 additions & 0 deletions doc/schemas/app_openapi.json
Expand Up @@ -126,11 +126,19 @@
},
"GetTxStatus__Out": {
"properties": {
"seqno": {
"$ref": "#/components/schemas/int64"
},
"status": {
"$ref": "#/components/schemas/TxStatus"
},
"view": {
"$ref": "#/components/schemas/int64"
}
},
"required": [
"view",
"seqno",
"status"
],
"type": "object"
Expand Down
8 changes: 8 additions & 0 deletions doc/schemas/gov_openapi.json
Expand Up @@ -137,11 +137,19 @@
},
"GetTxStatus__Out": {
"properties": {
"seqno": {
"$ref": "#/components/schemas/int64"
},
"status": {
"$ref": "#/components/schemas/TxStatus"
},
"view": {
"$ref": "#/components/schemas/int64"
}
},
"required": [
"view",
"seqno",
"status"
],
"type": "object"
Expand Down
8 changes: 8 additions & 0 deletions doc/schemas/node_openapi.json
Expand Up @@ -237,11 +237,19 @@
},
"GetTxStatus__Out": {
"properties": {
"seqno": {
"$ref": "#/components/schemas/int64"
},
"status": {
"$ref": "#/components/schemas/TxStatus"
},
"view": {
"$ref": "#/components/schemas/int64"
}
},
"required": [
"view",
"seqno",
"status"
],
"type": "object"
Expand Down
2 changes: 2 additions & 0 deletions src/node/rpc/call_types.h
Expand Up @@ -35,6 +35,8 @@ namespace ccf

struct Out
{
kv::Consensus::View view;
kv::Consensus::SeqNo seqno;
TxStatus status;
};
};
Expand Down
2 changes: 2 additions & 0 deletions src/node/rpc/common_endpoint_registry.h
Expand Up @@ -65,6 +65,8 @@ namespace ccf
get_status_for_txid_v1(in.view, in.seqno, out.status);
if (result == ccf::ApiResult::OK)
{
out.view = in.view;
out.seqno = in.seqno;
return make_success(out);
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/node/rpc/serialization.h
Expand Up @@ -66,7 +66,7 @@ namespace ccf
DECLARE_JSON_TYPE(GetTxStatus::In)
DECLARE_JSON_REQUIRED_FIELDS(GetTxStatus::In, view, seqno)
DECLARE_JSON_TYPE(GetTxStatus::Out)
DECLARE_JSON_REQUIRED_FIELDS(GetTxStatus::Out, status)
DECLARE_JSON_REQUIRED_FIELDS(GetTxStatus::Out, view, seqno, status)

DECLARE_JSON_TYPE(GetNetworkInfo::Out)
DECLARE_JSON_REQUIRED_FIELDS(
Expand Down

0 comments on commit 3a978f9

Please sign in to comment.