diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f811d5f..2440337e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.15.1 (13.06.2023) + +* Fix `SCAddress` contract type. + ## 0.15.0 (05.06.2023) * Add Soroban Preview 9 support. * Add Soroban examples. diff --git a/README.md b/README.md index 4c9d60fd..ec8e7e25 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ The **Stellar SDK** is composed of two complementary components: **`TxBuild`** + ```elixir def deps do [ - {:stellar_sdk, "~> 0.15.0"} + {:stellar_sdk, "~> 0.15.1"} ] end ``` diff --git a/lib/tx_build/sc_address.ex b/lib/tx_build/sc_address.ex index 56e65f6c..fb4b4e36 100644 --- a/lib/tx_build/sc_address.ex +++ b/lib/tx_build/sc_address.ex @@ -49,9 +49,10 @@ defmodule Stellar.TxBuild.SCAddress do end def to_xdr(%__MODULE__{type: :contract, value: value}) do - type = SCAddressType.new(:SC_ADDRESS_contract) + type = SCAddressType.new(:SC_ADDRESS_TYPE_CONTRACT) value + |> KeyPair.raw_contract() |> Hash.new() |> SCAddress.new(type) end diff --git a/mix.exs b/mix.exs index 0af308c1..1a9d5287 100644 --- a/mix.exs +++ b/mix.exs @@ -2,7 +2,7 @@ defmodule Stellar.MixProject do use Mix.Project @github_url "https://github.com/kommitters/stellar_sdk" - @version "0.15.0" + @version "0.15.1" def project do [ diff --git a/test/tx_build/sc_address_test.exs b/test/tx_build/sc_address_test.exs index bf3b9e99..2c80a29e 100644 --- a/test/tx_build/sc_address_test.exs +++ b/test/tx_build/sc_address_test.exs @@ -53,8 +53,12 @@ defmodule Stellar.TxBuild.SCAddressTest do test "to_xdr when type is contract", %{contract: contract} do %SCAddress{ - sc_address: %Hash{value: "CCEMOFO5TE7FGOAJOA3RDHPC6RW3CFXRVIGOFQPFE4ZGOKA2QEA636SN"}, - type: %SCAddressType{identifier: :SC_ADDRESS_contract} + sc_address: %Hash{ + value: + <<136, 199, 21, 221, 153, 62, 83, 56, 9, 112, 55, 17, 157, 226, 244, 109, 177, 22, 241, + 170, 12, 226, 193, 229, 39, 50, 103, 40, 26, 129, 1, 237>> + }, + type: %SCAddressType{identifier: :SC_ADDRESS_TYPE_CONTRACT} } = contract |> TxSCAddress.new() |> TxSCAddress.to_xdr() end end