Skip to content

Commit

Permalink
Merge branch '4.x' into ok/6701-Result-of-contract-method-.send-is-ha…
Browse files Browse the repository at this point in the history
…rd-to-type
  • Loading branch information
avkos committed Mar 12, 2024
2 parents fbd9f96 + 383af39 commit 2e44e94
Show file tree
Hide file tree
Showing 17 changed files with 51 additions and 44 deletions.
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: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
### Requirement

Before getting started, ensure that you have ``Yarn`` installed on your machine.

[How to install Yarn](https://www.hostinger.com/tutorials/how-to-install-yarn)
### Installation

```
Expand Down
9 changes: 5 additions & 4 deletions docs/docs/guides/getting_started/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ sidebar_label: Quickstart

# Quickstart


## Live code editor

<iframe width="100%" height="700px" src="https://stackblitz.com/edit/vitejs-vite-aksddx?embed=1&file=main.js&showSidebar=1"></iframe>

## Installation

If NPM is being used as package manager, use the following for installing the web3.js library.
Expand Down Expand Up @@ -247,7 +252,3 @@ const subscription = uniswapToken.events.Transfer();
subscription.on('data',console.log);
// ↳ [{...},{...}, ...] live events will be printed in the console
```

## Live code editor

<iframe width="100%" height="700px" src="https://stackblitz.com/edit/vitejs-vite-aksddx?embed=1&file=main.js&showSidebar=1"></iframe>
8 changes: 4 additions & 4 deletions docs/docs/guides/glossary/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,24 @@ contract Test {
```json title='Resulting JSON ABI'
[
{
"type": "constructor"
"type": "constructor",
"stateMutability": "nonpayable",
"inputs": [{"internalType":"uint256","name":"testInt","type":"uint256"}],
},
{
"type": "event"
"type": "event",
"name": "Event",
"inputs": [{"indexed":true,"internalType":"uint256","name":"b","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"c","type":"bytes32"}],
"anonymous": false,
},
{
"type": "event"
"type": "event",
"name": "Event2",
"inputs": [{"indexed":true,"internalType":"uint256","name":"b","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"c","type":"bytes32"}],
"anonymous": false,
},
{
"type": "function"
"type": "function",
"name": "foo",
"stateMutability": "nonpayable",
"inputs": [{"internalType":"uint256","name":"b","type":"uint256"},{"internalType":"bytes32","name":"c","type":"bytes32"}],
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/MYewdgzgLgBAhgIwJYwLwwNoCga5gbxz1wCIkwAHAVyghIC5MjjdCWWywoBTAJzDgAbACoBPCtwYwS0XuQDmJADTN20gQFtJjEpu4B9ZavYko47dNkKSxvAF8VagreKce-IWIlSZUOWEVHJ3U4LR8IUQ0EEEFDIKdTc3C-axcYO1sAXXi8XzgeAFkaRCRBJDMfMHAKOFFEQUkc0jNvHVBIPypgKB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LE0AUrql8hp9PhMTcGky7nV0nmTvmcCvNq1mew7Bzgizu1gfzdruC66QdbkCL3Bi9wEuYV8A3PeNVVU8rfKq27Ogaz4Wv82DLGcclnGpTDOhjDUdSmzLdHCZbRUlY7dsVZg8dacCHzanLPcO3gU3cvnMZWAEwfSCXUEpDPscwH3eTV9DPHSNKcPmzGx1WyjNuld3V2C9RERROFQ9jfbucfdTfLT4EEEA1HyT+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-axcYO1sAXXi8XzgeAFkaRCRBJDMfMHAKOFFEQUkc0jNvHVBIPypgKBBeG2IHVTYOOCqwSJAqOkYAMyEIbibpcmpaKWwnYYTyABNuAA9uHalOxbTScncBESSdOB2d3m4IOiXXPR8QAHcwPiNg6QtCwke6PZ50NKDTbnZZg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DUdSmzLdHCZbRUlY7dsVZg8dacCHzanLPcO3gU3cvnMZWAEwfSCXUEpDPscwH3eTV9DPHSNKcPmzGx1WyjNuld3V2C9RERROFQ9jfbucfdTfLT4EEEA1HyT+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
9 changes: 5 additions & 4 deletions docs/docs/guides/wallet/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ sidebar_label: 'Mastering Wallets & Accounts'

# Wallets and Accounts Overview


## Live code editor

<iframe width="100%" height="700px" src="https://stackblitz.com/edit/vitejs-vite-mhuwrk?embed=1&file=main.js&showSidebar=1"></iframe>

## Introduction

A Web3.js `Wallet` is your main entry point if you want to use a private key directly to do any blockchain operations (transactions), also called `Signer` in other libraries.
Expand Down Expand Up @@ -220,7 +225,3 @@ The following is a list of `Accounts` [methods](/libdocs/Wallet) in the `web3.et
- [sign](/libdocs/Accounts#sign)
- [signTransaction](/libdocs/Accounts#signtransaction)


## Live code editor

<iframe width="100%" height="700px" src="https://stackblitz.com/edit/vitejs-vite-mhuwrk?embed=1&file=main.js&showSidebar=1"></iframe>
9 changes: 5 additions & 4 deletions docs/docs/guides/web3_providers_guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ sidebar_label: 'Mastering Providers'

# Web3js providers overview


## Live code editor

<iframe width="100%" height="700px" src="https://stackblitz.com/edit/vitejs-vite-zfusfd?embed=1&file=main.js&showSidebar=1"></iframe>

## Introduction

web3.js providers are objects responsible for enabling connectivity with the Ethereum network in various ways. Connecting your web application to an Ethereum node is necessary for sending transactions, querying data, and interacting with smart contracts on the network. In this guide, we will explore the different types of providers available in web3.js, how to set them up, and how to use them in your code.
Expand Down Expand Up @@ -375,7 +380,3 @@ provider.on('error', (error) => {
```



## Live code editor

<iframe width="100%" height="700px" src="https://stackblitz.com/edit/vitejs-vite-zfusfd?embed=1&file=main.js&showSidebar=1"></iframe>
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 @@ -413,7 +413,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
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ describe('contract defaults (extra)', () => {
});

describeIf(isWs)('blockHeaderTimeout', () => {
it('should use "blockHeaderTimout" on "instance" level', async () => {
it('should use "blockHeaderTimeout" on "instance" level', async () => {
contract = new Contract(GreeterAbi, undefined, {
provider: getSystemTestProvider(),
});
Expand Down
Loading

1 comment on commit 2e44e94

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 2e44e94 Previous: 6c075db Ratio
processingTx 9632 ops/sec (±4.51%) 9301 ops/sec (±4.81%) 0.97
processingContractDeploy 40025 ops/sec (±7.68%) 39129 ops/sec (±7.62%) 0.98
processingContractMethodSend 20572 ops/sec (±6.36%) 19443 ops/sec (±5.19%) 0.95
processingContractMethodCall 41412 ops/sec (±5.18%) 38971 ops/sec (±6.34%) 0.94
abiEncode 47589 ops/sec (±6.18%) 44252 ops/sec (±6.92%) 0.93
abiDecode 32932 ops/sec (±6.83%) 30419 ops/sec (±8.89%) 0.92
sign 1676 ops/sec (±1.13%) 1656 ops/sec (±4.08%) 0.99
verify 378 ops/sec (±2.78%) 373 ops/sec (±0.78%) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.