Skip to content

Commit c70a75c

Browse files
authored
fix: remove the :ok tuple when calling get_current_status_message (#1039)
1 parent 3c58d61 commit c70a75c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/beacon_api/helpers.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ defmodule BeaconApi.Helpers do
4848
@spec block_root_by_block_id(block_id()) ::
4949
{:ok, root_info()} | {:error, String.t()} | :not_found | :empty_slot | :invalid_id
5050
def block_root_by_block_id(:head) do
51-
with {:ok, current_status} <- BeaconChain.get_current_status_message() do
51+
with current_status <- BeaconChain.get_current_status_message() do
5252
# TODO compute is_optimistic_or_invalid
5353
execution_optimistic = true
5454
{:ok, {current_status.head_root, execution_optimistic, false}}

lib/lambda_ethereum_consensus/beacon/beacon_chain.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ defmodule LambdaEthereumConsensus.Beacon.BeaconChain do
8989
@spec get_fork_version() :: Types.version()
9090
def get_fork_version(), do: GenServer.call(__MODULE__, :get_fork_version)
9191

92-
@spec get_current_status_message() :: {:ok, Types.StatusMessage.t()} | {:error, any}
92+
@spec get_current_status_message() :: Types.StatusMessage.t()
9393
def get_current_status_message(), do: GenServer.call(__MODULE__, :get_current_status_message)
9494

9595
##########################

test/unit/beacon_api/beacon_api_v1_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ defmodule Unit.BeaconApiTest.V1 do
3333

3434
start_link_supervised!({Db, dir: tmp_dir})
3535

36-
patch(BeaconChain, :get_current_status_message, {:ok, status_message})
36+
patch(BeaconChain, :get_current_status_message, status_message)
3737
patch(BeaconChain, :get_genesis_time, 42)
3838

3939
:ok

0 commit comments

Comments
 (0)