Skip to content

Commit

Permalink
compress code in playbooks
Browse files Browse the repository at this point in the history
  • Loading branch information
bchamagne committed Jan 24, 2024
1 parent 9c84bc9 commit 4e5594b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .formatter.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"{mix,.formatter}.exs",
"{config,lib,test}/**/*.{ex,exs,heex}",
"apps/*/{lib,config,test}/**/*.{ex,exs}",
"apps/*/mix.exs"
"apps/*/mix.exs",
"priv/migration_tasks/**/*.exs"
],
import_deps: [:distillery]
]
4 changes: 2 additions & 2 deletions lib/archethic/utils/regression/api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,13 @@ defmodule Archethic.Utils.Regression.Api do
%{
"to" => Base.encode16(to),
"amount" => amount,
"token" => token_address,
"token" => Base.encode16(token_address),
"token_id" => token_id
}
end)
}
},
"code" => code,
"code" => TransactionData.decompress_code(code),
"content" => Base.encode16(content),
"recipients" =>
Enum.map(recipients, fn %Recipient{address: address, action: action, args: args} ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ defmodule Archethic.Utils.Regression.Playbook.SmartContract.Counter do
contract_seed,
%TransactionData{
content: "0",
code: contract_code()
code: contract_code() |> TransactionData.compress_code()
},
storage_nonce_pubkey,
endpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ defmodule Archethic.Utils.Regression.Playbook.SmartContract.Legacy do
SmartContract.deploy(
contract_seed,
%TransactionData{
code: contract_code(recipient_address, amount_to_send)
code:
contract_code(recipient_address, amount_to_send)
|> TransactionData.compress_code()
},
storage_nonce_pubkey,
endpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule Archethic.Utils.Regression.Playbook.SmartContract.UcoAth do
contract_seed,
%TransactionData{
content: Jason.encode!(%{"ucoMaxPrice" => -1}),
code: contract_code()
code: contract_code() |> TransactionData.compress_code()
},
storage_nonce_pubkey,
endpoint
Expand Down

0 comments on commit 4e5594b

Please sign in to comment.