Skip to content

Commit

Permalink
Fix #6439: ensure provider.supportsSubscriptions exists before watc…
Browse files Browse the repository at this point in the history
…hing by subscription (#6440)

* ensure `provider.supportsSubscriptions` exist before watching by subscription

* update CHANGELOG.md at web3-eth
  • Loading branch information
Muhammad-Altabba authored Sep 19, 2023
1 parent 54c5ed0 commit 2b445bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/web3-eth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,8 @@ Documentation:

- Added to `Web3Config` property `contractDataInputFill` allowing users to have the choice using property `data`, `input` or `both` for contract methods to be sent to the RPC provider when creating contracts. (#6377) (#6400)

## [Unreleased]
## [Unreleased]

### Fixed

- Ensure provider.supportsSubscriptions exists before watching by subscription (#6440)
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function watchTransactionForConfirmations<

// so a subscription for newBlockHeaders can be made instead of polling
const provider: Web3BaseProvider = web3Context.requestManager.provider as Web3BaseProvider;
if (provider.supportsSubscriptions()) {
if (provider && 'supportsSubscriptions' in provider && provider.supportsSubscriptions()) {
watchTransactionBySubscription({
web3Context,
transactionReceipt,
Expand Down

0 comments on commit 2b445bf

Please sign in to comment.