Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 16 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 14 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,30 @@ soroban-token-spec = { version = "26.0.1", path = "soroban-token-spec" }
stellar-asset-spec = { version = "26.0.1", path = "stellar-asset-spec" }

[workspace.dependencies.soroban-env-common]
version = "=26.1.3"
# git = "https://github.com/stellar/rs-soroban-env"
# rev = "c0e58f94ff2983a09440cef6a54253349fd3c4db"
version = "=26.1.2"
git = "https://github.com/stellar/rs-soroban-env"
rev = "7fb0a840812fe8921bb48bebf7b4aa7160467ec8"

[workspace.dependencies.soroban-env-guest]
version = "=26.1.3"
# git = "https://github.com/stellar/rs-soroban-env"
# rev = "c0e58f94ff2983a09440cef6a54253349fd3c4db"
version = "=26.1.2"
git = "https://github.com/stellar/rs-soroban-env"
rev = "7fb0a840812fe8921bb48bebf7b4aa7160467ec8"

[workspace.dependencies.soroban-env-host]
version = "=26.1.3"
# git = "https://github.com/stellar/rs-soroban-env"
# rev = "c0e58f94ff2983a09440cef6a54253349fd3c4db"
version = "=26.1.2"
git = "https://github.com/stellar/rs-soroban-env"
rev = "7fb0a840812fe8921bb48bebf7b4aa7160467ec8"

[workspace.dependencies.stellar-strkey]
version = "=0.0.16"

# CAP-71 pre-release pin: per-cap-feature layout; "curr" feature no longer exists.
[workspace.dependencies.stellar-xdr]
version = "=26.0.1"
# git = "https://github.com/stellar/rs-stellar-xdr"
# rev = "dd7a165a193126fd37a751d867bee1cb8f3b55a6"
version = "=26.0.0"
git = "https://github.com/stellar/rs-stellar-xdr"
rev = "a749b69b3471aec0c20ec431b0297f3414d66421"
default-features = false
features = ["curr"]
features = ["cap_0071"]

#[patch.crates-io]
#soroban-env-common = { path = "../rs-soroban-env/soroban-env-common" }
Expand Down
2 changes: 1 addition & 1 deletion soroban-meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ edition = "2021"
rust-version.workspace = true

[dependencies]
stellar-xdr = { workspace = true, features = ["curr", "std"] }
stellar-xdr = { workspace = true, features = ["std"] }
thiserror = "1.0.32"
wasmparser = "0.116.1"
1 change: 0 additions & 1 deletion soroban-meta/src/read.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::io::Cursor;

use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{Limited, Limits, ReadXdr, ScMetaEntry};
use wasmparser::{BinaryReaderError, Parser, Payload};

Expand Down
2 changes: 1 addition & 1 deletion soroban-meta/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::read;
use std::fs;
use stellar_xdr::curr::{Limits, ScMetaEntry, ScMetaV0, StringM, WriteXdr};
use stellar_xdr::{Limits, ScMetaEntry, ScMetaV0, StringM, WriteXdr};

