This commit is contained in:
Ulf Wiger
2025-03-12 09:51:42 +01:00
parent ead33e2744
commit 8c5e9b9f26
11 changed files with 51 additions and 47 deletions
@@ -1,9 +1,10 @@
%%%-------------------------------------------------------------------
%%% @copyright (C) 2025, QPQ AG
%%% @copyright (C) 2019, Aeternity Anstalt
%%% @doc Basic sanity checks and examples on Cuckoo cycle PoW executables.
%%% @end
%%%-------------------------------------------------------------------
-module(aecuckoo_SUITE).
-module(gmcuckoo_SUITE).
%% common_test exports
-export(
@@ -56,7 +57,7 @@ smoke_test(Config) ->
HeaderEquivalent = <<0:(44*8), (base64:encode(<<Nonce:64/little-unsigned-integer>>))/binary, 0:(24*8)>>,
42 = length(Solution),
true = aeminer_pow_cuckoo:verify_proof_(HeaderEquivalent, Solution, 15),
true = gmminer_pow_cuckoo:verify_proof_(HeaderEquivalent, Solution, 15),
ok.
@@ -1,17 +1,18 @@
%%%=============================================================================
%%% @copyright (C) 2025, QPQ AG
%%% @copyright (C) 2019, Aeternity Anstalt
%%% @doc
%%% Unit tests for the aeminer_pow_cuckoo module
%%% Unit tests for the gmminer_pow_cuckoo module
%%% @end
%%%=============================================================================
-module(aeminer_pow_cuckoo_tests).
-module(gmminer_pow_cuckoo_tests).
-include_lib("eunit/include/eunit.hrl").
-include("aeminer.hrl").
-include("gmminer.hrl").
-define(TEST_MODULE, aeminer_pow_cuckoo).
-define(POW_MODULE, aeminer_pow).
-define(TEST_MODULE, gmminer_pow_cuckoo).
-define(POW_MODULE, gmminer_pow).
-define(TEST_BIN, <<"wsffgujnjkqhduihsahswgdf">>).
-define(TEST_HIGH_NONCE, 38). %% Nonce with solution with high target.
@@ -1,16 +1,17 @@
%%%=============================================================================
%%% @copyright (C) 2025, QPQ AG
%%% @copyright (C) 2019, Aeternity Anstalt
%%% @doc
%%% Unit tests for the aeminer_pow module
%%% Unit tests for the gmminer_pow module
%%% @end
%%%=============================================================================
-module(aeminer_pow_tests).
-module(gmminer_pow_tests).
-include_lib("eunit/include/eunit.hrl").
-define(TEST_MODULE, aeminer_pow).
-define(TEST_MODULE, gmminer_pow).
-include("aeminer.hrl").
-include("gmminer.hrl").
conversion_test_() ->
{setup,
@@ -47,7 +48,7 @@ conversion_test_() ->
?assertEqual(255, ?TEST_MODULE:scientific_to_integer(16#0200ff00)),
?assertEqual(16#800000, ?TEST_MODULE:scientific_to_integer(16#04008000)),
?assertEqual(?HIGHEST_TARGET_INT,
aeminer_pow:scientific_to_integer(?HIGHEST_TARGET_SCI))
gmminer_pow:scientific_to_integer(?HIGHEST_TARGET_SCI))
end},
{"Integer to scientific and back",
fun() ->