Skip to content

Commit

Permalink
Fix validation stamp fee control (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neylix committed Dec 13, 2022
1 parent e8bca36 commit 177a78f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/archethic/mining/validation_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1087,9 +1087,15 @@ defmodule Archethic.Mining.ValidationContext do
%ValidationStamp{timestamp: timestamp, ledger_operations: %LedgerOperations{fee: fee}},
%__MODULE__{transaction: tx}
) do
previous_usd_price =
timestamp
|> OracleChain.get_last_scheduling_date()
|> OracleChain.get_uco_price()
|> Keyword.fetch!(:usd)

Fee.calculate(
tx,
OracleChain.get_uco_price(timestamp) |> Keyword.fetch!(:usd),
previous_usd_price,
timestamp
) == fee
end
Expand Down

0 comments on commit 177a78f

Please sign in to comment.