Skip to content

Commit

Permalink
update/added_protocol_version_in_status
Browse files Browse the repository at this point in the history
Added protocol_version to InfoGetStatusResult response
  • Loading branch information
ZhmakAS committed Aug 2, 2024
1 parent fdac8c4 commit 44826b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rpc/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions tests/data/rpc_response/get_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"id": "1",
"result": {
"api_version": "2.0.0",
"protocol_version": "5.4.3",
"peers": [
{
"node_id": "tls:4cca..587b",
Expand Down
1 change: 1 addition & 0 deletions tests/rpc/client_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 44826b3

Please sign in to comment.