Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #662 from helium/rg/hip0015
Browse files Browse the repository at this point in the history
Add support for HIP15
  • Loading branch information
evanmcc authored Nov 17, 2020
2 parents 58711fb + 5f87842 commit 79a749e
Show file tree
Hide file tree
Showing 7 changed files with 793 additions and 75 deletions.
2 changes: 2 additions & 0 deletions include/blockchain_vars.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
-define(poc_witnesses_percent, poc_witnesses_percent).
-define(poc_challengers_percent, poc_challengers_percent).
-define(dc_percent, dc_percent).
-define(witness_redundancy, witness_redundancy).
-define(poc_reward_decay_rate, poc_reward_decay_rate).

%%%
%%% bundle txn vars
Expand Down
2 changes: 1 addition & 1 deletion src/transactions/v1/blockchain_txn_poc_receipts_v1.erl
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ absorb(Txn, Chain) ->
catch What:Why:Stacktrace ->
lager:error([{poc_id, POCID}], "poc receipt calculation failed: ~p ~p ~p",
[What, Why, Stacktrace]),
{error, state_missing}
{error, state_missing}
end.

-spec get_lower_and_upper_bounds(Secret :: binary(),
Expand Down
214 changes: 168 additions & 46 deletions src/transactions/v1/blockchain_txn_rewards_v1.erl

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/transactions/v1/blockchain_txn_vars_v1.erl
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,10 @@ validate_var(?poc_challengers_percent, Value) ->
validate_float(Value, "poc_challengers_percent", 0.0, 1.0);
validate_var(?dc_percent, Value) ->
validate_float(Value, "dc_percent", 0.0, 1.0);
validate_var(?witness_redundancy, Value) ->
validate_int(Value, "witness_redundancy", 2, 100, false);
validate_var(?poc_reward_decay_rate, Value) ->
validate_float(Value, "poc_reward_decay_rate", 0.0, 1.0);
validate_var(?reward_version, Value) ->
case Value of
N when is_integer(N), N >= 1, N =< 5 ->
Expand Down
Loading

0 comments on commit 79a749e

Please sign in to comment.