From 9d19f369e077c99588e55b3944cdfbc38a694fd4 Mon Sep 17 00:00:00 2001 From: Edwin Steven Guayacan <80716239+EdwinGuayacan@users.noreply.github.com> Date: Wed, 1 Feb 2023 09:39:17 -0500 Subject: [PATCH 1/3] Add YAML continuation command implementation (#272) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add YAML continuation command implementation Co-authored-by: David Roldán --- README.md | 113 +++++++++++++++++- lib/pact/command/cont_command.ex | 75 +++++++++++- test/pact/command/cont_command_test.exs | 100 +++++++++++++--- test/pact/command/exec_command_test.exs | 14 +-- ...t_exec_2.yaml => for_test_commands_1.yaml} | 0 ...t_exec_3.yaml => for_test_commands_2.yaml} | 0 ...t_exec_4.yaml => for_test_commands_3.yaml} | 0 ...t_exec_5.yaml => for_test_commands_4.yaml} | 0 ...t_exec_6.yaml => for_test_commands_5.yaml} | 0 ...t_exec_7.yaml => for_test_commands_6.yaml} | 0 ...t_exec_8.yaml => for_test_commands_7.yaml} | 0 .../yaml_tests_files/for_test_cont.yaml | 26 ++++ 12 files changed, 301 insertions(+), 27 deletions(-) rename test/support/yaml_tests_files/{for_test_exec_2.yaml => for_test_commands_1.yaml} (100%) rename test/support/yaml_tests_files/{for_test_exec_3.yaml => for_test_commands_2.yaml} (100%) rename test/support/yaml_tests_files/{for_test_exec_4.yaml => for_test_commands_3.yaml} (100%) rename test/support/yaml_tests_files/{for_test_exec_5.yaml => for_test_commands_4.yaml} (100%) rename test/support/yaml_tests_files/{for_test_exec_6.yaml => for_test_commands_5.yaml} (100%) rename test/support/yaml_tests_files/{for_test_exec_7.yaml => for_test_commands_6.yaml} (100%) rename test/support/yaml_tests_files/{for_test_exec_8.yaml => for_test_commands_7.yaml} (100%) create mode 100644 test/support/yaml_tests_files/for_test_cont.yaml diff --git a/README.md b/README.md index be9b616..4471cf0 100644 --- a/README.md +++ b/README.md @@ -350,17 +350,17 @@ env_data = %{accounts_admin_keyset: [keypair.pub_key]} }} ``` -#### With a `YAML` file +#### From a `YAML` file YAML struct: - `networkId`: [NetworkID](#networkid) value. - `code`: there are two ways to set the code from the `YAML` file: - `code`: [Code](#code) value. - - `codeFile`: The name of a `pact` file in the same directory as the `YAML` file. + - `codeFile`: The name of a `pact` file in the same directory as the `YAML` file. For example, `code.pact`. - `data`: there are two ways to set the data from the `YAML` file: - `data`: [EnvData](#envdata) value. - - `dataFile`: The name of a `json` file in the same directory as the `YAML` file. + - `dataFile`: The name of a `json` file in the same directory as the `YAML` file. For example, `data.json`. - `nonce`: [Nonce](#nonce) value. - `publicMeta`: [Metadata](#metadata) value. - `keyPairs`: [KeyPairs](#keypairs) values. @@ -422,7 +422,7 @@ keyPairs: ```elixir alias Kadena.Pact.ExecCommand -"~/your_file_path" +"~/example.yaml" |> ExecCommand.from_yaml() |> ExecCommand.build() @@ -445,6 +445,10 @@ alias Kadena.Pact.ExecCommand ### Building a Continuation Command +There are two ways to create a ContCommand. + +#### Using [attributes](#attributes) structures + ```elixir alias Kadena.Cryptography alias Kadena.Pact @@ -508,6 +512,107 @@ rollback = true }} ``` +#### From a `YAML` file + +YAML struct: + +- `networkId`: [NetworkID](#networkid) value. +- `data`: there are two ways to set the data from the `YAML` file: + - `data`: [EnvData](#envdata) value. + - `dataFile`: The name of a `json` file in the same directory as the `YAML` file. For example, `data.json`. +- `nonce`: [Nonce](#nonce) value. +- `publicMeta`: [Metadata](#metadata) value. +- `keyPairs`: [KeyPairs](#keypairs) values. +- `signers`: [Signers](#signers) values. +- `pactTxHash`: [PactTxHash](#pacttxhash-continuation-command) value. +- `rollback`: [Rollback](#rollback-continuation-command) value. +- `Step`: [Step](#step-continuation-command) value. +- `proof`: [Proof](#proof-continuation-command) value. + + +The scheme below shows how to set the different values of a `ContCommand` + +```YAML +networkId: +data/dataFile: +nonce: +publicMeta: + creationTime: + chainId: + gasLimit: + gasPrice: + ttl: + sender: +keyPairs: + - public: + secret: +signers: + - publicKey: + scheme: + addr: + capsList: + - name: + args: + - +pactTxHash: +step: +rollback: +proof: + +``` +**Example** + +YAML file: +```YAML +networkId: :testnet04 +data: + accounts_admin_keyset: + - 6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7 +nonce: 2023-01-01 00:00:00.000000 UTC +publicMeta: + creationTime: 1667249173 + chainId: "0" + gasLimit: 2500 + gasPrice: 0.01 + ttl: 28800 + sender: k:6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7 +keyPairs: + - public: 6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7 + secret: 99f7e1e8f2f334ae8374aa28bebdb997271a0e0a5e92c80be9609684a3d6f0d4 + capsList: + name: coin.GAS + args: + - 6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7 +pactTxHash: yxM0umrtdcvSUZDc_GSjwadH6ELYFCjOqI59Jzqapi4 +step: 1 +rollback: true + +``` + +```elixir +alias Kadena.Pact.ContCommand + +"~/example.yaml" +|> ContCommand.from_yaml() +|> ContCommand.build() + +{:ok, + %Kadena.Types.Command{ + cmd: + "{\"meta\":{\"chainId\":\"0\",\"creationTime\":1667249173,\"gasLimit\":2500,\"gasPrice\":0.01,\"sender\":\"k:6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7\",\"ttl\":28800},\"networkId\":\"testnet04\",\"nonce\":\"2023-01-01 00:00:00.000000 UTC\",\"payload\":{\"cont\":{\"data\":{\"accounts_admin_keyset\":[\"6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7\"]},\"pactId\":\"\",\"proof\":null,\"rollback\":true,\"step\":0}},\"signers\":[{\"addr\":null,\"clist\":[{\"args\":[\"6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7\"],\"name\":\"coin.GAS\"}],\"pubKey\":\"6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7\",\"scheme\":\"ED25519\"}]}", + hash: %Kadena.Types.PactTransactionHash{ + hash: "psIXOGGneMAV1Ie3zx5O1VWMFueFZrShvaBx4YOCkjQ" + }, + sigs: [ + %Kadena.Types.Signature{ + sig: + "1ae6e796bbf8e1ddb005945508ac6fd13cc6435c4f63609cff299114865fd13879b8b5bcad13383ae377acc10411e49e745397320a2ba5bf9d1370cafbf90a06" + } + ] + }} + +``` + ## Chainweb Pact API Interaction with [Chainweb Pact API][chainweb_pact_api_doc] is done through the [**Kadena.Chainweb.Pact**][chainweb_pact_api] module using simple functions to access endpoints. diff --git a/lib/pact/command/cont_command.ex b/lib/pact/command/cont_command.ex index 90593d6..d566ac5 100644 --- a/lib/pact/command/cont_command.ex +++ b/lib/pact/command/cont_command.ex @@ -6,7 +6,7 @@ defmodule Kadena.Pact.ContCommand do alias Kadena.Chainweb.Pact.CommandPayload alias Kadena.Cryptography.{Sign, Utils} - alias Kadena.Pact.Command.Hash + alias Kadena.Pact.Command.{Hash, YamlReader} alias Kadena.Types.{ Command, @@ -103,7 +103,34 @@ defmodule Kadena.Pact.ContCommand do def new(_opts), do: %__MODULE__{} @impl true - def from_yaml(_path), do: new() + def from_yaml(path) when is_binary(path) do + with {:ok, map_result} <- YamlReader.read(path) do + network_id = Map.get(map_result, "networkId") + data = Map.get(map_result, "data") + nonce = Map.get(map_result, "nonce", "") + meta_data = Map.get(map_result, "publicMeta", MetaData.new()) + pact_tx_hash = Map.get(map_result, "pactTxHash", "") + step = Map.get(map_result, "step", 0) + proof = Map.get(map_result, "proof") + rollback = Map.get(map_result, "rollback", true) + keypairs = Map.get(map_result, "keyPairs", []) + signers = Map.get(map_result, "signers", []) + + %__MODULE__{} + |> process_metadata(meta_data) + |> process_keypairs(keypairs) + |> process_signers(signers) + |> set_network(network_id) + |> set_data(data) + |> set_nonce(nonce) + |> set_pact_tx_hash(pact_tx_hash) + |> set_proof(proof) + |> set_step(step) + |> set_rollback(rollback) + end + end + + def from_yaml(_path), do: {:error, [path: :invalid]} @impl true def set_network(%__MODULE__{} = cmd_request, network) do @@ -313,4 +340,48 @@ defmodule Kadena.Pact.ContCommand do defp build_signatures([%SignCommand{sig: sig} | rest], result), do: build_signatures(rest, result ++ [Signature.new(sig)]) + + defp process_metadata(%__MODULE__{} = cmd_request, %MetaData{} = metadata), + do: set_metadata(cmd_request, metadata) + + defp process_metadata(%__MODULE__{} = cmd_request, %{} = metadata) do + case MetaData.new(metadata) do + %MetaData{} = result -> %{cmd_request | meta_data: result} + {:error, reason} -> {:error, [meta_data: :invalid] ++ reason} + end + end + + defp process_metadata(%__MODULE__{}, _metadata), do: {:error, [metadata: :invalid]} + + defp process_keypairs(%__MODULE__{} = cmd_request, [%{} = keypair_data | rest]) do + case KeyPair.new(keypair_data) do + %KeyPair{} = result -> + cmd_request + |> add_keypair(result) + |> process_keypairs(rest) + + {:error, reason} -> + {:error, [keypair: :invalid] ++ reason} + end + end + + defp process_keypairs(%__MODULE__{} = cmd_request, []), do: cmd_request + defp process_keypairs(%__MODULE__{}, _keypair), do: {:error, [keypair: :invalid]} + defp process_keypairs({:error, reason}, _keypairs), do: {:error, reason} + + defp process_signers(%__MODULE__{} = cmd_request, [%{} = signers_data | rest]) do + case Signer.new(signers_data) do + %Signer{} = result -> + cmd_request + |> add_signer(result) + |> process_signers(rest) + + {:error, reason} -> + {:error, [signers: :invalid] ++ reason} + end + end + + defp process_signers(%__MODULE__{} = cmd_request, []), do: cmd_request + defp process_signers({:error, reason}, _signers), do: {:error, reason} + defp process_signers(%__MODULE__{}, _signers), do: {:error, [signers: :invalid]} end diff --git a/test/pact/command/cont_command_test.exs b/test/pact/command/cont_command_test.exs index 1b2ddd8..f450ca5 100644 --- a/test/pact/command/cont_command_test.exs +++ b/test/pact/command/cont_command_test.exs @@ -20,26 +20,98 @@ defmodule Kadena.Pact.ContCommandTest do describe "create ContCommand with YAMl file" do setup do - path = "" + path = "test/support/yaml_tests_files/for_test_cont.yaml" + path2 = "test/support/yaml_tests_files/for_test_commands_1.yaml" + path3 = "test/support/yaml_tests_files/for_test_commands_2.yaml" + path4 = "test/support/yaml_tests_files/for_test_commands_3.yaml" + path5 = "test/support/yaml_tests_files/for_test_commands_4.yaml" + path6 = "test/support/yaml_tests_files/for_test_commands_5.yaml" + path7 = "test/support/yaml_tests_files/for_test_commands_6.yaml" + path8 = "test/support/yaml_tests_files/for_test_commands_7.yaml" + bad_path = "test/support/yaml_tests_files/no_existent.yaml" %{ - path: path + path: path, + path2: path2, + path3: path3, + path4: path4, + path5: path5, + path6: path6, + path7: path7, + path8: path8, + bad_path: bad_path } end test "with a valid YAML file", %{path: path} do - %Kadena.Pact.ContCommand{ - data: nil, - keypairs: [], - meta_data: nil, - network_id: nil, - nonce: nil, - pact_tx_hash: nil, - proof: nil, - rollback: nil, - signers: [], - step: nil - } = ContCommand.from_yaml(path) + {:ok, + %Kadena.Types.Command{ + cmd: + "{\"meta\":{\"chainId\":\"0\",\"creationTime\":1667249173,\"gasLimit\":1000,\"gasPrice\":1.0e-6,\"sender\":\"k:554754f48b16df24b552f6832dda090642ed9658559fef9f3ee1bb4637ea7c94\",\"ttl\":28800},\"networkId\":\"testnet04\",\"nonce\":\"2023-06-13 17:45:18.211131 UTC\",\"payload\":{\"cont\":{\"data\":{\"accounts-admin-keyset\":[\"6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7\"]},\"pactId\":\"yxM0umrtdcvSUZDc_GSjwadH6ELYFCjOqI59Jzqapi4\",\"proof\":null,\"rollback\":true,\"step\":1}},\"signers\":[{\"addr\":null,\"clist\":[],\"pubKey\":\"6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7\",\"scheme\":\"ED25519\"},{\"addr\":\"cc30ae980161eba5da95a0d27dbdef29f185a23406942059c16cb120f6dc9dea\",\"clist\":[{\"args\":[\"8693e641ae2bbe9ea802c736f42027b03f86afe63cae315e7169c9c496c17332\"],\"name\":\"coin.GAS\"}],\"pubKey\":\"cc30ae980161eba5da95a0d27dbdef29f185a23406942059c16cb120f6dc9dea\",\"scheme\":\"ED25519\"}]}", + hash: %Kadena.Types.PactTransactionHash{ + hash: "fcR4cObX0BegUNvQu3CeMn8FhMlufY6CYHxQa39eJuY" + }, + sigs: [ + %Kadena.Types.Signature{ + sig: + "eef27b61796cd1668e73078af4de4cb028796291c99e54a12be5f98ba0121b4bb631b322fdd583458e5ae30d962039452676a3f3c83a1f3b4b1be2e74b188a0d" + } + ] + }} = + path + |> ContCommand.from_yaml() + |> ContCommand.build() + end + + test "without metadata, signers and keypairs", %{path2: path2} do + {:ok, + %Kadena.Types.Command{ + cmd: + "{\"meta\":{\"chainId\":\"0\",\"creationTime\":0,\"gasLimit\":0,\"gasPrice\":0,\"sender\":\"\",\"ttl\":0},\"networkId\":\"testnet04\",\"nonce\":\"step01\",\"payload\":{\"cont\":{\"data\":{\"accounts-admin-keyset\":[\"ba54b224d1924dd98403f5c751abdd10de6cd81b0121800bf7bdbdcfaec7388d\"]},\"pactId\":\"\",\"proof\":null,\"rollback\":true,\"step\":0}},\"signers\":[]}", + hash: %Kadena.Types.PactTransactionHash{ + hash: "njHWk39wmyfWDKFF5GJRRlfBcdj57oTUZYKiKY3Ru4I" + }, + sigs: [] + }} = + path2 + |> ContCommand.from_yaml() + |> ContCommand.build() + end + + test "with an invalid path" do + {:error, [path: :invalid]} = ContCommand.from_yaml(123) + end + + test "with a non existing YAML file", %{bad_path: bad_path} do + {:error, + %YamlElixir.FileNotFoundError{ + message: + "Failed to open file \"test/support/yaml_tests_files/no_existent.yaml\": no such file or directory" + }} = ContCommand.from_yaml(bad_path) + end + + test "with an invalid meta_data", %{path3: path3} do + {:error, [metadata: :invalid]} = ContCommand.from_yaml(path3) + end + + test "with an invalid meta_data args", %{path4: path4} do + {:error, [meta_data: :invalid, gas_price: :invalid]} = ContCommand.from_yaml(path4) + end + + test "with an invalid keypair", %{path5: path5} do + {:error, [keypair: :invalid]} = ContCommand.from_yaml(path5) + end + + test "with an invalid keypair args", %{path6: path6} do + {:error, [keypair: :invalid, pub_key: :invalid]} = ContCommand.from_yaml(path6) + end + + test "with an invalid signers", %{path7: path7} do + {:error, [signers: :invalid]} = ContCommand.from_yaml(path7) + end + + test "with an invalid signers args", %{path8: path8} do + {:error, [signers: :invalid, scheme: :invalid]} = ContCommand.from_yaml(path8) end end diff --git a/test/pact/command/exec_command_test.exs b/test/pact/command/exec_command_test.exs index a4ed736..47d591f 100644 --- a/test/pact/command/exec_command_test.exs +++ b/test/pact/command/exec_command_test.exs @@ -21,13 +21,13 @@ defmodule Kadena.Pact.ExecCommandTest do describe "create ExecCommand with YAMl file" do setup do path = "test/support/yaml_tests_files/for_test_exec.yaml" - path2 = "test/support/yaml_tests_files/for_test_exec_2.yaml" - path3 = "test/support/yaml_tests_files/for_test_exec_3.yaml" - path4 = "test/support/yaml_tests_files/for_test_exec_4.yaml" - path5 = "test/support/yaml_tests_files/for_test_exec_5.yaml" - path6 = "test/support/yaml_tests_files/for_test_exec_6.yaml" - path7 = "test/support/yaml_tests_files/for_test_exec_7.yaml" - path8 = "test/support/yaml_tests_files/for_test_exec_8.yaml" + path2 = "test/support/yaml_tests_files/for_test_commands_1.yaml" + path3 = "test/support/yaml_tests_files/for_test_commands_2.yaml" + path4 = "test/support/yaml_tests_files/for_test_commands_3.yaml" + path5 = "test/support/yaml_tests_files/for_test_commands_4.yaml" + path6 = "test/support/yaml_tests_files/for_test_commands_5.yaml" + path7 = "test/support/yaml_tests_files/for_test_commands_6.yaml" + path8 = "test/support/yaml_tests_files/for_test_commands_7.yaml" bad_path = "test/support/yaml_tests_files/no_existent.yaml" %{ diff --git a/test/support/yaml_tests_files/for_test_exec_2.yaml b/test/support/yaml_tests_files/for_test_commands_1.yaml similarity index 100% rename from test/support/yaml_tests_files/for_test_exec_2.yaml rename to test/support/yaml_tests_files/for_test_commands_1.yaml diff --git a/test/support/yaml_tests_files/for_test_exec_3.yaml b/test/support/yaml_tests_files/for_test_commands_2.yaml similarity index 100% rename from test/support/yaml_tests_files/for_test_exec_3.yaml rename to test/support/yaml_tests_files/for_test_commands_2.yaml diff --git a/test/support/yaml_tests_files/for_test_exec_4.yaml b/test/support/yaml_tests_files/for_test_commands_3.yaml similarity index 100% rename from test/support/yaml_tests_files/for_test_exec_4.yaml rename to test/support/yaml_tests_files/for_test_commands_3.yaml diff --git a/test/support/yaml_tests_files/for_test_exec_5.yaml b/test/support/yaml_tests_files/for_test_commands_4.yaml similarity index 100% rename from test/support/yaml_tests_files/for_test_exec_5.yaml rename to test/support/yaml_tests_files/for_test_commands_4.yaml diff --git a/test/support/yaml_tests_files/for_test_exec_6.yaml b/test/support/yaml_tests_files/for_test_commands_5.yaml similarity index 100% rename from test/support/yaml_tests_files/for_test_exec_6.yaml rename to test/support/yaml_tests_files/for_test_commands_5.yaml diff --git a/test/support/yaml_tests_files/for_test_exec_7.yaml b/test/support/yaml_tests_files/for_test_commands_6.yaml similarity index 100% rename from test/support/yaml_tests_files/for_test_exec_7.yaml rename to test/support/yaml_tests_files/for_test_commands_6.yaml diff --git a/test/support/yaml_tests_files/for_test_exec_8.yaml b/test/support/yaml_tests_files/for_test_commands_7.yaml similarity index 100% rename from test/support/yaml_tests_files/for_test_exec_8.yaml rename to test/support/yaml_tests_files/for_test_commands_7.yaml diff --git a/test/support/yaml_tests_files/for_test_cont.yaml b/test/support/yaml_tests_files/for_test_cont.yaml new file mode 100644 index 0000000..c30be07 --- /dev/null +++ b/test/support/yaml_tests_files/for_test_cont.yaml @@ -0,0 +1,26 @@ +networkId: :testnet04 +data: + accounts-admin-keyset: + - 6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7 +nonce: 2023-06-13 17:45:18.211131 UTC +publicMeta: + creationTime: 1667249173 + chainId: "0" + gasLimit: 1000 + gasPrice: 0.000001 + ttl: 28800 + sender: k:554754f48b16df24b552f6832dda090642ed9658559fef9f3ee1bb4637ea7c94 +keyPairs: + - public: 6ffea3fabe4e7fe6a89f88fc6d662c764ed1359fbc03a28afdac3935415347d7 + secret: 99f7e1e8f2f334ae8374aa28bebdb997271a0e0a5e92c80be9609684a3d6f0d4 +signers: + - publicKey: cc30ae980161eba5da95a0d27dbdef29f185a23406942059c16cb120f6dc9dea + scheme: :ed25519 + addr: cc30ae980161eba5da95a0d27dbdef29f185a23406942059c16cb120f6dc9dea + capsList: + - name: coin.GAS + args: + - 8693e641ae2bbe9ea802c736f42027b03f86afe63cae315e7169c9c496c17332 +pactTxHash: yxM0umrtdcvSUZDc_GSjwadH6ELYFCjOqI59Jzqapi4 +step: 1 +rollback: true From efd283da64d52b2ccfbac69104978341c9bdd166 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 10:26:55 -0500 Subject: [PATCH 2/3] Update all dependencies (#274) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/cd.yml | 6 +++--- .github/workflows/ci.yml | 8 ++++---- .github/workflows/scorecards.yml | 8 ++++---- mix.exs | 2 +- mix.lock | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ebf170e..e7605fd 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -29,12 +29,12 @@ jobs: hex.pm:443 repo.hex.pm:443 - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0 - - uses: erlef/setup-elixir@b980a5ac9b7316a23ebc16de2bb69b7c3ad731b5 # v1.15.0 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: erlef/setup-elixir@e3f6ffe2878180f57318bf13febd3933ee81f664 # v1.15.2 with: otp-version: ${{ matrix.otp }} elixir-version: ${{ matrix.elixir }} - - uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2 + - uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4 with: path: deps key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95501e5..0132bc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,13 +33,13 @@ jobs: github.com:443 repo.hex.pm:443 - - uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6 # v2.6.0 - - uses: erlef/setup-beam@b980a5ac9b7316a23ebc16de2bb69b7c3ad731b5 # v1.15.0 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: erlef/setup-beam@e3f6ffe2878180f57318bf13febd3933ee81f664 # v1.15.2 id: beam with: otp-version: "24" elixir-version: "1.13.4" - - uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2.1.7 + - uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4 with: path: deps key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} @@ -50,7 +50,7 @@ jobs: - name: Check Formatting run: mix format --check-formatted - name: Restore PLT cache - uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2.1.7 + uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4 id: plt_cache with: key: | diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 09d67dc..70d48be 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -37,12 +37,12 @@ jobs: sigstore-tuf-root.storage.googleapis.com:443 - name: "Checkout code" - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # v2.0.6 + uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2 with: results_file: results.sarif results_format: sarif @@ -61,7 +61,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 with: name: SARIF file path: results.sarif @@ -69,6 +69,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@c7f292ea4f542c473194b33813ccd4c207a6c725 # v2.1.21 + uses: github/codeql-action/upload-sarif@3ebbd71c74ef574dbc558c82f70e52732c8b44fe # v2.2.1 with: sarif_file: results.sarif diff --git a/mix.exs b/mix.exs index 4aa2318..0d5e9d6 100644 --- a/mix.exs +++ b/mix.exs @@ -46,7 +46,7 @@ defmodule Kadena.MixProject do {:yaml_elixir, "~> 2.9"}, {:credo, "~> 1.6", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false}, - {:ex_doc, "~> 0.24", only: :dev, runtime: false}, + {:ex_doc, "~> 0.29", only: :dev, runtime: false}, {:excoveralls, "~> 0.15", only: :test} ] end diff --git a/mix.lock b/mix.lock index 5a75d13..2f566c9 100644 --- a/mix.lock +++ b/mix.lock @@ -5,9 +5,9 @@ "credo": {:hex, :credo, "1.6.7", "323f5734350fd23a456f2688b9430e7d517afb313fbd38671b8a4449798a7854", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "41e110bfb007f7eda7f897c10bf019ceab9a0b269ce79f015d54b0dcf4fc7dd3"}, "decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"}, "dialyxir": {:hex, :dialyxir, "1.2.0", "58344b3e87c2e7095304c81a9ae65cb68b613e28340690dfe1a5597fd08dec37", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "61072136427a851674cab81762be4dbeae7679f85b1272b6d25c3a839aff8463"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.29", "149d50dcb3a93d9f3d6f3ecf18c918fb5a2d3c001b5d3305c926cddfbd33355b", [:mix], [], "hexpm", "4902af1b3eb139016aed210888748db8070b8125c2342ce3dcae4f38dcc63503"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.30", "0b938aa5b9bafd455056440cdaa2a79197ca5e693830b4a982beada840513c5f", [:mix], [], "hexpm", "3b5385c2d36b0473d0b206927b841343d25adb14f95f0110062506b300cd5a1b"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, - "ex_doc": {:hex, :ex_doc, "0.29.0", "4a1cb903ce746aceef9c1f9ae8a6c12b742a5461e6959b9d3b24d813ffbea146", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "f096adb8bbca677d35d278223361c7792d496b3fc0d0224c9d4bc2f651af5db1"}, + "ex_doc": {:hex, :ex_doc, "0.29.1", "b1c652fa5f92ee9cf15c75271168027f92039b3877094290a75abcaac82a9f77", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "b7745fa6374a36daf484e2a2012274950e084815b936b1319aeebcf7809574f6"}, "excoveralls": {:hex, :excoveralls, "0.15.0", "ac941bf85f9f201a9626cc42b2232b251ad8738da993cf406a4290cacf562ea4", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "9631912006b27eca30a2f3c93562bc7ae15980afb014ceb8147dc5cdd8f376f1"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, From caefdb33c9afaf21b123b1333171609d0223acbb Mon Sep 17 00:00:00 2001 From: Edwin Steven Guayacan <80716239+EdwinGuayacan@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:03:12 -0500 Subject: [PATCH 3/3] Prepare release v0.19.0 (#275) --- CHANGELOG.md | 5 +++++ README.md | 9 ++------- mix.exs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89bdb8b..bd0bcfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.19.0 (01.02.2023) + +- Added [YAML Continuation command](https://github.com/kommitters/kadena.ex/issues/209) +- Update all dependencies + ## 0.18.0 (31.01.2023) - Added [YAML reader](https://github.com/kommitters/kadena.ex/issues/253) diff --git a/README.md b/README.md index 4471cf0..1128409 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Add `kadena` to your list of dependencies in `mix.exs`: ```elixir def deps do [ - {:kadena, "~> 0.18.0"} + {:kadena, "~> 0.19.0"} ] end ``` @@ -1944,14 +1944,8 @@ Chainweb.Peer.new() ## Roadmap -The latest updated branch to target a PR is `v0.19` - You can see a big picture of the roadmap here: [**ROADMAP**][roadmap] -### What we're working on now 🎉 - -- [Accept request commands as YAML files](https://github.com/kommitters/kadena.ex/milestone/2) - ### Done - What we've already developed! 🚀
@@ -1978,6 +1972,7 @@ You can see a big picture of the roadmap here: [**ROADMAP**][roadmap] - [Pact Commands Builder](https://github.com/kommitters/kadena.ex/issues/131) - [Chainweb](https://github.com/kommitters/kadena.ex/issues/57) - [Chainweb P2P API](https://github.com/kommitters/kadena.ex/milestone/1) +- [Accept request commands as YAML files](https://github.com/kommitters/kadena.ex/milestone/2)
diff --git a/mix.exs b/mix.exs index 0d5e9d6..751d2a0 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Kadena.MixProject do use Mix.Project - @version "0.18.0" + @version "0.19.0" @github_url "https://github.com/kommitters/kadena.ex" def project do