diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9627ca4f..ce4f3fbc 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,7 +20,7 @@ jobs: HEX_API_KEY: ${{ secrets.HEX_API_KEY }} steps: - name: Harden Runner - uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0 with: disable-sudo: true egress-policy: block @@ -30,8 +30,8 @@ jobs: repo.hex.pm:443 builds.hex.pm:443 - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - uses: erlef/setup-elixir@c2e02f777c158310fc6d3d4e11b36a52d2d52db8 # v1.15.4 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: erlef/setup-elixir@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0 with: otp-version: ${{ matrix.otp }} elixir-version: ${{ matrix.elixir }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ace7ad3d..ef57c666 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: MIX_ENV: test steps: - name: Harden Runner - uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0 with: disable-sudo: true egress-policy: block @@ -33,10 +33,10 @@ jobs: builds.hex.pm:443 - name: Checkout Github repo - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Sets up an Erlang/OTP environment - uses: erlef/setup-elixir@c2e02f777c158310fc6d3d4e11b36a52d2d52db8 # v1.15.4 + uses: erlef/setup-elixir@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0 with: otp-version: ${{ matrix.otp }} elixir-version: ${{ matrix.elixir }} @@ -91,7 +91,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Harden Runner - uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0 with: disable-sudo: true egress-policy: block diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 459dcd29..ef9aedbe 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0 with: disable-sudo: true egress-policy: block @@ -31,18 +31,18 @@ jobs: api.osv.dev:443 api.securityscorecards.dev:443 bestpractices.coreinfrastructure.org:443 - fulcio.sigstore.dev:443 + *.sigstore.dev:443 github.com:443 - rekor.sigstore.dev:443 sigstore-tuf-root.storage.googleapis.com:443 + oss-fuzz-build-logs.storage.googleapis.com:443 - name: "Checkout code" - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3 + uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0 with: results_file: results.sarif results_format: 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@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6 + uses: github/codeql-action/upload-sarif@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2 with: sarif_file: results.sarif diff --git a/CHANGELOG.md b/CHANGELOG.md index 0269d3dd..8ee21912 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.13.1 (02.08.2023) + +* [Add missing operation results and rename OperationInnerResult to OperationResultTr](https://github.com/kommitters/stellar_base/pull/284). +* Update all dependencies. + ## 0.13.0 (27.07.2023) * [Allow to encode and decode TransactionMeta](https://github.com/kommitters/stellar_base/issues/279). diff --git a/README.md b/README.md index 1865b0d5..4e31c970 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ You should only use **`stellar_base`** if you are planning to build on top of it ```elixir def deps do [ - {:stellar_base, "~> 0.13.0"} + {:stellar_base, "~> 0.13.1"} ] end ``` diff --git a/lib/xdr/transactions/operation_result.ex b/lib/xdr/transactions/operation_result.ex index 6d83bead..91770250 100644 --- a/lib/xdr/transactions/operation_result.ex +++ b/lib/xdr/transactions/operation_result.ex @@ -2,13 +2,13 @@ defmodule StellarBase.XDR.OperationResult do @moduledoc """ Representation of Stellar `OperationResult` type. """ - alias StellarBase.XDR.{OperationInnerResult, OperationResultCode, Void} + alias StellarBase.XDR.{OperationResultTr, OperationResultCode, Void} @behaviour XDR.Declaration - @arms [opINNER: OperationInnerResult, default: Void] + @arms [opINNER: OperationResultTr, default: Void] - @type result :: OperationInnerResult.t() | Void.t() | any() + @type result :: OperationResultTr.t() | Void.t() | any() @type t :: %__MODULE__{result: result(), code: OperationResultCode.t()} diff --git a/lib/xdr/transactions/operation_inner_result.ex b/lib/xdr/transactions/operation_result_tr.ex similarity index 52% rename from lib/xdr/transactions/operation_inner_result.ex rename to lib/xdr/transactions/operation_result_tr.ex index 889c367c..518884fe 100644 --- a/lib/xdr/transactions/operation_inner_result.ex +++ b/lib/xdr/transactions/operation_result_tr.ex @@ -1,13 +1,22 @@ -defmodule StellarBase.XDR.OperationInnerResult do +defmodule StellarBase.XDR.OperationResultTr do @moduledoc """ - Representation of Stellar `OperationInnerResult` type. + Automatically generated by xdrgen + DO NOT EDIT or your changes may be overwritten + + Target implementation: elixir_xdr at https://hex.pm/packages/elixir_xdr + + Representation of Stellar `OperationResultTr` type. """ - alias StellarBase.XDR.{InvokeHostFunctionResult, OperationType} + + @behaviour XDR.Declaration + + alias StellarBase.XDR.OperationType alias StellarBase.XDR.Operations.{ AccountMergeResult, AllowTrustResult, BeginSponsoringFutureReservesResult, + BumpFootprintExpirationResult, BumpSequenceResult, ChangeTrustResult, ClaimClaimableBalanceResult, @@ -17,6 +26,7 @@ defmodule StellarBase.XDR.OperationInnerResult do CreateClaimableBalanceResult, EndSponsoringFutureReservesResult, InflationResult, + InvokeHostFunctionResult, LiquidityPoolDepositResult, LiquidityPoolWithdrawResult, ManageDataResult, @@ -25,13 +35,12 @@ defmodule StellarBase.XDR.OperationInnerResult do PaymentResult, PathPaymentStrictReceiveResult, PathPaymentStrictSendResult, + RestoreFootprintResult, RevokeSponsorshipResult, SetOptionsResult, SetTrustLineFlagsResult } - @behaviour XDR.Declaration - @arms [ CREATE_ACCOUNT: CreateAccountResult, PAYMENT: PaymentResult, @@ -57,27 +66,57 @@ defmodule StellarBase.XDR.OperationInnerResult do SET_TRUST_LINE_FLAGS: SetTrustLineFlagsResult, LIQUIDITY_POOL_DEPOSIT: LiquidityPoolDepositResult, LIQUIDITY_POOL_WITHDRAW: LiquidityPoolWithdrawResult, - INVOKE_HOST_FUNCTION: InvokeHostFunctionResult + INVOKE_HOST_FUNCTION: InvokeHostFunctionResult, + BUMP_FOOTPRINT_EXPIRATION: BumpFootprintExpirationResult, + RESTORE_FOOTPRINT: RestoreFootprintResult ] - @type t :: %__MODULE__{result: any(), type: OperationType.t()} + @type value :: + CreateAccountResult.t() + | PaymentResult.t() + | PathPaymentStrictReceiveResult.t() + | ManageSellOfferResult.t() + | SetOptionsResult.t() + | ChangeTrustResult.t() + | AllowTrustResult.t() + | AccountMergeResult.t() + | InflationResult.t() + | ManageDataResult.t() + | BumpSequenceResult.t() + | ManageBuyOfferResult.t() + | PathPaymentStrictSendResult.t() + | CreateClaimableBalanceResult.t() + | ClaimClaimableBalanceResult.t() + | BeginSponsoringFutureReservesResult.t() + | EndSponsoringFutureReservesResult.t() + | RevokeSponsorshipResult.t() + | ClawbackResult.t() + | ClawbackClaimableBalanceResult.t() + | SetTrustLineFlagsResult.t() + | LiquidityPoolDepositResult.t() + | LiquidityPoolWithdrawResult.t() + | InvokeHostFunctionResult.t() + | BumpFootprintExpirationResult.t() + | RestoreFootprintResult.t() + + @type t :: %__MODULE__{value: value(), type: OperationType.t()} - defstruct [:result, :type] + defstruct [:value, :type] - @spec new(result :: any(), type :: OperationType.t()) :: t() - def new(result, %OperationType{} = type), do: %__MODULE__{result: result, type: type} + @spec new(value :: value(), type :: OperationType.t()) :: t() + def new(value, %OperationType{} = type), do: %__MODULE__{value: value, type: type} @impl true - def encode_xdr(%__MODULE__{result: result, type: type}) do + def encode_xdr(%__MODULE__{value: value, type: type}) do type - |> XDR.Union.new(@arms, result) + |> XDR.Union.new(@arms, value) |> XDR.Union.encode_xdr() end @impl true - def encode_xdr!(%__MODULE__{result: result, type: type}) do + def encode_xdr!(%__MODULE__{value: value, type: type}) do type - |> XDR.Union.new(@arms, result) + |> XDR.Union.new(@arms, value) |> XDR.Union.encode_xdr!() end @@ -86,7 +125,7 @@ defmodule StellarBase.XDR.OperationInnerResult do def decode_xdr(bytes, spec) do case XDR.Union.decode_xdr(bytes, spec) do - {:ok, {{type, key}, rest}} -> {:ok, {new(key, type), rest}} + {:ok, {{type, value}, rest}} -> {:ok, {new(value, type), rest}} error -> error end end @@ -95,8 +134,8 @@ defmodule StellarBase.XDR.OperationInnerResult do def decode_xdr!(bytes, spec \\ union_spec()) def decode_xdr!(bytes, spec) do - {{type, key}, rest} = XDR.Union.decode_xdr!(bytes, spec) - {new(key, type), rest} + {{type, value}, rest} = XDR.Union.decode_xdr!(bytes, spec) + {new(value, type), rest} end @spec union_spec() :: XDR.Union.t() diff --git a/lib/xdr/transactions/operations/bump_footprint_expiration_result.ex b/lib/xdr/transactions/operations/bump_footprint_expiration_result.ex index fac25344..368104b6 100644 --- a/lib/xdr/transactions/operations/bump_footprint_expiration_result.ex +++ b/lib/xdr/transactions/operations/bump_footprint_expiration_result.ex @@ -1,4 +1,4 @@ -defmodule StellarBase.XDR.BumpFootprintExpirationResult do +defmodule StellarBase.XDR.Operations.BumpFootprintExpirationResult do @moduledoc """ Automatically generated by xdrgen DO NOT EDIT or your changes may be overwritten @@ -10,10 +10,8 @@ defmodule StellarBase.XDR.BumpFootprintExpirationResult do @behaviour XDR.Declaration - alias StellarBase.XDR.{ - BumpFootprintExpirationResultCode, - Void - } + alias StellarBase.XDR.Void + alias StellarBase.XDR.Operations.BumpFootprintExpirationResultCode @arms [ BUMP_FOOTPRINT_EXPIRATION_SUCCESS: Void, diff --git a/lib/xdr/transactions/operations/bump_footprint_expiration_result_code.ex b/lib/xdr/transactions/operations/bump_footprint_expiration_result_code.ex index e29a8d40..8c87502d 100644 --- a/lib/xdr/transactions/operations/bump_footprint_expiration_result_code.ex +++ b/lib/xdr/transactions/operations/bump_footprint_expiration_result_code.ex @@ -1,4 +1,4 @@ -defmodule StellarBase.XDR.BumpFootprintExpirationResultCode do +defmodule StellarBase.XDR.Operations.BumpFootprintExpirationResultCode do @moduledoc """ Automatically generated by xdrgen DO NOT EDIT or your changes may be overwritten diff --git a/lib/xdr/transactions/invoke_host_function_result.ex b/lib/xdr/transactions/operations/invoke_host_function_result.ex similarity index 91% rename from lib/xdr/transactions/invoke_host_function_result.ex rename to lib/xdr/transactions/operations/invoke_host_function_result.ex index 181cb8b9..67b7b93c 100644 --- a/lib/xdr/transactions/invoke_host_function_result.ex +++ b/lib/xdr/transactions/operations/invoke_host_function_result.ex @@ -1,4 +1,4 @@ -defmodule StellarBase.XDR.InvokeHostFunctionResult do +defmodule StellarBase.XDR.Operations.InvokeHostFunctionResult do @moduledoc """ Automatically generated by xdrgen DO NOT EDIT or your changes may be overwritten @@ -10,11 +10,8 @@ defmodule StellarBase.XDR.InvokeHostFunctionResult do @behaviour XDR.Declaration - alias StellarBase.XDR.{ - InvokeHostFunctionResultCode, - Hash, - Void - } + alias StellarBase.XDR.Operations.InvokeHostFunctionResultCode + alias StellarBase.XDR.{Hash, Void} @arms [ INVOKE_HOST_FUNCTION_SUCCESS: Hash, diff --git a/lib/xdr/transactions/invoke_host_function_result_code.ex b/lib/xdr/transactions/operations/invoke_host_function_result_code.ex similarity index 95% rename from lib/xdr/transactions/invoke_host_function_result_code.ex rename to lib/xdr/transactions/operations/invoke_host_function_result_code.ex index bea5aeeb..4cfaef81 100644 --- a/lib/xdr/transactions/invoke_host_function_result_code.ex +++ b/lib/xdr/transactions/operations/invoke_host_function_result_code.ex @@ -1,4 +1,4 @@ -defmodule StellarBase.XDR.InvokeHostFunctionResultCode do +defmodule StellarBase.XDR.Operations.InvokeHostFunctionResultCode do @moduledoc """ Automatically generated by xdrgen DO NOT EDIT or your changes may be overwritten diff --git a/lib/xdr/transactions/operations/restore_footprint_result.ex b/lib/xdr/transactions/operations/restore_footprint_result.ex index d22ec51f..6cf4d7e8 100644 --- a/lib/xdr/transactions/operations/restore_footprint_result.ex +++ b/lib/xdr/transactions/operations/restore_footprint_result.ex @@ -1,4 +1,4 @@ -defmodule StellarBase.XDR.RestoreFootprintResult do +defmodule StellarBase.XDR.Operations.RestoreFootprintResult do @moduledoc """ Automatically generated by xdrgen DO NOT EDIT or your changes may be overwritten @@ -10,10 +10,8 @@ defmodule StellarBase.XDR.RestoreFootprintResult do @behaviour XDR.Declaration - alias StellarBase.XDR.{ - RestoreFootprintResultCode, - Void - } + alias StellarBase.XDR.Void + alias StellarBase.XDR.Operations.RestoreFootprintResultCode @arms [ RESTORE_FOOTPRINT_SUCCESS: Void, diff --git a/lib/xdr/transactions/operations/restore_footprint_result_code.ex b/lib/xdr/transactions/operations/restore_footprint_result_code.ex index 0bf39fd9..37194ae3 100644 --- a/lib/xdr/transactions/operations/restore_footprint_result_code.ex +++ b/lib/xdr/transactions/operations/restore_footprint_result_code.ex @@ -1,4 +1,4 @@ -defmodule StellarBase.XDR.RestoreFootprintResultCode do +defmodule StellarBase.XDR.Operations.RestoreFootprintResultCode do @moduledoc """ Automatically generated by xdrgen DO NOT EDIT or your changes may be overwritten diff --git a/mix.exs b/mix.exs index cf292c73..9e8feb1c 100644 --- a/mix.exs +++ b/mix.exs @@ -2,7 +2,7 @@ defmodule StellarBase.MixProject do use Mix.Project @github_url "https://github.com/kommitters/stellar_base" - @version "0.13.0" + @version "0.13.1" def project do [ @@ -41,7 +41,7 @@ defmodule StellarBase.MixProject do {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false}, {:excoveralls, "~> 0.16", only: :test, runtime: false}, {:credo, "~> 1.5", only: [:dev, :test], runtime: false}, - {:ex_doc, "~> 0.29", only: :dev, runtime: false} + {:ex_doc, "~> 0.30", only: :dev, runtime: false} ] end diff --git a/mix.lock b/mix.lock index dae01ed1..ce85a9d2 100644 --- a/mix.lock +++ b/mix.lock @@ -4,23 +4,23 @@ "crc": {:hex, :crc, "0.10.2", "93ee6788904735d4d93f59a1e80860e4c9aa44e8d2ff7c69857eb62757454137", [:mix, :rebar3], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "6b931cfb5e7d20c3c4113adab460f29ee5a50a36b397edd81c9bede2bbdb505c"}, "credo": {:hex, :credo, "1.5.6", "e04cc0fdc236fefbb578e0c04bd01a471081616e741d386909e527ac146016c6", [:mix], [{:bunt, "~> 0.2.0", [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", "4b52a3e558bd64e30de62a648518a5ea2b6e3e5d2b164ef5296244753fc7eb17"}, "dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.29", "149d50dcb3a93d9f3d6f3ecf18c918fb5a2d3c001b5d3305c926cddfbd33355b", [:mix], [], "hexpm", "4902af1b3eb139016aed210888748db8070b8125c2342ce3dcae4f38dcc63503"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.33", "3c3fd9673bb5dcc9edc28dd90f50c87ce506d1f71b70e3de69aa8154bc695d44", [:mix], [], "hexpm", "2d526833729b59b9fdb85785078697c72ac5e5066350663e5be6a1182da61b8f"}, "ed25519": {:hex, :ed25519, "1.3.2", "e3a2d4badf57f0799279cf09925bd761ec38df6df3696e266585626280b5c0ad", [:mix], [], "hexpm", "2290e46e0e23717adbe20632c6dd29aa71a46ca6e153ef7ba41fe1204f66f859"}, "elixir_make": {:hex, :elixir_make, "0.6.2", "7dffacd77dec4c37b39af867cedaabb0b59f6a871f89722c25b28fcd4bd70530", [:mix], [], "hexpm", "03e49eadda22526a7e5279d53321d1cced6552f344ba4e03e619063de75348d9"}, "elixir_xdr": {:hex, :elixir_xdr, "0.3.9", "d9c461a1c04bc31ccb36114b606c750d0ba0bed0a1d7ffc35d206e58faaba0ba", [:mix], [], "hexpm", "30afac1a82fafe11708e14d92532a83a881d1004ec92bf00e3d8a827c6685e3d"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, - "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"}, + "ex_doc": {:hex, :ex_doc, "0.30.3", "bfca4d340e3b95f2eb26e72e4890da83e2b3a5c5b0e52607333bf5017284b063", [:mix], [{:earmark_parser, "~> 1.4.31", [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", "fbc8702046c1d25edf79de376297e608ac78cdc3a29f075484773ad1718918b6"}, "excoveralls": {:hex, :excoveralls, "0.16.1", "0bd42ed05c7d2f4d180331a20113ec537be509da31fed5c8f7047ce59ee5a7c5", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "dae763468e2008cf7075a64cb1249c97cb4bc71e236c5c2b5e5cdf1cfa2bf138"}, "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"}, "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, "jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"}, "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"}, - "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"}, + "makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, - "nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"}, "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}, diff --git a/test/xdr/transactions/inner_transaction_result_pair_test.exs b/test/xdr/transactions/inner_transaction_result_pair_test.exs index de3c2857..51841b9a 100644 --- a/test/xdr/transactions/inner_transaction_result_pair_test.exs +++ b/test/xdr/transactions/inner_transaction_result_pair_test.exs @@ -7,7 +7,7 @@ defmodule StellarBase.XDR.InnerTransactionResultPairTest do InnerTransactionResult, InnerTransactionResultPair, Int64, - OperationInnerResult, + OperationResultTr, OperationResult, OperationResultCode, OperationResultList, @@ -24,7 +24,7 @@ defmodule StellarBase.XDR.InnerTransactionResultPairTest do result = Void.new() |> CreateAccountResult.new(CreateAccountResultCode.new(:CREATE_ACCOUNT_SUCCESS)) - |> OperationInnerResult.new(OperationType.new(:CREATE_ACCOUNT)) + |> OperationResultTr.new(OperationType.new(:CREATE_ACCOUNT)) |> OperationResult.new(OperationResultCode.new(:opINNER)) |> (&OperationResultList.new([&1])).() |> InnerTransactionResultResult.new(TransactionResultCode.new(:txSUCCESS)) diff --git a/test/xdr/transactions/inner_transaction_result_result_test.exs b/test/xdr/transactions/inner_transaction_result_result_test.exs index 48d6eba9..3e2c8f03 100644 --- a/test/xdr/transactions/inner_transaction_result_result_test.exs +++ b/test/xdr/transactions/inner_transaction_result_result_test.exs @@ -2,7 +2,7 @@ defmodule StellarBase.XDR.InnerTransactionResultResultTest do use ExUnit.Case alias StellarBase.XDR.{ - OperationInnerResult, + OperationResultTr, OperationResult, OperationResultCode, OperationResultList, @@ -21,13 +21,13 @@ defmodule StellarBase.XDR.InnerTransactionResultResultTest do op_result1 = Void.new() |> CreateAccountResult.new(CreateAccountResultCode.new(:CREATE_ACCOUNT_SUCCESS)) - |> OperationInnerResult.new(OperationType.new(:CREATE_ACCOUNT)) + |> OperationResultTr.new(OperationType.new(:CREATE_ACCOUNT)) |> OperationResult.new(op_code) op_result2 = Void.new() |> CreateAccountResult.new(CreateAccountResultCode.new(:CREATE_ACCOUNT_SUCCESS)) - |> OperationInnerResult.new(OperationType.new(:CREATE_ACCOUNT)) + |> OperationResultTr.new(OperationType.new(:CREATE_ACCOUNT)) |> OperationResult.new(op_code) tx_code = TransactionResultCode.new(:txSUCCESS) diff --git a/test/xdr/transactions/inner_transaction_result_test.exs b/test/xdr/transactions/inner_transaction_result_test.exs index 1c44a386..ceb60d8f 100644 --- a/test/xdr/transactions/inner_transaction_result_test.exs +++ b/test/xdr/transactions/inner_transaction_result_test.exs @@ -5,7 +5,7 @@ defmodule StellarBase.XDR.InnerTransactionResultTest do Ext, InnerTransactionResult, Int64, - OperationInnerResult, + OperationResultTr, OperationResult, OperationResultCode, OperationResultList, @@ -24,7 +24,7 @@ defmodule StellarBase.XDR.InnerTransactionResultTest do result = Void.new() |> CreateAccountResult.new(CreateAccountResultCode.new(:CREATE_ACCOUNT_SUCCESS)) - |> OperationInnerResult.new(OperationType.new(:CREATE_ACCOUNT)) + |> OperationResultTr.new(OperationType.new(:CREATE_ACCOUNT)) |> OperationResult.new(OperationResultCode.new(:opINNER)) |> (&OperationResultList.new([&1])).() |> InnerTransactionResultResult.new(TransactionResultCode.new(:txSUCCESS)) diff --git a/test/xdr/transactions/operation_inner_result_test.exs b/test/xdr/transactions/operation_inner_result_test.exs deleted file mode 100644 index 6e43e0d6..00000000 --- a/test/xdr/transactions/operation_inner_result_test.exs +++ /dev/null @@ -1,166 +0,0 @@ -defmodule StellarBase.XDR.Operations.OperationInnerResult do - use ExUnit.Case - - alias StellarBase.XDR.{OperationInnerResult, OperationType, Void} - - alias StellarBase.XDR.Operations.{ - ClawbackResult, - ClawbackResultCode, - CreateAccountResult, - CreateAccountResultCode, - PaymentResult, - PaymentResultCode, - SetOptionsResult, - SetOptionsResultCode - } - - describe "CreateAccount OperationInnerResult" do - setup do - op_type = OperationType.new(:CREATE_ACCOUNT) - - result = - CreateAccountResult.new(Void.new(), CreateAccountResultCode.new(:CREATE_ACCOUNT_SUCCESS)) - - %{ - op_type: op_type, - result: result, - op_inner_result: OperationInnerResult.new(result, op_type), - binary: <<0, 0, 0, 0, 0, 0, 0, 0>> - } - end - - test "new/1", %{result: result, op_type: op_type} do - %OperationInnerResult{result: ^result, type: ^op_type} = - OperationInnerResult.new(result, op_type) - end - - test "encode_xdr/1", %{op_inner_result: op_inner_result, binary: binary} do - {:ok, ^binary} = OperationInnerResult.encode_xdr(op_inner_result) - end - - test "encode_xdr!/1", %{op_inner_result: op_inner_result, binary: binary} do - ^binary = OperationInnerResult.encode_xdr!(op_inner_result) - end - - test "decode_xdr/2", %{op_inner_result: op_inner_result, binary: binary} do - {:ok, {^op_inner_result, ""}} = OperationInnerResult.decode_xdr(binary) - end - - test "decode_xdr!/2", %{op_inner_result: op_inner_result, binary: binary} do - {^op_inner_result, ^binary} = OperationInnerResult.decode_xdr!(binary <> binary) - end - - test "decode_xdr/2 with an invalid binary" do - {:error, :not_binary} = OperationInnerResult.decode_xdr(123) - end - end - - describe "Payment OperationInnerResult" do - setup do - op_type = OperationType.new(:PAYMENT) - result = PaymentResult.new(Void.new(), PaymentResultCode.new(:PAYMENT_SUCCESS)) - - %{ - op_type: op_type, - result: result, - op_inner_result: OperationInnerResult.new(result, op_type), - binary: <<0, 0, 0, 1, 0, 0, 0, 0>> - } - end - - test "new/1", %{result: result, op_type: op_type} do - %OperationInnerResult{result: ^result, type: ^op_type} = - OperationInnerResult.new(result, op_type) - end - - test "encode_xdr/1", %{op_inner_result: op_inner_result, binary: binary} do - {:ok, ^binary} = OperationInnerResult.encode_xdr(op_inner_result) - end - - test "encode_xdr!/1", %{op_inner_result: op_inner_result, binary: binary} do - ^binary = OperationInnerResult.encode_xdr!(op_inner_result) - end - - test "decode_xdr/2", %{op_inner_result: op_inner_result, binary: binary} do - {:ok, {^op_inner_result, ""}} = OperationInnerResult.decode_xdr(binary) - end - - test "decode_xdr!/2", %{op_inner_result: op_inner_result, binary: binary} do - {^op_inner_result, ^binary} = OperationInnerResult.decode_xdr!(binary <> binary) - end - end - - describe "SetOptions OperationInnerResult" do - setup do - op_type = OperationType.new(:SET_OPTIONS) - result = SetOptionsResult.new(Void.new(), SetOptionsResultCode.new(:SET_OPTIONS_SUCCESS)) - - %{ - op_type: op_type, - result: result, - op_inner_result: OperationInnerResult.new(result, op_type), - binary: <<0, 0, 0, 5, 0, 0, 0, 0>> - } - end - - test "new/1", %{result: result, op_type: op_type} do - %OperationInnerResult{result: ^result, type: ^op_type} = - OperationInnerResult.new(result, op_type) - end - - test "encode_xdr/1", %{op_inner_result: op_inner_result, binary: binary} do - {:ok, ^binary} = OperationInnerResult.encode_xdr(op_inner_result) - end - - test "encode_xdr!/1", %{op_inner_result: op_inner_result, binary: binary} do - ^binary = OperationInnerResult.encode_xdr!(op_inner_result) - end - - test "decode_xdr/2", %{op_inner_result: op_inner_result, binary: binary} do - {:ok, {^op_inner_result, ""}} = OperationInnerResult.decode_xdr(binary) - end - - test "decode_xdr!/2", %{op_inner_result: op_inner_result, binary: binary} do - {^op_inner_result, ^binary} = OperationInnerResult.decode_xdr!(binary <> binary) - end - end - - describe "Clawback OperationInnerResult" do - setup do - op_type = OperationType.new(:CLAWBACK) - result = ClawbackResult.new(Void.new(), ClawbackResultCode.new(:CLAWBACK_SUCCESS)) - - %{ - op_type: op_type, - result: result, - op_inner_result: OperationInnerResult.new(result, op_type), - binary: <<0, 0, 0, 19, 0, 0, 0, 0>> - } - end - - test "new/1", %{result: result, op_type: op_type} do - %OperationInnerResult{result: ^result, type: ^op_type} = - OperationInnerResult.new(result, op_type) - end - - test "encode_xdr/1", %{op_inner_result: op_inner_result, binary: binary} do - {:ok, ^binary} = OperationInnerResult.encode_xdr(op_inner_result) - end - - test "encode_xdr!/1", %{op_inner_result: op_inner_result, binary: binary} do - ^binary = OperationInnerResult.encode_xdr!(op_inner_result) - end - - test "decode_xdr/2", %{op_inner_result: op_inner_result, binary: binary} do - {:ok, {^op_inner_result, ""}} = OperationInnerResult.decode_xdr(binary) - end - - test "decode_xdr!/2", %{op_inner_result: op_inner_result, binary: binary} do - {^op_inner_result, ^binary} = OperationInnerResult.decode_xdr!(binary <> binary) - end - - test "decode_xdr/2 with an invalid binary" do - {:error, :not_binary} = OperationInnerResult.decode_xdr(123) - end - end -end diff --git a/test/xdr/transactions/operation_result_list_test.exs b/test/xdr/transactions/operation_result_list_test.exs index 46ec5bc8..88dc9cf6 100644 --- a/test/xdr/transactions/operation_result_list_test.exs +++ b/test/xdr/transactions/operation_result_list_test.exs @@ -2,7 +2,7 @@ defmodule StellarBase.XDR.OperationResultListTest do use ExUnit.Case alias StellarBase.XDR.{ - OperationInnerResult, + OperationResultTr, OperationResult, OperationResultList, OperationResultCode, @@ -19,13 +19,13 @@ defmodule StellarBase.XDR.OperationResultListTest do op_result1 = Void.new() |> CreateAccountResult.new(CreateAccountResultCode.new(:CREATE_ACCOUNT_SUCCESS)) - |> OperationInnerResult.new(OperationType.new(:CREATE_ACCOUNT)) + |> OperationResultTr.new(OperationType.new(:CREATE_ACCOUNT)) |> OperationResult.new(code) op_result2 = Void.new() |> CreateAccountResult.new(CreateAccountResultCode.new(:CREATE_ACCOUNT_SUCCESS)) - |> OperationInnerResult.new(OperationType.new(:CREATE_ACCOUNT)) + |> OperationResultTr.new(OperationType.new(:CREATE_ACCOUNT)) |> OperationResult.new(code) op_results = [op_result1, op_result2] diff --git a/test/xdr/transactions/operation_result_test.exs b/test/xdr/transactions/operation_result_test.exs index 706b362a..ece3666d 100644 --- a/test/xdr/transactions/operation_result_test.exs +++ b/test/xdr/transactions/operation_result_test.exs @@ -2,7 +2,7 @@ defmodule StellarBase.XDR.OperationResultTest do use ExUnit.Case alias StellarBase.XDR.{ - OperationInnerResult, + OperationResultTr, OperationResult, OperationResultCode, OperationType, @@ -18,7 +18,7 @@ defmodule StellarBase.XDR.OperationResultTest do result = Void.new() |> CreateAccountResult.new(CreateAccountResultCode.new(:CREATE_ACCOUNT_SUCCESS)) - |> OperationInnerResult.new(OperationType.new(:CREATE_ACCOUNT)) + |> OperationResultTr.new(OperationType.new(:CREATE_ACCOUNT)) %{ code: code, diff --git a/test/xdr/transactions/operation_result_tr_test.exs b/test/xdr/transactions/operation_result_tr_test.exs new file mode 100644 index 00000000..919b28b4 --- /dev/null +++ b/test/xdr/transactions/operation_result_tr_test.exs @@ -0,0 +1,162 @@ +defmodule StellarBase.XDR.OperationInnerResultTest do + use ExUnit.Case + + alias StellarBase.XDR.{OperationResultTr, OperationType, Void} + + alias StellarBase.XDR.Operations.{ + ClawbackResult, + ClawbackResultCode, + CreateAccountResult, + CreateAccountResultCode, + PaymentResult, + PaymentResultCode, + SetOptionsResult, + SetOptionsResultCode + } + + describe "CreateAccount OperationResultTr" do + setup do + op_type = OperationType.new(:CREATE_ACCOUNT) + + value = + CreateAccountResult.new(Void.new(), CreateAccountResultCode.new(:CREATE_ACCOUNT_SUCCESS)) + + %{ + op_type: op_type, + value: value, + op_inner_value: OperationResultTr.new(value, op_type), + binary: <<0, 0, 0, 0, 0, 0, 0, 0>> + } + end + + test "new/1", %{value: value, op_type: op_type} do + %OperationResultTr{value: ^value, type: ^op_type} = OperationResultTr.new(value, op_type) + end + + test "encode_xdr/1", %{op_inner_value: op_inner_value, binary: binary} do + {:ok, ^binary} = OperationResultTr.encode_xdr(op_inner_value) + end + + test "encode_xdr!/1", %{op_inner_value: op_inner_value, binary: binary} do + ^binary = OperationResultTr.encode_xdr!(op_inner_value) + end + + test "decode_xdr/2", %{op_inner_value: op_inner_value, binary: binary} do + {:ok, {^op_inner_value, ""}} = OperationResultTr.decode_xdr(binary) + end + + test "decode_xdr!/2", %{op_inner_value: op_inner_value, binary: binary} do + {^op_inner_value, ^binary} = OperationResultTr.decode_xdr!(binary <> binary) + end + + test "decode_xdr/2 with an invalid binary" do + {:error, :not_binary} = OperationResultTr.decode_xdr(123) + end + end + + describe "Payment OperationResultTr" do + setup do + op_type = OperationType.new(:PAYMENT) + value = PaymentResult.new(Void.new(), PaymentResultCode.new(:PAYMENT_SUCCESS)) + + %{ + op_type: op_type, + value: value, + op_inner_value: OperationResultTr.new(value, op_type), + binary: <<0, 0, 0, 1, 0, 0, 0, 0>> + } + end + + test "new/1", %{value: value, op_type: op_type} do + %OperationResultTr{value: ^value, type: ^op_type} = OperationResultTr.new(value, op_type) + end + + test "encode_xdr/1", %{op_inner_value: op_inner_value, binary: binary} do + {:ok, ^binary} = OperationResultTr.encode_xdr(op_inner_value) + end + + test "encode_xdr!/1", %{op_inner_value: op_inner_value, binary: binary} do + ^binary = OperationResultTr.encode_xdr!(op_inner_value) + end + + test "decode_xdr/2", %{op_inner_value: op_inner_value, binary: binary} do + {:ok, {^op_inner_value, ""}} = OperationResultTr.decode_xdr(binary) + end + + test "decode_xdr!/2", %{op_inner_value: op_inner_value, binary: binary} do + {^op_inner_value, ^binary} = OperationResultTr.decode_xdr!(binary <> binary) + end + end + + describe "SetOptions OperationResultTr" do + setup do + op_type = OperationType.new(:SET_OPTIONS) + value = SetOptionsResult.new(Void.new(), SetOptionsResultCode.new(:SET_OPTIONS_SUCCESS)) + + %{ + op_type: op_type, + value: value, + op_inner_value: OperationResultTr.new(value, op_type), + binary: <<0, 0, 0, 5, 0, 0, 0, 0>> + } + end + + test "new/1", %{value: value, op_type: op_type} do + %OperationResultTr{value: ^value, type: ^op_type} = OperationResultTr.new(value, op_type) + end + + test "encode_xdr/1", %{op_inner_value: op_inner_value, binary: binary} do + {:ok, ^binary} = OperationResultTr.encode_xdr(op_inner_value) + end + + test "encode_xdr!/1", %{op_inner_value: op_inner_value, binary: binary} do + ^binary = OperationResultTr.encode_xdr!(op_inner_value) + end + + test "decode_xdr/2", %{op_inner_value: op_inner_value, binary: binary} do + {:ok, {^op_inner_value, ""}} = OperationResultTr.decode_xdr(binary) + end + + test "decode_xdr!/2", %{op_inner_value: op_inner_value, binary: binary} do + {^op_inner_value, ^binary} = OperationResultTr.decode_xdr!(binary <> binary) + end + end + + describe "Clawback OperationResultTr" do + setup do + op_type = OperationType.new(:CLAWBACK) + value = ClawbackResult.new(Void.new(), ClawbackResultCode.new(:CLAWBACK_SUCCESS)) + + %{ + op_type: op_type, + value: value, + op_inner_value: OperationResultTr.new(value, op_type), + binary: <<0, 0, 0, 19, 0, 0, 0, 0>> + } + end + + test "new/1", %{value: value, op_type: op_type} do + %OperationResultTr{value: ^value, type: ^op_type} = OperationResultTr.new(value, op_type) + end + + test "encode_xdr/1", %{op_inner_value: op_inner_value, binary: binary} do + {:ok, ^binary} = OperationResultTr.encode_xdr(op_inner_value) + end + + test "encode_xdr!/1", %{op_inner_value: op_inner_value, binary: binary} do + ^binary = OperationResultTr.encode_xdr!(op_inner_value) + end + + test "decode_xdr/2", %{op_inner_value: op_inner_value, binary: binary} do + {:ok, {^op_inner_value, ""}} = OperationResultTr.decode_xdr(binary) + end + + test "decode_xdr!/2", %{op_inner_value: op_inner_value, binary: binary} do + {^op_inner_value, ^binary} = OperationResultTr.decode_xdr!(binary <> binary) + end + + test "decode_xdr/2 with an invalid binary" do + {:error, :not_binary} = OperationResultTr.decode_xdr(123) + end + end +end diff --git a/test/xdr/transactions/operations/bump_footprint_expiration_result_code_test.exs b/test/xdr/transactions/operations/bump_footprint_expiration_result_code_test.exs index 048b3ee1..5578149b 100644 --- a/test/xdr/transactions/operations/bump_footprint_expiration_result_code_test.exs +++ b/test/xdr/transactions/operations/bump_footprint_expiration_result_code_test.exs @@ -1,7 +1,7 @@ -defmodule StellarBase.XDR.BumpFootprintExpirationResultCodeTest do +defmodule StellarBase.XDR.Operations.BumpFootprintExpirationResultCodeTest do use ExUnit.Case - alias StellarBase.XDR.BumpFootprintExpirationResultCode + alias StellarBase.XDR.Operations.BumpFootprintExpirationResultCode @codes [ :BUMP_FOOTPRINT_EXPIRATION_SUCCESS, diff --git a/test/xdr/transactions/operations/bump_footprint_expiration_result_test.exs b/test/xdr/transactions/operations/bump_footprint_expiration_result_test.exs index b2f2dc9f..1dba8713 100644 --- a/test/xdr/transactions/operations/bump_footprint_expiration_result_test.exs +++ b/test/xdr/transactions/operations/bump_footprint_expiration_result_test.exs @@ -1,8 +1,12 @@ -defmodule StellarBase.XDR.BumpFootprintExpirationResultTest do +defmodule StellarBase.XDR.Operations.BumpFootprintExpirationResultTest do use ExUnit.Case alias StellarBase.XDR.Void - alias StellarBase.XDR.{BumpFootprintExpirationResult, BumpFootprintExpirationResultCode} + + alias StellarBase.XDR.Operations.{ + BumpFootprintExpirationResult, + BumpFootprintExpirationResultCode + } describe "BumpFootprintExpirationResult" do setup do diff --git a/test/xdr/transactions/invoke_host_function_result_code_test.exs b/test/xdr/transactions/operations/invoke_host_function_result_code_test.exs similarity index 95% rename from test/xdr/transactions/invoke_host_function_result_code_test.exs rename to test/xdr/transactions/operations/invoke_host_function_result_code_test.exs index f93ca987..3df1500a 100644 --- a/test/xdr/transactions/invoke_host_function_result_code_test.exs +++ b/test/xdr/transactions/operations/invoke_host_function_result_code_test.exs @@ -1,7 +1,7 @@ -defmodule StellarBase.XDR.InvokeHostFunctionResultCodeTest do +defmodule StellarBase.XDR.Operations.InvokeHostFunctionResultCodeTest do use ExUnit.Case - alias StellarBase.XDR.InvokeHostFunctionResultCode + alias StellarBase.XDR.Operations.InvokeHostFunctionResultCode describe "InvokeHostFunctionResultCode" do setup do diff --git a/test/xdr/transactions/invoke_host_function_result_test.exs b/test/xdr/transactions/operations/invoke_host_function_result_test.exs similarity index 95% rename from test/xdr/transactions/invoke_host_function_result_test.exs rename to test/xdr/transactions/operations/invoke_host_function_result_test.exs index b5581efa..d321db5a 100644 --- a/test/xdr/transactions/invoke_host_function_result_test.exs +++ b/test/xdr/transactions/operations/invoke_host_function_result_test.exs @@ -1,14 +1,15 @@ -defmodule StellarBase.XDR.InvokeHostFunctionResultTest do +defmodule StellarBase.XDR.Operations.InvokeHostFunctionResultTest do use ExUnit.Case alias StellarBase.XDR.Hash - alias StellarBase.XDR.{ + alias StellarBase.XDR.Operations.{ InvokeHostFunctionResult, - InvokeHostFunctionResultCode, - Void + InvokeHostFunctionResultCode } + alias StellarBase.XDR.Void + describe "InvokeHostFunctionResult" do setup do invoke_host_function_result_success = diff --git a/test/xdr/transactions/operations/restore_footprint_result_code_test.exs b/test/xdr/transactions/operations/restore_footprint_result_code_test.exs index 1e64c9d7..ca85f755 100644 --- a/test/xdr/transactions/operations/restore_footprint_result_code_test.exs +++ b/test/xdr/transactions/operations/restore_footprint_result_code_test.exs @@ -1,7 +1,7 @@ -defmodule StellarBase.XDR.RestoreFootprintResultCodeTest do +defmodule StellarBase.XDR.Operations.RestoreFootprintResultCodeTest do use ExUnit.Case - alias StellarBase.XDR.RestoreFootprintResultCode + alias StellarBase.XDR.Operations.RestoreFootprintResultCode @codes [ :RESTORE_FOOTPRINT_SUCCESS, diff --git a/test/xdr/transactions/operations/restore_footprint_result_test.exs b/test/xdr/transactions/operations/restore_footprint_result_test.exs index bb825a89..3de0c738 100644 --- a/test/xdr/transactions/operations/restore_footprint_result_test.exs +++ b/test/xdr/transactions/operations/restore_footprint_result_test.exs @@ -1,8 +1,8 @@ -defmodule StellarBase.XDR.RestoreFootprintResultTest do +defmodule StellarBase.XDR.Operations.RestoreFootprintResultTest do use ExUnit.Case alias StellarBase.XDR.Void - alias StellarBase.XDR.{RestoreFootprintResult, RestoreFootprintResultCode} + alias StellarBase.XDR.Operations.{RestoreFootprintResult, RestoreFootprintResultCode} describe "RestoreFootprintResult" do setup do diff --git a/test/xdr/transactions/transaction_result_result_test.exs b/test/xdr/transactions/transaction_result_result_test.exs index c73d2d02..39e4c527 100644 --- a/test/xdr/transactions/transaction_result_result_test.exs +++ b/test/xdr/transactions/transaction_result_result_test.exs @@ -7,7 +7,7 @@ defmodule StellarBase.XDR.TransactionResultResultTest do InnerTransactionResult, InnerTransactionResultPair, Int64, - OperationInnerResult, + OperationResultTr, OperationResult, OperationResultCode, OperationResultList, @@ -24,7 +24,7 @@ defmodule StellarBase.XDR.TransactionResultResultTest do result = Void.new() |> CreateAccountResult.new(CreateAccountResultCode.new(:CREATE_ACCOUNT_SUCCESS)) - |> OperationInnerResult.new(OperationType.new(:CREATE_ACCOUNT)) + |> OperationResultTr.new(OperationType.new(:CREATE_ACCOUNT)) |> OperationResult.new(OperationResultCode.new(:opINNER)) |> (&OperationResultList.new([&1])).() diff --git a/test/xdr/transactions/transaction_result_test.exs b/test/xdr/transactions/transaction_result_test.exs index e227e833..45ba1a63 100644 --- a/test/xdr/transactions/transaction_result_test.exs +++ b/test/xdr/transactions/transaction_result_test.exs @@ -7,7 +7,7 @@ defmodule StellarBase.XDR.TransactionResultTest do InnerTransactionResult, InnerTransactionResultPair, Int64, - OperationInnerResult, + OperationResultTr, OperationResult, OperationResultCode, OperationResultList, @@ -28,7 +28,7 @@ defmodule StellarBase.XDR.TransactionResultTest do result = Void.new() |> CreateAccountResult.new(CreateAccountResultCode.new(:CREATE_ACCOUNT_SUCCESS)) - |> OperationInnerResult.new(OperationType.new(:CREATE_ACCOUNT)) + |> OperationResultTr.new(OperationType.new(:CREATE_ACCOUNT)) |> OperationResult.new(OperationResultCode.new(:opINNER)) |> (&OperationResultList.new([&1])).() |> InnerTransactionResultResult.new(TransactionResultCode.new(:txSUCCESS))