-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: stop comment out broken part of mutation
- Loading branch information
1 parent
ee25f20
commit 599a1ec
Showing
1 changed file
with
13 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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() | ||
|
@@ -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
|
||
start_height | ||
|> Hyperchain.get_delegates(leader) | ||
|> case do | ||
|