JoinColony / purser

Interact with Ethereum wallets easily
https://joincolony.github.io/purser
MIT License
84 stars 21 forks source link

Update dependency ethereumjs-util to v7 #334

Open renovate[bot] opened 4 years ago

renovate[bot] commented 4 years ago

This PR contains the following updates:

Package Type Update Change
ethereumjs-util devDependencies major ^6.2.0 -> 7.0.7
ethereumjs-util dependencies major ^6.2.0 -> ^7.0.0

Release Notes

ethereumjs/ethereumjs-util ### [`v7.0.7`](https://togithub.com/ethereumjs/ethereumjs-util/blob/master/CHANGELOG.md#​707---2020-10-15) [Compare Source](https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.6...v7.0.7) - Removed `stateRoot` check for `Account.isEmpty()` to make emptiness check `EIP-161` compliant, PR [#​279](https://togithub.com/ethereumjs/ethereumjs-util/pull/279) - Added type `AddressLike` and helper `bnToHex()`, PR [#​279](https://togithub.com/ethereumjs/ethereumjs-util/pull/279) - Added `account.raw()` which returns a Buffer Array of the raw Buffers for the account in order, PR [#​279](https://togithub.com/ethereumjs/ethereumjs-util/pull/279) [7.0.7]: https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.6...v7.0.7 ### [`v7.0.6`](https://togithub.com/ethereumjs/ethereumjs-util/blob/master/CHANGELOG.md#​706---2020-10-07) [Compare Source](https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.5...v7.0.6) ##### New `Account` class This release adds a new `Account` class intended as a modern replacement for `ethereumjs-account`. It has a shape of `Account(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`, and `Array: fromValuesArray`. **Methods**: `isEmpty(): boolean`, `isContract(): boolean`, `serialize(): Buffer` Example usage: ```typescript import { Account, BN } from 'ethereumjs-util' const account = new Account( new BN(0), // nonce, default: 0 new BN(10).pow(new BN(18)), // balance, default: 0 undefined, // stateRoot, default: KECCAK256_RLP (hash of RLP of null) undefined, // codeHash, default: KECCAK256_NULL (hash of null) ) ``` For more info see the documentation, examples of usage in `test/account.spec.ts` or PR [#​275](https://togithub.com/ethereumjs/ethereumjs-util/pull/275). ##### New export: TypeScript types A new file with helpful TypeScript types has been added to the exports of this project, see PR [#​275](https://togithub.com/ethereumjs/ethereumjs-util/pull/275). In this release it contains `BNLike`, `BufferLike`, and `TransformableToBuffer`. ##### Address.toBuffer() The Address class has as a new method `address.toBuffer()` that will give you a copy of the underlying `address.buf` (PR [#​277](https://togithub.com/ethereumjs/ethereumjs-util/pull/277)). ##### `toBuffer()` now converts TransformableToBuffer The `toBuffer()` exported function now additionally converts any object with a `toBuffer()` method (PR [#​277](https://togithub.com/ethereumjs/ethereumjs-util/pull/277)). [7.0.6]: https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.5...v7.0.6 ### [`v7.0.5`](https://togithub.com/ethereumjs/ethereumjs-util/blob/master/CHANGELOG.md#​705---2020-09-09) [Compare Source](https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.4...v7.0.5) This release adds a new module `address` - see [README](https://togithub.com/ethereumjs/ethereumjs-util#modules) - with a new `Address` class and type which can be used for creating and representing Ethereum addresses. Example usage: ```typescript import { Address } from 'ethereumjs-util' const pubKey = Buffer.from( '3a443d8381a6798a70c6ff9304bdc8cb0163c23211d11628fae52ef9e0dca11a001cf066d56a8156fc201cd5df8a36ef694eecd258903fca7086c1fae7441e1d', 'hex', ) const address = Address.fromPublicKey(pubKey) ``` In `TypeScript` the associated `Address` 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](https://togithub.com/ethereumjs/ethereumjs-util/pull/186) [7.0.5]: https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.4...v7.0.5 ### [`v7.0.4`](https://togithub.com/ethereumjs/ethereumjs-util/blob/master/CHANGELOG.md#​704---2020-08-04) [Compare Source](https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.3...v7.0.4) - Fixed `BN.js` and `RLP` re-export failures from TypeScript, PR [#​270](https://togithub.com/ethereumjs/ethereumjs-util/pull/270) - Fixed an issue along large-value input due to a string copy inconsistency within the `assertIs*` helper functions, issue affects most methods of the library, PR [#​269](https://togithub.com/ethereumjs/ethereumjs-util/pull/269) [7.0.4]: https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.3...v7.0.4 ### [`v7.0.3`](https://togithub.com/ethereumjs/ethereumjs-util/blob/master/CHANGELOG.md#​703---2020-07-07) [Compare Source](https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.2...v7.0.3) This release replaces the `keccak` and `secp256k1` dependencies (PR [#​257](https://togithub.com/ethereumjs/ethereumjs-util/pull/257)) and instead uses the [ethereum-cryptography](https://togithub.com/ethereum/js-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](https://togithub.com/ethereum/js-organization/issues/18) for context. **Other Changes:** - Added `TypeScript` definitions for `ethjs-util` methods, PR [#​248](https://togithub.com/ethereumjs/ethereumjs-util/pull/248) and PR [#​260](https://togithub.com/ethereumjs/ethereumjs-util/pull/260) [7.0.3]: https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.2...v7.0.3 ### [`v7.0.2`](https://togithub.com/ethereumjs/ethereumjs-util/blob/master/CHANGELOG.md#​702---2020-05-25) [Compare Source](https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.1...v7.0.2) This patch release re-establishes the state of `v7.0.0` release and upgrades the `BN.js` re-export version back to `v5` since quick patches for both the `v5` ([v5.1.2](https://togithub.com/indutny/bn.js/releases/tag/v5.1.2)) and the `v4` branch ([v4.11.9](https://togithub.com/indutny/bn.js/releases/tag/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 profit from future upgrades and patches. An upgrade is highly recommended, the `v7.0.1` release will be marked as deprecated along this release. See: Issue [#​250](https://togithub.com/ethereumjs/ethereumjs-util/issues/250) [7.0.2]: https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.1...v7.0.2 ### [`v7.0.1`](https://togithub.com/ethereumjs/ethereumjs-util/blob/master/CHANGELOG.md#​701---2020-05-15) [Compare Source](https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.0...v7.0.1) [DEPRECATED in favour of v7.0.2] This patch release downgrades the re-exported `BN.js` version from `v5` to `v4` (so a continuation of what has being used within the `v6.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 as deprecated along this release. See: Issue [#​250](https://togithub.com/ethereumjs/ethereumjs-util/issues/250) [7.0.1]: https://togithub.com/ethereumjs/ethereumjs-util/compare/v7.0.0...v7.0.1 ### [`v7.0.0`](https://togithub.com/ethereumjs/ethereumjs-util/blob/master/CHANGELOG.md#​700---2020-04-30) [Compare Source](https://togithub.com/ethereumjs/ethereumjs-util/compare/v6.2.1...v7.0.0) [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](https://togithub.com/ethereumjs/ethereumjs-util/issues/172) and are guided by the principles of: - Make the API more typestrict - Be less ambiguous regarding accepted values - Avoid implicit type conversions - Be more explicit on wrong input (just: throw) 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 the `Bytes.toBuffer()` method for conversion. ##### Account Module ##### Enforced Hex Prefixing for Address Strings PR: [#​241](https://togithub.com/ethereumjs/ethereumjs-util/pull/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](https://togithub.com/ethereumjs/ethereumjs-util/pull/242) ##### Enforce Buffer Inputs for Account Methods PR: [#​245](https://togithub.com/ethereumjs/ethereumjs-util/pull/245) Implicit `Buffer` conversions for the following methods have been removed and `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](https://togithub.com/ethereumjs/ethereumjs-util/pull/244) - Enforced `Buffer` input for `Bytes.setLengthLeft()`, `Bytes.setLengthRight()` - `Bytes.setLength()` has been removed (alias for `Bytes.setLengthLeft()`) - `Bytes.stripZeros()` has been removed (alias for `Bytes.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](https://togithub.com/ethereumjs/ethereumjs-util/pull/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 - Added support for Node 14, PR [#​249](https://togithub.com/ethereumjs/ethereumjs-util/pull/249) - Dropped support for Node `8` along PR [#​228](https://togithub.com/ethereumjs/ethereumjs-util/pull/228) - Updated `BN.js` library re-export from `4.x` to `5.x`, PR [#​249], [#​249](https://togithub.com/ethereumjs/ethereumjs-util/pull/249) - Removed `secp2561` re-export (use methods provided or import directly), PR [#​228](https://togithub.com/ethereumjs/ethereumjs-util/pull/228) ##### Cryto Library Updates: Keccak, secp2561 `Keccak` dependency has been updated from `2.1.0` to `3.0.0`. This version comes 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 from `3.0.1` to `4.0.1`. ##### Developer Improvements - Refactored test suite (module split-up, headless Firefox and Chrome), PR [#​231](https://togithub.com/ethereumjs/ethereumjs-util/pull/231) - Moved CI from Travis to GitHub Actions, PR [#​231](https://togithub.com/ethereumjs/ethereumjs-util/pull/231) - Improved and updated `TypeDoc` API documentation, PR [#​232](https://togithub.com/ethereumjs/ethereumjs-util/pull/232) and PR [#​236](https://togithub.com/ethereumjs/ethereumjs-util/pull/236) - Basic API tests for re-exports (BN.js, RLP, ethjsUtil), PR [#​235](https://togithub.com/ethereumjs/ethereumjs-util/pull/235) [7.0.0]: https://togithub.com/ethereumjs/ethereumjs-util/compare/v6.2.0...v7.0.0 ### [`v6.2.1`](https://togithub.com/ethereumjs/ethereumjs-util/releases/v6.2.1) [Compare Source](https://togithub.com/ethereumjs/ethereumjs-util/compare/v6.2.0...v6.2.1) This release replaces the native `secp256k1` and `keccak` dependencies with [ethereum-cryptopgraphy](https://togithub.com/ethereum/js-ethereum-cryptography) which doesn't need native compilation.

Renovate configuration

:date: Schedule: At any time (no schedule defined).

:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.

:recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: 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.