Skip to content

Commit

Permalink
Add both versions of getVersionInfo in, change type of createdAt
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Oct 24, 2024
1 parent a26c6be commit 54e3360
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
3 changes: 2 additions & 1 deletion cmd/soroban-rpc/internal/methods/get_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,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"`
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-rpc/internal/methods/get_transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type TransactionInfo struct {
// Ledger is the sequence of the ledger which included the transaction.
Ledger uint32 `json:"ledger"`
// LedgerCloseTime is the unix timestamp of when the transaction was included in the ledger.
LedgerCloseTime int64 `json:"createdAt,string"`
LedgerCloseTime int64 `json:"createdAt"`
}

// GetTransactionsResponse encapsulates the response structure for getTransactions queries.
Expand Down
22 changes: 17 additions & 5 deletions cmd/soroban-rpc/internal/methods/get_version_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ type GetVersionInfoResponse struct {
BuildTimestamp string `json:"buildTimestamp"`
CaptiveCoreVersion string `json:"captiveCoreVersion"`
ProtocolVersion uint32 `json:"protocolVersion"`
//nolint:tagliatelle
CommitHashDeprecated string `json:"commit_hash"`
//nolint:tagliatelle
BuildTimestampDeprecated string `json:"build_timestamp"`
//nolint:tagliatelle
CaptiveCoreVersionDeprecated string `json:"captive_core_version"`
//nolint:tagliatelle
ProtocolVersionDeprecated uint32 `json:"protocol_version"`
}

func NewGetVersionInfoHandler(
Expand All @@ -37,11 +45,15 @@ func NewGetVersionInfoHandler(
}

return GetVersionInfoResponse{
Version: config.Version,
CommitHash: config.CommitHash,
BuildTimestamp: config.BuildTimestamp,
CaptiveCoreVersion: captiveCoreVersion,
ProtocolVersion: protocolVersion,
Version: config.Version,
CommitHash: config.CommitHash,
CommitHashDeprecated: config.CommitHash,
BuildTimestamp: config.BuildTimestamp,
BuildTimestampDeprecated: config.BuildTimestamp,
CaptiveCoreVersion: captiveCoreVersion,
CaptiveCoreVersionDeprecated: captiveCoreVersion,
ProtocolVersion: protocolVersion,
ProtocolVersionDeprecated: protocolVersion,
}, nil
})
}

0 comments on commit 54e3360

Please sign in to comment.