From 46f3cb3b53569871700986dcb2bda8f1c98ee90f Mon Sep 17 00:00:00 2001 From: George Date: Wed, 23 Oct 2024 13:46:22 -0700 Subject: [PATCH] Add both versions of getVersionInfo in --- .../internal/methods/get_events.go | 3 +- .../internal/methods/get_version_info.go | 28 ++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/cmd/soroban-rpc/internal/methods/get_events.go b/cmd/soroban-rpc/internal/methods/get_events.go index 8312b530..933e6d81 100644 --- a/cmd/soroban-rpc/internal/methods/get_events.go +++ b/cmd/soroban-rpc/internal/methods/get_events.go @@ -339,7 +339,8 @@ type PaginationOptions struct { type GetEventsResponse struct { Events []EventInfo `json:"events"` LatestLedger uint32 `json:"latestLedger"` - // Cursor represents last populated event ID if total events reach the limit or end of the search window + // Cursor represents last populated event ID if total events reach the limit + // or end of the search window Cursor string `json:"cursor"` } diff --git a/cmd/soroban-rpc/internal/methods/get_version_info.go b/cmd/soroban-rpc/internal/methods/get_version_info.go index 038bf54a..97c3562b 100644 --- a/cmd/soroban-rpc/internal/methods/get_version_info.go +++ b/cmd/soroban-rpc/internal/methods/get_version_info.go @@ -14,11 +14,15 @@ import ( ) type GetVersionInfoResponse struct { - Version string `json:"version"` - CommitHash string `json:"commitHash"` - BuildTimestamp string `json:"buildTimestamp"` - CaptiveCoreVersion string `json:"captiveCoreVersion"` - ProtocolVersion uint32 `json:"protocolVersion"` + Version string `json:"version"` + CommitHash string `json:"commitHash"` + CommitHash2 string `json:"commit_hash"` + BuildTimestamp string `json:"buildTimestamp"` + BuildTimestamp2 string `json:"build_timestamp"` + CaptiveCoreVersion string `json:"captiveCoreVersion"` + CaptiveCoreVersion2 string `json:"captive_core_version"` + ProtocolVersion uint32 `json:"protocolVersion"` + ProtocolVersion2 uint32 `json:"protocol_version"` } func NewGetVersionInfoHandler( @@ -37,11 +41,15 @@ func NewGetVersionInfoHandler( } return GetVersionInfoResponse{ - Version: config.Version, - CommitHash: config.CommitHash, - BuildTimestamp: config.BuildTimestamp, - CaptiveCoreVersion: captiveCoreVersion, - ProtocolVersion: protocolVersion, + Version: config.Version, + CommitHash: config.CommitHash, + CommitHash2: config.CommitHash, + BuildTimestamp: config.BuildTimestamp, + BuildTimestamp2: config.BuildTimestamp, + CaptiveCoreVersion: captiveCoreVersion, + CaptiveCoreVersion2: captiveCoreVersion, + ProtocolVersion: protocolVersion, + ProtocolVersion2: protocolVersion, }, nil }) }