Skip to content

Commit 274e276

Browse files
authored
Bump XDR and env to v23.0.0-rc.1.1 (#1467)
### What Bump XDR and env to v23.0.0-rc.1.1 This is a minimum necessary SDK change to support protocol 23. ### Why Preparing for 23.0.0-rc.1 release ### Known limitations N/A
1 parent f46e9e0 commit 274e276

122 files changed

Lines changed: 485 additions & 474 deletions

File tree

Some content is hidden

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

Cargo.lock

Lines changed: 52 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@ soroban-ledger-snapshot = { version = "22.0.8", path = "soroban-ledger-snapshot"
2424
soroban-token-sdk = { version = "22.0.8", path = "soroban-token-sdk" }
2525

2626
[workspace.dependencies.soroban-env-common]
27-
version = "=22.1.3"
27+
version = "=23.0.0-rc.1.1"
2828
#git = "https://github.com/stellar/rs-soroban-env"
2929
#rev = "bd0c80a1fe171e75f8d745f17975a73927d44ecd"
3030

3131
[workspace.dependencies.soroban-env-guest]
32-
version = "=22.1.3"
32+
version = "=23.0.0-rc.1.1"
3333
#git = "https://github.com/stellar/rs-soroban-env"
3434
#rev = "bd0c80a1fe171e75f8d745f17975a73927d44ecd"
3535

3636
[workspace.dependencies.soroban-env-host]
37-
version = "=22.1.3"
37+
version = "=23.0.0-rc.1.1"
3838
#git = "https://github.com/stellar/rs-soroban-env"
3939
#rev = "bd0c80a1fe171e75f8d745f17975a73927d44ecd"
4040

4141
[workspace.dependencies.stellar-strkey]
42-
version = "=0.0.9"
42+
version = "=0.0.13"
4343

4444
[workspace.dependencies.stellar-xdr]
45-
version = "=22.1.0"
45+
version = "=23.0.0-rc.1"
4646
default-features = false
4747
features = ["curr"]
4848
#git = "https://github.com/stellar/rs-stellar-xdr"

soroban-ledger-snapshot/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ edition = "2021"
1111
rust-version.workspace = true
1212

1313
[dependencies]
14-
soroban-env-host = { workspace = true }
14+
soroban-env-host = { workspace = true, features = ["testutils"] }
1515
soroban-env-common = {workspace = true, features = ["serde"]}
1616
serde = { version = "1.0.0", features = ["derive"] }
1717
serde_with = { version = "3.4.0", features = ["hex"] }

soroban-ledger-snapshot/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ impl LedgerSnapshot {
6161
self.set_ledger_info(li.clone());
6262
Ok(())
6363
});
64-
let _result = host.with_mut_storage(|s| {
65-
self.update_entries(&s.map);
66-
Ok(())
67-
});
64+
self.update_entries(&host.get_stored_entries().unwrap());
6865
}
6966

7067
// Get the ledger info in the snapshot.
@@ -168,7 +165,7 @@ impl LedgerSnapshot {
168165
impl Default for LedgerSnapshot {
169166
fn default() -> Self {
170167
Self {
171-
protocol_version: 22,
168+
protocol_version: 23,
172169
sequence_number: Default::default(),
173170
timestamp: Default::default(),
174171
network_id: Default::default(),

soroban-sdk/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ soroban-env-guest = { workspace = true }
2727

2828
[target.'cfg(not(target_family="wasm"))'.dependencies]
2929
soroban-env-host = { workspace = true, features = [] }
30-
soroban-ledger-snapshot = { workspace = true }
30+
soroban-ledger-snapshot = { workspace = true, optional = true }
3131
stellar-strkey = { workspace = true }
3232
arbitrary = { version = "~1.3.0", features = ["derive"], optional = true }
3333
derive_arbitrary = { version = "~1.3.0", optional = true }
@@ -44,6 +44,7 @@ soroban-sdk-macros = { workspace = true, features = ["testutils"] }
4444
soroban-env-host = { workspace = true, features = ["testutils"] }
4545
stellar-xdr = { workspace = true, features = ["curr", "std"] }
4646
soroban-spec = { workspace = true }
47+
soroban-ledger-snapshot = { workspace = true }
4748
ed25519-dalek = "2.0.0"
4849
rand = "0.8.5"
4950
ctor = "0.2.9"
@@ -57,7 +58,7 @@ expect-test = "1.4.1"
5758

5859
[features]
5960
alloc = []
60-
testutils = ["soroban-sdk-macros/testutils", "soroban-env-host/testutils", "dep:ed25519-dalek", "dep:arbitrary", "dep:derive_arbitrary", "dep:ctor"]
61+
testutils = ["soroban-sdk-macros/testutils", "soroban-env-host/testutils", "dep:ed25519-dalek", "dep:arbitrary", "dep:derive_arbitrary", "dep:ctor", "dep:soroban-ledger-snapshot"]
6162
hazmat = []
6263
docs = []
6364

soroban-sdk/src/address.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,15 @@ impl Debug for Address {
5151
let strkey = Strkey::PublicKeyEd25519(ed25519::PublicKey(ed25519));
5252
write!(f, "AccountId({})", strkey.to_string())?;
5353
}
54-
xdr::ScAddress::Contract(contract_id) => {
54+
xdr::ScAddress::Contract(xdr::ContractId(contract_id)) => {
5555
let strkey = Strkey::Contract(Contract(contract_id.0));
5656
write!(f, "Contract({})", strkey.to_string())?;
5757
}
58+
ScAddress::MuxedAccount(_)
59+
| ScAddress::ClaimableBalance(_)
60+
| ScAddress::LiquidityPool(_) => {
61+
return Err(core::fmt::Error);
62+
}
5863
}
5964
} else {
6065
return Err(core::fmt::Error);
@@ -316,7 +321,7 @@ impl Address {
316321
}
317322

318323
#[cfg(any(not(target_family = "wasm"), test, feature = "testutils"))]
319-
use crate::env::xdr::Hash;
324+
use crate::env::xdr::{ContractId, Hash};
320325
use crate::unwrap::UnwrapOptimized;
321326

322327
#[cfg(any(test, feature = "testutils"))]
@@ -325,15 +330,15 @@ impl crate::testutils::Address for Address {
325330
fn generate(env: &Env) -> Self {
326331
Self::try_from_val(
327332
env,
328-
&ScAddress::Contract(Hash(env.with_generator(|mut g| g.address()))),
333+
&ScAddress::Contract(ContractId(Hash(env.with_generator(|mut g| g.address())))),
329334
)
330335
.unwrap()
331336
}
332337
}
333338

334339
#[cfg(not(target_family = "wasm"))]
335340
impl Address {
336-
pub(crate) fn contract_id(&self) -> Hash {
341+
pub(crate) fn contract_id(&self) -> ContractId {
337342
let sc_address: ScAddress = self.try_into().unwrap();
338343
if let ScAddress::Contract(c) = sc_address {
339344
c
@@ -343,6 +348,6 @@ impl Address {
343348
}
344349

345350
pub(crate) fn from_contract_id(env: &Env, contract_id: [u8; 32]) -> Self {
346-
Self::try_from_val(env, &ScAddress::Contract(Hash(contract_id))).unwrap()
351+
Self::try_from_val(env, &ScAddress::Contract(ContractId(Hash(contract_id)))).unwrap()
347352
}
348353
}

0 commit comments

Comments
 (0)