@@ -63,7 +63,7 @@ type ServiceClient struct {
6363 trackedRuntimes map [common.Namespace ]* trackedRuntime
6464}
6565
66- // Implements api.Backend.
66+ // GetGenesisBlock implements api.Backend.
6767func (sc * ServiceClient ) GetGenesisBlock (ctx context.Context , request * api.RuntimeRequest ) (* block.Block , error ) {
6868 // First check if we have the genesis blocks cached. They are immutable so easy
6969 // to cache to avoid repeated requests to the CometBFT app.
@@ -92,7 +92,7 @@ func (sc *ServiceClient) GetGenesisBlock(ctx context.Context, request *api.Runti
9292 return blk , nil
9393}
9494
95- // Implements api.Backend.
95+ // GetLatestBlock implements api.Backend.
9696func (sc * ServiceClient ) GetLatestBlock (ctx context.Context , request * api.RuntimeRequest ) (* block.Block , error ) {
9797 return sc .getLatestBlockAt (ctx , request .RuntimeID , request .Height )
9898}
@@ -106,7 +106,7 @@ func (sc *ServiceClient) getLatestBlockAt(ctx context.Context, runtimeID common.
106106 return q .LatestBlock (ctx , runtimeID )
107107}
108108
109- // Implements api.Backend.
109+ // GetRuntimeState implements api.Backend.
110110func (sc * ServiceClient ) GetRuntimeState (ctx context.Context , request * api.RuntimeRequest ) (* api.RuntimeState , error ) {
111111 q , err := sc .querier .QueryAt (ctx , request .Height )
112112 if err != nil {
@@ -116,7 +116,7 @@ func (sc *ServiceClient) GetRuntimeState(ctx context.Context, request *api.Runti
116116 return q .RuntimeState (ctx , request .RuntimeID )
117117}
118118
119- // Implements api.Backend.
119+ // GetLastRoundResults implements api.Backend.
120120func (sc * ServiceClient ) GetLastRoundResults (ctx context.Context , request * api.RuntimeRequest ) (* api.RoundResults , error ) {
121121 q , err := sc .querier .QueryAt (ctx , request .Height )
122122 if err != nil {
@@ -144,7 +144,7 @@ func (sc *ServiceClient) GetPastRoundRoots(ctx context.Context, request *api.Run
144144 return q .PastRoundRoots (ctx , request .RuntimeID )
145145}
146146
147- // Implements api.Backend.
147+ // GetIncomingMessageQueueMeta implements api.Backend.
148148func (sc * ServiceClient ) GetIncomingMessageQueueMeta (ctx context.Context , request * api.RuntimeRequest ) (* message.IncomingMessageQueueMeta , error ) {
149149 q , err := sc .querier .QueryAt (ctx , request .Height )
150150 if err != nil {
@@ -154,7 +154,7 @@ func (sc *ServiceClient) GetIncomingMessageQueueMeta(ctx context.Context, reques
154154 return q .IncomingMessageQueueMeta (ctx , request .RuntimeID )
155155}
156156
157- // Implements api.Backend.
157+ // GetIncomingMessageQueue implements api.Backend.
158158func (sc * ServiceClient ) GetIncomingMessageQueue (ctx context.Context , request * api.InMessageQueueRequest ) ([]* message.IncomingMessage , error ) {
159159 q , err := sc .querier .QueryAt (ctx , request .Height )
160160 if err != nil {
@@ -164,7 +164,7 @@ func (sc *ServiceClient) GetIncomingMessageQueue(ctx context.Context, request *a
164164 return q .IncomingMessageQueue (ctx , request .RuntimeID , request .Offset , request .Limit )
165165}
166166
167- // Implements api.Backend.
167+ // WatchBlocks implements api.Backend.
168168func (sc * ServiceClient ) WatchBlocks (_ context.Context , id common.Namespace ) (<- chan * api.AnnotatedBlock , pubsub.ClosableSubscription , error ) {
169169 notifiers := sc .getRuntimeNotifiers (id )
170170 sub := notifiers .blockNotifier .Subscribe ()
@@ -183,7 +183,7 @@ func (sc *ServiceClient) WatchAllBlocks() (<-chan *block.Block, *pubsub.Subscrip
183183 return ch , sub
184184}
185185
186- // Implements api.Backend.
186+ // WatchEvents implements api.Backend.
187187func (sc * ServiceClient ) WatchEvents (_ context.Context , id common.Namespace ) (<- chan * api.Event , pubsub.ClosableSubscription , error ) {
188188 notifiers := sc .getRuntimeNotifiers (id )
189189 sub := notifiers .eventNotifier .Subscribe ()
@@ -194,7 +194,7 @@ func (sc *ServiceClient) WatchEvents(_ context.Context, id common.Namespace) (<-
194194 return ch , sub , nil
195195}
196196
197- // Implements api.Backend.
197+ // WatchExecutorCommitments implements api.Backend.
198198func (sc * ServiceClient ) WatchExecutorCommitments (_ context.Context , id common.Namespace ) (<- chan * commitment.ExecutorCommitment , pubsub.ClosableSubscription , error ) {
199199 notifiers := sc .getRuntimeNotifiers (id )
200200 sub := notifiers .ecNotifier .Subscribe ()
@@ -226,7 +226,7 @@ func (sc *ServiceClient) trackRuntime(id common.Namespace) {
226226 sc .queryCh <- app .QueryForRuntime (id )
227227}
228228
229- // Implements api.Backend.
229+ // StateToGenesis implements api.Backend.
230230func (sc * ServiceClient ) StateToGenesis (ctx context.Context , height int64 ) (* api.Genesis , error ) {
231231 q , err := sc .querier .QueryAt (ctx , height )
232232 if err != nil {
@@ -291,7 +291,7 @@ func (sc *ServiceClient) getEvents(ctx context.Context, height int64, txns [][]b
291291 return events , nil
292292}
293293
294- // Implements api.Backend.
294+ // GetEvents implements api.Backend.
295295func (sc * ServiceClient ) GetEvents (ctx context.Context , height int64 ) ([]* api.Event , error ) {
296296 // Get transactions at given height.
297297 txns , err := sc .backend .GetTransactions (ctx , height )
@@ -306,7 +306,7 @@ func (sc *ServiceClient) GetEvents(ctx context.Context, height int64) ([]*api.Ev
306306 return sc .getEvents (ctx , height , txns )
307307}
308308
309- // Implements api.Backend.
309+ // Cleanup implements api.Backend.
310310func (sc * ServiceClient ) Cleanup () {
311311}
312312
@@ -327,12 +327,12 @@ func (sc *ServiceClient) getRuntimeNotifiers(id common.Namespace) *runtimeBroker
327327 return notifiers
328328}
329329
330- // Implements api.ServiceClient.
330+ // ServiceDescriptor implements api.ServiceClient.
331331func (sc * ServiceClient ) ServiceDescriptor () tmapi.ServiceDescriptor {
332332 return tmapi .NewServiceDescriptor (api .ModuleName , app .EventType , sc .queryCh )
333333}
334334
335- // Implements api.ServiceClient.
335+ // DeliverBlock implements api.ServiceClient.
336336func (sc * ServiceClient ) DeliverBlock (ctx context.Context , blk * cmttypes.Block ) error {
337337 sc .mu .RLock ()
338338 trs := slices .Collect (maps .Values (sc .trackedRuntimes ))
@@ -373,7 +373,7 @@ func (sc *ServiceClient) DeliverBlock(ctx context.Context, blk *cmttypes.Block)
373373 return nil
374374}
375375
376- // Implements api.ServiceClient.
376+ // DeliverEvent implements api.ServiceClient.
377377func (sc * ServiceClient ) DeliverEvent (ctx context.Context , height int64 , tx cmttypes.Tx , ev * cmtabcitypes.Event ) error {
378378 events , err := EventsFromCometBFT (tx , height , []cmtabcitypes.Event {* ev })
379379 if err != nil {
@@ -496,7 +496,7 @@ func (sc *ServiceClient) fetchBlock(ctx context.Context, runtimeID common.Namesp
496496 }, nil
497497}
498498
499- // Implements api.ExecutorCommitmentNotifier.
499+ // DeliverExecutorCommitment implements api.ExecutorCommitmentNotifier.
500500func (sc * ServiceClient ) DeliverExecutorCommitment (runtimeID common.Namespace , ec * commitment.ExecutorCommitment ) {
501501 notifiers := sc .getRuntimeNotifiers (runtimeID )
502502 notifiers .ecNotifier .Broadcast (ec )
0 commit comments