Skip to content

Commit f188304

Browse files
committed
Muxed address support sketch for Soroban SDK.
This introduces the `MuxedAddress` type that maps to either `AddressObject` or `MuxedAddressObject`. In order to not 'leak' the muxed addresses everywhere (as they have pretty narrow use cases), introduce a separate token interface that supports muxed addresses for transfer (could also support e.g. transfer_from). This is basically token extension, but a bit clunkier due to the lack of overload support. The amount of copy-paste could be reduced though with some code generation (I'm not sure that's necessary though). Also only expose muxed addresses to generate clients when that's explicitly requested, as again users normally don't need to worry about them.
1 parent 211569a commit f188304

File tree

107 files changed

+937
-368
lines changed

Some content is hidden

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

107 files changed

+937
-368
lines changed

Cargo.lock

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

Cargo.toml

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

2626
[workspace.dependencies.soroban-env-common]
27-
version = "=22.1.3"
27+
version = "=23.0.0"
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"
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"
3838
#git = "https://github.com/stellar/rs-soroban-env"
3939
#rev = "bd0c80a1fe171e75f8d745f17975a73927d44ecd"
4040

@@ -44,16 +44,19 @@ version = "=0.0.9"
4444
[workspace.dependencies.stellar-xdr]
4545
version = "=22.1.0"
4646
default-features = false
47-
features = ["curr"]
47+
features = ["next"]
4848
#git = "https://github.com/stellar/rs-stellar-xdr"
4949
#rev = "67be5955a15f1d3a4df83fe86e6ae107f687141b"
5050

51-
#[patch.crates-io]
52-
#soroban-env-common = { path = "../rs-soroban-env/soroban-env-common" }
53-
#soroban-env-guest = { path = "../rs-soroban-env/soroban-env-guest" }
54-
#soroban-env-host = { path = "../rs-soroban-env/soroban-env-host" }
55-
#[patch."https://github.com/stellar/rs-stellar-xdr"]
56-
#stellar-xdr = { path = "../rs-stellar-xdr/" }
51+
[patch.crates-io]
52+
#[patch."https://github.com/stellar/rs-soroban-env"]
53+
soroban-env-common = { path = "../rs-soroban-env2/soroban-env-common" }
54+
soroban-env-guest = { path = "../rs-soroban-env2/soroban-env-guest" }
55+
soroban-env-host = { path = "../rs-soroban-env2/soroban-env-host" }
56+
stellar-xdr = { path = "../rs-stellar-xdr/" }
57+
58+
[patch."https://github.com/stellar/rs-stellar-xdr"]
59+
stellar-xdr = { path = "../rs-stellar-xdr/" }
5760

5861
[profile.dev]
5962
overflow-checks = true

soroban-sdk-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ crate-git-revision = "0.0.6"
2222
soroban-spec = { workspace = true }
2323
soroban-spec-rust = { workspace = true }
2424
soroban-env-common = { workspace = true }
25-
stellar-xdr = { workspace = true, features = ["curr", "std"] }
25+
stellar-xdr = { workspace = true, features = ["next", "std"] }
2626
syn = {version="2.0.77",features=["full"]}
2727
quote = "1.0"
2828
proc-macro2 = "1.0"

soroban-sdk-macros/src/derive_enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use proc_macro2::{Literal, TokenStream as TokenStream2};
33
use quote::{format_ident, quote};
44
use syn::{spanned::Spanned, Attribute, DataEnum, Error, Fields, Ident, Path, Visibility};
55

6-
use stellar_xdr::curr as stellar_xdr;
6+
use stellar_xdr::next as stellar_xdr;
77
use stellar_xdr::{
88
Error as XdrError, ScSpecEntry, ScSpecTypeDef, ScSpecUdtUnionCaseTupleV0, ScSpecUdtUnionCaseV0,
99
ScSpecUdtUnionCaseVoidV0, ScSpecUdtUnionV0, StringM, VecM, WriteXdr, SCSYMBOL_LIMIT,

soroban-sdk-macros/src/derive_enum_int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use itertools::MultiUnzip;
22
use proc_macro2::TokenStream as TokenStream2;
33
use quote::{format_ident, quote};
4-
use stellar_xdr::curr as stellar_xdr;
4+
use stellar_xdr::next as stellar_xdr;
55
use stellar_xdr::{ScSpecUdtEnumV0, StringM};
66
use syn::{spanned::Spanned, Attribute, DataEnum, Error, ExprLit, Ident, Lit, Path, Visibility};
77

soroban-sdk-macros/src/derive_error_enum_int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use itertools::MultiUnzip;
22
use proc_macro2::TokenStream as TokenStream2;
33
use quote::{format_ident, quote};
4-
use stellar_xdr::curr as stellar_xdr;
4+
use stellar_xdr::next as stellar_xdr;
55
use stellar_xdr::{ScSpecEntry, ScSpecUdtErrorEnumCaseV0, ScSpecUdtErrorEnumV0, StringM, WriteXdr};
66
use syn::{spanned::Spanned, Attribute, DataEnum, Error, ExprLit, Ident, Lit, Path};
77

soroban-sdk-macros/src/derive_spec_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use proc_macro2::TokenStream as TokenStream2;
22
use quote::{format_ident, quote};
3-
use stellar_xdr::curr as stellar_xdr;
3+
use stellar_xdr::next as stellar_xdr;
44
use stellar_xdr::{
55
ScSpecEntry, ScSpecFunctionInputV0, ScSpecFunctionV0, ScSpecTypeDef, ScSymbol, StringM, VecM,
66
WriteXdr, SCSYMBOL_LIMIT,

soroban-sdk-macros/src/derive_struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use proc_macro2::{Literal, TokenStream as TokenStream2};
33
use quote::{format_ident, quote};
44
use syn::{Attribute, DataStruct, Error, Ident, Path, Visibility};
55

6-
use stellar_xdr::curr as stellar_xdr;
6+
use stellar_xdr::next as stellar_xdr;
77
use stellar_xdr::{
88
ScSpecEntry, ScSpecTypeDef, ScSpecUdtStructFieldV0, ScSpecUdtStructV0, StringM, WriteXdr,
99
};

soroban-sdk-macros/src/derive_struct_tuple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use proc_macro2::{Literal, TokenStream as TokenStream2};
33
use quote::{format_ident, quote};
44
use syn::{Attribute, DataStruct, Error, Ident, Path, Visibility};
55

6-
use stellar_xdr::curr as stellar_xdr;
6+
use stellar_xdr::next as stellar_xdr;
77
use stellar_xdr::{
88
ScSpecEntry, ScSpecTypeDef, ScSpecUdtStructFieldV0, ScSpecUdtStructV0, StringM, WriteXdr,
99
};

soroban-sdk-macros/src/doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use itertools::Itertools;
2-
use stellar_xdr::curr as stellar_xdr;
2+
use stellar_xdr::next as stellar_xdr;
33
use stellar_xdr::StringM;
44
use syn::{Attribute, Expr, ExprLit, Lit, Meta, MetaNameValue};
55

0 commit comments

Comments
 (0)