Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit b816de2

Browse files
feat: add support for the merge hardfork (#3971)
Co-authored-by: David Murdoch <187813+davidmurdoch@users.noreply.github.com> Co-authored-by: David Murdoch <david@davidmurdoch.com>
1 parent d267903 commit b816de2

File tree

133 files changed

+7223
-4314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+7223
-4314
lines changed

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
node: [12.0.0, 12.x, 14.x, 16.x, 18.x]
13+
node: [14.0.0, 14.x, 16.x, 18.x]
1414
os: [windows-2019, ubuntu-18.04, ubuntu-20.04, macos-11]
1515
exclude:
1616
# Node v18 does not run on ubuntu-18.04: https://github.com/nodejs/node/issues/42351#issuecomment-1068424442

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
node: [12.0.0, 12.x, 14.x, 16.x, 18.x]
13+
node: [14.0.0, 14.x, 16.x, 18.x]
1414
os: [ubuntu-20.04]
1515

1616
runs-on: ${{ matrix.os }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v12.0.0
1+
v14.0.0

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## Getting set up
44

5-
- Use Node.js v12.0.0.
6-
- Why v12.0.0? Because this is the first LTS release of Node.js v12 and is the earliest version Ganache supports.
5+
- Use Node.js v14.0.0.
6+
- Why v14.0.0? Because this is the first LTS release of Node.js v14 and is the earliest version Ganache supports.
77
- recommendation: use [nvm](https://github.com/nvm-sh/nvm) on Linux and macOS, and [nvm-windows](https://github.com/coreybutler/nvm-windows) on
88
Windows, to configure your node version.
9-
- On Linux and macOS, if you have `nvm` installed, just run `nvm use` to switch to Node.js v12.0.0.
9+
- On Linux and macOS, if you have `nvm` installed, just run `nvm use` to switch to Node.js v14.0.0.
1010
- `git clone git@github.com:trufflesuite/ganache.git`
1111
- `cd ganache`
1212
- `npm install` (use npm v6)
@@ -153,7 +153,7 @@ index 2a2aa9e..57cbf21 100644
153153

154154
These are guidelines, not rules. :-)
155155

156-
- Use Node.js v12.0.0 for most local development.
156+
- Use Node.js v14.0.0 for most local development.
157157
- Use `bigint` literals, e.g., `123n`; if the number is externally configurable and/or could exceed
158158
`Number.MAX_SAFE_INTEGER`.
159159
- Write tests.

package-lock.json

Lines changed: 55 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"author": "David Murdoch <david@trufflesuite.com> (https://davidmurdoch.com)",
44
"private": true,
55
"engines": {
6-
"node": ">=12.0.0",
7-
"npm": ">=6.12.0"
6+
"node": ">=14.0.0",
7+
"npm": ">=6.14.4"
88
},
99
"scripts": {
1010
"build": "npm run tsc && cross-env NODE_OPTIONS=--max_old_space_size=4096 lerna run build",
@@ -47,8 +47,8 @@
4747
"pretty-quick": "3.1.2",
4848
"semver": "7.3.5",
4949
"shx": "0.3.3",
50-
"ts-node": "10.4.0",
51-
"typescript": "4.6.4",
50+
"ts-node": "10.9.1",
51+
"typescript": "4.7.4",
5252
"validate-npm-package-name": "3.0.0",
5353
"yargs": "16.2.0"
5454
},

src/chains/ethereum/address/index.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { Data, JsonRpcDataInputArg } from "@ganache/utils";
1+
import { Address as EJSAddress } from "@ethereumjs/util";
2+
import { JsonRpcDataInputArg, Data } from "@ganache/utils";
23

3-
export class Address extends Data {
4+
export class Address extends EJSAddress {
45
static ByteLength = 20;
56

6-
constructor(value: string | Buffer) {
7-
super(value, Address.ByteLength);
7+
constructor(value: Buffer) {
8+
super(value);
89
}
910

1011
public static from<T extends string | Buffer = string | Buffer>(value: T) {
11-
return new Address(value);
12+
return new Address(Data.toBuffer(value, Address.ByteLength));
1213
}
1314

1415
static toBuffer(value: JsonRpcDataInputArg): Buffer {
@@ -18,4 +19,8 @@ export class Address extends Data {
1819
static toString(value: JsonRpcDataInputArg): string {
1920
return Address.from(value).toString();
2021
}
22+
23+
toJSON() {
24+
return this.toString();
25+
}
2126
}

0 commit comments

Comments
 (0)