Skip to content

Commit

Permalink
Set all the nodes as I/O replicas for network tx
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel committed May 16, 2022
1 parent 7014ef2 commit 0daad8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/archethic/mining/validation_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ defmodule Archethic.Mining.ValidationContext do
) do
io_storage_nodes =
if Transaction.network_type?(type) do
P2P.available_nodes()
P2P.list_nodes()
else
movement_addresses = LedgerOperations.movement_addresses(ledger_ops)

Expand Down
10 changes: 9 additions & 1 deletion test/archethic/mining/distributed_workflow_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ defmodule Archethic.Mining.DistributedWorkflowTest do
http_port: 4000,
first_public_key: "key1",
last_public_key: "key1",
geo_patch: "AAA",
network_patch: "AAA",
reward_address: <<0::8, 0::8, :crypto.strong_rand_bytes(32)::binary>>
}

Expand Down Expand Up @@ -415,6 +417,8 @@ defmodule Archethic.Mining.DistributedWorkflowTest do
http_port: 4000,
first_public_key: "key1",
last_public_key: "key1",
geo_patch: "AAA",
network_patch: "AAA",
reward_address: <<0::8, 0::8, :crypto.strong_rand_bytes(32)::binary>>
}

Expand Down Expand Up @@ -542,6 +546,8 @@ defmodule Archethic.Mining.DistributedWorkflowTest do
http_port: 4000,
first_public_key: "key1",
last_public_key: "key1",
network_patch: "AAA",
geo_patch: "AAA",
reward_address: <<0::8, 0::8, :crypto.strong_rand_bytes(32)::binary>>
}

Expand Down Expand Up @@ -615,7 +621,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) == P2P.list_nodes() |> length()))

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

Expand Down Expand Up @@ -729,6 +735,8 @@ defmodule Archethic.Mining.DistributedWorkflowTest do
http_port: 4000,
first_public_key: "key1",
last_public_key: "key1",
geo_patch: "AAA",
network_patch: "AAA",
reward_address: <<0::8, 0::8, :crypto.strong_rand_bytes(32)::binary>>
}

Expand Down

0 comments on commit 0daad8f

Please sign in to comment.