Skip to content

Commit

Permalink
Merge pull request #330 from kommitters/v0.17
Browse files Browse the repository at this point in the history
Release v0.17.1
  • Loading branch information
Odraxs authored Aug 8, 2023
2 parents 9fed6c7 + 21c44a2 commit ab4a688
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.17.1 (08.08.2023)

* Allow contract_data key to be any type of `SCVal`

## 0.17.0 (04.08.2023)

* Finish Soroban Preview 10 Support:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The **Stellar SDK** is composed of two complementary components: **`TxBuild`** +
```elixir
def deps do
[
{:stellar_sdk, "~> 0.17.0"}
{:stellar_sdk, "~> 0.17.1"}
]
end
```
Expand Down
6 changes: 2 additions & 4 deletions docs/examples/soroban/bump_footprint_expiration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Read more about it:
- https://soroban.stellar.org/docs/fundamentals-and-concepts/state-expiration#bumpfootprintexpirationop
- https://docs.rs/soroban-sdk/latest/soroban_sdk/storage/struct.Storage.html

In this example, we will bump the contract instance of an already deployed contract in the network, adding 1000 ledgers to it.
In this example, we will bump the contract instance and the wasm of an already deployed contract in the network, adding 1000 ledgers to it.

> **Warning**
> Please note that Soroban is still under development, so breaking changes may occur.
Expand All @@ -28,8 +28,6 @@ alias Stellar.TxBuild.{
SorobanTransactionData
}

alias Stellar.KeyPair

contract_address = "CAMGSYINVVL6WP3Q5WPNL7FS4GZP37TWV7MKIRQF5QMYLK3N2SW4P3RC"
contract_sc_address = SCAddress.new(contract_address)
key = SCVal.new(ledger_key_contract_instance: nil)
Expand All @@ -49,7 +47,7 @@ contract_data =
]}
)

hash= StellarBase.StrKey.decode!(contract_address, :contract)
hash = Base.decode16!("067eb7ba419edd3e946e08eb17a81fbe1e850e690ed7692160875c2b65b45f21", case: :lower)
contract_code = LedgerKey.new({:contract_code, [hash: hash, body_type: :data_entry]})
footprint = LedgerFootprint.new(read_only: [contract_data, contract_code])

Expand Down
4 changes: 1 addition & 3 deletions lib/tx_build/ledger/contract_data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ defmodule Stellar.TxBuild.Ledger.ContractData do
def to_xdr(_struct), do: {:error, :invalid_struct}

@spec validate_sc_val_ledger_instance(key :: key()) :: validation()
defp validate_sc_val_ledger_instance(%SCVal{type: :ledger_key_contract_instance} = key),
do: {:ok, key}

defp validate_sc_val_ledger_instance(%SCVal{} = key), do: {:ok, key}
defp validate_sc_val_ledger_instance(_key), do: {:error, :invalid_key}

@spec durability_to_xdr(atom()) :: ContractDataDurability.t()
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 Stellar.MixProject do
use Mix.Project

@github_url "https://github.com/kommitters/stellar_sdk"
@version "0.17.0"
@version "0.17.1"

def project do
[
Expand Down

0 comments on commit ab4a688

Please sign in to comment.