Skip to content

Commit

Permalink
change default contract type + add data & contract types in set_type
Browse files Browse the repository at this point in the history
  • Loading branch information
bchamagne committed Jan 18, 2023
1 parent be48860 commit bea0b80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ defmodule Archethic.Contracts.Interpreter.TransactionStatements do
%Transaction{ type: :transfer }
"""
@spec set_type(Transaction.t(), binary()) :: Transaction.t()
def set_type(tx = %Transaction{}, type) when type in ["transfer", "token", "hosting"] do
def set_type(tx = %Transaction{}, type)
when type in ["transfer", "token", "hosting", "data", "contract"] do
%{tx | type: String.to_existing_atom(type)}
end

Expand Down
2 changes: 1 addition & 1 deletion lib/archethic/contracts/worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ defmodule Archethic.Contracts.Worker do
previous_transaction: _
}
) do
put_in(acc, [:next_transaction, Access.key(:type)], :transfer)
put_in(acc, [:next_transaction, Access.key(:type)], :contract)
end

defp chain_type(acc), do: acc
Expand Down

0 comments on commit bea0b80

Please sign in to comment.