Skip to content

Commit

Permalink
Fix warning "web3.js is running without provider" #6290 (#6428)
Browse files Browse the repository at this point in the history
* fix warning "web3.js is running without provider"

* add changelogs
  • Loading branch information
avkos authored Sep 18, 2023
1 parent e4ba45c commit 8010a6d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1994,3 +1994,30 @@ If there are any bugs, improvements, optimizations or any new feature proposal f
- Dependencies updated

## [Unreleased]

### Fixed

#### web3

- Fix of incorrect provider warning behaviour

#### web3-eth-accounts

- Fixed "The `r` and `s` returned by `sign` to does not always consist of 64 characters" (#6411)

#### web3-eth-contract

### Added

#### web3-eth

- 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)

#### web3-eth-contract

- Added `dataInputFill` as a ContractInitOption, allowing users to have the choice using property `data`, `input` or `both` for contract methods to be sent to the RPC provider. (#6355)
- 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)

#### web3-types

- add `asEIP1193Provider` to `Web3BaseProvider` so every inherited class can have the returned value of `request` method, fully compatible with EIP-1193. (#6407)
4 changes: 4 additions & 0 deletions packages/web3/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,7 @@ Documentation:
- To fix issue #6190, added the functionality to introduce different timeout value for Web3. (#6336)

## [Unreleased]

### Fixed

- Fix of incorrect provider warning behaviour
3 changes: 2 additions & 1 deletion packages/web3/src/web3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export class Web3<
if (
isNullish(providerOrContext) ||
(typeof providerOrContext === 'string' && providerOrContext.trim() === '') ||
(!isSupportedProvider(providerOrContext as SupportedProviders<EthExecutionAPI>) &&
(typeof providerOrContext !== 'string' &&
!isSupportedProvider(providerOrContext as SupportedProviders<EthExecutionAPI>) &&
!(providerOrContext as Web3ContextInitOptions).provider)
) {
console.warn(
Expand Down

0 comments on commit 8010a6d

Please sign in to comment.