Skip to content

Commit 5298c4e

Browse files
authored
Merge pull request #277 from kommitters/v0.12
Release v0.12.0
2 parents 58a3fb5 + e50f1c1 commit 5298c4e

File tree

195 files changed

+7073
-4933
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+7073
-4933
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 0.12.0 (24.07.2023)
4+
5+
* [Soroban Preview 10 support](https://github.com/kommitters/stellar_base/issues/273).
36
## 0.11.1 (01.06.2023)
47

58
* [Add missing value types in SCVal](https://github.com/kommitters/stellar_base/pull/270).

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ You should only use **`stellar_base`** if you are planning to build on top of it
2626
```elixir
2727
def deps do
2828
[
29-
{:stellar_base, "~> 0.11.1"}
29+
{:stellar_base, "~> 0.12.0"}
3030
]
3131
end
3232
```
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
defmodule StellarBase.XDR.ConfigSettingContractExecutionLanesV0 do
2+
@moduledoc """
3+
Automatically generated by xdrgen
4+
DO NOT EDIT or your changes may be overwritten
5+
6+
Target implementation: elixir_xdr at https://hex.pm/packages/elixir_xdr
7+
8+
Representation of Stellar `ConfigSettingContractExecutionLanesV0` type.
9+
"""
10+
11+
@behaviour XDR.Declaration
12+
13+
alias StellarBase.XDR.UInt32
14+
15+
@struct_spec XDR.Struct.new(ledger_max_tx_count: UInt32)
16+
17+
@type ledger_max_tx_count_type :: UInt32.t()
18+
19+
@type t :: %__MODULE__{ledger_max_tx_count: ledger_max_tx_count_type()}
20+
21+
defstruct [:ledger_max_tx_count]
22+
23+
@spec new(ledger_max_tx_count :: ledger_max_tx_count_type()) :: t()
24+
def new(%UInt32{} = ledger_max_tx_count),
25+
do: %__MODULE__{ledger_max_tx_count: ledger_max_tx_count}
26+
27+
@impl true
28+
def encode_xdr(%__MODULE__{ledger_max_tx_count: ledger_max_tx_count}) do
29+
[ledger_max_tx_count: ledger_max_tx_count]
30+
|> XDR.Struct.new()
31+
|> XDR.Struct.encode_xdr()
32+
end
33+
34+
@impl true
35+
def encode_xdr!(%__MODULE__{ledger_max_tx_count: ledger_max_tx_count}) do
36+
[ledger_max_tx_count: ledger_max_tx_count]
37+
|> XDR.Struct.new()
38+
|> XDR.Struct.encode_xdr!()
39+
end
40+
41+
@impl true
42+
def decode_xdr(bytes, struct \\ @struct_spec)
43+
44+
def decode_xdr(bytes, struct) do
45+
case XDR.Struct.decode_xdr(bytes, struct) do
46+
{:ok, {%XDR.Struct{components: [ledger_max_tx_count: ledger_max_tx_count]}, rest}} ->
47+
{:ok, {new(ledger_max_tx_count), rest}}
48+
49+
error ->
50+
error
51+
end
52+
end
53+
54+
@impl true
55+
def decode_xdr!(bytes, struct \\ @struct_spec)
56+
57+
def decode_xdr!(bytes, struct) do
58+
{%XDR.Struct{components: [ledger_max_tx_count: ledger_max_tx_count]}, rest} =
59+
XDR.Struct.decode_xdr!(bytes, struct)
60+
61+
{new(ledger_max_tx_count), rest}
62+
end
63+
end

lib/xdr/contract/config_setting/config_setting_entry.ex

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ defmodule StellarBase.XDR.ConfigSettingEntry do
1818
ConfigSettingContractHistoricalDataV0,
1919
ConfigSettingContractMetaDataV0,
2020
ConfigSettingContractBandwidthV0,
21-
ContractCostParams
21+
ContractCostParams,
22+
StateExpirationSettings,
23+
ConfigSettingContractExecutionLanesV0,
24+
UInt64List
2225
}
2326

2427
@arms [
@@ -31,7 +34,10 @@ defmodule StellarBase.XDR.ConfigSettingEntry do
3134
CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS: ContractCostParams,
3235
CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES: ContractCostParams,
3336
CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES: UInt32,
34-
CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: UInt32
37+
CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: UInt32,
38+
CONFIG_SETTING_STATE_EXPIRATION: StateExpirationSettings,
39+
CONFIG_SETTING_CONTRACT_EXECUTION_LANES: ConfigSettingContractExecutionLanesV0,
40+
CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: UInt64List
3541
]
3642

3743
@type value ::
@@ -42,6 +48,9 @@ defmodule StellarBase.XDR.ConfigSettingEntry do
4248
| ConfigSettingContractMetaDataV0.t()
4349
| ConfigSettingContractBandwidthV0.t()
4450
| ContractCostParams.t()
51+
| StateExpirationSettings.t()
52+
| ConfigSettingContractExecutionLanesV0.t()
53+
| UInt64List.t()
4554

4655
@type t :: %__MODULE__{value: value(), type: ConfigSettingID.t()}
4756

lib/xdr/contract/config_setting/config_setting_id.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ defmodule StellarBase.XDR.ConfigSettingID do
2020
CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS: 6,
2121
CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES: 7,
2222
CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES: 8,
23-
CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: 9
23+
CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: 9,
24+
CONFIG_SETTING_STATE_EXPIRATION: 10,
25+
CONFIG_SETTING_CONTRACT_EXECUTION_LANES: 11,
26+
CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: 12
2427
]
2528

