Skip to content

Commit

Permalink
Smart Contracts playbooks rework (#994)
Browse files Browse the repository at this point in the history
* Rework Smart Contracts playbooks

* Adapt playbook since we cannot use datetime with seconds anymore

* Update after rebase to match new contract spec

---------

Co-authored-by: Neylix <julien.leclerc05@protonmail.com>
  • Loading branch information
bchamagne and Neylix committed Oct 4, 2023
1 parent 210d884 commit ace44a7
Show file tree
Hide file tree
Showing 12 changed files with 984 additions and 598 deletions.
13 changes: 13 additions & 0 deletions lib/archethic/contracts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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
4 changes: 2 additions & 2 deletions lib/archethic/transaction_chain/transaction/data/recipient.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ defmodule Archethic.TransactionChain.TransactionData.Recipient do

@type t :: %__MODULE__{
address: Crypto.prepended_hash(),
action: String.t(),
args: list(any())
action: String.t() | nil,
args: list(any()) | nil
}

@doc """
Expand Down
3 changes: 2 additions & 1 deletion lib/archethic/utils/regression.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ defmodule Archethic.Utils.Regression do

alias Archethic.Utils

alias Archethic.Utils.Regression.Playbook.SmartContract
alias Archethic.Utils.Regression.Playbook.UCO

alias Archethic.Utils.WebClient
alias Archethic.Utils.Regression.Benchmark.EndToEndValidation
alias Archethic.Utils.Regression.Benchmark.P2PMessage

@playbooks [UCO]
@playbooks [UCO, SmartContract]
@benchmarks [P2PMessage, EndToEndValidation]

def run_playbooks(nodes, opts \\ []) do
Expand Down
Loading

0 comments on commit ace44a7

Please sign in to comment.