aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
Diffstat (limited to 'eth')
-rw-r--r--eth/api.go4
-rw-r--r--eth/downloader/api.go2
-rw-r--r--eth/filters/api.go2
3 files changed, 4 insertions, 4 deletions
diff --git a/eth/api.go b/eth/api.go
index 41387c27f..a0b1f8ac2 100644
--- a/eth/api.go
+++ b/eth/api.go
@@ -603,7 +603,7 @@ type NewBlocksArgs struct {
// NewBlocks triggers a new block event each time a block is appended to the chain. It accepts an argument which allows
// the caller to specify whether the output should contain transactions and in what format.
func (s *PublicBlockChainAPI) NewBlocks(ctx context.Context, args NewBlocksArgs) (rpc.Subscription, error) {
- notifier, supported := ctx.Value(rpc.NotifierContextKey).(rpc.Notifier)
+ notifier, supported := rpc.NotifierFromContext(ctx)
if !supported {
return nil, rpc.ErrNotificationsUnsupported
}
@@ -1345,7 +1345,7 @@ func (s *PublicTransactionPoolAPI) PendingTransactions() []*RPCTransaction {
// NewPendingTransaction creates a subscription that is triggered each time a transaction enters the transaction pool
// and is send from one of the transactions this nodes manages.
func (s *PublicTransactionPoolAPI) NewPendingTransactions(ctx context.Context) (rpc.Subscription, error) {
- notifier, supported := ctx.Value(rpc.NotifierContextKey).(rpc.Notifier)
+ notifier, supported := rpc.NotifierFromContext(ctx)
if !supported {
return nil, rpc.ErrNotificationsUnsupported
}
diff --git a/eth/downloader/api.go b/eth/downloader/api.go
index 670a3ade3..94cd6515f 100644
--- a/eth/downloader/api.go
+++ b/eth/downloader/api.go
@@ -85,7 +85,7 @@ type SyncingResult struct {
// Syncing provides information when this nodes starts synchronising with the Ethereum network and when it's finished.
func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (rpc.Subscription, error) {
- notifier, supported := ctx.Value(rpc.NotifierContextKey).(rpc.Notifier)
+ notifier, supported := rpc.NotifierFromContext(ctx)
if !supported {
return nil, rpc.ErrNotificationsUnsupported
}
diff --git a/eth/filters/api.go b/eth/filters/api.go
index 9e95ebd83..d9bd4d4b7 100644
--- a/eth/filters/api.go
+++ b/eth/filters/api.go
@@ -234,7 +234,7 @@ func (s *PublicFilterAPI) newLogFilter(earliest, latest int64, addresses []commo
}
func (s *PublicFilterAPI) Logs(ctx context.Context, args NewFilterArgs) (rpc.Subscription, error) {
- notifier, supported := ctx.Value(rpc.NotifierContextKey).(rpc.Notifier)
+ notifier, supported := rpc.NotifierFromContext(ctx)
if !supported {
return nil, rpc.ErrNotificationsUnsupported
}