Skip to content

Commit

Permalink
Merge pull request #173 from kommitters/v0.22
Browse files Browse the repository at this point in the history
Release v0.22
  • Loading branch information
L-Zuluaga authored Jul 24, 2024
2 parents a352507 + 8de3bea commit 78ec767
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.22.0 (24.07.2024)

- Update the getHealth endpoint response

## 0.21.0 (24.07.2024)

- [Stellar Protocol 21 support](https://github.com/kommitters/soroban.ex/issues/158).
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
```elixir
def deps do
[
{:soroban, "~> 0.21.0"}
{:soroban, "~> 0.22.0"}
]
end
```
Expand Down Expand Up @@ -405,7 +405,13 @@ General node health check.
server = Soroban.RPC.Server.testnet()
Soroban.RPC.get_health(server)

{:ok, %Soroban.RPC.GetHealthResponse{status: "healthy"}}
{:ok,
%Soroban.RPC.GetHealthResponse{
status: "healthy",
latest_ledger: 706073,
oldest_ledger: 688794,
ledger_retention_window: 17280
}}

```

Expand Down
11 changes: 9 additions & 2 deletions lib/rpc/responses/get_health_response.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ defmodule Soroban.RPC.GetHealthResponse do
@behaviour Soroban.RPC.Response.Spec

@type status :: String.t()
@type latest_ledger :: non_neg_integer()
@type oldest_ledger :: non_neg_integer()
@type ledger_retention_window :: non_neg_integer()

@type t :: %__MODULE__{
status: status()
status: status(),
latest_ledger: latest_ledger(),
oldest_ledger: oldest_ledger(),
ledger_retention_window: ledger_retention_window()
}

defstruct [:status]
defstruct [:status, :latest_ledger, :oldest_ledger, :ledger_retention_window]

@impl true
def new(attrs), do: struct(%__MODULE__{}, attrs)
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Soroban.MixProject do
use Mix.Project

@version "0.21.0"
@version "0.22.0"
@github_url "https://github.com/kommitters/soroban.ex"

def project do
Expand Down
5 changes: 4 additions & 1 deletion test/rpc/responses/get_health_response_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ defmodule Soroban.RPC.GetHealthResponseTest do
setup do
%{
result: %{
status: "healthy"
status: "healthy",
latest_ledger: 706_073,
oldest_ledger: 688_794,
ledger_retention_window: 17_280
}
}
end
Expand Down
5 changes: 4 additions & 1 deletion test/rpc_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ defmodule Soroban.RPC.CannedRPCGetHealthClientImpl do

{:ok,
%{
status: "healthy"
status: "healthy",
latest_ledger: 706_073,
oldest_ledger: 688_794,
ledger_retention_window: 17_280
}}
end
end
Expand Down

0 comments on commit 78ec767

Please sign in to comment.