Skip to content

Commit 4b9a096

Browse files
authored
block,blockchain,vm: Block release v3.0.0 (#682)
* block: version bump * block: adds changelog from v2.2.1 to v3.0.0 * blockchain: integrating ethereumjs block 3.0.0 * blockchain: converting canonicalDifficulty to buffer * blockchain: instantiating Block with empty/undefined data * blockchain: integrating Block 3.0.0 * block: lint:fix changes * All siloed tests passing. * vm: lint fix * leftovers of a rebase * lint fix * lint fix * vm,block: integrating Block with Lerna * block: remove circular dependency to ethereumjs-blockchain introduced in ethereumjs/ethereumjs-block#93 * block: removing unnecessary npx command * block: lint fix * blockchain: removing typo * vm: fix BlockHeader import * blockchain: fixing block initialization [Buffer[], Buffer[], Buffer[]] format * vm: updating methods to async * vm: misc changes * block: describing recovery bit normalization statement * block: removing source linking * docs: update for all packages
1 parent b5e2958 commit 4b9a096

File tree

89 files changed

+2872
-3060
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2872
-3060
lines changed

lerna.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,5 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "0.0.0",
6-
"command": {
7-
"bootstrap": {
8-
"ignore": "ethereumjs-block"
9-
}
10-
}
5+
"version": "0.0.0"
116
}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
}
1212
},
1313
"scripts": {
14-
"bootstrap": "lerna bootstrap --ignore-scripts && lerna exec npm i --scope=ethereumjs-block",
14+
"bootstrap": "lerna bootstrap --ignore-scripts",
1515
"postinstall": "npm run bootstrap",
16+
"build:all": "lerna run build",
1617
"lint": "lerna run lint"
1718
}
1819
}

packages/account/docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
### Modules
88

9-
- ["index"](modules/_index_.md)
9+
* ["index"](modules/_index_.md)

packages/account/docs/classes/_index_.account.md

+98-98
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,42 @@
44

55
## Hierarchy
66

7-
- **Account**
7+
* **Account**
88

99
## Index
1010

1111
### Constructors
1212

