Skip to content

Commit 4b7e299

Browse files
mootz12sisureshCopilotclaudedmkozh
authored
Remove deprecated token event format from soroban-token-sdk (#1822)
### What Removes the deprecated event format from the `soroban-token-sdk`. These were originally deprecated for the v23 release. ### Why Closes #1775 ### Known limitations None --------- Co-authored-by: Siddharth Suresh <siddharth@stellar.org> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sisuresh <5050166+sisuresh@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Dmytro Kozhevin <dmytro@stellar.org> Co-authored-by: Jay Geng <jay@stellar.org>
1 parent 8ce917a commit 4b7e299

File tree

5 files changed

+15
-80
lines changed

5 files changed

+15
-80
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ concurrency:
1212

1313
env:
1414
ARTIFACT_RETENTION_DAYS_FOR_TEST_WASMS: 7
15+
SOROBAN_SDK_BUILD_SYSTEM_SUPPORTS_SPEC_SHAKING_V2: 1
1516

1617
defaults:
1718
run:

soroban-token-sdk/src/_migrating.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//! # Migrating from v23 to v26
2+
//!
3+
//! 1. Remove the deprecated event format. For details, see the [migration guide for v23 contract events].
4+
//! And for an example using the `soroban_token_sdk` directly, see the [migration guide for v23 token transfer][v23_token_transfer].
5+
//!
6+
//! [migration guide for v23 contract events]: soroban_sdk::_migrating::v23_contractevent
7+
//!
18
//! # Migrating from v22 to v23
29
//!
310
//! 1. [`MuxedAddress` replaces `Address` as the `to` of the `TokenInterface::transfer`][v23_token_transfer]

soroban-token-sdk/src/_migrating/v23_token_transfer.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
//! the exchange deposits for the token contracts, but is necessary for that.
1717
//!
1818
//! The necessary token modification is very minimal. Consider the following
19-
//! `transfer` implementation that still uses `Address` destination:
19+
//! `transfer` implementation that still uses `Address` destination. Note that
20+
//! this example will only compile pre-v26 because the old event publishing
21+
//! helper used below is no longer available. If you are using v26 or later,
22+
//! use the updated implementation shown in the next code snippet.
2023
//!
21-
//! ```
24+
//! ```compile_fail
2225
//! use soroban_sdk::{Env, Address};
2326
//! use soroban_token_sdk::TokenUtils;
2427
//! // ... inside some token contract ...
@@ -27,7 +30,8 @@
2730
//! from.require_auth();
2831
//! // Token-specific implementation of balance movement.
2932
//! token_impl::move_balance(&env, &from, &to, amount);
30-
//! // Publish the event.
33+
//! // Publish the event using the pre-v26 helper API.
34+
//! // In v26+, use the event type from `soroban_token_sdk::events` instead.
3135
//! TokenUtils::new(&env).events().transfer(from, to, amount);
3236
//! }
3337
//!

soroban-token-sdk/src/event.rs

Lines changed: 0 additions & 71 deletions
This file was deleted.

soroban-token-sdk/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
#![cfg_attr(feature = "docs", feature(doc_cfg))]
33
pub mod _migrating;
44

5-
use crate::event::Events;
65
use crate::metadata::Metadata;
76
use soroban_sdk::Env;
87

9-
pub mod event;
108
pub mod events;
119
pub mod metadata;
1210
mod tests;
@@ -23,8 +21,4 @@ impl TokenUtils {
2321
pub fn metadata(&self) -> Metadata {
2422
Metadata::new(&self.0)
2523
}
26-
27-
pub fn events(&self) -> Events {
28-
Events::new(&self.0)
29-
}
3024
}

0 commit comments

Comments
 (0)