Skip to content

Commit

Permalink
update the tx value price
Browse files Browse the repository at this point in the history
  • Loading branch information
blackode committed Jun 8, 2022
1 parent 35cf54c commit 3c24793
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lib/archethic/mining/fee.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@ defmodule Archethic.Mining.Fee do
true == Transaction.network_type?(type) ->
0

type == :oracle ->
0.01 / uco_price_in_usd

true ->
transaction_value = get_transaction_value(tx) / @unit_uco
transaction_value = 0.01 / uco_price_in_usd
nb_recipients = get_number_recipients(tx)
nb_bytes = get_transaction_size(tx)
nb_storage_nodes = get_number_replicas(tx)
Expand All @@ -63,12 +60,6 @@ defmodule Archethic.Mining.Fee do
end
end

defp get_transaction_value(%Transaction{
data: %TransactionData{ledger: %Ledger{uco: %UCOLedger{transfers: uco_transfers}}}
}) do
Enum.reduce(uco_transfers, 0, &(&1.amount + &2))
end

defp get_transaction_size(tx = %Transaction{}) do
tx
|> Transaction.to_pending()
Expand Down

0 comments on commit 3c24793

Please sign in to comment.