mirror of https://github.com/ethereum/go-ethereum
rpc: add method to test for subscription support (#25942)
This adds two ways to check for subscription support. First, one can now check whether the transport method (HTTP/WS/etc.) is capable of subscriptions using the new Client.SupportsSubscriptions method. Second, the error returned by Subscribe can now reliably be tested using this pattern: sub, err := client.Subscribe(...) if errors.Is(err, rpc.ErrNotificationsUnsupported) { // no subscription support } --------- Co-authored-by: Felix Lange <fjl@twurst.com>pull/27472/head
parent
8bbaf882a6
commit
6f08c2f3f1
Loading…
Reference in new issue