@@ -16,7 +16,7 @@ use commonware_cryptography::{
1616} ;
1717use commonware_macros:: select;
1818use commonware_p2p:: Recipients ;
19- use commonware_runtime:: { Clock , Handle , Metrics , Spawner } ;
19+ use commonware_runtime:: { ContextCell , spawn_cell , Clock , Handle , Metrics , Spawner } ;
2020use commonware_utils:: futures:: { AbortablePool , Aborter } ;
2121use futures:: {
2222 channel:: { mpsc, oneshot} ,
7575 P : PublicKey ,
7676{
7777 /// Context held by the actor.
78- context : E ,
78+ context : ContextCell < E > ,
7979
8080 /// Receiver for incoming messages to the actor.
8181 mailbox : mpsc:: Receiver < Message < V , B , S , P > > ,
@@ -126,7 +126,7 @@ where
126126 let ( sender, mailbox) = mpsc:: channel ( 1000 ) ;
127127 (
128128 Self {
129- context,
129+ context : ContextCell :: new ( context ) ,
130130 mailbox,
131131 buffer,
132132 block_codec_cfg,
@@ -141,7 +141,7 @@ where
141141
142142 /// Start the actor.
143143 pub fn start ( mut self ) -> Handle < ( ) > {
144- self . context . spawn_ref ( ) ( self . run ( ) )
144+ spawn_cell ! ( self . context, self . run( ) . await )
145145 }
146146
147147 /// Run the shard actor.
0 commit comments