Skip to content

Commit

Permalink
Merge #3308
Browse files Browse the repository at this point in the history
3308: tx-generator: include collateralPercentage r=deepfire a=MarcFontaine



Co-authored-by: MarcFontaine <[email protected]>
  • Loading branch information
iohk-bors[bot] and MarcFontaine authored Oct 21, 2021
2 parents 0a553b5 + 6e55b94 commit c7d0f38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nix/nixos/tx-generator-service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ let
( let
## hard-code mainnet cost model
scriptFees = executionMemory * 577 / 10000 + executionSteps * 721 / 10000000;
collateralPercentage = 200;

totalFee = if plutusMode
then tx_fee + scriptFees * inputs_per_tx
else tx_fee;
safeCollateral = max (scriptFees + tx_fee) min_utxo_value;
safeCollateral = max ((scriptFees + tx_fee) * collateralPercentage / 100) min_utxo_value;
minTotalValue = min_utxo_value * outputs_per_tx + totalFee;
minValuePerInput = minTotalValue / inputs_per_tx + 1;
in
Expand Down

0 comments on commit c7d0f38

Please sign in to comment.