This PR adds basic support for custom chains (i.e. anything but the default for ethereumjs-tx, which is mainnet). This is done by using the ethereumjs-common package to define a chain definition based on a default: either mainnet for chain IDs 1 (mainnet) and 1337 (local/private), or 5 for goerli. Other chain IDs are sent as-is, which may cause validation errors if they are not supported by ethereumjs-common.
Ideally, all chain definition should all be configurable when signing a transaction, but that would require a fairly significant API change.
Additions
Add (limited) support for custom chains
Add ethereumjs-common dependency (also a dependency of ethereumjs-tx)
Define getChainDefinition helper in purser-core
Changes
Implement custom chains in ethereumjs-tx transactions and update tests, for purser-metamask, purser-ledger and purser-trezor.
This PR adds basic support for custom chains (i.e. anything but the default for
ethereumjs-tx
, which ismainnet
). This is done by using theethereumjs-common
package to define a chain definition based on a default: eithermainnet
for chain IDs1
(mainnet) and1337
(local/private), or5
forgoerli
. Other chain IDs are sent as-is, which may cause validation errors if they are not supported byethereumjs-common
.Ideally, all chain definition should all be configurable when signing a transaction, but that would require a fairly significant API change.
Additions
ethereumjs-common
dependency (also a dependency ofethereumjs-tx
)getChainDefinition
helper inpurser-core
Changes
ethereumjs-tx
transactions and update tests, forpurser-metamask
,purser-ledger
andpurser-trezor
.