diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index ccc0c3c7a7..bb3de426fb 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1691,8 +1691,8 @@ func (api *TransactionAPI) SendRawTransactionSync(ctx context.Context, input hex } // Subscribe to receipt stream (filtered to this tx) - rcpts := make(chan []*ReceiptWithTx, 1) - sub := api.b.SubscribeTransactionReceipts([]common.Hash{hash}, rcpts) + receipts := make(chan []*ReceiptWithTx, 1) + sub := api.b.SubscribeTransactionReceipts([]common.Hash{hash}, receipts) defer sub.Unsubscribe() subErrCh := sub.Err() @@ -1717,7 +1717,7 @@ func (api *TransactionAPI) SendRawTransactionSync(ctx context.Context, input hex } return nil, err - case batch := <-rcpts: + case batch := <-receipts: for _, rwt := range batch { if rwt == nil || rwt.Receipt == nil || rwt.Receipt.TxHash != hash { continue diff --git a/internal/ethapi/api_test.go b/internal/ethapi/api_test.go index 94d9982a83..c6da3669a8 100644 --- a/internal/ethapi/api_test.go +++ b/internal/ethapi/api_test.go @@ -443,7 +443,6 @@ type testBackend struct { // test-only fields for SendRawTransactionSync receiptsFeed *event.Feed - headFeed *event.Feed // keep if other tests use it; otherwise remove autoMine bool sentTx *types.Transaction @@ -481,7 +480,6 @@ func newTestBackend(t *testing.T, n int, gspec *core.Genesis, engine consensus.E acc: acc, pending: blocks[n], pendingReceipts: receipts[n], - headFeed: new(event.Feed), receiptsFeed: new(event.Feed), } return backend @@ -607,7 +605,7 @@ func (b testBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscr panic("implement me") } func (b testBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription { - return b.headFeed.Subscribe(ch) + panic("implement me") } func (b *testBackend) SendTx(ctx context.Context, tx *types.Transaction) error { b.sentTx = tx