Skip to content

@ethereumjs/tx v4.0.1

Compare
Choose a tag to compare
@holgerd77 holgerd77 released this 19 Oct 10:00
· 1205 commits to master since this release
8432656

Support for Geth genesis.json Genesis Format

For lots of custom chains (for e.g. devnets and testnets), you might come across a Geth genesis.json config which has both config specification for the chain as well as the genesis state specification.

Common now has a new constructor Common.fromGethGenesis() - see PRs #2300 and #2319 - which can be used in following manner to instantiate for example a VM run or a tx with a genesis.json based Common:

import { Common } from '@ethereumjs/common'
// Load geth genesis json file into lets say `genesisJson` and optional `chain` and `genesisHash`
const common = Common.fromGethGenesis(genesisJson, { chain: 'customChain', genesisHash })
// If you don't have `genesisHash` while initiating common, you can later configure common (for e.g.
// calculating it afterwards by using the `@ethereumjs/blockchain` package)
common.setForkHashes(genesisHash)

New Ethers Static Constructor

There is a new static constructor TransactionFactory.fromEthersProvider() which has been added to the library, see PR #2315. The new constructor allows for an easy instantiation of a fitting transaction object using an Ethers provider connecting e.g. to a local node or a service provider like Infura.

Other Changes and Fixes

  • Disallow tx initialization with values incorrectly passed in as arrays, PR #2284