#[test]
fn test_from_wasm() {
Expand Down
2 changes: 1 addition & 1 deletion soroban-sdk-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ doctest = false
soroban-spec = { workspace = true }
soroban-spec-rust = { workspace = true }
soroban-env-common = { workspace = true }
stellar-xdr = { workspace = true, features = ["curr", "std"] }
stellar-xdr = { workspace = true, features = ["std"] }
syn = {version="2.0.77",features=["full"]}
quote = "1.0"
proc-macro2 = "1.0"
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk-macros/src/derive_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use syn::{
Visibility,
};

use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{
Error as XdrError, ScSpecEntry, ScSpecTypeDef, ScSpecUdtUnionCaseTupleV0, ScSpecUdtUnionCaseV0,
ScSpecUdtUnionCaseVoidV0, ScSpecUdtUnionV0, StringM, VecM, WriteXdr, SCSYMBOL_LIMIT,
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk-macros/src/derive_enum_int.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use itertools::MultiUnzip;
use proc_macro2::TokenStream as TokenStream2;
use quote::{format_ident, quote};
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{ScSpecUdtEnumV0, StringM};
use syn::{
ext::IdentExt as _, spanned::Spanned, Attribute, DataEnum, Error, ExprLit, Ident, Lit, Path,
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk-macros/src/derive_error_enum_int.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use itertools::MultiUnzip;
use proc_macro2::TokenStream as TokenStream2;
use quote::{format_ident, quote};
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{ScSpecEntry, ScSpecUdtErrorEnumCaseV0, ScSpecUdtErrorEnumV0, StringM, WriteXdr};
use syn::{
ext::IdentExt as _, spanned::Spanned, Attribute, DataEnum, Error, ExprLit, Ident, Lit, Path,
Expand Down
2 changes: 1 addition & 1 deletion soroban-sdk-macros/src/derive_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use heck::ToSnakeCase;
use proc_macro2::Span;
use proc_macro2::TokenStream as TokenStream2;
use quote::{format_ident, quote};
use stellar_xdr::curr::{
use stellar_xdr::{
ScSpecEntry, ScSpecEventDataFormat, ScSpecEventParamLocationV0, ScSpecEventParamV0,
ScSpecEventV0, ScSymbol, StringM, WriteXdr,
};
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk-macros/src/derive_spec_fn.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use proc_macro2::TokenStream as TokenStream2;
use quote::{format_ident, quote};
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{
ScSpecEntry, ScSpecFunctionInputV0, ScSpecFunctionV0, ScSpecTypeDef, ScSymbol, StringM,
WriteXdr, SCSYMBOL_LIMIT,
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk-macros/src/derive_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use proc_macro2::{Literal, TokenStream as TokenStream2};
use quote::{format_ident, quote};
use syn::{ext::IdentExt as _, Attribute, DataStruct, Error, Ident, Path, Visibility};

use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{
ScSpecEntry, ScSpecTypeDef, ScSpecUdtStructFieldV0, ScSpecUdtStructV0, StringM, WriteXdr,
};
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk-macros/src/derive_struct_tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use proc_macro2::{Literal, TokenStream as TokenStream2};
use quote::{format_ident, quote};
use syn::{ext::IdentExt as _, Attribute, DataStruct, Error, Ident, Path, Visibility};

use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{
ScSpecEntry, ScSpecTypeDef, ScSpecUdtStructFieldV0, ScSpecUdtStructV0, StringM, WriteXdr,
};
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk-macros/src/doc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use itertools::Itertools;
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::StringM;
use syn::{Attribute, Expr, ExprLit, Lit, Meta, MetaNameValue};

Expand Down
2 changes: 1 addition & 1 deletion soroban-sdk-macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use stellar_xdr;
extern crate proc_macro;

mod arbitrary;
Expand Down Expand Up @@ -54,7 +55,6 @@ use syn_ext::HasFnsItem;

use soroban_spec_rust::{generate_from_wasm_with_options, GenerateFromFileError, GenerateOptions};

use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{Limits, ScMetaEntry, ScMetaV0, StringM, WriteXdr};

pub(crate) const DEFAULT_XDR_RW_LIMITS: Limits = Limits {
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk-macros/src/map_type.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use quote::ToTokens;
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{
ScSpecTypeBytesN, ScSpecTypeDef, ScSpecTypeMap, ScSpecTypeOption, ScSpecTypeResult,
ScSpecTypeTuple, ScSpecTypeUdt, ScSpecTypeVec,
Expand Down
2 changes: 1 addition & 1 deletion soroban-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ctor = { version = "0.5.0", optional = true }
soroban-sdk-macros = { workspace = true, features = ["testutils"] }
soroban-env-host = { workspace = true, features = ["testutils"] }
soroban-ledger-snapshot = { workspace = true, features = ["testutils"] }
stellar-xdr = { workspace = true, features = ["curr", "std"] }
stellar-xdr = { workspace = true, features = ["std"] }
soroban-spec = { workspace = true }
ed25519-dalek = "2.0.0"
rand = "0.8.5"
Expand Down
14 changes: 14 additions & 0 deletions soroban-sdk/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,20 @@ impl Address {
self.env.require_auth(self);
}

/// Delegates the current `__check_auth` authorization to the provided
/// `address`. CAP-71-01: must be called from inside a custom account's
/// `__check_auth`. The host requires `address` to have authorized the same
/// call tree (same signature payload + context) via the auth entry's
/// delegate signatures.
///
/// ### Panics
///
/// If called outside of `__check_auth`, or if `address` has not
/// authorized this invocation.
pub fn delegate_account_auth(&self) {
self.env.delegate_account_auth(self);
}

/// Creates an `Address` corresponding to the provided Stellar strkey.
///
/// The only supported strkey types are account keys (`G...`) and contract keys (`C...`). Any
Expand Down
5 changes: 5 additions & 0 deletions soroban-sdk/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,11 @@ impl Env {
internal::Env::require_auth(self, address.to_object()).unwrap_infallible();
}

#[doc(hidden)]
pub(crate) fn delegate_account_auth(&self, address: &Address) {
internal::Env::delegate_account_auth(self, address.to_object()).unwrap_infallible();
}

/// Invokes a function of a contract that is registered in the [Env].
///
/// # Panics
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk/src/tests/contract_add_i32.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate as soroban_sdk;
use soroban_sdk::{contract, contractimpl, Env};
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{
Limits, ReadXdr, ScSpecEntry, ScSpecFunctionInputV0, ScSpecFunctionV0, ScSpecTypeDef,
};
Expand Down
18 changes: 6 additions & 12 deletions soroban-sdk/src/tests/contract_docs.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
mod fn_ {
use crate as soroban_sdk;
use soroban_sdk::{contract, contractimpl, Env};
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{Limits, ReadXdr, ScSpecEntry, ScSpecFunctionV0};
use stellar_xdr::{Limits, ReadXdr, ScSpecEntry, ScSpecFunctionV0};

#[contract]
pub struct Contract;
Expand Down Expand Up @@ -39,8 +38,7 @@ mod fn_ {
mod struct_ {
use crate as soroban_sdk;
use soroban_sdk::contracttype;
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{Limits, ReadXdr, ScSpecEntry, ScSpecUdtStructFieldV0, ScSpecUdtStructV0};
use stellar_xdr::{Limits, ReadXdr, ScSpecEntry, ScSpecUdtStructFieldV0, ScSpecUdtStructV0};

/// S holds a and
// TODO: Implement.
Expand Down Expand Up @@ -83,8 +81,7 @@ mod struct_ {
mod struct_tuple {
use crate as soroban_sdk;
use soroban_sdk::contracttype;
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{Limits, ReadXdr, ScSpecEntry, ScSpecUdtStructFieldV0, ScSpecUdtStructV0};
use stellar_xdr::{Limits, ReadXdr, ScSpecEntry, ScSpecUdtStructFieldV0, ScSpecUdtStructV0};

/// S holds two u64s.
#[contracttype]
Expand Down Expand Up @@ -125,8 +122,7 @@ mod struct_tuple {
mod enum_ {
use crate as soroban_sdk;
use soroban_sdk::contracttype;
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{
use stellar_xdr::{
Limits, ReadXdr, ScSpecEntry, ScSpecUdtUnionCaseTupleV0, ScSpecUdtUnionCaseV0,
ScSpecUdtUnionCaseVoidV0, ScSpecUdtUnionV0,
};
Expand Down Expand Up @@ -177,8 +173,7 @@ mod enum_ {
mod enum_int {
use crate as soroban_sdk;
use soroban_sdk::contracttype;
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{Limits, ReadXdr, ScSpecEntry, ScSpecUdtEnumCaseV0, ScSpecUdtEnumV0};
use stellar_xdr::{Limits, ReadXdr, ScSpecEntry, ScSpecUdtEnumCaseV0, ScSpecUdtEnumV0};

/// E has variants A and B.
#[contracttype]
Expand Down Expand Up @@ -220,8 +215,7 @@ mod enum_int {
mod enum_error_int {
use crate as soroban_sdk;
use soroban_sdk::contracterror;
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{
use stellar_xdr::{
Limits, ReadXdr, ScSpecEntry, ScSpecUdtErrorEnumCaseV0, ScSpecUdtErrorEnumV0,
};

Expand Down
1 change: 0 additions & 1 deletion soroban-sdk/src/tests/contract_fn.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate as soroban_sdk;
use soroban_sdk::{contract, contractimpl, Env};
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{
Limits, ReadXdr, ScSpecEntry, ScSpecFunctionInputV0, ScSpecFunctionV0, ScSpecTypeDef,
ScSpecTypeTuple,
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk/src/tests/contract_meta.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate as soroban_sdk;
use soroban_sdk::contractmeta;
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{Limits, ReadXdr, ScMetaEntry, ScMetaV0};

#[test]
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk/src/tests/contract_udt_raw_identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use soroban_sdk::{
contract, contracterror, contractevent, contractimpl, contracttrait, contracttype,
testutils::Events as _, Env,
};
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{
Limits, ReadXdr, ScSpecEntry, ScSpecEventDataFormat, ScSpecEventParamLocationV0,
ScSpecEventParamV0, ScSpecEventV0, ScSpecFunctionInputV0, ScSpecFunctionV0, ScSpecTypeDef,
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk/src/tests/contract_udt_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use soroban_sdk::{
contract, contractimpl, contracttype, map, symbol_short, ConversionError, Env, IntoVal,
TryFromVal, Val,
};
use stellar_xdr::curr as stellar_xdr;
use stellar_xdr::{
Limits, ReadXdr, ScSpecEntry, ScSpecFunctionInputV0, ScSpecFunctionV0, ScSpecTypeDef,
ScSpecTypeTuple, ScSpecTypeUdt,
Expand Down
Loading
Loading