Skip to content

Commit

Permalink
fix: stop comment out broken part of mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
yaboiishere committed Dec 11, 2024
1 parent ee25f20 commit 599a1ec
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions lib/ae_mdw/db/mutations/leader_mutation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule AeMdw.Db.LeaderMutation do
Possibly put the new leaders for a hyperchain
"""

alias AeMdw.Collection
# alias AeMdw.Collection
alias AeMdw.Blocks
alias AeMdw.Db.Model
alias AeMdw.Db.State
Expand Down Expand Up @@ -43,7 +43,7 @@ defmodule AeMdw.Db.LeaderMutation do
height
|> Hyperchain.epoch_info_at_height()
|> case do
{:ok, %{epoch: epoch, first: start_height}} ->
{:ok, %{epoch: epoch, first: _start_height}} ->
state =
height
|> Hyperchain.leaders_for_epoch_at_height()
Expand All @@ -64,19 +64,20 @@ defmodule AeMdw.Db.LeaderMutation do
end)

state
|> Collection.stream(
Model.RevValidator,
:backward,
Collection.generate_key_boundary({epoch, Collection.binary()}),
nil
)
|> Enum.reduce(state, fn {^epoch, leader}, state ->
put_delegates(state, start_height, epoch, leader)
end)
# |> Collection.stream(
# Model.RevValidator,
# :backward,
# Collection.generate_key_boundary({epoch, Collection.binary()}),
# nil
# )

# |> Enum.reduce(state, fn {^epoch, leader}, state ->
# put_delegates(state, start_height, epoch, leader)
# end)
end
end

defp put_delegates(state, start_height, epoch, leader) do
def put_delegates(state, start_height, epoch, leader) do

Check warning on line 80 in lib/ae_mdw/db/mutations/leader_mutation.ex

View workflow job for this annotation

GitHub Actions / Automated linting

Functions should have a @SPEC type specification.
start_height
|> Hyperchain.get_delegates(leader)
|> case do
Expand Down

0 comments on commit 599a1ec

Please sign in to comment.