Skip to content

Commit

Permalink
Fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Neylix committed Jan 25, 2023
1 parent 16a5f39 commit 5ecbcd7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
4 changes: 3 additions & 1 deletion lib/archethic/contracts/interpreter/library.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ defmodule Archethic.Contracts.Interpreter.Library do
alias Archethic.P2P.Message.GenesisAddress
alias Archethic.P2P.Message.FirstPublicKey

alias Archethic.Contracts.Interpreter.Utils

@doc """
Match a regex expression
Expand Down Expand Up @@ -143,7 +145,7 @@ defmodule Archethic.Contracts.Interpreter.Library do
:blake2b
end

:crypto.hash(algo, decode_binary(content))
:crypto.hash(algo, Utils.maybe_decode_hex(content))
|> Base.encode16()
end

Expand Down
16 changes: 6 additions & 10 deletions lib/archethic/contracts/loader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,12 @@ defmodule Archethic.Contracts.Loader do
protocol_version
)

case Worker.execute(contract_address, tx) do
:ok ->
Logger.info("Transaction towards contract ingested",
transaction_address: Base.encode16(tx_address),
transaction_type: tx_type
)

_ ->
:ok
end
Worker.execute(contract_address, tx)

Logger.info("Transaction towards contract ingested",
transaction_address: Base.encode16(tx_address),
transaction_type: tx_type
)
end)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ defmodule Archethic.Mining.PendingTransactionValidationTest do
assert :ok = PoolsMemTable.put_pool_member(:technical_council, tx.previous_public_key)

MockDB
|> expect(:get_transaction, fn _, _ ->
|> expect(:get_transaction, fn _, _, _ ->
{:ok,
%Transaction{
data: %TransactionData{
Expand Down
4 changes: 2 additions & 2 deletions test/archethic/replication_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ defmodule Archethic.ReplicationTest do

MockDB
|> expect(:get_genesis_address, fn _ -> "@Alice0" end)
|> expect(:get_transaction, fn _, _ ->
|> expect(:get_transaction, fn _, _, _ ->
{:ok,
%Transaction{
validation_stamp: %ValidationStamp{timestamp: DateTime.utc_now()},
Expand Down Expand Up @@ -344,7 +344,7 @@ defmodule Archethic.ReplicationTest do

MockDB
|> expect(:get_genesis_address, fn _ -> "@Alice0" end)
|> expect(:get_transaction, fn _, _ ->
|> expect(:get_transaction, fn _, _, _ ->
{:ok,
%Transaction{
validation_stamp: %ValidationStamp{timestamp: DateTime.utc_now()},
Expand Down

0 comments on commit 5ecbcd7

Please sign in to comment.