Skip to content

Commit

Permalink
Solve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
spacesailor24 committed Mar 31, 2022
2 parents a15e419 + 6db0f4a commit 4681e83
Show file tree
Hide file tree
Showing 23 changed files with 243 additions and 98 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTIONS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Guidelines for Pull Requests and Releases (Web3 1.x)
## Guidelines for Pull Requests and Releases (Web3 4.x)

This document provides some ground rules for contributors (including the maintainer(s) of
the project) about how to make, review and publish changes to 1.x. The most basic requirement is
the project) about how to make, review and publish changes to 4.x. The most basic requirement is
that **Web3 not break**.

### Pull Requests for substantive changes (e.g. everything except comments and docs)
Expand Down
43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,45 @@ yarn add web3

## Getting Started

- :writing_hand: If you have questions [submit an issue](https://github.com/ChainSafe/web3.js/issues/new/choose) or join us on [Discord](https://discord.gg/yjyvFRP)
![Discord](https://img.shields.io/discord/593655374469660673.svg?label=Discord&logo=discord)
- :writing_hand: If you have questions [submit an issue](https://github.com/ChainSafe/web3.js/issues/new/choose) or join us on [Discord](https://discord.gg/yjyvFRP)
![Discord](https://img.shields.io/discord/593655374469660673.svg?label=Discord&logo=discord)

## Prerequisites

- :gear: [NodeJS](https://nodejs.org/) (LTS/Fermium)
- :toolbox: [Yarn](https://yarnpkg.com/)/[Lerna](https://lerna.js.org/)
- :gear: [NodeJS](https://nodejs.org/) (LTS/Fermium)
- :toolbox: [Yarn](https://yarnpkg.com/)/[Lerna](https://lerna.js.org/)

## Architecture Overview

| Package | Version | License | Docs | Description |
| --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- |
| [web3](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/@chainsafe/lodestar) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io/en/v1.5.2/) | :rotating_light: Entire Web3.js offering (includes all packages) |
| Package | Version | License | Docs | Description |
| ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [web3](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | :rotating_light: Entire Web3.js offering (includes all packages) |
| [web3-common](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-common) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-common) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Common data structures and interfaces |
| [web3-core](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-core) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-core) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Core functions for web3.js packages |
| [web3-eth](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-eth) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Modules to interact with the Ethereum blockchain and smart contracts |
| [web3-eth-abi](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-abi) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-eth-abi) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Functions for encoding and decoding EVM in/output |
| [web3-eth-accounts](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-accounts) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-eth-accounts) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Functions for managing Ethereum accounts and signing |
| [web3-eth-contract](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-contract) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-eth-contract) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | The contract pacakge contained in [web3-eth](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth) |
| [web3-eth-ens](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-ens) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-eth-ens) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Functions for interacting with the Ethereum Name Service |
| [web3-eth-iban](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-iban) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-eth-iban) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Functionality for converting Ethereum addressed to IBAN addressed and vice versa |
| [web3-eth-personal](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-personal) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-eth-personal) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Module to interact with the Ethereum blockchain accounts stored in the node |
| [web3-eth-tx](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-tx) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-eth-tx) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | [@ethereumjs/tx](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/tx) wrapper class |
| [web3-net](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-net) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-net) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Functions to interact with an Ethereum node's network properties |
| [web3-providers-http](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-providers-http) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-providers-http) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Web3.js provider for the HTTP protocol |
| [web3-providers-ipc](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-providers-ipc) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-providers-ipc) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Web3.js provider for IPC |
| [web3-providers-ws](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-providers-ws) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-providers-ws) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Web3.js provider for the Websocket protocol |
| [web3-utils](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-utils) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-utils) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Useful utility functions for Dapp developers |
| [web3-validator](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-validator) | [![npm](https://img.shields.io/npm/v/web3)](https://www.npmjs.com/package/web3-validator) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://web3js.readthedocs.io) | Utilities for validating objects |

## Package.json Scripts

| Script | Description |
| ---------------- | ------------------------------------------------------------------ |
| clean | Uses `rimraf` to remove `dist/` |
| build | Uses `tsc` to build all packages |
| lint | Uses `eslint` to lint all packages |
| lint:fix | Uses `eslint` to check and fix any warnings |
| format | Uses `prettier` to format the code |
| test | Uses `jest` to run unit tests in each package |
| test:integration | Uses `jest` to run tests under `/test/integration` in each package |
| test:unit | Uses `jest` to run tests under `/test/unit` in each package |
27 changes: 27 additions & 0 deletions REVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Review Guidelines

Our review guidelines are intended to provide clear steps for PR proposers and reviewers.

Only published PRs will be considered for review. Draft PRs will be considered in-progress and not yet ready for review.

## Rules

- [ ] PR follows the provided [template](.github/PULL_REQUEST_TEMPLATE.md).
- [ ] PR doesn't contain unnecessary changes.
- [ ] The changed code preserves the conventions and stylistic consistency of the project.
- [ ] PR uses labels accordingly. (new labels may be suggested)
- [ ] PR includes unit and e2e tests if related to any logic changes.
- [ ] The code coverage rate did not decrease.
- [ ] The error case is always tested.
- [ ] The description of the test case is self-describing.
- [ ] Test cases are grouped for clarity.
- [ ] A PR may only be merged if the following conditions are fulfilled:
- [ ] The correct base branch is selected.
- [ ] Any new files contain the web3.js file header.
- [ ] The documentation was updated (if applicable).
- [ ] The CHANGELOG was updated accordingly.
- [ ] The CI with QA passes successfully.
- [ ] The CI logs were manually checked to ensure false positives were not reported.
- [ ] All comments have been addressed.
- [ ] Doesn't add undue maintenance burden.
- [ ] Doesn't increase the bundle size or is clearly explained why.
18 changes: 18 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Security Policy

## Supported Versions

Legacy-compatibility `v1.x`:

- :hourglass_flowing_sand: Web3.js was the previous implementation of the library, written in JavaScript.

Current-implementation `v4.x`:

- :hourglass: Web3.js has undergone a complete refactoring and rewrite.
- :stop_sign: We encourage **not** using these releases until official stable releases will be announced.
- :globe_with_meridians: We encourage using the [most recently released version](https://github.com/ChainSafe/web3.js/releases/latest) from the `v1.x` release track before reporting an issue.

## Reporting a Vulnerability

- :rotating_light: Please, send vulnerability reports to `security@chainsafe.io`.
- :warning: **Please do not file a public ticket** mentioning the vulnerability, as doing so could increase the likelihood of the vulnerability being exploited before a fix has been created, released and installed on the network.
6 changes: 3 additions & 3 deletions packages/web3-common/src/eth_execution_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export interface Log {
readonly blockNumber?: Uint | null;
readonly address?: Address;
readonly data?: HexStringBytes;
readonly topics?: Topic[];
readonly topics?: null | Topic | Topic[];
}

// https://github.com/ethereum/execution-apis/blob/main/src/schemas/receipt.json#L44
Expand Down Expand Up @@ -255,8 +255,8 @@ export type EthExecutionAPI = {
eth_getWork: () => [HexString32Bytes, HexString32Bytes, HexString32Bytes];
eth_submitWork: (
nonce: HexString8Bytes,
seedHash: HexString32Bytes,
difficulty: HexString32Bytes,
hash: HexString32Bytes,
digest: HexString32Bytes,
) => boolean;
eth_submitHashrate: (hashRate: HexString32Bytes, id: HexString32Bytes) => boolean;

Expand Down
3 changes: 2 additions & 1 deletion packages/web3-common/src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ export const convertScalarValue = (value: unknown, ethType: string, format: Data
}
}
} catch (error) {
// TODO: Add debugging to verify the error is thrown by the correct function
// If someone did't used `eth` keyword we can return original value
// as the scope of this code is formatting not validation
return value;
}

Expand Down
12 changes: 6 additions & 6 deletions packages/web3-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ yarn add web3-core
| test:unit | Uses `jest` to run tests under `/test/unit` |

[docs]: http://web3js.readthedocs.io/en/4.0/
[repo]: https://github.com/ethereum/web3.js
[repo]: https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-core
[npm-image]: https://img.shields.io/npm/v/web3-core-method.svg
[npm-url]: https://npmjs.org/packages/web3-package-tempalte
[deps-image]: https://david-dm.org/ethereum/web3.js/4.x/status.svg?path=tools/web3-package-tempalte
[deps-url]: https://david-dm.org/ethereum/web3.js/4.x?path=tools/web3-package-tempalte
[deps-dev-image]: https://david-dm.org/ethereum/web3.js/4.x/dev-status.svg?path=tools/web3-package-tempalte
[deps-dev-url]: https://david-dm.org/ethereum/web3.js/4.x?type=dev&path=tools/web3-package-tempalte
[npm-url]: https://npmjs.com/package/web3-core
[deps-image]: https://david-dm.org/ethereum/web3.js/4.x/status.svg?path=tools/web3-core
[deps-url]: https://david-dm.org/ethereum/web3.js/4.x?path=tools/web3-core
[deps-dev-image]: https://david-dm.org/ethereum/web3.js/4.x/dev-status.svg?path=tools/web3-core
[deps-dev-url]: https://david-dm.org/ethereum/web3.js/4.x?type=dev&path=tools/web3-core
14 changes: 7 additions & 7 deletions packages/web3-eth-abi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ yarn add web3-eth-abi
| test:unit | Uses `jest` to run tests under `/test/unit` |

[docs]: http://web3js.readthedocs.io/en/4.0/
[repo]: https://github.com/ethereum/web3.js
[npm-image]: https://img.shields.io/npm/v/web3-core-method.svg
[npm-url]: https://npmjs.org/packages/web3-package-tempalte
[deps-image]: https://david-dm.org/ethereum/web3.js/4.x/status.svg?path=tools/web3-package-tempalte
[deps-url]: https://david-dm.org/ethereum/web3.js/4.x?path=tools/web3-package-tempalte
[deps-dev-image]: https://david-dm.org/ethereum/web3.js/4.x/dev-status.svg?path=tools/web3-package-tempalte
[deps-dev-url]: https://david-dm.org/ethereum/web3.js/4.x?type=dev&path=tools/web3-package-tempalte
[repo]: https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-abi
[npm-image]: https://img.shields.io/npm/v/web3-eth-abi-method.svg
[npm-url]: https://npmjs.com/package/web3-eth-abi
[deps-image]: https://david-dm.org/ethereum/web3.js/4.x/status.svg?path=tools/web3-eth-abi
[deps-url]: https://david-dm.org/ethereum/web3.js/4.x?path=tools/web3-eth-abi
[deps-dev-image]: https://david-dm.org/ethereum/web3.js/4.x/dev-status.svg?path=tools/web3-eth-abi
[deps-dev-url]: https://david-dm.org/ethereum/web3.js/4.x?type=dev&path=tools/web3-eth-abi
Loading

0 comments on commit 4681e83

Please sign in to comment.