Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

fix tests for election v4 stuff #561

Merged
merged 1 commit into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{<<"base64url">>,{pkg,<<"base64url">>,<<"1.0.1">>},1},
{<<"blockchain">>,
{git,"https://github.com/helium/blockchain-core.git",
{ref,"7801ba9797b9675e463b710b5c00e38c27dd40ef"}},
{ref,"14f283ddb68c43fdbabf708865442a094a99d275"}},
0},
{<<"clique">>,
{git,"https://github.com/helium/clique.git",
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ echo "Node not in consensus: $non_consensus_node"
exported_genesis_file="/tmp/genesis_$(date +%Y%m%d%H%M%S)"
# get the genesis block from one of the consensus nodes
LOOP=5
while [ $LOOP -ne 0 ]; do
while [ $LOOP -gt 0 ]; do
for node in ${nodes[@]}; do
if [[ $(./_build/testdev\+miner$node/rel/miner$node/bin/miner$node info in_consensus) = *true* ]]; then
./_build/testdev\+miner$node/rel/miner$node/bin/miner$node genesis export $exported_genesis_file
Expand Down
2 changes: 1 addition & 1 deletion src/cli/miner_cli_genesis.erl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ make_vars() ->
?block_time => BlockTime,
?election_interval => Interval,
?election_restart_interval => 5,
?election_version => 3,
?election_version => 4,
?election_bba_penalty => 0.01,
?election_seen_penalty => 0.25,
?election_selection_pct => 75,
Expand Down
4 changes: 4 additions & 0 deletions test/miner_blockchain_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ init_per_testcase(TestCase, Config0) ->
?election_bba_penalty => 0.01,
?election_seen_penalty => 0.05,
?election_version => 3};
election_v3_test ->
#{
?election_version => 2
};
_ ->
#{}
end,
Expand Down
9 changes: 6 additions & 3 deletions test/miner_ct_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,9 @@ make_vars(Keys, Map, Mode) ->
?poc_challengers_percent => 0.09 + 0.06,
?poc_witnesses_percent => 0.02 + 0.03,
?consensus_percent => 0.10,
?election_version => 2,
?election_version => 4,
?election_bba_penalty => 0.01,
?election_seen_penalty => 0.05,
?election_cluster_res => 8,
?election_removal_pct => 85,
?election_selection_pct => 60,
Expand Down Expand Up @@ -956,9 +958,10 @@ make_vars(Keys, Map, Mode) ->
legacy ->
%% ideally figure out a few more that are safe to
%% remove or bring back the splitting code
LegVars = maps:without([?poc_version, ?poc_path_limit,
LegVars = maps:without([?poc_version, ?poc_path_limit, ?sc_grace_blocks,
?election_version, ?election_removal_pct, ?election_cluster_res,
?chain_vars_version, ?block_version],
?chain_vars_version, ?block_version, ?election_bba_penalty,
?election_seen_penalty],
Vars),
Proof = blockchain_txn_vars_v1:legacy_create_proof(Priv, LegVars),
Txn = blockchain_txn_vars_v1:new(LegVars, 1, #{master_key => BinPub,
Expand Down