Skip to content

Commit

Permalink
Rework Smart Contracts playbooks
Browse files Browse the repository at this point in the history
  • Loading branch information
bchamagne committed May 10, 2023
1 parent 6bc44ef commit 64885c1
Show file tree
Hide file tree
Showing 12 changed files with 1,042 additions and 523 deletions.
13 changes: 13 additions & 0 deletions lib/archethic/contracts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ defmodule Archethic.Contracts do

@extended_mode? Mix.env() != :prod

@doc """
Return the minimum trigger interval in milliseconds.
Depends on the env
"""
@spec minimum_trigger_interval(boolean()) :: pos_integer()
def minimum_trigger_interval(extended_mode? \\ @extended_mode?) do
if extended_mode? do
1_000
else
60_000
end
end

@doc """
Parse a smart contract code and return a contract struct
"""
Expand Down
1 change: 1 addition & 0 deletions lib/archethic/contracts/interpreter/action_interpreter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ defmodule Archethic.Contracts.Interpreter.ActionInterpreter do
# | .__/|_| |_| \_/ \__,_|\__\___|
# |_|
# ----------------------------------------------------------------------

defp extract_trigger([{{:atom, "triggered_by"}, {{:atom, "transaction"}, _, nil}}]) do
:transaction
end
Expand Down
Loading

0 comments on commit 64885c1

Please sign in to comment.