Skip to content

Commit 572b293

Browse files
authored
Remove event subscription functions from contract runtime. (#3725)
## Motivation In #3692 I added basic user events, but subscriptions are not implemented yet. However, I optimistically added the contract runtime functions for subscriptions in that PR, too, so they are now user-visible but don't work yet. ## Proposal Remove them from the contract runtime, so that if we release a new SDK, they don't show up yet. ## Test Plan CI ## Release Plan - Nothing to do / These changes follow the usual release cycle. ## Links - Reverts a few lines of #3692. - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 93826ce commit 572b293

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

linera-sdk/src/contract/runtime.rs

-20
Original file line numberDiff line numberDiff line change
@@ -296,26 +296,6 @@ where
296296
bcs::from_bytes(&event).expect("Failed to deserialize event")
297297
}
298298

299-
/// Subscribes this application to an event stream.
300-
pub fn subscribe_to_events(
301-
&mut self,
302-
chain_id: ChainId,
303-
application_id: ApplicationId,
304-
name: StreamName,
305-
) {
306-
contract_wit::subscribe_to_events(chain_id.into(), application_id.into(), &name.into())
307-
}
308-
309-
/// Unsubscribes this application from an event stream.
310-
pub fn unsubscribe_from_events(
311-
&mut self,
312-
chain_id: ChainId,
313-
application_id: ApplicationId,
314-
name: StreamName,
315-
) {
316-
contract_wit::unsubscribe_from_events(chain_id.into(), application_id.into(), &name.into())
317-
}
318-
319299
/// Queries an application service as an oracle and returns the response.
320300
///
321301
/// Should only be used with queries where it is very likely that all validators will compute

linera-sdk/src/contract/test_runtime.rs

-20
Original file line numberDiff line numberDiff line change
@@ -840,26 +840,6 @@ where
840840
bcs::from_bytes(value).expect("Failed to deserialize event value")
841841
}
842842

843-
/// Subscribes this application to an event stream.
844-
pub fn subscribe_to_events(
845-
&mut self,
846-
_chain_id: ChainId,
847-
_application_id: ApplicationId,
848-
_name: StreamName,
849-
) {
850-
// This is a no-op in the mock runtime.
851-
}
852-
853-
/// Unsubscribes this application from an event stream.
854-
pub fn unsubscribe_from_events(
855-
&mut self,
856-
_chain_id: ChainId,
857-
_application_id: ApplicationId,
858-
_name: StreamName,
859-
) {
860-
// This is a no-op in the mock runtime.
861-
}
862-
863843
/// Adds an expected `query_service` call`, and the response it should return in the test.
864844
pub fn add_expected_service_query<A: ServiceAbi + Send>(
865845
&mut self,

0 commit comments

Comments
 (0)