Skip to content

Commit

Permalink
Update after rebase to match new contract spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Neylix committed Sep 19, 2023
1 parent ac88ef0 commit 08a1a58
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 111 deletions.
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
8 changes: 6 additions & 2 deletions lib/archethic/utils/regression/api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ defmodule Archethic.Utils.Regression.Api do
alias Archethic.TransactionChain.TransactionData.TokenLedger
alias Archethic.TransactionChain.TransactionData.TokenLedger.Transfer, as: TokenTransfer
alias Archethic.TransactionChain.TransactionData.Ownership
alias Archethic.TransactionChain.TransactionData.Recipient
alias Archethic.TransactionChain.TransactionData.UCOLedger
alias Archethic.TransactionChain.TransactionData.UCOLedger.Transfer, as: UCOTransfer

Expand All @@ -31,7 +32,7 @@ defmodule Archethic.Utils.Regression.Api do
)
|> Enum.at(0)

@faucet_seed Application.compile_env(:archethic, [ArchethicWeb.FaucetController, :seed])
@faucet_seed Application.compile_env(:archethic, [ArchethicWeb.Explorer.FaucetController, :seed])

defstruct [
:host,
Expand Down Expand Up @@ -559,7 +560,10 @@ defmodule Archethic.Utils.Regression.Api do
},
"code" => code,
"content" => Base.encode16(content),
"recipients" => Enum.map(recipients, &Base.encode16(&1)),
"recipients" =>
Enum.map(recipients, fn %Recipient{address: address, action: action, args: args} ->
%{"address" => Base.encode16(address), "action" => action, "arg" => args}
end),
"ownerships" =>
Enum.map(ownerships, fn %Ownership{
secret: secret,
Expand Down
6 changes: 2 additions & 4 deletions lib/archethic/utils/regression/playbooks/smart_contract.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ defmodule Archethic.Utils.Regression.Playbook.SmartContract do

alias Archethic.TransactionChain.TransactionData
alias Archethic.TransactionChain.TransactionData.Ownership
alias Archethic.TransactionChain.TransactionData.Recipient

alias Archethic.Utils.Regression.Api
alias Archethic.Utils.WebSocket.Client, as: WSClient

alias __MODULE__.Counter
alias __MODULE__.Legacy
alias __MODULE__.Faucet
alias __MODULE__.UcoAth

require Logger
Expand All @@ -42,8 +42,6 @@ defmodule Archethic.Utils.Regression.Playbook.SmartContract do
Counter.play(storage_nonce_pubkey, endpoint)
Logger.info("============== CONTRACT: LEGACY ==============")
Legacy.play(storage_nonce_pubkey, endpoint)
Logger.info("============== CONTRACT: FAUCET ==============")
Faucet.play(storage_nonce_pubkey, endpoint)
Logger.info("============== CONTRACT: UCO ATH ==============")
UcoAth.play(storage_nonce_pubkey, endpoint)
end
Expand Down Expand Up @@ -103,7 +101,7 @@ defmodule Archethic.Utils.Regression.Playbook.SmartContract do
:transfer,
%TransactionData{
content: Keyword.get(opts, :content, ""),
recipients: [contract_address]
recipients: [%Recipient{address: contract_address}]
},
endpoint
)
Expand Down
103 changes: 0 additions & 103 deletions lib/archethic/utils/regression/playbooks/smart_contract/faucet.ex

This file was deleted.

0 comments on commit 08a1a58

Please sign in to comment.