2629
@enum_spec %XDR.Enum{declarations: @declarations, identifier: nil}

lib/xdr/contract/config_setting/contract_cost_param_entry.ex

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,47 @@ defmodule StellarBase.XDR.ContractCostParamEntry do
1111
@behaviour XDR.Declaration
1212

1313
alias StellarBase.XDR.{
14-
Int64,
15-
ExtensionPoint
14+
ExtensionPoint,
15+
Int64
1616
}
1717

1818
@struct_spec XDR.Struct.new(
19+
ext: ExtensionPoint,
1920
const_term: Int64,
20-
linear_term: Int64,
21-
ext: ExtensionPoint
21+
linear_term: Int64
2222
)
2323

24+
@type ext_type :: ExtensionPoint.t()
2425
@type const_term_type :: Int64.t()
2526
@type linear_term_type :: Int64.t()
26-
@type ext_type :: ExtensionPoint.t()
2727

2828
@type t :: %__MODULE__{
29+
ext: ext_type(),
2930
const_term: const_term_type(),
30-
linear_term: linear_term_type(),
31-
ext: ext_type()
31+
linear_term: linear_term_type()
3232
}
3333

34-
defstruct [:const_term, :linear_term, :ext]
34+
defstruct [:ext, :const_term, :linear_term]
3535

36-
@spec new(const_term :: const_term_type(), linear_term :: linear_term_type(), ext :: ext_type()) ::
36+
@spec new(ext :: ext_type(), const_term :: const_term_type(), linear_term :: linear_term_type()) ::
3737
t()
3838
def new(
39+
%ExtensionPoint{} = ext,
3940
%Int64{} = const_term,
40-
%Int64{} = linear_term,
41-
%ExtensionPoint{} = ext
41+
%Int64{} = linear_term
4242
),
43-
do: %__MODULE__{const_term: const_term, linear_term: linear_term, ext: ext}
43+
do: %__MODULE__{ext: ext, const_term: const_term, linear_term: linear_term}
4444

4545
@impl true
46-
def encode_xdr(%__MODULE__{const_term: const_term, linear_term: linear_term, ext: ext}) do
47-
[const_term: const_term, linear_term: linear_term, ext: ext]
46+
def encode_xdr(%__MODULE__{ext: ext, const_term: const_term, linear_term: linear_term}) do
47+
[ext: ext, const_term: const_term, linear_term: linear_term]
4848
|> XDR.Struct.new()
4949
|> XDR.Struct.encode_xdr()
5050
end
5151

5252
@impl true
53-
def encode_xdr!(%__MODULE__{const_term: const_term, linear_term: linear_term, ext: ext}) do
54-
[const_term: const_term, linear_term: linear_term, ext: ext]
53+
def encode_xdr!(%__MODULE__{ext: ext, const_term: const_term, linear_term: linear_term}) do
54+
[ext: ext, const_term: const_term, linear_term: linear_term]
5555
|> XDR.Struct.new()
5656
|> XDR.Struct.encode_xdr!()
5757
end
@@ -62,9 +62,9 @@ defmodule StellarBase.XDR.ContractCostParamEntry do
6262
def decode_xdr(bytes, struct) do
6363
case XDR.Struct.decode_xdr(bytes, struct) do
6464
{:ok,
65-
{%XDR.Struct{components: [const_term: const_term, linear_term: linear_term, ext: ext]},
65+
{%XDR.Struct{components: [ext: ext, const_term: const_term, linear_term: linear_term]},
6666
rest}} ->
67-
{:ok, {new(const_term, linear_term, ext), rest}}
67+
{:ok, {new(ext, const_term, linear_term), rest}}
6868

6969
error ->
7070
error
@@ -75,9 +75,9 @@ defmodule StellarBase.XDR.ContractCostParamEntry do
7575
def decode_xdr!(bytes, struct \\ @struct_spec)
7676

7777
def decode_xdr!(bytes, struct) do
78-
{%XDR.Struct{components: [const_term: const_term, linear_term: linear_term, ext: ext]}, rest} =
78+
{%XDR.Struct{components: [ext: ext, const_term: const_term, linear_term: linear_term]}, rest} =
7979
XDR.Struct.decode_xdr!(bytes, struct)
8080

81-
{new(const_term, linear_term, ext), rest}
81+
{new(ext, const_term, linear_term), rest}
8282
end
8383
end

lib/xdr/contract/config_setting/contract_cost_type.ex

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,18 @@ defmodule StellarBase.XDR.ContractCostType do
3030
VmMemRead: 16,
3131
VmMemWrite: 17,
3232
VmInstantiation: 18,
33-
InvokeVmFunction: 19,
34-
ChargeBudget: 20
33+
VmCachedInstantiation: 19,
34+
InvokeVmFunction: 20,
35+
ChargeBudget: 21,
36+
ComputeKeccak256Hash: 22,
37+
ComputeEcdsaSecp256k1Key: 23,
38+
ComputeEcdsaSecp256k1Sig: 24,
39+
RecoverEcdsaSecp256k1Key: 25,
40+
Int256AddSub: 26,
41+
Int256Mul: 27,
42+
Int256Div: 28,
43+
Int256Pow: 29,
44+
Int256Shift: 30
3545
]
3646

3747
@enum_spec %XDR.Enum{declarations: @declarations, identifier: nil}

0 commit comments

Comments
 (0)