Skip to content

Commit 46efa3a

Browse files
committed
Fixed some dialyzer issues removing unused functions
1 parent ff42301 commit 46efa3a

File tree

4 files changed

+39
-37
lines changed

4 files changed

+39
-37
lines changed

lib/lambda_ethereum_consensus/fork_choice/fork_choice.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ defmodule LambdaEthereumConsensus.ForkChoice do
259259
%{slot: slot, body: body} = head_block
260260

261261
OperationsCollector.notify_new_block(head_block)
262-
263262
ExecutionChain.notify_new_block(slot, body.eth1_data, body.execution_payload)
264263

265264
update_fork_choice_data(
@@ -271,7 +270,7 @@ defmodule LambdaEthereumConsensus.ForkChoice do
271270

272271
Libp2pPort.notify_new_block({slot, head_root})
273272

274-
Logger.info("[Fork choice] Updated fork choice cache", slot: slot)
273+
Logger.debug("[Fork choice] Updated fork choice cache", slot: slot)
275274

276275
:ok
277276
end

lib/lambda_ethereum_consensus/p2p/gossip/beacon_block.ex

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,20 @@ defmodule LambdaEthereumConsensus.P2P.Gossip.BeaconBlock do
3838
:ok
3939
end
4040

41-
@spec subscribe_to_topic() :: :ok | :error
42-
def subscribe_to_topic() do
43-
topic()
44-
|> Libp2pPort.subscribe_to_topic(__MODULE__)
45-
|> case do
46-
:ok ->
47-
:ok
41+
# # TODO: Is anyone using this function?
42+
# @spec subscribe_to_topic() :: :ok | :error
43+
# def subscribe_to_topic() do
44+
# topic()
45+
# |> Libp2pPort.subscribe_to_topic(__MODULE__)
46+
# |> case do
47+
# :ok ->
48+
# :ok
4849

49-
{:error, reason} ->
50-
Logger.error("[Gossip] Subscription failed: '#{reason}'")
51-
:error
52-
end
53-
end
50+
# {:error, reason} ->
51+
# Logger.error("[Gossip] Subscription failed: '#{reason}'")
52+
# :error
53+
# end
54+
# end
5455

5556
def topic() do
5657
fork_context = ForkChoice.get_fork_digest() |> Base.encode16(case: :lower)

lib/lambda_ethereum_consensus/p2p/gossip/blob_sidecar.ex

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,20 @@ defmodule LambdaEthereumConsensus.P2P.Gossip.BlobSideCar do
2626
end
2727
end
2828

29-
@spec subscribe_to_topics() :: :ok | {:error, String.t()}
30-
def subscribe_to_topics() do
31-
Enum.each(topics(), fn topic ->
32-
case Libp2pPort.subscribe_to_topic(topic, __MODULE__) do
33-
:ok ->
34-
:ok
29+
# TODO: Is anyone using this function?
30+
# @spec subscribe_to_topics() :: :ok | {:error, String.t()}
31+
# def subscribe_to_topics() do
32+
# Enum.each(topics(), fn topic ->
33+
# case Libp2pPort.subscribe_to_topic(topic, __MODULE__) do
34+
# :ok ->
35+
# :ok
3536

36-
{:error, reason} ->
37-
Logger.error("[Gossip] Subscription failed: '#{reason}'")
38-
{:error, reason}
39-
end
40-
end)
41-
end
37+
# {:error, reason} ->
38+
# Logger.error("[Gossip] Subscription failed: '#{reason}'")
39+
# {:error, reason}
40+
# end
41+
# end)
42+
# end
4243

4344
def topics() do
4445
# TODO: this doesn't take into account fork digest changes

lib/lambda_ethereum_consensus/p2p/gossip/operations_collector.ex

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,18 @@ defmodule LambdaEthereumConsensus.P2P.Gossip.OperationsCollector do
4040
"bls_to_execution_change"
4141
]
4242

43-
def subscribe_to_topics() do
44-
Enum.reduce_while(topics(), :ok, fn topic, _acc ->
45-
case Libp2pPort.subscribe_to_topic(topic, __MODULE__) do
46-
:ok ->
47-
{:cont, :ok}
48-
49-
{:error, reason} ->
50-
{:halt, {:error, "[OperationsCollector] Subscription failed: '#{reason}'"}}
51-
end
52-
end)
53-
end
43+
# TODO: Is anyone using this function?
44+
# def subscribe_to_topics() do
45+
# Enum.reduce_while(topics(), :ok, fn topic, _acc ->
46+
# case Libp2pPort.subscribe_to_topic(topic, __MODULE__) do
47+
# :ok ->
48+
# {:cont, :ok}
49+
50+
# {:error, reason} ->
51+
# {:halt, {:error, "[OperationsCollector] Subscription failed: '#{reason}'"}}
52+
# end
53+
# end)
54+
# end
5455

5556
@spec get_bls_to_execution_changes(non_neg_integer()) :: list(SignedBLSToExecutionChange.t())
5657
def get_bls_to_execution_changes(count) do

0 commit comments

Comments
 (0)