Skip to content

Block release v3.0.0 #682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2ac90fc
block: version bump
evertonfraga Mar 31, 2020
3310aa1
block: adds changelog from v2.2.1 to v3.0.0
evertonfraga Mar 31, 2020
ff3f0c9
blockchain: integrating ethereumjs block 3.0.0
evertonfraga Apr 1, 2020
35bcf85
blockchain: converting canonicalDifficulty to buffer
evertonfraga Apr 1, 2020
3653adb
blockchain: instantiating Block with empty/undefined data
evertonfraga Apr 1, 2020
aced4c9
blockchain: integrating Block 3.0.0
evertonfraga Apr 2, 2020
4ee9aec
block: lint:fix changes
evertonfraga Apr 2, 2020
55d3391
All siloed tests passing.
evertonfraga Apr 21, 2020
0d3f316
vm: lint fix
evertonfraga Apr 24, 2020
541f96d
leftovers of a rebase
evertonfraga Apr 30, 2020
2b97af7
lint fix
evertonfraga May 1, 2020
e11b29a
lint fix
evertonfraga May 1, 2020
5368838
vm,block: integrating Block with Lerna
evertonfraga May 6, 2020
4cba1ba
block: remove circular dependency to ethereumjs-blockchain introduced…
evertonfraga May 7, 2020
b61c5dc
block: removing unnecessary npx command
evertonfraga May 7, 2020
c512460
block: lint fix
evertonfraga May 7, 2020
e078863
blockchain: removing typo
evertonfraga May 7, 2020
848bc08
vm: fix BlockHeader import
evertonfraga May 7, 2020
73d759b
blockchain: fixing block initialization [Buffer[], Buffer[], Buffer[]…
evertonfraga May 14, 2020
677e892
vm: updating methods to async
evertonfraga May 14, 2020
9bda9e6
vm: misc changes
evertonfraga May 14, 2020
da15214
block: describing recovery bit normalization statement
evertonfraga May 14, 2020
7229cfa
block: removing source linking
evertonfraga May 14, 2020
d63eb98
docs: update for all packages
evertonfraga May 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,5 @@
"packages": [
"packages/*"
],
"version": "0.0.0",
"command": {
"bootstrap": {
"ignore": "ethereumjs-block"
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ethereumjs-block is now integrated to Lerna workflow, so this change removes it from the ignore list for the bootstrap command.

"version": "0.0.0"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
}
},
"scripts": {
"bootstrap": "lerna bootstrap --ignore-scripts && lerna exec npm i --scope=ethereumjs-block",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lerna bootstrap now installs packages for ethereumjs-block as well, so removing npm i here.

"bootstrap": "lerna bootstrap --ignore-scripts",
"postinstall": "npm run bootstrap",
"build:all": "lerna run build",
"lint": "lerna run lint"
}
}
2 changes: 1 addition & 1 deletion packages/account/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

### Modules

- ["index"](modules/_index_.md)
* ["index"](modules/_index_.md)
196 changes: 98 additions & 98 deletions packages/account/docs/classes/_index_.account.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@

## Hierarchy

- **Account**
* **Account**

## Index

### Constructors

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

### Properties

