Skip to content
This repository was archived by the owner on Jun 17, 2021. It is now read-only.

Commit c1787c1

Browse files
authored
Merge pull request #278 from ethereumjs/new-release
New release v7.0.6
2 parents c0798ed + 54efacb commit c1787c1

File tree

10 files changed

+143
-72
lines changed

10 files changed

+143
-72
lines changed

CHANGELOG.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
(modification: no type change headlines) and this project adheres to
77
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
88

9-
## [7.0.6] - [UNRELEASED]
9+
## [7.0.6] - 2020-10-07
1010

1111
### New `Account` class
1212

@@ -31,21 +31,27 @@ const account = new Account(
3131
)
3232
```
3333

34-
For more info see the documentation or examples of usage in `test/account.spec.ts`.
34+
For more info see the documentation, examples of usage in `test/account.spec.ts` or
35+
PR [#275](https://github.com/ethereumjs/ethereumjs-util/pull/275).
3536

3637
### New export: TypeScript types
3738

38-
A new file with helpful TypeScript types has been added to the exports of this project.
39+
A new file with helpful TypeScript types has been added to the exports of this project,
40+
see PR [#275](https://github.com/ethereumjs/ethereumjs-util/pull/275).
3941

4042
In this release it contains `BNLike`, `BufferLike`, and `TransformableToBuffer`.
4143

4244
### Address.toBuffer()
4345

44-
The Address class has as a new method `address.toBuffer()` that will give you a copy of the underlying `address.buf`.
46+
The Address class has as a new method `address.toBuffer()` that will give you a copy of the underlying `address.buf`
47+
(PR [#277](https://github.com/ethereumjs/ethereumjs-util/pull/277)).
4548

4649
### `toBuffer()` now converts TransformableToBuffer
4750

48-
The `toBuffer()` exported function now additionally converts any object with a `toBuffer()` method.
51+
The `toBuffer()` exported function now additionally converts any object with a `toBuffer()` method
52+
(PR [#277](https://github.com/ethereumjs/ethereumjs-util/pull/277)).
53+
54+
[7.0.6]: https://github.com/ethereumjs/ethereumjs-util/compare/v7.0.5...v7.0.6
4955

5056
## [7.0.5] - 2020-09-09
5157

docs/classes/_account_.account.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
*Defined in [account.ts:61](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L61)*
3838

39-
This constructor takes the values, validates and assigns them.
39+
This constructor assigns and validates the values.
4040
Use the static factory methods to assist in creating an Account from varying data types.
4141

4242
**Parameters:**
@@ -88,9 +88,9 @@ ___
8888

8989
**isContract**(): *boolean*
9090

91-
*Defined in [account.ts:96](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L96)*
91+
*Defined in [account.ts:106](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L106)*
9292

93-
Returns a `Boolean` deteremining if the account is a contract.
93+
Returns a `Boolean` determining if the account is a contract.
9494

9595
**Returns:** *boolean*
9696

@@ -100,9 +100,11 @@ ___
100100

101101
**isEmpty**(): *boolean*
102102

103-
*Defined in [account.ts:103](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L103)*
103+
*Defined in [account.ts:115](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L115)*
104104

105105
Returns a `Boolean` determining if the account is empty.
106+
For more details about account emptiness see [EIP-161](https://eips.ethereum.org/EIPS/eip-161).
107+
Note: The stateRoot is also checked to be empty since in Frontier it was possible to create a contract with no code where nonce remained 0 but some values were written to storage in the constructor (thus stateRoot is not KECCAK256_RLP).
106108

107109
**Returns:** *boolean*
108110

@@ -112,7 +114,7 @@ ___
112114

113115
**serialize**(): *Buffer*
114116

115-
*Defined in [account.ts:89](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L89)*
117+
*Defined in [account.ts:99](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L99)*
116118

117119
Returns the RLP serialization of the account as a `Buffer`.
118120

docs/classes/_address_.address.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
### Methods
2020

2121
* [isZero](_address_.address.md#iszero)
22+
* [toBuffer](_address_.address.md#tobuffer)
2223
* [toString](_address_.address.md#tostring)
2324
* [fromPrivateKey](_address_.address.md#static-fromprivatekey)
2425
* [fromPublicKey](_address_.address.md#static-frompublickey)
@@ -65,6 +66,18 @@ Is address zero.
6566

6667
___
6768

69+
### toBuffer
70+
71+
**toBuffer**(): *Buffer*
72+
73+
*Defined in [address.ts:95](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/address.ts#L95)*
74+
75+
Returns Buffer representation of address.
76+
77+
**Returns:** *Buffer*
78+
79+
___
80+
6881
### toString
6982

7083
**toString**(): *string*
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[ethereumjs-util](../README.md)["types"](../modules/_types_.md)[TransformableToArray](_types_.transformabletoarray.md)
2+
3+
# Interface: TransformableToArray
4+
5+
## Hierarchy
6+
7+
* **TransformableToArray**
8+
9+
## Index
10+
11+
### Methods
12+
13+
* [toArray](_types_.transformabletoarray.md#toarray)
14+
* [toBuffer](_types_.transformabletoarray.md#optional-tobuffer)
15+
16+
## Methods
17+
18+
### toArray
19+
20+
**toArray**(): *Uint8Array*
21+
22+
*Defined in [types.ts:30](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/types.ts#L30)*
23+
24+
**Returns:** *Uint8Array*
25+
26+
___
27+
28+
### `Optional` toBuffer
29+
30+
**toBuffer**(): *Buffer*
31+
32+
*Defined in [types.ts:31](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/types.ts#L31)*
33+
34+
**Returns:** *Buffer*

docs/interfaces/_types_.transformabletobuffer.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,25 @@
1010

1111
### Methods
1212

13+
* [toArray](_types_.transformabletobuffer.md#optional-toarray)
1314
* [toBuffer](_types_.transformabletobuffer.md#tobuffer)
1415

1516
## Methods
1617

18+
### `Optional` toArray
19+
20+
**toArray**(): *Uint8Array*
21+
22+
*Defined in [types.ts:39](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/types.ts#L39)*
23+
24+
**Returns:** *Uint8Array*
25+
26+
___
27+
1728
### toBuffer
1829

1930
**toBuffer**(): *Buffer*
2031

21-
*Defined in [types.ts:10](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/types.ts#L10)*
32+
*Defined in [types.ts:38](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/types.ts#L38)*
2233

2334
**Returns:** *Buffer*

docs/modules/_account_.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838

3939
**publicToAddress**: *pubToAddress* = pubToAddress
4040

41-
*Defined in [account.ts:246](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L246)*
41+
*Defined in [account.ts:258](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L258)*
4242

4343
## Functions
4444

4545
### `Const` generateAddress
4646

4747
**generateAddress**(`from`: Buffer, `nonce`: Buffer): *Buffer*
4848

49-
*Defined in [account.ts:168](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L168)*
49+
*Defined in [account.ts:180](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L180)*
5050

5151
Generates an address of a newly created contract.
5252

@@ -65,7 +65,7 @@ ___
6565

6666
**generateAddress2**(`from`: Buffer, `salt`: Buffer, `initCode`: Buffer): *Buffer*
6767

68-
*Defined in [account.ts:189](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L189)*
68+
*Defined in [account.ts:201](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L201)*
6969

7070
Generates an address for a contract created using CREATE2.
7171

@@ -85,7 +85,7 @@ ___
8585

8686
**importPublic**(`publicKey`: Buffer): *Buffer*
8787

88-
*Defined in [account.ts:269](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L269)*
88+
*Defined in [account.ts:281](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L281)*
8989

9090
Converts a public key to the Ethereum format.
9191

@@ -103,7 +103,7 @@ ___
103103

104104
**isValidAddress**(`hexAddress`: string): *boolean*
105105

106-
*Defined in [account.ts:116](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L116)*
106+
*Defined in [account.ts:128](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L128)*
107107

108108
Checks if the address is a valid. Accepts checksummed addresses too.
109109

@@ -121,7 +121,7 @@ ___
121121

122122
**isValidChecksumAddress**(`hexAddress`: string, `eip1191ChainId?`: undefined | number): *boolean*
123123

124-
*Defined in [account.ts:156](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L156)*
124+
*Defined in [account.ts:168](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L168)*
125125

126126
Checks if the address is a valid checksummed address.
127127

@@ -142,7 +142,7 @@ ___
142142

143143
**isValidPrivate**(`privateKey`: Buffer): *boolean*
144144

145-
*Defined in [account.ts:207](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L207)*
145+
*Defined in [account.ts:219](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L219)*
146146

147147
Checks if the private key satisfies the rules of the curve secp256k1.
148148

@@ -160,7 +160,7 @@ ___
160160

161161
**isValidPublic**(`publicKey`: Buffer, `sanitize`: boolean): *boolean*
162162

163-
*Defined in [account.ts:217](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L217)*
163+
*Defined in [account.ts:229](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L229)*
164164

165165
Checks if the public key satisfies the rules of the curve secp256k1
166166
and the requirements of Ethereum.
@@ -180,9 +180,9 @@ ___
180180

181181
**isZeroAddress**(`hexAddress`: string): *boolean*
182182

183-
*Defined in [account.ts:289](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L289)*
183+
*Defined in [account.ts:301](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L301)*
184184

185-
Checks if a given address is a zero address.
185+
Checks if a given address is the zero address.
186186

187187
**Parameters:**
188188

@@ -198,7 +198,7 @@ ___
198198

199199
**privateToAddress**(`privateKey`: Buffer): *Buffer*
200200

201-
*Defined in [account.ts:252](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L252)*
201+
*Defined in [account.ts:264](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L264)*
202202

203203
Returns the ethereum address of a given private key.
204204

@@ -216,7 +216,7 @@ ___
216216

217217
**privateToPublic**(`privateKey`: Buffer): *Buffer*
218218

219-
*Defined in [account.ts:260](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L260)*
219+
*Defined in [account.ts:272](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L272)*
220220

221221
Returns the ethereum public key of a given private key.
222222

@@ -234,7 +234,7 @@ ___
234234

235235
**pubToAddress**(`pubKey`: Buffer, `sanitize`: boolean): *Buffer*
236236

237-
*Defined in [account.ts:237](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L237)*
237+
*Defined in [account.ts:249](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L249)*
238238

239239
Returns the ethereum address of a given public key.
240240
Accepts "Ethereum public keys" and SEC1 encoded keys.
@@ -254,13 +254,13 @@ ___
254254

255255
**toChecksumAddress**(`hexAddress`: string, `eip1191ChainId?`: undefined | number): *string*
256256

257-
*Defined in [account.ts:131](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L131)*
257+
*Defined in [account.ts:143](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L143)*
258258

259259
Returns a checksummed address.
260260

261261
If a eip1191ChainId is provided, the chainId will be included in the checksum calculation. This
262262
has the effect of checksummed addresses for one chain having invalid checksums for others.
263-
For more details, consult EIP-1191.
263+
For more details see [EIP-1191](https://eips.ethereum.org/EIPS/eip-1191).
264264

265265
WARNING: Checksums with and without the chainId will differ. As of 2019-06-26, the most commonly
266266
used variation in Ethereum was without the chainId. This may change in the future.
@@ -280,8 +280,8 @@ ___
280280

281281
**zeroAddress**(): *string*
282282

283-
*Defined in [account.ts:280](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L280)*
283+
*Defined in [account.ts:292](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L292)*
284284

285-
Returns a zero address.
285+
Returns the zero address.
286286

287287
**Returns:** *string*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy