Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

refactor: Change BlockHeader -> miner data type to Address #4464

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion docs/assets/js/ganache/ganache.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/js/ganache/ganache.min.js.map

Large diffs are not rendered by default.

202 changes: 101 additions & 101 deletions docs/index.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/typedoc/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,7 @@
"flags": {},
"comment": {
"shortText": "Returns information about a block by block hash.",
"returns": "The block, `null` if the block doesn't exist.\n\n* `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.\n* `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.\n* `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.\n* `miner`: `DATA`, 20 Bytes - Address of the miner.\n* `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.\n* `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.\n* `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.\n* `logsBloom`: `DATA`, 256 Bytes - The bloom filter for the logs of the block. `null` when pending.\n* `difficulty`: `QUANTITY` - Integer of the difficulty of this block.\n* `number`: `QUANTITY` - The block number. `null` when pending.\n* `gasLimit`: `QUANTITY` - The maximum gas allowed in the block.\n* `gasUsed`: `QUANTITY` - Total gas used by all transactions in the block.\n* `timestamp`: `QUANTITY` - The unix timestamp for when the block was collated.\n* `extraData`: `DATA` - Extra data for the block.\n* `mixHash`: `DATA`, 256 Bytes - Hash identifier for the block.\n* `nonce`: `DATA`, 8 Bytes - Hash of the generated proof-of-work. `null` when pending.\n* `totalDifficulty`: `QUANTITY` - Integer of the total difficulty of the chain until this block.\n* `size`: `QUANTITY` - Integer the size of the block in bytes.\n* `transactions`: `Array` - Array of transaction objects or 32 Bytes transaction hashes depending on the last parameter.\n* `uncles`: `Array` - Array of uncle hashes.\n",
"returns": "The block, `null` if the block doesn't exist.\n\n* `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.\n* `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.\n* `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.\n* `miner`: `ADDRESS`, 20 Bytes - Address of the miner.\n* `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.\n* `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.\n* `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.\n* `logsBloom`: `DATA`, 256 Bytes - The bloom filter for the logs of the block. `null` when pending.\n* `difficulty`: `QUANTITY` - Integer of the difficulty of this block.\n* `number`: `QUANTITY` - The block number. `null` when pending.\n* `gasLimit`: `QUANTITY` - The maximum gas allowed in the block.\n* `gasUsed`: `QUANTITY` - Total gas used by all transactions in the block.\n* `timestamp`: `QUANTITY` - The unix timestamp for when the block was collated.\n* `extraData`: `DATA` - Extra data for the block.\n* `mixHash`: `DATA`, 256 Bytes - Hash identifier for the block.\n* `nonce`: `DATA`, 8 Bytes - Hash of the generated proof-of-work. `null` when pending.\n* `totalDifficulty`: `QUANTITY` - Integer of the total difficulty of the chain until this block.\n* `size`: `QUANTITY` - Integer the size of the block in bytes.\n* `transactions`: `Array` - Array of transaction objects or 32 Bytes transaction hashes depending on the last parameter.\n* `uncles`: `Array` - Array of uncle hashes.\n",
"tags": [
{
"tag": "example",
Expand Down Expand Up @@ -1931,7 +1931,7 @@
"flags": {},
"comment": {
"shortText": "Returns information about a block by block number.",
"returns": "The block, `null` if the block doesn't exist.\n\n* `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.\n* `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.\n* `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.\n* `miner`: `DATA`, 20 Bytes - Address of the miner.\n* `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.\n* `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.\n* `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.\n* `logsBloom`: `DATA`, 256 Bytes - The bloom filter for the logs of the block. `null` when pending.\n* `difficulty`: `QUANTITY` - Integer of the difficulty of this block.\n* `number`: `QUANTITY` - The block number. `null` when pending.\n* `gasLimit`: `QUANTITY` - The maximum gas allowed in the block.\n* `gasUsed`: `QUANTITY` - Total gas used by all transactions in the block.\n* `timestamp`: `QUANTITY` - The unix timestamp for when the block was collated.\n* `extraData`: `DATA` - Extra data for the block.\n* `mixHash`: `DATA`, 256 Bytes - Hash identifier for the block.\n* `nonce`: `DATA`, 8 Bytes - Hash of the generated proof-of-work. `null` when pending.\n* `totalDifficulty`: `QUANTITY` - Integer of the total difficulty of the chain until this block.\n* `size`: `QUANTITY` - Integer the size of the block in bytes.\n* `transactions`: `Array` - Array of transaction objects or 32 Bytes transaction hashes depending on the last parameter.\n* `uncles`: `Array` - Array of uncle hashes.\n",
"returns": "The block, `null` if the block doesn't exist.\n\n* `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.\n* `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.\n* `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.\n* `miner`: `ADDRESS`, 20 Bytes - Address of the miner.\n* `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.\n* `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.\n* `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.\n* `logsBloom`: `DATA`, 256 Bytes - The bloom filter for the logs of the block. `null` when pending.\n* `difficulty`: `QUANTITY` - Integer of the difficulty of this block.\n* `number`: `QUANTITY` - The block number. `null` when pending.\n* `gasLimit`: `QUANTITY` - The maximum gas allowed in the block.\n* `gasUsed`: `QUANTITY` - Total gas used by all transactions in the block.\n* `timestamp`: `QUANTITY` - The unix timestamp for when the block was collated.\n* `extraData`: `DATA` - Extra data for the block.\n* `mixHash`: `DATA`, 256 Bytes - Hash identifier for the block.\n* `nonce`: `DATA`, 8 Bytes - Hash of the generated proof-of-work. `null` when pending.\n* `totalDifficulty`: `QUANTITY` - Integer of the total difficulty of the chain until this block.\n* `size`: `QUANTITY` - Integer the size of the block in bytes.\n* `transactions`: `Array` - Array of transaction objects or 32 Bytes transaction hashes depending on the last parameter.\n* `uncles`: `Array` - Array of uncle hashes.\n",
"tags": [
{
"tag": "example",
Expand Down Expand Up @@ -3364,7 +3364,7 @@
"flags": {},
"comment": {
"shortText": "Returns information about a uncle of a block by hash and uncle index position.",
"returns": "A block object or `null` when no block is found.\n\n* `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.\n* `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.\n* `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.\n* `miner`: `DATA`, 20 Bytes - Address of the miner.\n* `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.\n* `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.\n* `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.\n* `logsBloom`: `DATA`, 256 Bytes - The bloom filter for the logs of the block. `null` when pending.\n* `difficulty`: `QUANTITY` - Integer of the difficulty of this block.\n* `number`: `QUANTITY` - The block number. `null` when pending.\n* `gasLimit`: `QUANTITY` - The maximum gas allowed in the block.\n* `gasUsed`: `QUANTITY` - Total gas used by all transactions in the block.\n* `timestamp`: `QUANTITY` - The unix timestamp for when the block was collated.\n* `extraData`: `DATA` - Extra data for the block.\n* `mixHash`: `DATA`, 256 Bytes - Hash identifier for the block.\n* `nonce`: `DATA`, 8 Bytes - Hash of the generated proof-of-work. `null` when pending.\n* `totalDifficulty`: `QUANTITY` - Integer of the total difficulty of the chain until this block.\n* `size`: `QUANTITY` - Integer the size of the block in bytes.\n* `uncles`: `Array` - Array of uncle hashes.\n\n**NOTE: **The return does not contain a list of transactions in the uncle\nblock, to get this, make another request to `eth_getBlockByHash`.\n",
"returns": "A block object or `null` when no block is found.\n\n* `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.\n* `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.\n* `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.\n* `miner`: `ADDRESS`, 20 Bytes - Address of the miner.\n* `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.\n* `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.\n* `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.\n* `logsBloom`: `DATA`, 256 Bytes - The bloom filter for the logs of the block. `null` when pending.\n* `difficulty`: `QUANTITY` - Integer of the difficulty of this block.\n* `number`: `QUANTITY` - The block number. `null` when pending.\n* `gasLimit`: `QUANTITY` - The maximum gas allowed in the block.\n* `gasUsed`: `QUANTITY` - Total gas used by all transactions in the block.\n* `timestamp`: `QUANTITY` - The unix timestamp for when the block was collated.\n* `extraData`: `DATA` - Extra data for the block.\n* `mixHash`: `DATA`, 256 Bytes - Hash identifier for the block.\n* `nonce`: `DATA`, 8 Bytes - Hash of the generated proof-of-work. `null` when pending.\n* `totalDifficulty`: `QUANTITY` - Integer of the total difficulty of the chain until this block.\n* `size`: `QUANTITY` - Integer the size of the block in bytes.\n* `uncles`: `Array` - Array of uncle hashes.\n\n**NOTE: **The return does not contain a list of transactions in the uncle\nblock, to get this, make another request to `eth_getBlockByHash`.\n",
"tags": [
{
"tag": "example",
Expand Down Expand Up @@ -3944,7 +3944,7 @@
"flags": {},
"comment": {
"shortText": "Returns information about a uncle of a block by hash and uncle index position.",
"returns": "A block object or `null` when no block is found.\n\n* `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.\n* `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.\n* `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.\n* `miner`: `DATA`, 20 Bytes - Address of the miner.\n* `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.\n* `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.\n* `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.\n* `logsBloom`: `DATA`, 256 Bytes - The bloom filter for the logs of the block. `null` when pending.\n* `difficulty`: `QUANTITY` - Integer of the difficulty of this block.\n* `number`: `QUANTITY` - The block number. `null` when pending.\n* `gasLimit`: `QUANTITY` - The maximum gas allowed in the block.\n* `gasUsed`: `QUANTITY` - Total gas used by all transactions in the block.\n* `timestamp`: `QUANTITY` - The unix timestamp for when the block was collated.\n* `extraData`: `DATA` - Extra data for the block.\n* `mixHash`: `DATA`, 256 Bytes - Hash identifier for the block.\n* `nonce`: `DATA`, 8 Bytes - Hash of the generated proof-of-work. `null` when pending.\n* `totalDifficulty`: `QUANTITY` - Integer of the total difficulty of the chain until this block.\n* `size`: `QUANTITY` - Integer the size of the block in bytes.\n* `uncles`: `Array` - Array of uncle hashes.\n\n* **NOTE: **The return does not contain a list of transactions in the uncle\nblock, to get this, make another request to `eth_getBlockByHash`.\n",
"returns": "A block object or `null` when no block is found.\n\n* `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.\n* `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.\n* `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.\n* `miner`: `ADDRESS`, 20 Bytes - Address of the miner.\n* `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.\n* `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.\n* `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.\n* `logsBloom`: `DATA`, 256 Bytes - The bloom filter for the logs of the block. `null` when pending.\n* `difficulty`: `QUANTITY` - Integer of the difficulty of this block.\n* `number`: `QUANTITY` - The block number. `null` when pending.\n* `gasLimit`: `QUANTITY` - The maximum gas allowed in the block.\n* `gasUsed`: `QUANTITY` - Total gas used by all transactions in the block.\n* `timestamp`: `QUANTITY` - The unix timestamp for when the block was collated.\n* `extraData`: `DATA` - Extra data for the block.\n* `mixHash`: `DATA`, 256 Bytes - Hash identifier for the block.\n* `nonce`: `DATA`, 8 Bytes - Hash of the generated proof-of-work. `null` when pending.\n* `totalDifficulty`: `QUANTITY` - Integer of the total difficulty of the chain until this block.\n* `size`: `QUANTITY` - Integer the size of the block in bytes.\n* `uncles`: `Array` - Array of uncle hashes.\n\n* **NOTE: **The return does not contain a list of transactions in the uncle\nblock, to get this, make another request to `eth_getBlockByHash`.\n",
"tags": [
{
"tag": "example",
Expand Down
206 changes: 103 additions & 103 deletions docs/typedoc/classes/default.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/chains/ethereum/block/src/runtime-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Common } from "@ethereumjs/common";
export type BlockHeader = {
parentHash: Data;
sha3Uncles: Data;
miner: Data;
miner: Address;
stateRoot: Data;
transactionsRoot: Data;
receiptsRoot: Data;
Expand Down Expand Up @@ -56,7 +56,7 @@ export function makeHeader(
return {
parentHash: Data.from(raw[0], 32),
sha3Uncles: Data.from(raw[1], 32),
miner: Data.from(raw[2], 20),
miner: new Address(raw[2]),
stateRoot: Data.from(raw[3], 32),
transactionsRoot: Data.from(raw[4], 32),
receiptsRoot: Data.from(raw[5], 32),
Expand Down
8 changes: 4 additions & 4 deletions src/chains/ethereum/ethereum/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ export default class EthereumApi implements Api {
* * `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.
* * `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.
* * `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.
* * `miner`: `DATA`, 20 Bytes - Address of the miner.
* * `miner`: `ADDRESS`, 20 Bytes - Address of the miner.
* * `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.
* * `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.
* * `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.
Expand Down Expand Up @@ -1173,7 +1173,7 @@ export default class EthereumApi implements Api {
* * `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.
* * `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.
* * `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.
* * `miner`: `DATA`, 20 Bytes - Address of the miner.
* * `miner`: `ADDRESS`, 20 Bytes - Address of the miner.
* * `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.
* * `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.
* * `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.
Expand Down Expand Up @@ -1435,7 +1435,7 @@ export default class EthereumApi implements Api {
* * `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.
* * `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.
* * `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.
* * `miner`: `DATA`, 20 Bytes - Address of the miner.
* * `miner`: `ADDRESS`, 20 Bytes - Address of the miner.
* * `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.
* * `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.
* * `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.
Expand Down Expand Up @@ -1477,7 +1477,7 @@ export default class EthereumApi implements Api {
* * `hash`: `DATA`, 32 Bytes - Hash of the block. `null` when pending.
* * `parentHash`: `DATA`, 32 Bytes - Hash of the parent block.
* * `sha3Uncles`: `DATA`, 32 Bytes - SHA3 of the uncles data in the block.
* * `miner`: `DATA`, 20 Bytes - Address of the miner.
* * `miner`: `ADDRESS`, 20 Bytes - Address of the miner.
* * `stateRoot`: `DATA`, 32 Bytes - The root of the state trie of the block.
* * `transactionsRoot`: `DATA`, 32 Bytes - The root of the transaction trie of the block.
* * `receiptsRoot`: `DATA`, 32 Bytes - The root of the receipts trie of the block.
Expand Down