- [balance](_index_.account.md#balance)
- [codeHash](_index_.account.md#codehash)
- [nonce](_index_.account.md#nonce)
- [stateRoot](_index_.account.md#stateroot)
* [balance](_index_.account.md#balance)
* [codeHash](_index_.account.md#codehash)
* [nonce](_index_.account.md#nonce)
* [stateRoot](_index_.account.md#stateroot)

### Methods

- [getCode](_index_.account.md#getcode)
- [getStorage](_index_.account.md#getstorage)
- [isContract](_index_.account.md#iscontract)
- [isEmpty](_index_.account.md#isempty)
- [serialize](_index_.account.md#serialize)
- [setCode](_index_.account.md#setcode)
- [setStorage](_index_.account.md#setstorage)
* [getCode](_index_.account.md#getcode)
* [getStorage](_index_.account.md#getstorage)
* [isContract](_index_.account.md#iscontract)
* [isEmpty](_index_.account.md#isempty)
* [serialize](_index_.account.md#serialize)
* [setCode](_index_.account.md#setcode)
* [setStorage](_index_.account.md#setstorage)

## Constructors

### constructor
### constructor

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

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

Creates a new account object

```
~~~
var data = [
'0x02', //nonce
'0x0384', //balance
Expand All @@ -55,142 +55,142 @@ var data = {
}

const account = new Account(data)
```
~~~

**Parameters:**

| Name | Type | Description |
| ------- | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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`. |
Name | Type | Description |
------ | ------ | ------ |
`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`. |

**Returns:** _[Account](\_index_.account.md)\_
**Returns:** *[Account](_index_.account.md)*

## Properties

### balance
### balance

• **balance**: _Buffer_
• **balance**: *Buffer*

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

The account's balance in wei.

---
___

### codeHash
### codeHash

• **codeHash**: _Buffer_
• **codeHash**: *Buffer*

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

The hash of the code of the contract.

---
___

### nonce
### nonce

• **nonce**: _Buffer_
• **nonce**: *Buffer*

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

The account's nonce.

---
___

### stateRoot
### stateRoot

• **stateRoot**: _Buffer_
• **stateRoot**: *Buffer*

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

The stateRoot for the storage of the contract.

## Methods

### getCode
### getCode

▸ **getCode**(`trie`: Trie, `cb`: TrieGetCb): _void_
▸ **getCode**(`trie`: Trie, `cb`: TrieGetCb): *void*

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

Fetches the code from the trie.

**Parameters:**

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

**Returns:** _void_
**Returns:** *void*

---
___

### getStorage
### getStorage

▸ **getStorage**(`trie`: Trie, `key`: Buffer | string, `cb`: TrieGetCb): _void_
▸ **getStorage**(`trie`: Trie, `key`: Buffer | string, `cb`: TrieGetCb): *void*

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

Fetches `key` from the account's storage.

**Parameters:**

| Name | Type | Description |
| ------ | -------------------- | ----------- |
| `trie` | Trie | - |
| `key` | Buffer | string | - |
| `cb` | TrieGetCb | |
Name | Type | Description |
------ | ------ | ------ |
`trie` | Trie | - |
`key` | Buffer | string | - |
`cb` | TrieGetCb | |

**Returns:** _void_
**Returns:** *void*

---
___

### isContract
### isContract

▸ **isContract**(): _boolean_
▸ **isContract**(): *boolean*

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

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

**Returns:** _boolean_
**Returns:** *boolean*

---
___

### isEmpty
### isEmpty

▸ **isEmpty**(): _boolean_
▸ **isEmpty**(): *boolean*

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

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

**Returns:** _boolean_
**Returns:** *boolean*

---
___

### serialize
### serialize

▸ **serialize**(): _Buffer_
▸ **serialize**(): *Buffer*

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

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

**Returns:** _Buffer_
**Returns:** *Buffer*

---
___

### setCode
### setCode

▸ **setCode**(`trie`: Trie, `code`: Buffer, `cb`: function): _void_
▸ **setCode**(`trie`: Trie, `code`: Buffer, `cb`: function): *void*

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

Stores the code in the trie.

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

**Parameters:**

▪ **trie**: _Trie_
▪ **trie**: *Trie*

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

▪ **code**: _Buffer_
▪ **code**: *Buffer*

▪ **cb**: _function_
▪ **cb**: *function*

The callback.

▸ (`err`: any, `codeHash`: Buffer): _void_
▸ (`err`: any, `codeHash`: Buffer): *void*

**Parameters:**

| Name | Type |
| ---------- | ------ |
| `err` | any |
| `codeHash` | Buffer |
Name | Type |
------ | ------ |
`err` | any |
`codeHash` | Buffer |

**Returns:** _void_
**Returns:** *void*

---
___

### setStorage
### setStorage

▸ **setStorage**(`trie`: Trie, `key`: Buffer | string, `val`: Buffer | string, `cb`: TriePutCb): _void_
▸ **setStorage**(`trie`: Trie, `key`: Buffer | string, `val`: Buffer | string, `cb`: TriePutCb): *void*

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

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

Example for `getStorage` and `setStorage`:

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

**Parameters:**

| Name | Type | Description |
| ------ | -------------------- | ----------- |
| `trie` | Trie | - |
| `key` | Buffer | string | - |
| `val` | Buffer | string | - |
| `cb` | TriePutCb | |
Name | Type | Description |
------ | ------ | ------ |
`trie` | Trie | - |
`key` | Buffer | string | - |
`val` | Buffer | string | - |
`cb` | TriePutCb | |

**Returns:** _void_
**Returns:** *void*
2 changes: 1 addition & 1 deletion packages/account/docs/modules/_index_.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

### Classes

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