Skip to content

Commit

Permalink
I/O replicas for network tx to be all the nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel committed May 31, 2022
1 parent c58aa07 commit 75e3e48
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/archethic/mining/distributed_workflow.ex
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ defmodule Archethic.Mining.DistributedWorkflow do

io_storage_nodes =
if Transaction.network_type?(tx.type) do
P2P.available_nodes()
P2P.list_nodes()
else
resolved_addresses
|> Enum.map(fn {_origin, resolved} -> resolved end)
Expand Down
2 changes: 1 addition & 1 deletion lib/archethic/mining/standalone_workflow.ex
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ defmodule Archethic.Mining.StandaloneWorkflow do

io_storage_nodes =
if Transaction.network_type?(tx.type) do
P2P.available_nodes()
P2P.list_nodes()
else
resolved_addresses
|> Enum.map(fn {_origin, resolved} -> resolved end)
Expand Down
3 changes: 2 additions & 1 deletion test/archethic/mining/distributed_workflow_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ defmodule Archethic.Mining.DistributedWorkflowTest do

assert chain_storage_nodes_view == <<1::1, 1::1, 1::1, 1::1>>
assert beacon_storage_nodes_view == <<1::1, 1::1, 1::1, 1::1>>
assert io_storage_nodes_view == <<1::1, 1::1, 1::1, 1::1>>
assert <<0::1, 1::1>> == confirmed_validation_nodes
end

Expand Down Expand Up @@ -621,7 +622,7 @@ defmodule Archethic.Mining.DistributedWorkflowTest do
tree = %{chain: chain_tree, beacon: beacon_tree, IO: io_tree}} ->
assert Enum.all?(chain_tree, &(bit_size(&1) == 3))

assert Enum.all?(io_tree, &(bit_size(&1) == 3))
assert Enum.all?(io_tree, &(bit_size(&1) == 4))

assert Enum.all?(beacon_tree, &(bit_size(&1) == 3))

Expand Down

0 comments on commit 75e3e48

Please sign in to comment.