From 44826b37fa1cceb93223304e5f38fd7dedf9a1ee Mon Sep 17 00:00:00 2001 From: Artem Zhmaka Date: Fri, 2 Aug 2024 11:02:16 +0200 Subject: [PATCH] update/added_protocol_version_in_status Added protocol_version to InfoGetStatusResult response --- rpc/response.go | 2 ++ tests/data/rpc_response/get_status.json | 1 + tests/rpc/client_example_test.go | 1 + 3 files changed, 4 insertions(+) diff --git a/rpc/response.go b/rpc/response.go index 4b5c44b..454f5f7 100644 --- a/rpc/response.go +++ b/rpc/response.go @@ -398,6 +398,8 @@ func (b InfoGetValidatorChangesResult) GetRawJSON() json.RawMessage { type InfoGetStatusResult struct { // The RPC API version. APIVersion string `json:"api_version"` + // The protocol version running in the node + ProtocolVersion string `json:"protocol_version"` // The compiled node version. BuildVersion string `json:"build_version"` // The chainspec name, used to identify the currently connected network. diff --git a/tests/data/rpc_response/get_status.json b/tests/data/rpc_response/get_status.json index 4589db2..149ce39 100644 --- a/tests/data/rpc_response/get_status.json +++ b/tests/data/rpc_response/get_status.json @@ -3,6 +3,7 @@ "id": "1", "result": { "api_version": "2.0.0", + "protocol_version": "5.4.3", "peers": [ { "node_id": "tls:4cca..587b", diff --git a/tests/rpc/client_example_test.go b/tests/rpc/client_example_test.go index 52513a4..4890b9a 100644 --- a/tests/rpc/client_example_test.go +++ b/tests/rpc/client_example_test.go @@ -88,5 +88,6 @@ func Test_Client_RPCGetStatus_WithAuthorizationHeader(t *testing.T) { status, err := client.GetStatus(context.Background()) require.NoError(t, err) assert.Equal(t, "2.0.0", status.APIVersion) + assert.Equal(t, "5.4.3", status.ProtocolVersion) assert.NotEmpty(t, status.LatestSwitchBlockHash) }