Skip to content

Commit adf31b2

Browse files
committed
Bump XDR and env to v23.0.0-rc.1.
This is a minimum necessary SDK change to support protocol 23.
1 parent f46e9e0 commit adf31b2

File tree

7 files changed

+98
-51
lines changed

7 files changed

+98
-51
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 4 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"
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"
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"
3838
#git = "https://github.com/stellar/rs-soroban-env"
3939
#rev = "bd0c80a1fe171e75f8d745f17975a73927d44ecd"
4040

4141
[workspace.dependencies.stellar-strkey]
4242
version = "=0.0.9"
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-sdk/src/address.rs

Lines changed: 9 additions & 4 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"))]
@@ -333,7 +338,7 @@ impl crate::testutils::Address for Address {
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
}

soroban-sdk/src/env.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ use crate::{
122122
};
123123
use internal::{
124124
AddressObject, Bool, BytesObject, DurationObject, I128Object, I256Object, I256Val, I64Object,
125-
StorageType, StringObject, Symbol, SymbolObject, TimepointObject, U128Object, U256Object,
126-
U256Val, U32Val, U64Object, U64Val, Void,
125+
MuxedAddressObject, StorageType, StringObject, Symbol, SymbolObject, TimepointObject,
126+
U128Object, U256Object, U256Val, U32Val, U64Object, U64Val, Void,
127127
};
128128

129129
#[doc(hidden)]
@@ -447,6 +447,12 @@ impl Env {
447447
pub fn logs(&self) -> Logs {
448448
Logs::new(self)
449449
}
450+
451+
pub(crate) fn check_same_env(&self, other: &Self) {
452+
self.env_impl
453+
.check_same_env(&other.env_impl)
454+
.unwrap_optimized()
455+
}
450456
}
451457

452458
#[doc(hidden)]
@@ -1812,13 +1818,6 @@ impl internal::EnvBase for Env {
18121818
match e {}
18131819
}
18141820

1815-
fn check_same_env(&self, other: &Self) -> Result<(), Self::Error> {
1816-
Ok(self
1817-
.env_impl
1818-
.check_same_env(&other.env_impl)
1819-
.unwrap_optimized())
1820-
}
1821-
18221821
fn bytes_copy_from_slice(
18231822
&self,
18241823
b: BytesObject,

0 commit comments

Comments
 (0)