Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix typos #6885

Merged
merged 3 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ Released with 1.0.0-beta.37 code base.

- Introduce review and release guidelines. (#3460)
- Add EIP-1193 compatible provider to `AbstractProvider` interface. (#3499)
- Add Typescript definitions for contract `methods` and `call`. (#3454)
- Add TypeScript definitions for contract `methods` and `call`. (#3454)
- Update AbstractProvider and contract.methods TS definitions (#3521)
- Add support for ENS contenthash methods. (#3392, #2782)

### Changed

- Change CI provider from Travis to Github Actions. (#3468)
- Change CI provider from Travis to GitHub Actions. (#3468)
- Update `web3-eth-abi` ABICoder dependency. (#3490)
- Update AbiCoder param formatting (#3522)
- Improve code clarity of HttpProvider keepAlive option setting. (#3463)
Expand Down Expand Up @@ -354,7 +354,7 @@ Released with 1.0.0-beta.37 code base.

### Added

- Github action for running tests for `web3-eth2-core` and `web3-eth2-beaconchain` packages (#3892)
- GitHub action for running tests for `web3-eth2-core` and `web3-eth2-beaconchain` packages (#3892)
- Added description to documentation on how to connect using a remote node provider (#3884)
- Added Security risk warning to docs for `web3.utils.soliditySha3` (#3908)
- `.nvmrc` file using Node.js version `v.14.15.1` (#3817)
Expand All @@ -366,7 +366,7 @@ Released with 1.0.0-beta.37 code base.
- Renamed the `tsc` script in all packages to `compile`; updates the corresponding `lerna run` usage in the main `package.json` (#3894)
- moved deprecation warnings to postinstall scripts (#3917)
- Upgrade `@chainsafe/geth-dev-assistant` from `0.1.5` to `0.1.9` (#3950)
- Replaced hardcoded infura link with Github Secret for some tests (#3943)
- Replaced hardcoded infura link with GitHub Secret for some tests (#3943)
- Bump `elliptic` from `6.5.3` to `6.5.4` for `web3-eth-accounts` (#3941)
- Bump `elliptic` from `6.5.3` to `6.5.4` for `web3-bzz` (#3940)
- Bump `elliptic` from `6.5.3` to `6.5.4` for `web3-core-requestmanager` (#3945)
Expand Down Expand Up @@ -466,13 +466,13 @@ Released with 1.0.0-beta.37 code base.

- Not considering `tx.chainId` if `tx.common.customChain.chainId` is provided for `web3.eth.accounts.signTransaction` function (#4293)
- Added missing PromiEvent handler types (#4194)
- Updated README to include Webpack 5 angular support instructions (#4174)
- Updated README to include webpack 5 angular support instructions (#4174)
- Updated the documentation for the `Web3.utils`, removed context for `_` (underscore lib) (#4403)
- Emit subscription id with connect event when creating a subscription (#4300)
- Introduced new configuration "blockHeaderTimeout" for waiting of block headers for transaction receipt (#3891)
- Format `block.baseFeePerGas` to number (#4330)
- Correct `web3-eth-personal.sendTransaction` example in documentation (#4409)
- Updated README to include Webpack 5 angular support instructions (#4174)
- Updated README to include webpack 5 angular support instructions (#4174)

### Fixed

Expand Down Expand Up @@ -509,7 +509,7 @@ Released with 1.0.0-beta.37 code base.
- Fix typos in web3-utils.rst (#4662)
- Added effectiveGasPrice to TransactionReceipt (#4692)
- Correction in documentation for `web3.eth.accounts.signTransaction` (#4576)
- Updated README to include Webpack 5 create-react-app support instructions (#4173)
- Updated README to include webpack 5 create-react-app support instructions (#4173)
- Update the documentation for `methods.myMethod.estimateGas` (#4702)
- Fix typos in REVIEW.md and TESTING.md (#4691)
- Fix encoding for "0x" string values (#4512)
Expand Down Expand Up @@ -562,7 +562,7 @@ Released with 1.0.0-beta.37 code base.

- Replace deprecated String.prototype.substr() (#4855)
- Exporting AbiCoder as coder (#4937)
- Github build workflow updated min build for node.js 12 and tests for 12, 14 and 16 (#5014)
- GitHub build workflow updated min build for node.js 12 and tests for 12, 14 and 16 (#5014)
- Updated libraries using BN and the BN library (#5072)

### Added
Expand Down Expand Up @@ -950,7 +950,7 @@ should use 4.0.1-alpha.0 for testing.

#### web3-validator

- Fix issue when importing `web3-validator` package within browser environments (Webpack minified filename changed from `index.min.js` to `web3-validator.min.js`) (#5710)
- Fix issue when importing `web3-validator` package within browser environments (webpack minified filename changed from `index.min.js` to `web3-validator.min.js`) (#5710)
- Fix build error '"type"' does not satisfy the constraint (#5712)

#### web3-eth-abi
Expand Down Expand Up @@ -2260,7 +2260,7 @@ If there are any bugs, improvements, optimizations or any new feature proposal f

#### web3-core

- Web3config `contractDataInputFill` has been defaulted to `data`, istead of `input`. (#6622)
- Web3config `contractDataInputFill` has been defaulted to `data`, instead of `input`. (#6622)

#### web3-eth-contracts

Expand Down
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Further details about versioning can be found in the [semver 2.0.0 specification

### Running E2E Tests

`E2E Network Tests` will be triggered to run via a Github workflow when a PR is open for a branch prefixed with `release/` and is being merged into `4.x` branch. These tests depend on a couple of ENVs to be set that are configurable in Github's Action Secrets when running these tests in CI. The following required secrets are:
`E2E Network Tests` will be triggered to run via a GitHub workflow when a PR is open for a branch prefixed with `release/` and is being merged into `4.x` branch. These tests depend on a couple of ENVs to be set that are configurable in GitHub's Action Secrets when running these tests in CI. The following required secrets are:

- `E2E_TESTS_ALLOWED_SEND_TRANSACTION`: If set to `false` this will keep the Sepolia tests that spend ETH from running, setting to anything else will cause them to run
- `TEST_ACCOUNT_PRIVATE_KEY`: The private key of the Sepolia account to use when submitting transactions
Expand Down Expand Up @@ -50,7 +50,7 @@ Further details about versioning can be found in the [semver 2.0.0 specification
8. `git tag bumped-version`: Tag the commit with bumped version having prefix `v` , e.g. `git tag v4.0.1-alpha.0`
9. `git push origin release/bumped-version`: Push release branch to `origin`
10. `git push origin --tags`: Push release tag created in `Step 8` to `origin`
11. Create a draft release on Github similar to [this](https://github.com/web3/web3.js/releases/tag/v4.2.0)
11. Create a draft release on GitHub similar to [this](https://github.com/web3/web3.js/releases/tag/v4.2.0)

- Select recently pushed tag in `choose a tag` drop down

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/hardhat_tutorial/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Following the recent compatibility update of Hardhat plugin [hardhat-web3-v4](ht
This tutorial will guide you through using Web3js as a plugin to interact with the Blockchain.

## Pre-requisite
This tutorial assumes you have previous knowledge of writing Smart contracts, and are convenient working with Javascript/Typescript. You should have [NodeJS](https://nodejs.org/en) version greater than v16 installed.
This tutorial assumes you have previous knowledge of writing Smart contracts, and are convenient working with JavaScript/TypeScript. You should have [NodeJS](https://nodejs.org/en) version greater than v16 installed.

:::note
To install dependencies, we will use `NPM`.
Expand Down Expand Up @@ -49,7 +49,7 @@ npx hardhat init

### Install required dependencies (including `hardhat-web3-v4`)

Select `Typescript` and `Yes` for the rest of the options.
Select `TypeScript` and `Yes` for the rest of the options.
You will be prompted to install the required dependencies. Reply `yes` to complete the installation.
To include the `Hardhat-web3-v4` plugin, we will install it via `npm`.

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/smart_contracts/infer_contract_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Web3.js is a popular library used for interacting with EVM blockchains. One of i

Before we dive into the problem, let's take a quick look at the problem. Web3.js provides a simple and convenient way to interact with Solidity contracts. To use Web3.js to interact with a Solidity contract, you need to know the contract's address and the ABI (Application Binary Interface) of the contract. The ABI is JSON data that contains the definition of the functions in the contract, including their, name, input parameters and return values.

Web3.js uses ABI type to dynamically load available methods and events but Typescript currently [doesn't support loading JSON as const](https://github.com/microsoft/TypeScript/issues/32063). If you go to the [Playground Link](https://www.typescriptlang.org/play?#code/MYewdgzgLgBAhgIwJYwLwwNoCga5gbxz1wCIkwAHAVyghIC5MjjdCWWywoBTAJzDgAbACoBPCtwYwS0XuQDmJADTN20gQFtJjEpu4B9ZavYko47dNkKSxvAF8V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CB+HA3RHAAanKOUJIeDEal18Xard3DAE8cALHqGFYWJXO5H5mMBYpJEPjTMWEz4gPAqroN4ODuSQ9taUZZQWUIA0h15UjhWnQMaOXvLE0AUrql8hp9PhMTcGky7nV0nmTvmcCvNq1mew7Bzgizu1gfzdruC66QdbkCL3Bi9wEuYV8A3PeNVVU8rfKq27Ogaz4Wv82DLGcclnGpTDOhjDUdSmzLdHCZbRUlY7dsVZg8dacCHzanLPcO3gU3cvnMZWAEwfSCXUEpDPscwH3eTV9DPHSNKcPmzGx1WyjNuld3V2C9RERROFQ9jfbucfdTfLT4EEEA1HyT+Ioy+r-rNc7ZvJDbwOgjC2BUO6o2Pl2DGI9V51h6JxQQABlKghpBDpWvi9Eed8cafWWpRF+wJ55zWcnzNa3VEpVy2r-Q2+14YHhAcjTuY90Y52xgWB+HUCZF0BA2N+Id4xIXsH7aq7Do7ENnrZeybV4K4NWuwVcAserAmZpAPcnsODD2vFgthk9NYgCvvg9WvDpBl1IQo8hbEoa13-g3E2ZtgF73btbQRECgJQM0awyBIi6r8K4SQFMIA0xGNjOTP8Qi87Ow4T4gxOgeiEOCfwimithE6PInTaJVI7KtTiUHL+Z8bLKN3HwAAYqmbOt8PGuK8aFPRZpfFxJMXI9aEMKGWL-ntdQmUm52LoQ40BTiHREEyPACAMB2jQAANxAA) and choose '.d.ts' you can check type difference with and without `as const`.
Web3.js uses ABI type to dynamically load available methods and events but TypeScript currently [doesn't support loading JSON as const](https://github.com/microsoft/TypeScript/issues/32063). If you go to the [Playground Link](https://www.typescriptlang.org/play?#code/MYewdgzgLgBAhgIwJYwLwwNoCga5gbxz1wCIkwAHAVyghIC5MjjdCWWywoBTAJzDgAbACoBPCtwYwS0XuQDmJADTN20gQFtJjEpu4B9ZavYko47dNkKSxvAF8VagreKce-IWIlSZUOWEVHJ3U4LR8IUQ0EEEFDIKdTc3C-axcYO1sAXXi8XzgeAFkaRCRBJDMfMHAKOFFEQUkc0jNvHVBIPypgKBBeG2I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rql8hp9PhMTcGky7nV0nmTvmcCvNq1mew7Bzgizu1gfzdruC66QdbkCL3Bi9wEuYV8A3PeNVVU8rfKq27Ogaz4Wv82DLGcclnGpTDOhjDUdSmzLdHCZbRUlY7dsVZg8dacCHzanLPcO3gU3cvnMZWAEwfSCXUEpDPscwH3eTV9DPHSNKcPmzGx1WyjNuld3V2C9RERROFQ9jfbucfdTfLT4EEEA1HyT+Ioy+r-rNc7ZvJDbwOgjC2BUO6o2Pl2DGI9V51h6JxQQABlKghpBDpWvi9Eed8cafWWpRF+wJ55zWcnzNa3VEpVy2r-Q2+14YHhAcjTuY90Y52xgWB+HUCZF0BA2N+Id4xIXsH7aq7Do7ENnrZeybV4K4NWuwVcAserAmZpAPcnsODD2vFgthk9NYgCvvg9WvDpBl1IQo8hbEoa13-g3E2ZtgF73btbQRECgJQM0awyBIi6r8K4SQFMIA0xGNjOTP8Qi87Ow4T4gxOgeiEOCfwimithE6PInTaJVI7KtTiUHL+Z8bLKN3HwAAYqmbOt8PGuK8aFPRZpfFxJMXI9aEMKGWL-ntdQmUm52LoQ40BTiHREEyPACAMB2jQAANxAA) and choose '.d.ts' you can check type difference with and without `as const`.

```typescript
import { Contract, Web3 } from 'web3';
Expand All @@ -32,7 +32,7 @@ import ERC20 from './node_modules/@openzeppelin/contracts/build/contracts/ERC20.
})();
```

To work around it you need to copy abi into a Typescript file like this:
To work around it you need to copy abi into a TypeScript file like this:

```typescript
import {Contract, Web3} from 'web3';
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-eth-accounts/src/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ export class Common extends EventEmitter {
// eslint-disable-next-line no-null/no-null
hf.block === null || (hf.ttd !== undefined && hf.ttd !== null) ? 0 : hf.block,
);
// Typescript can't seem to follow that the hfBlock is not null at this point
// TypeScript can't seem to follow that the hfBlock is not null at this point
// eslint-disable-next-line no-null/no-null
return block > hfBlock! && acc === null ? block : acc;
// eslint-disable-next-line no-null/no-null
Expand Down
4 changes: 2 additions & 2 deletions packages/web3-eth-contract/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ const contract = new Contract(abi);

## Compatibility

We have tested the Typescript interface support for the ABIs compiled with solidity version `v0.4.x` and above. If you face any issue regarding the contract typing, please create an issue to report to us.
We have tested the TypeScript interface support for the ABIs compiled with solidity version `v0.4.x` and above. If you face any issue regarding the contract typing, please create an issue to report to us.

The Typescript support for fixed length array types are supported up 30 elements. See more details [here](https://github.com/ChainSafe/web3.js/blob/nh%2F4562-contract-typing/packages/web3-eth-abi/src/number_map_type.ts#L1). This limitation is only to provide more performant developer experience in IDEs. In future we may come up with a workaround to avoid this limitation. If you have any idea feel free to share.
The TypeScript support for fixed length array types are supported up 30 elements. See more details [here](https://github.com/ChainSafe/web3.js/blob/nh%2F4562-contract-typing/packages/web3-eth-abi/src/number_map_type.ts#L1). This limitation is only to provide more performant developer experience in IDEs. In future we may come up with a workaround to avoid this limitation. If you have any idea feel free to share.

## Package.json Scripts

Expand Down
2 changes: 1 addition & 1 deletion packages/web3-eth-contract/src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export class Contract<Abi extends ContractAbi>
* });
* ```
*
* To use the type safe interface for these contracts you have to include the ABI definitions in your Typescript project and then declare these as `const`.
* To use the type safe interface for these contracts you have to include the ABI definitions in your TypeScript project and then declare these as `const`.
*
* ```ts title="Example"
* const myContractAbi = [....] as const; // ABI definitions
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-validator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fix issue when importing `web3-validator` package within browser environments (Webpack minified filename changed from `index.min.js` to `web3-validator.min.js`) (#5710)
- Fix issue when importing `web3-validator` package within browser environments (webpack minified filename changed from `index.min.js` to `web3-validator.min.js`) (#5710)

## [0.1.1-alpha.4]

Expand Down
Loading