Skip to content

Commit

Permalink
Merge pull request #305 from kommitters/v0.15
Browse files Browse the repository at this point in the history
Release v0.15.1
  • Loading branch information
Odraxs authored Jul 12, 2024
2 parents 902b7a8 + 6a98d12 commit 261b2ed
Show file tree
Hide file tree
Showing 17 changed files with 445 additions and 43 deletions.
8 changes: 4 additions & 4 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@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
disable-sudo: true
egress-policy: block
Expand All @@ -30,12 +30,12 @@ jobs:
repo.hex.pm:443
builds.hex.pm:443
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: erlef/setup-elixir@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: erlef/setup-elixir@a6e26b22319003294c58386b6f25edbc7336819a # v1.18.0
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
otp: ['22.3', '23.3']
elixir: ['1.10', '1.11']
otp: ['23.3']
elixir: ['1.11', '1.12']
env:
MIX_ENV: test
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
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@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Sets up an Erlang/OTP environment
uses: erlef/setup-elixir@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0
uses: erlef/setup-elixir@a6e26b22319003294c58386b6f25edbc7336819a # v1.18.0
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
Expand All @@ -48,7 +48,7 @@ jobs:
echo "::set-output name=mix_hash::$mix_hash"
- name: Cache dependecies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: deps
key: ${{ runner.os }}-mix-${{ steps.set_vars.outputs.mix_hash }}
Expand All @@ -57,7 +57,7 @@ jobs:
- name: Cache PLT files
id: plt-cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
_build
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
disable-sudo: true
egress-policy: block
Expand Down
10 changes: 5 additions & 5 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@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
disable-sudo: true
egress-policy: block
Expand All @@ -38,12 +38,12 @@ jobs:
www.bestpractices.dev:443
- name: "Checkout code"
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -62,14 +62,14 @@ 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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5
uses: github/codeql-action/upload-sarif@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12
with:
sarif_file: results.sarif
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.15.1 (12.07.2024)

* [Update soroban transaction meta type](https://github.com/kommitters/stellar_base/issues/302).
* Update dependencies.
| Package | Type | Update | Change |
|---|---|---|---|
| [actions/cache](https://togithub.com/actions/cache) | action | major | `v3.3.1` -> `v4.0.2` |
| [actions/checkout](https://togithub.com/actions/checkout) | action | minor | `v4.0.0` -> `v4.1.7` |
| [actions/upload-artifact](https://togithub.com/actions/upload-artifact) | action | major | `v3.1.3` -> `v4.3.4` |
| [erlef/setup-elixir](https://togithub.com/erlef/setup-elixir) | action | minor | `v1.16.0` -> `v1.18.0` |
| [ex_doc](https://hex.pm/packages/ex_doc) | | minor | `~> 0.30` -> `~> 0.34` |
| [excoveralls](https://hex.pm/packages/excoveralls) | | minor | `~> 0.17` -> `~> 0.18.1` |
| [github/codeql-action](https://togithub.com/github/codeql-action) | action | major | `v2.21.5` -> `v3.25.12` |
| [ossf/scorecard-action](https://togithub.com/ossf/scorecard-action) | action | minor | `v2.2.0` -> `v2.3.3` |
| [step-security/harden-runner](https://togithub.com/step-security/harden-runner) | action | minor | `v2.5.1` -> `v2.8.1` |

## 0.15.0 (20.12.2023)

* [Support stable Protocol 20 release](https://github.com/kommitters/stellar_base/issues/295).
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.15.0"}
{:stellar_base, "~> 0.15.1"}
]
end
```
Expand Down
8 changes: 4 additions & 4 deletions lib/xdr/transactions/soroban_transaction_meta.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ defmodule StellarBase.XDR.SorobanTransactionMeta do
@behaviour XDR.Declaration

alias StellarBase.XDR.{
ExtensionPoint,
SorobanTransactionMetaExt,
ContractEventList,
SCVal,
DiagnosticEventList
}

@struct_spec XDR.Struct.new(
ext: ExtensionPoint,
ext: SorobanTransactionMetaExt,
events: ContractEventList,
return_value: SCVal,
diagnostic_events: DiagnosticEventList
)

@type ext_type :: ExtensionPoint.t()
@type ext_type :: SorobanTransactionMetaExt.t()
@type events_type :: ContractEventList.t()
@type return_value_type :: SCVal.t()
@type diagnostic_events_type :: DiagnosticEventList.t()
Expand All @@ -45,7 +45,7 @@ defmodule StellarBase.XDR.SorobanTransactionMeta do
diagnostic_events :: diagnostic_events_type()
) :: t()
def new(
%ExtensionPoint{} = ext,
%SorobanTransactionMetaExt{} = ext,
%ContractEventList{} = events,
%SCVal{} = return_value,
%DiagnosticEventList{} = diagnostic_events
Expand Down
74 changes: 74 additions & 0 deletions lib/xdr/transactions/soroban_transaction_meta_ext.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
defmodule StellarBase.XDR.SorobanTransactionMetaExt do
@moduledoc """
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 `SorobanTransactionMetaExt` type.
"""

@behaviour XDR.Declaration

alias StellarBase.XDR.{
Void,
SorobanTransactionMetaExtV1
}

@arms %{
0 => Void,
1 => SorobanTransactionMetaExtV1
}

@type value ::
Void.t()
| SorobanTransactionMetaExtV1.t()

@type t :: %__MODULE__{value: value(), type: integer()}

defstruct [:value, :type]

@spec new(value :: value(), type :: integer()) :: t()
def new(value, type), do: %__MODULE__{value: value, type: type}

@impl true
def encode_xdr(%__MODULE__{value: value, type: type}) do
type
|> XDR.Int.new()
|> XDR.Union.new(@arms, value)
|> XDR.Union.encode_xdr()
end

@impl true
def encode_xdr!(%__MODULE__{value: value, type: type}) do
type
|> XDR.Int.new()
|> XDR.Union.new(@arms, value)
|> XDR.Union.encode_xdr!()
end

@impl true
def decode_xdr(bytes, spec \\ union_spec())

def decode_xdr(bytes, spec) do
case XDR.Union.decode_xdr(bytes, spec) do
{:ok, {{type, value}, rest}} -> {:ok, {new(value, type), rest}}
error -> error
end
end

@impl true
def decode_xdr!(bytes, spec \\ union_spec())

def decode_xdr!(bytes, spec) do
{{type, value}, rest} = XDR.Union.decode_xdr!(bytes, spec)
{new(value, type), rest}
end

@spec union_spec() :: XDR.Union.t()
defp union_spec do
0
|> XDR.Int.new()
|> XDR.Union.new(@arms)
end
end
Loading

0 comments on commit 261b2ed

Please sign in to comment.