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

Add support for HIP15 #662

Merged
merged 4 commits into from
Nov 17, 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: 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