This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^6.2.0
->7.0.7
^6.2.0
->^7.0.0
Release Notes
ethereumjs/ethereumjs-util
v7.0.7
Compare Source
stateRoot
check forAccount.isEmpty()
to make emptiness checkEIP-161
compliant, PR #279AddressLike
and helperbnToHex()
, PR #279account.raw()
which returns a Buffer Array of the raw Buffers for the account in order, PR #279v7.0.6
Compare Source
New
Account
classThis release adds a new
Account
class intended as a modern replacement forethereumjs-account
. It has a shape ofAccount(nonce?: BN, balance?: BN, stateRoot?: Buffer, codeHash?: Buffer)
.Instantiation
The static factory methods assist in creating an
Account
object from varying data types:Object: fromAccountData
,RLP: fromRlpSerializedAccount
, andArray: fromValuesArray
.Methods:
isEmpty(): boolean
,isContract(): boolean
,serialize(): Buffer
Example usage:
For more info see the documentation, examples of usage in
test/account.spec.ts
orPR #275.
New export: TypeScript types
A new file with helpful TypeScript types has been added to the exports of this project,
see PR #275.
In this release it contains
BNLike
,BufferLike
, andTransformableToBuffer
.Address.toBuffer()
The Address class has as a new method
address.toBuffer()
that will give you a copy of the underlyingaddress.buf
(PR #277).
toBuffer()
now converts TransformableToBufferThe
toBuffer()
exported function now additionally converts any object with atoBuffer()
method(PR #277).
v7.0.5
Compare Source
This release adds a new module
address
- see README -with a new
Address
class and type which can be used for creating and representing Ethereum addresses.Example usage:
In
TypeScript
the associatedAddress
type can be used to more strictly enforce type checks(e.g. on the length of an address) on function parameters expecting an address input.
So you can declare a function like the following:
myAddressRelatedFunction(Address: address)
to get more assurance that the address input is correct.
See PR #186
v7.0.4
Compare Source
BN.js
andRLP
re-export failures from TypeScript,PR #270
within the
assertIs*
helper functions, issue affects most methods of thelibrary,
PR #269
v7.0.3
Compare Source
This release replaces the
keccak
andsecp256k1
dependencies(PR #257)
and instead uses the
ethereum-cryptography
package that uses native JS implementations for cryptographic primitives
and makes use of modern and forward-compatible N-API implementations in Node
wherever possible.
This is part of a larger initiative led by Nomic Labs to improve the developer
experience within the Ethereum developer ecosystem,
see ethereum/js-organization#18 for context.
Other Changes:
TypeScript
definitions forethjs-util
methods,PR #248 and
PR #260
v7.0.2
Compare Source
This patch release re-establishes the state of
v7.0.0
release and upgradesthe
BN.js
re-export version back tov5
since quick patches for boththe
v5
(v5.1.2) andthe
v4
branch (v4.11.9)have been released to fix interoperability issues between the
BN.js
versions.This now makes it possible to move to the latest
BN.js
v5
version and profitfrom future upgrades and patches.
An upgrade is highly recommended, the
v7.0.1
release will be marked asdeprecated along this release.
See: Issue #250
v7.0.1
Compare Source
[DEPRECATED in favour of v7.0.2]
This patch release downgrades the re-exported
BN.js
version fromv5
tov4
(so a continuation of what has being used within thev6.x
versions).This is due to some unexpected interoperability problems in libraries using
the older
v4
BN.js
branch in their some of their respective dependencies.An upgrade is highly recommended, the
v7.0.0
release will be marked asdeprecated along this release.
See: Issue #250
v7.0.0
Compare Source
[DEPRECATED in favour of v7.0.1]
This release comes with significant changes to the API, updated versions of
the core crypto libraries and substantial developer improvements in the form
of a refactored test suite and API documentation.
API Changes
Changes to the API have been discussed in Issue
#172 and are
guided by the principles of:
While the implemented changes come with some additional need for manual type
conversions depending on the usage context, they should finally lead to
cleaner usage patterns on the cosuming side and a more predictable, robust and
less error-prone control flow.
Some note: for methods where
Buffer
usage is now enforced you can use theBytes.toBuffer()
method for conversion.Account Module
Enforced Hex Prefixing for Address Strings
PR: #241
Hex prefixing is now enforced for all address string inputs and functions
will throw if a non-hex string is provided:
Account.isValidAddress()
Account.isZeroAddress()
Account.toChecksumAddress()
Account.isValidChecksumAddress()
The
Account.isPrecompile()
method was removed from the code base,PR #242
Enforce Buffer Inputs for Account Methods
PR: #245
Implicit
Buffer
conversions for the following methods have been removedand
Buffer
inputs are now enforced:Account.generateAddress()
Account.generateAddress2()
Account.pubToAddress()
AccountprivateToPublic()
AccountimportPublic()
Bytes Module
Typestrict Methods and Type-Explicit Method Split-Up
PR: #244
Buffer
input forBytes.setLengthLeft()
,Bytes.setLengthRight()
Bytes.setLength()
has been removed (alias forBytes.setLengthLeft()
)Bytes.stripZeros()
has been removed (alias forBytes.unPad()
)Bytes.unpad
has been split up into:Bytes.unpadBuffer()
Bytes.unpadHexString()
Bytes.unpadArray()
Hash Module
Typestrict Methods and Type-Explicit Method Split-Up
PR #247
The following methods are now
Buffer
-only:Hash.keccak()
Hash.keccak256()
Hash.sha256()
Hash.ripemd160()
Hash.keccak()
gets the following additional convenience methods:Hash.keccakFromString()
Hash.keccakFromHexString()
(hex string enforced)Hash.keccakFromArray()
Hash.sha256()
gets the following additional convenience methods:Hash.sha256FromString()
Hash.sha256FromArray()
Hash.ripemd160()
gets the following additional convenience methods:Hash.ripemd160FromString()
Hash.ripemd160FromArray()
Other Breaking Changes
PR #249
8
alongPR #228
BN.js
library re-export from4.x
to5.x
,PR [#249], #249
secp2561
re-export (use methods provided or import directly),PR #228
Cryto Library Updates: Keccak, secp2561
Keccak
dependency has been updated from2.1.0
to3.0.0
. This versioncomes with prebuilds for Linux, MacOS and Windows so most users won't need
to have
node-gyp
run on installation.The version update also brings in feature compatibility with newer Node.js
versions.
The
secp2561
ECDSA dependency has been updated from3.0.1
to4.0.1
.Developer Improvements
PR #231
PR #231
TypeDoc
API documentation,PR #232 and
PR #236
PR #235
v6.2.1
Compare Source
This release replaces the native
secp256k1
andkeccak
dependencies with ethereum-cryptopgraphy which doesn't need native compilation.Renovate configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by WhiteSource Renovate. View repository job log here.