13-
- [constructor](_index_.account.md#constructor)
13+
* [constructor](_index_.account.md#constructor)
1414

1515
### Properties
1616

17-
- [balance](_index_.account.md#balance)
18-
- [codeHash](_index_.account.md#codehash)
19-
- [nonce](_index_.account.md#nonce)
20-
- [stateRoot](_index_.account.md#stateroot)
17+
* [balance](_index_.account.md#balance)
18+
* [codeHash](_index_.account.md#codehash)
19+
* [nonce](_index_.account.md#nonce)
20+
* [stateRoot](_index_.account.md#stateroot)
2121

2222
### Methods
2323

24-
- [getCode](_index_.account.md#getcode)
25-
- [getStorage](_index_.account.md#getstorage)
26-
- [isContract](_index_.account.md#iscontract)
27-
- [isEmpty](_index_.account.md#isempty)
28-
- [serialize](_index_.account.md#serialize)
29-
- [setCode](_index_.account.md#setcode)
30-
- [setStorage](_index_.account.md#setstorage)
24+
* [getCode](_index_.account.md#getcode)
25+
* [getStorage](_index_.account.md#getstorage)
26+
* [isContract](_index_.account.md#iscontract)
27+
* [isEmpty](_index_.account.md#isempty)
28+
* [serialize](_index_.account.md#serialize)
29+
* [setCode](_index_.account.md#setcode)
30+
* [setStorage](_index_.account.md#setstorage)
3131

3232
## Constructors
3333

34-
### constructor
34+
### constructor
3535

36-
\+ **new Account**(`data?`: any): _[Account](\_index_.account.md)\_
36+
\+ **new Account**(`data?`: any): *[Account](_index_.account.md)*
3737

38-
_Defined in [index.ts:41](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L41)_
38+
*Defined in [index.ts:41](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L41)*
3939

4040
Creates a new account object
4141

42-
```
42+
~~~
4343
var data = [
4444
'0x02', //nonce
4545
'0x0384', //balance
@@ -55,142 +55,142 @@ var data = {
5555
}
5656
5757
const account = new Account(data)
58-
```
58+
~~~
5959

6060
**Parameters:**
6161

62-
| Name | Type | Description |
63-
| ------- | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
64-
| `data?` | any | An account can be initialized with either a `buffer` containing the RLP serialized account. Or an `Array` of buffers relating to each of the account Properties, listed in order below. For `Object` and `Array` each of the elements can either be a `Buffer`, hex `String`, `Number`, or an object with a `toBuffer` method such as `Bignum`. |
62+
Name | Type | Description |
63+
------ | ------ | ------ |
64+
`data?` | any | An account can be initialized with either a `buffer` containing the RLP serialized account. Or an `Array` of buffers relating to each of the account Properties, listed in order below. For `Object` and `Array` each of the elements can either be a `Buffer`, hex `String`, `Number`, or an object with a `toBuffer` method such as `Bignum`. |
6565

66-
**Returns:** _[Account](\_index_.account.md)\_
66+
**Returns:** *[Account](_index_.account.md)*
6767

6868
## Properties
6969

70-
### balance
70+
### balance
7171

72-
**balance**: _Buffer_
72+
**balance**: *Buffer*
7373

74-
_Defined in [index.ts:31](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L31)_
74+
*Defined in [index.ts:31](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L31)*
7575

7676
The account's balance in wei.
7777

78-
---
78+
___
7979

80-
### codeHash
80+
### codeHash
8181

82-
**codeHash**: _Buffer_
82+
**codeHash**: *Buffer*
8383

84-
_Defined in [index.ts:41](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L41)_
84+
*Defined in [index.ts:41](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L41)*
8585

8686
The hash of the code of the contract.
8787

88-
---
88+
___
8989

90-
### nonce
90+
### nonce
9191

92-
**nonce**: _Buffer_
92+
**nonce**: *Buffer*
9393

94-
_Defined in [index.ts:26](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L26)_
94+
*Defined in [index.ts:26](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L26)*
9595

9696
The account's nonce.
9797

98-
---
98+
___
9999

100-
### stateRoot
100+
### stateRoot
101101

102-
**stateRoot**: _Buffer_
102+
**stateRoot**: *Buffer*
103103

104-
_Defined in [index.ts:36](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L36)_
104+
*Defined in [index.ts:36](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L36)*
105105

106106
The stateRoot for the storage of the contract.
107107

108108
## Methods
109109

110-
### getCode
110+
### getCode
111111

112-
**getCode**(`trie`: Trie, `cb`: TrieGetCb): _void_
112+
**getCode**(`trie`: Trie, `cb`: TrieGetCb): *void*
113113

114-
_Defined in [index.ts:116](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L116)_
114+
*Defined in [index.ts:116](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L116)*
115115

116116
Fetches the code from the trie.
117117

118118
**Parameters:**
119119

120-
| Name | Type | Description |
121-
| ------ | --------- | ----------------------------------------------------------------------------------- |
122-
| `trie` | Trie | The [trie](https://github.com/ethereumjs/merkle-patricia-tree) storing the accounts |
123-
| `cb` | TrieGetCb | The callback |
120+
Name | Type | Description |
121+
------ | ------ | ------ |
122+
`trie` | Trie | The [trie](https://github.com/ethereumjs/merkle-patricia-tree) storing the accounts |
123+
`cb` | TrieGetCb | The callback |
124124

125-
**Returns:** _void_
125+
**Returns:** *void*
126126

127-
---
127+
___
128128

129-
### getStorage
129+
### getStorage
130130

131-
**getStorage**(`trie`: Trie, `key`: Buffer | string, `cb`: TrieGetCb): _void_
131+
**getStorage**(`trie`: Trie, `key`: Buffer | string, `cb`: TrieGetCb): *void*
132132

133-
_Defined in [index.ts:179](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L179)_
133+
*Defined in [index.ts:179](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L179)*
134134

135135
Fetches `key` from the account's storage.
136136

137137
**Parameters:**
138138

139-
| Name | Type | Description |
140-
| ------ | -------------------- | ----------- |
141-
| `trie` | Trie | - |
142-
| `key` | Buffer | string | - |
143-
| `cb` | TrieGetCb | |
139+
Name | Type | Description |
140+
------ | ------ | ------ |
141+
`trie` | Trie | - |
142+
`key` | Buffer | string | - |
143+
`cb` | TrieGetCb | |
144144

145-
**Returns:** _void_
145+
**Returns:** *void*
146146

147-
---
147+
___
148148

149-
### isContract
149+
### isContract
150150

151-
**isContract**(): _boolean_
151+
**isContract**(): *boolean*
152152

153-
_Defined in [index.ts:107](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L107)_
153+
*Defined in [index.ts:107](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L107)*
154154

155155
Returns a `Boolean` deteremining if the account is a contract.
156156

157-
**Returns:** _boolean_
157+
**Returns:** *boolean*
158158

159-
---
159+
___
160160

161-
### isEmpty
161+
### isEmpty
162162

163-
**isEmpty**(): _boolean_
163+
**isEmpty**(): *boolean*
164164

165-
_Defined in [index.ts:232](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L232)_
165+
*Defined in [index.ts:232](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L232)*
166166

167167
Returns a `Boolean` determining if the account is empty.
168168

169-
**Returns:** _boolean_
169+
**Returns:** *boolean*
170170

171-
---
171+
___
172172

173-
### serialize
173+
### serialize
174174

175-
**serialize**(): _Buffer_
175+
**serialize**(): *Buffer*
176176

177-
_Defined in [index.ts:99](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L99)_
177+
*Defined in [index.ts:99](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L99)*
178178

179179
Returns the RLP serialization of the account as a `Buffer`.
180180

181-
**Returns:** _Buffer_
181+
**Returns:** *Buffer*
182182

183-
---
183+
___
184184

185-
### setCode
185+
### setCode
186186

187-
**setCode**(`trie`: Trie, `code`: Buffer, `cb`: function): _void_
187+
**setCode**(`trie`: Trie, `code`: Buffer, `cb`: function): *void*
188188

189-
_Defined in [index.ts:160](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L160)_
189+
*Defined in [index.ts:160](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L160)*
190190

191191
Stores the code in the trie.
192192

193-
```
193+
~~~
194194
// Requires manual merkle-patricia-tree install
195195
const SecureTrie = require('merkle-patricia-tree/secure')
196196
const Account = require('./index.js').default
@@ -215,44 +215,44 @@ account.setCode(trie, code, function(err, codeHash) {
215215
console.log(`Code ${code.toString('hex')} read from trie`)
216216
})
217217
})
218-
```
218+
~~~
219219

220220
**Parameters:**
221221

222-
**trie**: _Trie_
222+
**trie**: *Trie*
223223

224224
The [trie](https://github.com/ethereumjs/merkle-patricia-tree) storing the accounts.
225225

226-
**code**: _Buffer_
226+
**code**: *Buffer*
227227

228-
**cb**: _function_
228+
**cb**: *function*
229229

230230
The callback.
231231

232-
▸ (`err`: any, `codeHash`: Buffer): _void_
232+
▸ (`err`: any, `codeHash`: Buffer): *void*
233233

234234
**Parameters:**
235235

236-
| Name | Type |
237-
| ---------- | ------ |
238-
| `err` | any |
239-
| `codeHash` | Buffer |
236+
Name | Type |
237+
------ | ------ |
238+
`err` | any |
239+
`codeHash` | Buffer |
240240

241-
**Returns:** _void_
241+
**Returns:** *void*
242242

243-
---
243+
___
244244

245-
### setStorage
245+
### setStorage
246246

247-
**setStorage**(`trie`: Trie, `key`: Buffer | string, `val`: Buffer | string, `cb`: TriePutCb): _void_
247+
**setStorage**(`trie`: Trie, `key`: Buffer | string, `val`: Buffer | string, `cb`: TriePutCb): *void*
248248

249-
_Defined in [index.ts:218](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L218)_
249+
*Defined in [index.ts:218](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L218)*
250250

251251
Stores a `val` at the `key` in the contract's storage.
252252

253253
Example for `getStorage` and `setStorage`:
254254

255-
```
255+
~~~
256256
// Requires manual merkle-patricia-tree install
257257
const SecureTrie = require('merkle-patricia-tree/secure')
258258
const Account = require('./index.js').default
@@ -273,15 +273,15 @@ account.setStorage(trie, key, value, function(err) {
273273
console.log(`Value ${value.toString('hex')} set and retrieved from trie.`)
274274
})
275275
})
276-
```
276+
~~~
277277

278278
**Parameters:**
279279

280-
| Name | Type | Description |
281-
| ------ | -------------------- | ----------- |
282-
| `trie` | Trie | - |
283-
| `key` | Buffer | string | - |
284-
| `val` | Buffer | string | - |
285-
| `cb` | TriePutCb | |
280+
Name | Type | Description |
281+
------ | ------ | ------ |
282+
`trie` | Trie | - |
283+
`key` | Buffer | string | - |
284+
`val` | Buffer | string | - |
285+
`cb` | TriePutCb | |
286286

287-
**Returns:** _void_
287+
**Returns:** *void*

packages/account/docs/modules/_index_.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
### Classes
88

9-
- [Account](../classes/_index_.account.md)
9+
* [Account](../classes/_index_.account.md)

0 commit comments

Comments
 (0)