Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmanzanera committed Jul 22, 2024
1 parent 2458689 commit 4f2e7e2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
4 changes: 3 additions & 1 deletion lib/archethic/mining/pending_transaction_validation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ defmodule Archethic.Mining.PendingTransactionValidation do
{:transfers, true} <-
{:transfers, Enum.all?(token_transfers, &Reward.is_reward_token?(&1.token_address))},
{:mining_public_key, true} <-
{:mining_public_key, Crypto.valid_public_key?(mining_public_key)} do
{:mining_public_key,
Crypto.valid_public_key?(mining_public_key) and
Crypto.get_public_key_curve(mining_public_key) == :bls} do
:ok
else
:error ->
Expand Down
7 changes: 4 additions & 3 deletions test/archethic/bootstrap/sync_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,10 @@ defmodule Archethic.Bootstrap.SyncTest do
3000,
4000,
:tcp,
<<0::8, 0::8, :crypto.strong_rand_bytes(32)::binary>>,
<<0::8, 0::8, :crypto.strong_rand_bytes(32)::binary>>,
:crypto.strong_rand_bytes(64)
ArchethicCase.random_public_key(),
ArchethicCase.random_public_key(),
:crypto.strong_rand_bytes(64),
Crypto.generate_random_keypair(:bls) |> elem(0)
)
})

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 @@ -112,7 +112,8 @@ defmodule Archethic.Mining.DistributedWorkflowTest do
<<0, 0, 16, 233, 156, 172, 143, 228, 236, 12, 227, 76, 1, 80, 12, 236, 69, 10, 209, 6,
234, 172, 97, 188, 240, 207, 70, 115, 64, 117, 44, 82, 132, 186>>,
origin_public_key,
certificate
certificate,
Crypto.generate_random_keypair(:bls) |> elem(0)
)
})

Expand Down
6 changes: 4 additions & 2 deletions test/archethic/mining/pending_transaction_validation_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,8 @@ defmodule Archethic.Mining.PendingTransactionValidationTest do
<<0, 0, 4, 221, 19, 74, 75, 69, 16, 50, 149, 253, 24, 115, 128, 241, 110, 118, 139, 7,
48, 217, 58, 43, 145, 233, 77, 125, 190, 207, 31, 64, 157, 137>>,
origin_public_key,
certificate
certificate,
Crypto.generate_random_keypair(:bls) |> elem(0)
)

tx = TransactionFactory.create_non_valided_transaction(type: :node, content: content)
Expand Down Expand Up @@ -581,7 +582,8 @@ defmodule Archethic.Mining.PendingTransactionValidationTest do
<<0, 0, 4, 221, 19, 74, 75, 69, 16, 50, 149, 253, 24, 115, 128, 241, 110, 118, 139, 7,
48, 217, 58, 43, 145, 233, 77, 125, 190, 207, 31, 64, 157, 137>>,
<<0::8, 0::8, :crypto.strong_rand_bytes(32)::binary>>,
certificate
certificate,
Crypto.generate_random_keypair(:bls) |> elem(0)
)

tx =
Expand Down
5 changes: 3 additions & 2 deletions test/archethic/shared_secrets/mem_tables_loader_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ defmodule Archethic.SharedSecrets.MemTablesLoaderTest do
:tcp,
ArchethicCase.random_address(),
origin_public_key,
ArchethicCase.random_public_key()
:crypto.strong_rand_bytes(32),
Crypto.generate_random_keypair(:bls) |> elem(0)
)
}
}
Expand Down Expand Up @@ -159,7 +160,7 @@ defmodule Archethic.SharedSecrets.MemTablesLoaderTest do
ArchethicCase.random_address(),
node_origin_public_key,
:crypto.strong_rand_bytes(32),
ArchethicCase.random_public_key()
Crypto.generate_random_keypair(:bls) |> elem(0)
)
}
}
Expand Down

0 comments on commit 4f2e7e2

Please sign in to comment.