Skip to content

Commit 0ce1ae2

Browse files
committed
Han's comments
1 parent 56509eb commit 0ce1ae2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

rpc/events.go

+3
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,9 @@ func (h *Handler) sendReorg(w jsonrpc.Conn, reorg *sync.ReorgData, id uint64) er
372372
return err
373373
}
374374

375+
// SubscribeTxnStatus subscribes to status changes of a transaction. It checks for updates each time a new block is added.
376+
// Subsequent updates are sent only when the transaction status changes.
377+
// The optional block_id parameter is ignored, as status changes are not stored and historical data cannot be sent.
375378
func (h *Handler) SubscribeTxnStatus(ctx context.Context, txHash felt.Felt, _ *BlockID) (*SubscriptionID, *jsonrpc.Error) {
376379
var (
377380
lastKnownStatus, lastSendStatus *TransactionStatus

rpc/handlers.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func (h *Handler) Methods() ([]jsonrpc.Method, string) { //nolint: funlen
290290
},
291291
{
292292
Name: "starknet_getTransactionStatus",
293-
Params: []jsonrpc.Parameter{{Name: "transaction_hash"}},
293+
Params: []jsonrpc.Parameter{{Name: "transaction_hash"}, {Name: "block", Optional: true}},
294294
Handler: h.TransactionStatus,
295295
},
296296
{
@@ -339,7 +339,7 @@ func (h *Handler) Methods() ([]jsonrpc.Method, string) { //nolint: funlen
339339
},
340340
{
341341
Name: "starknet_subscribeTransactionStatus",
342-
Params: []jsonrpc.Parameter{{Name: "transaction_hash"}, {Name: "block"}},
342+
Params: []jsonrpc.Parameter{{Name: "transaction_hash"}, {Name: "block", Optional: true}},
343343
Handler: h.SubscribeTxnStatus,
344344
},
345345
{

0 commit comments

Comments
 (0)