Skip to content

Commit

Permalink
Merge pull request #245 from kommitters/v0.9
Browse files Browse the repository at this point in the history
Release v0.9.1
  • Loading branch information
keliumJU committed Mar 31, 2023
2 parents 505ad81 + c1e6143 commit 3836e17
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 0.9.1 (31.03.2023)
* Update boundary for InvokeHostFuntion, from `StellarBase.XDR.InvokeHostFunctionOp` to `StellarBase.XDR.Operations.InvokeHostFunction`.

## 0.9.0 (29.03.2023)
* Add [CAP-0046 support](https://github.com/kommitters/stellar_base/issues/223) in the XDR version: [df18148747e807618acf4639db41c4fd6f0be9fc](https://github.com/stellar/stellar-xdr/commit/df18148747e807618acf4639db41c4fd6f0be9fc) which corresponds to the [Soroban Preview 7](https://soroban.stellar.org/docs/reference/releases#preview-7-february-16th-2023).
* Update all dependencies.
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.9.0"}
{:stellar_base, "~> 0.9.1"}
]
end
```
Expand Down
4 changes: 2 additions & 2 deletions lib/xdr/transactions/operation_body.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ defmodule StellarBase.XDR.OperationBody do
SetTrustLineFlags,
LiquidityPoolDeposit,
LiquidityPoolWithdraw,
InvokeHostFunctionOp
InvokeHostFunction
}

@behaviour XDR.Declaration
Expand Down Expand Up @@ -58,7 +58,7 @@ defmodule StellarBase.XDR.OperationBody do
SET_TRUST_LINE_FLAGS: SetTrustLineFlags,
LIQUIDITY_POOL_DEPOSIT: LiquidityPoolDeposit,
LIQUIDITY_POOL_WITHDRAW: LiquidityPoolWithdraw,
INVOKE_HOST_FUNCTION: InvokeHostFunctionOp
INVOKE_HOST_FUNCTION: InvokeHostFunction
]

@type operation :: any()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule StellarBase.XDR.InvokeHostFunctionOp do
defmodule StellarBase.XDR.Operations.InvokeHostFunction do
@moduledoc """
Representation of Stellar `InvokeHostFunctionOp` type.
Representation of Stellar `InvokeHostFunction` type.
"""

alias StellarBase.XDR.{ContractAuthList, LedgerFootprint, HostFunction}
Expand Down
2 changes: 1 addition & 1 deletion 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.9.0"
@version "0.9.1"

def project do
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
defmodule StellarBase.XDR.InvokeHostFunctionOpTest do
defmodule StellarBase.XDR.Operations.InvokeHostFunctionTest do
use ExUnit.Case

alias StellarBase.XDR.{
InvokeHostFunctionOp,
SCVal,
SCValType,
SCVec,
Expand Down Expand Up @@ -38,9 +37,11 @@ defmodule StellarBase.XDR.InvokeHostFunctionOpTest do
UInt64
}

alias StellarBase.XDR.Operations.InvokeHostFunction

alias StellarBase.StrKey

describe "InvokeHostFunctionOp" do
describe "InvokeHostFunction" do
setup do
## HostFunction
scval1 = SCVal.new(Int64.new(3), SCValType.new(:SCV_U63))
Expand Down Expand Up @@ -99,7 +100,7 @@ defmodule StellarBase.XDR.InvokeHostFunctionOpTest do
host_function: host_function,
footprint: footprint,
auth: auth_list,
invoke_host_function_op: InvokeHostFunctionOp.new(host_function, footprint, auth_list),
invoke_host_function_op: InvokeHostFunction.new(host_function, footprint, auth_list),
binary:
<<0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 114, 213, 178, 144, 98, 27, 186, 154,
Expand All @@ -124,40 +125,40 @@ defmodule StellarBase.XDR.InvokeHostFunctionOpTest do
end

test "new/1", %{host_function: host_function, footprint: footprint, auth: auth} do
%InvokeHostFunctionOp{host_function: ^host_function, footprint: ^footprint, auth: ^auth} =
InvokeHostFunctionOp.new(host_function, footprint, auth)
%InvokeHostFunction{host_function: ^host_function, footprint: ^footprint, auth: ^auth} =
InvokeHostFunction.new(host_function, footprint, auth)
end

test "encode_xdr/1", %{
invoke_host_function_op: invoke_host_function_op,
binary: binary
} do
{:ok, ^binary} = InvokeHostFunctionOp.encode_xdr(invoke_host_function_op)
{:ok, ^binary} = InvokeHostFunction.encode_xdr(invoke_host_function_op)
end

test "encode_xdr!/1", %{
invoke_host_function_op: invoke_host_function_op,
binary: binary
} do
^binary = InvokeHostFunctionOp.encode_xdr!(invoke_host_function_op)
^binary = InvokeHostFunction.encode_xdr!(invoke_host_function_op)
end

test "decode_xdr/2", %{
invoke_host_function_op: invoke_host_function_op,
binary: binary
} do
{:ok, {^invoke_host_function_op, ""}} = InvokeHostFunctionOp.decode_xdr(binary)
{:ok, {^invoke_host_function_op, ""}} = InvokeHostFunction.decode_xdr(binary)
end

test "decode_xdr/2 with an invalid binary" do
{:error, :not_binary} = InvokeHostFunctionOp.decode_xdr(123)
{:error, :not_binary} = InvokeHostFunction.decode_xdr(123)
end

test "decode_xdr!/2", %{
invoke_host_function_op: invoke_host_function_op,
binary: binary
} do
{^invoke_host_function_op, ^binary} = InvokeHostFunctionOp.decode_xdr!(binary <> binary)
{^invoke_host_function_op, ^binary} = InvokeHostFunction.decode_xdr!(binary <> binary)
end
end
end

0 comments on commit 3836e17

Please sign in to comment.