Skip to content

Commit

Permalink
Merge pull request #286 from kommitters/v0.13
Browse files Browse the repository at this point in the history
Release v0.13.1
  • Loading branch information
Odraxs committed Aug 2, 2023
2 parents c95d716 + 6f1482d commit b54aa43
Show file tree
Hide file tree
Showing 30 changed files with 294 additions and 256 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
6 changes: 3 additions & 3 deletions lib/xdr/transactions/operation_result.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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()}

Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -17,6 +26,7 @@ defmodule StellarBase.XDR.OperationInnerResult do
CreateClaimableBalanceResult,
EndSponsoringFutureReservesResult,
InflationResult,
InvokeHostFunctionResult,
LiquidityPoolDepositResult,
LiquidityPoolWithdrawResult,
ManageDataResult,
Expand All @@ -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,
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 3 additions & 5 deletions lib/xdr/transactions/operations/restore_footprint_result.ex
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
[
Expand Down Expand Up @@ -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

Expand Down
Loading

0 comments on commit b54aa43

Please sign in to comment.