-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from kommitters/v0.15
Release v0.15.1
- Loading branch information
Showing
17 changed files
with
445 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.