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

crc-32 and JSON ESM import fix #6049

Merged
merged 5 commits into from
May 5, 2023
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,12 @@ should use 4.0.1-alpha.0 for testing.

- Added `filters` param to the `Filter` type (#6010)

### Fixed

#### web3-eth-accounts

- Fixed ESM import bugs reported in (#6032) and (#6034)

### Changed

#### web3-eth
Expand Down
4 changes: 4 additions & 0 deletions packages/web3-eth-accounts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Fixed ESM import bugs reported in (#6032) and (#6034)

### Changed

- Replaced `Buffer` for `Uint8Array` (#6004)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "goerli",
"chainId": 5,
"networkId": 5,
Expand Down Expand Up @@ -94,3 +94,4 @@
"enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"
]
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "mainnet",
"chainId": 1,
"networkId": 1,
Expand Down Expand Up @@ -110,3 +110,4 @@
"enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"
]
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "sepolia",
"chainId": 11155111,
"networkId": 11155111,
Expand Down Expand Up @@ -97,3 +97,4 @@
"enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"
]
}
;
11 changes: 7 additions & 4 deletions packages/web3-eth-accounts/src/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@ GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
import { buf as crc32Uint8Array } from 'crc-32';
import pkg from 'crc-32';
import { EventEmitter } from 'events';
import type { Numbers } from 'web3-types';
import { bytesToHex, hexToBytes, uint8ArrayConcat } from 'web3-utils';
import { TypeOutput } from './types';
import { intToUint8Array, toType, parseGethGenesis } from './utils';
import goerli from './chains/goerli.json';
import mainnet from './chains/mainnet.json';
import sepolia from './chains/sepolia.json';
import goerli from './chains/goerli';
import mainnet from './chains/mainnet';
import sepolia from './chains/sepolia';
import { EIPs } from './eips';
import type { ConsensusAlgorithm, ConsensusType } from './enums';
import { Chain, CustomChain, Hardfork } from './enums';
import { hardforks as HARDFORK_SPECS } from './hardforks';

import type {
BootstrapNodeConfig,
CasperConfig,
Expand All @@ -42,6 +43,8 @@ import type {
HardforkConfig,
} from './types';

const { buf: crc32Uint8Array } = pkg;

type HardforkSpecKeys = keyof typeof HARDFORK_SPECS;
type HardforkSpecValues = typeof HARDFORK_SPECS[HardforkSpecKeys];
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-1153",
"number": 1153,
"comment": "Transient Storage",
Expand All @@ -20,3 +20,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-1559",
"number": 1559,
"comment": "Fee market change for ETH 1.0 chain",
Expand All @@ -24,3 +24,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-2315",
"number": 2315,
"comment": "Simple subroutines for the EVM",
Expand All @@ -23,3 +23,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-2537",
"number": 2537,
"comment": "BLS12-381 precompiles",
Expand Down Expand Up @@ -176,3 +176,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-2565",
"number": 2565,
"comment": "ModExp gas cost",
Expand All @@ -15,3 +15,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-2718",
"comment": "Typed Transaction Envelope",
"url": "https://eips.ethereum.org/EIPS/eip-2718",
Expand All @@ -9,3 +9,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-2929",
"comment": "Gas cost increases for state access opcodes",
"url": "https://eips.ethereum.org/EIPS/eip-2929",
Expand Down Expand Up @@ -82,3 +82,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-2930",
"comment": "Optional access lists",
"url": "https://eips.ethereum.org/EIPS/eip-2930",
Expand All @@ -19,3 +19,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3074",
"number": 3074,
"comment": "AUTH and AUTHCALL opcodes",
Expand All @@ -23,3 +23,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3198",
"number": 3198,
"comment": "BASEFEE opcode",
Expand All @@ -15,3 +15,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3529",
"comment": "Reduction in refunds",
"url": "https://eips.ethereum.org/EIPS/eip-3529",
Expand All @@ -24,3 +24,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3540",
"number": 3540,
"comment": "EVM Object Format (EOF) v1",
Expand All @@ -11,3 +11,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3541",
"comment": "Reject new contracts starting with the 0xEF byte",
"url": "https://eips.ethereum.org/EIPS/eip-3541",
Expand All @@ -10,3 +10,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3554",
"comment": "Reduction in refunds",
"url": "Difficulty Bomb Delay to December 1st 2021",
Expand All @@ -15,3 +15,4 @@
}
}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3607",
"number": 3607,
"comment": "Reject transactions from senders with deployed code",
Expand All @@ -11,3 +11,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3651",
"number": 3198,
"comment": "Warm COINBASE",
Expand All @@ -11,3 +11,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3670",
"number": 3670,
"comment": "EOF - Code Validation",
Expand All @@ -11,3 +11,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3675",
"number": 3675,
"comment": "Upgrade consensus to Proof-of-Stake",
Expand All @@ -11,3 +11,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3855",
"number": 3855,
"comment": "PUSH0 instruction",
Expand All @@ -16,3 +16,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-3860",
"number": 3860,
"comment": "Limit and meter initcode",
Expand All @@ -21,3 +21,4 @@
},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-4345",
"number": 4345,
"comment": "Difficulty Bomb Delay to June 2022",
Expand All @@ -15,3 +15,4 @@
}
}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-4399",
"number": 4399,
"comment": "Supplant DIFFICULTY opcode with PREVRANDAO",
Expand All @@ -11,3 +11,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-4844",
"number": 4844,
"comment": "Shard Blob Transactions",
Expand Down Expand Up @@ -55,3 +55,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-4895",
"number": 4895,
"comment": "Beacon chain push withdrawals as operations",
Expand All @@ -11,3 +11,4 @@
"vm": {},
"pow": {}
}
;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"name": "EIP-5133",
"number": 5133,
"comment": "Delaying Difficulty Bomb to mid-September 2022",
Expand All @@ -15,3 +15,4 @@
}
}
}
;
Loading