Skip to content
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
20 changes: 18 additions & 2 deletions client/rpc/src/eth/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use fc_rpc_core::types::*;
use fp_rpc::EthereumRuntimeRPCApi;

use crate::{
eth::{rich_block_build, Eth, EthConfig},
eth::{empty_block_from, rich_block_build, Eth, EthConfig},
frontier_backend_client, internal_err,
};

Expand Down Expand Up @@ -198,7 +198,23 @@ where
_ => Ok(None),
}
}
None => Ok(None),
None => {
if let BlockNumber::Num(block_number) = number {
let eth_block = empty_block_from(block_number.into());
let eth_hash =
H256::from_slice(keccak_256(&rlp::encode(&eth_block.header)).as_slice());
Ok(Some(rich_block_build(
eth_block,
Default::default(),
Some(eth_hash),
full,
None,
false,
)))
} else {
Ok(None)
}
}
}
}

Expand Down
25 changes: 25 additions & 0 deletions client/rpc/src/eth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,31 @@ fn rich_block_build(
}
}

fn empty_block_from(number: U256) -> ethereum::BlockV2 {
let ommers = Vec::<ethereum::Header>::new();
let receipts = Vec::<ethereum::ReceiptV2>::new();
let receipts_root = ethereum::util::ordered_trie_root(
receipts.iter().map(ethereum::EnvelopedEncodable::encode),
);
let logs_bloom = ethereum_types::Bloom::default();
let partial_header = ethereum::PartialHeader {
parent_hash: H256::default(),
beneficiary: Default::default(),
state_root: Default::default(),
receipts_root,
logs_bloom,
difficulty: U256::zero(),
number,
gas_limit: U256::from(4_000_000),
gas_used: U256::zero(),
timestamp: Default::default(),
extra_data: Vec::new(),
mix_hash: H256::default(),
nonce: H64::default(),
};
ethereum::Block::new(partial_header, Default::default(), ommers)
}

fn transaction_build(
ethereum_transaction: EthereumTransaction,
block: Option<EthereumBlock>,
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
},
"license": "Apache-2.0",
"dependencies": {
"vuepress": "^1.9.9"
"vuepress": "^1.9.10"
}
}
138 changes: 69 additions & 69 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1184,19 +1184,19 @@
optionalDependencies:
prettier "^1.18.2"

"@vuepress/core@1.9.9":
version "1.9.9"
resolved "https://registry.yarnpkg.com/@vuepress/core/-/core-1.9.9.tgz#aa8bc4497fcbb6aab9c1e290944d422edeb20495"
integrity sha512-Ekgu409ZSgvAV9n14F3DaEWtgkwrEicg1nWs0gbxGgUCdREeX/7rwxSfKwWwBjCwfCUKR2L3+6pXGjzxex0t+g==
"@vuepress/core@1.9.10":
version "1.9.10"
resolved "https://registry.yarnpkg.com/@vuepress/core/-/core-1.9.10.tgz#ce17d603a0195ab2b8152f5a33bea274869184a3"
integrity sha512-H9ddo5fSinPb8QYl8OJFbZikMpOW84bm/U3Drzz8CnCXNtpda7CU2wX/XzOhe98G8jp45xhtZRkxOrqzBBAShA==
dependencies:
"@babel/core" "^7.8.4"
"@vue/babel-preset-app" "^4.1.2"
"@vuepress/markdown" "1.9.9"
"@vuepress/markdown-loader" "1.9.9"
"@vuepress/plugin-last-updated" "1.9.9"
"@vuepress/plugin-register-components" "1.9.9"
"@vuepress/shared-utils" "1.9.9"
"@vuepress/types" "1.9.9"
"@vuepress/markdown" "1.9.10"
"@vuepress/markdown-loader" "1.9.10"
"@vuepress/plugin-last-updated" "1.9.10"
"@vuepress/plugin-register-components" "1.9.10"
"@vuepress/shared-utils" "1.9.10"
"@vuepress/types" "1.9.10"
autoprefixer "^9.5.1"
babel-loader "^8.0.4"
bundle-require "2.1.8"
Expand Down Expand Up @@ -1231,71 +1231,71 @@
webpack-merge "^4.1.2"
webpackbar "3.2.0"

"@vuepress/markdown-loader@1.9.9":
version "1.9.9"
resolved "https://registry.yarnpkg.com/@vuepress/markdown-loader/-/markdown-loader-1.9.9.tgz#b44e446a04808b9aef503d32fdcbc1e7fb7afef4"
integrity sha512-nyY+sytuQaDLEIk6Yj9JFUfSQpe9/sz30xQFkGCYqi0lQTRGQM6IcRDgfcTS7b25A0qRlwpDGBfKQiGGMZKSfg==
"@vuepress/markdown-loader@1.9.10":
version "1.9.10"
resolved "https://registry.yarnpkg.com/@vuepress/markdown-loader/-/markdown-loader-1.9.10.tgz#076619a9079d4955bb73b59dc9e474c488d49bb7"
integrity sha512-94BlwKc+lOaN/A5DkyA9KWHvMlMC1sWunAXE3Tv0WYzgYLDs9QqCsx7L5kLkpcOOVVm/8kBJumnXvVBwhqJddw==
dependencies:
"@vuepress/markdown" "1.9.9"
"@vuepress/markdown" "1.9.10"
loader-utils "^1.1.0"
lru-cache "^5.1.1"

"@vuepress/markdown@1.9.9":
version "1.9.9"
resolved "https://registry.yarnpkg.com/@vuepress/markdown/-/markdown-1.9.9.tgz#1f582e6302e91a09491ca7bd0c8bcf9683140e03"
integrity sha512-JzFdBdGe5aoiKSaEgF+h3JLDXNVfWPI5DJWXrIt7rhhkMJesF6HowIznPLdXqukzHfXHcPvo9oQ4o6eT0YmVGA==
"@vuepress/markdown@1.9.10":
version "1.9.10"
resolved "https://registry.yarnpkg.com/@vuepress/markdown/-/markdown-1.9.10.tgz#63df6c6137e2d6bac2d03b5911e4326484761ba7"
integrity sha512-sXTLjeZzH8SQuAL5AEH0hhsMljjNJbzWbBvzaj5yQCCdf+3sp/dJ0kwnBSnQjFPPnzPg5t3tLKGUYHyW0KiKzA==
dependencies:
"@vuepress/shared-utils" "1.9.9"
"@vuepress/shared-utils" "1.9.10"
markdown-it "^8.4.1"
markdown-it-anchor "^5.0.2"
markdown-it-chain "^1.3.0"
markdown-it-emoji "^1.4.0"
markdown-it-table-of-contents "^0.4.0"
prismjs "^1.13.0"

"@vuepress/plugin-active-header-links@1.9.9":
version "1.9.9"
resolved "https://registry.yarnpkg.com/@vuepress/plugin-active-header-links/-/plugin-active-header-links-1.9.9.tgz#fad96c550bea0b204fe16266cff1405e8636c1e1"
integrity sha512-lTnIhbuALjOjFts33jJD8r4ScNBxnZ6MtmePKEwvYlC3J9uvngs1Htpb1JzLEX9QCydt+bhLmZ92bTXn/PdTpg==
"@vuepress/plugin-active-header-links@1.9.10":
version "1.9.10"
resolved "https://registry.yarnpkg.com/@vuepress/plugin-active-header-links/-/plugin-active-header-links-1.9.10.tgz#bcd96ee7c156310de30a9565ab9ca18e72f18a5a"
integrity sha512-2dRr3DE2UBFXhyMtLR3sGTdRyDM8YStuY6AOoQmoSgwy1IHt7PO7ypOuf1akF+1Nv8Q2aISU06q6TExZouu3Mw==
dependencies:
"@vuepress/types" "1.9.9"
"@vuepress/types" "1.9.10"
lodash.debounce "^4.0.8"

"@vuepress/plugin-last-updated@1.9.9":
version "1.9.9"
resolved "https://registry.yarnpkg.com/@vuepress/plugin-last-updated/-/plugin-last-updated-1.9.9.tgz#a7cb5f39b2793c8d113de08a514c316c26cc38c1"
integrity sha512-MV4csmM0/lye83VtkOc+b8fs0roi7mvE7BmCCOE39Z6t8nv/ZmEPOwKeHD0+hXPT+ZfoATYvDcsYU7uxbdw0Pw==
"@vuepress/plugin-last-updated@1.9.10":
version "1.9.10"
resolved "https://registry.yarnpkg.com/@vuepress/plugin-last-updated/-/plugin-last-updated-1.9.10.tgz#e2564512fe5652be892351cd95c5e611fd11a3be"
integrity sha512-YxzWGF/OfU6WsHSynZFn74NGGp7dY27Bjy9JyyFo8wF5+2V1gpyDjveHKHGKugS/pMXlxfjzhv9E2Wmy9R7Iog==
dependencies:
"@vuepress/types" "1.9.9"
"@vuepress/types" "1.9.10"
cross-spawn "^6.0.5"

"@vuepress/plugin-nprogress@1.9.9":
version "1.9.9"
resolved "https://registry.yarnpkg.com/@vuepress/plugin-nprogress/-/plugin-nprogress-1.9.9.tgz#4fee4818ddc8ddc6a1778b7f2b74ab784c90915d"
integrity sha512-+3fLxjwTLH8MeU54E7i1ovRu9KzBom2lvSeUsu9B8PuLyrETAqW7Pe1H66awEEALEe0ZnnEU4d7SeVe9ljsLAQ==
"@vuepress/plugin-nprogress@1.9.10":
version "1.9.10"
resolved "https://registry.yarnpkg.com/@vuepress/plugin-nprogress/-/plugin-nprogress-1.9.10.tgz#945142c2db4a2a11942c063d5d0f01bc5d295f49"
integrity sha512-I1kkm6yWUQd7vwiV3lEDVpVP0Lr04K0zlczU502lDUa1RufSZ7vt+mlF5fOM28GqT+pKTEToWmm+VNT/R3qvMQ==
dependencies:
"@vuepress/types" "1.9.9"
"@vuepress/types" "1.9.10"
nprogress "^0.2.0"

"@vuepress/plugin-register-components@1.9.9":
version "1.9.9"
resolved "https://registry.yarnpkg.com/@vuepress/plugin-register-components/-/plugin-register-components-1.9.9.tgz#95be133d6ef33c03f410caae8eb1fabdf27a7999"
integrity sha512-tddnAiSmJsIWWPzE7TcbGU8xzndXf4a8i4BfIev2QzSUnIOQFZDGXUAsCkw4/f9N9UFxQSObjFPzTeUUxb7EvA==
"@vuepress/plugin-register-components@1.9.10":
version "1.9.10"
resolved "https://registry.yarnpkg.com/@vuepress/plugin-register-components/-/plugin-register-components-1.9.10.tgz#3f8fd91acefec32b115d4dce89b14863cbe29212"
integrity sha512-sgdJ5OydTPZAoTkselpvVP3Xsd6bfZ0FpaxOTinal0gJ99h49lvLu9bvzMx13rdGRFO/kRXn0qQQpwKTAfTPqA==
dependencies:
"@vuepress/shared-utils" "1.9.9"
"@vuepress/types" "1.9.9"
"@vuepress/shared-utils" "1.9.10"
"@vuepress/types" "1.9.10"

"@vuepress/plugin-search@1.9.9":
version "1.9.9"
resolved "https://registry.yarnpkg.com/@vuepress/plugin-search/-/plugin-search-1.9.9.tgz#d30804b86f9b7f54b3db0b987a288433be3cfd7b"
integrity sha512-W/FE+YHoXDD4qk2wu5yRMkti271TA4y+7UBMrmCavvVAGrLIRnaZfswRUgIiDlEthBc+Pn8/As/Dy1jFTLBa9A==
"@vuepress/plugin-search@1.9.10":
version "1.9.10"
resolved "https://registry.yarnpkg.com/@vuepress/plugin-search/-/plugin-search-1.9.10.tgz#313a504020d60a2f694b27a8b6457ee99b4c71e7"
integrity sha512-bn2XJikaRgQZXvu8upCjOWrxbLHIRTqnJ3w7G0mo6jCYWGVsHNo6XhVpqylpLR2PWnHT/ImO2bGo38/5Bag/tQ==
dependencies:
"@vuepress/types" "1.9.9"
"@vuepress/types" "1.9.10"

"@vuepress/shared-utils@1.9.9":
version "1.9.9"
resolved "https://registry.yarnpkg.com/@vuepress/shared-utils/-/shared-utils-1.9.9.tgz#f6561ec2264d54e4e459d17678766ffe09f4bfc6"
integrity sha512-qhk/7QF5LgMEXhEB1hlqreGFgkz4p2pmaBBNFxnAnYmSwmyO+u/oFOpZLI16QRx9Wg6ekR2ENmByQLxV7y4lJg==
"@vuepress/shared-utils@1.9.10":
version "1.9.10"
resolved "https://registry.yarnpkg.com/@vuepress/shared-utils/-/shared-utils-1.9.10.tgz#45aae7fcf07a2067fb340c71e5bd96837b48dfee"
integrity sha512-M9A3DocPih+V8dKK2Zg9FJQ/f3JZrYsdaM/vQ9F48l8bPlzxw5NvqXIYMK4kKcGEyerQNTWCudoCpLL5uiU0hg==
dependencies:
chalk "^2.3.2"
escape-html "^1.0.3"
Expand All @@ -1322,26 +1322,26 @@
toml "^3.0.0"
upath "^1.1.0"

"@vuepress/theme-default@1.9.9":
version "1.9.9"
resolved "https://registry.yarnpkg.com/@vuepress/theme-default/-/theme-default-1.9.9.tgz#26f1965e1204445fa617308d3b06f134baab4936"
integrity sha512-de0FiOwM/h3rFTBSZK0NNBB117lA/e3IHusU7Xm2XeZRiZ/EE3yvbWclZnbbRNt3YjDMmrWXEW/kBTBxfiMuWQ==
"@vuepress/theme-default@1.9.10":
version "1.9.10"
resolved "https://registry.yarnpkg.com/@vuepress/theme-default/-/theme-default-1.9.10.tgz#6e916e2164ab3d9cc9567610e4ada9c3a568f206"
integrity sha512-XnXn9t+pYCIhWi3cZXJlighuy93FFm5yXdISAAlFlcNkshuGtqamkjacHV8q/QZMfOhSIs6wX7Hj88u2IsT5mw==
dependencies:
"@vuepress/plugin-active-header-links" "1.9.9"
"@vuepress/plugin-nprogress" "1.9.9"
"@vuepress/plugin-search" "1.9.9"
"@vuepress/types" "1.9.9"
"@vuepress/plugin-active-header-links" "1.9.10"
"@vuepress/plugin-nprogress" "1.9.10"
"@vuepress/plugin-search" "1.9.10"
"@vuepress/types" "1.9.10"
docsearch.js "^2.5.2"
lodash "^4.17.15"
stylus "^0.54.8"
stylus-loader "^3.0.2"
vuepress-plugin-container "^2.0.2"
vuepress-plugin-smooth-scroll "^0.0.3"

"@vuepress/types@1.9.9":
version "1.9.9"
resolved "https://registry.yarnpkg.com/@vuepress/types/-/types-1.9.9.tgz#7c21e4c91c13e58e2ff303ded9ad7425805cb07d"
integrity sha512-ukGW49ILzLhIc7CltHMr+BeIjWKloJNN1mrvbDz3beycp9b9kgH+DXNdRIK9QCKr4fJsy7x08vNMwZr9Nq/PTQ==
"@vuepress/types@1.9.10":
version "1.9.10"
resolved "https://registry.yarnpkg.com/@vuepress/types/-/types-1.9.10.tgz#5b8d112a0d7dbaffce1e5d39b66754412c83ecc6"
integrity sha512-TDNQn4og85onmBpLTTXXmncW3rUnYGr2MkuI8OIFJZetDNM49t1WbjNVlrT+kx7C6qXi6okDQgrHGYXajHZWfg==
dependencies:
"@types/markdown-it" "^10.0.0"
"@types/webpack-dev-server" "^3"
Expand Down Expand Up @@ -7936,14 +7936,14 @@ vuepress-plugin-smooth-scroll@^0.0.3:
dependencies:
smoothscroll-polyfill "^0.4.3"

vuepress@^1.9.9:
version "1.9.9"
resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-1.9.9.tgz#75b313f48a21b2eeb435cad52333f26b3b8a7404"
integrity sha512-CU94W3EdWaCavGx2VSvQJMI/hyv+m/YMdrvJJw67EVfmmJJDb1iTGrilDgLd0qsyrXzBy0Ru9Qi6rkf4IwcOTg==
vuepress@^1.9.10:
version "1.9.10"
resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-1.9.10.tgz#14700fccd85bc56c810cf367ecc797fcbecc7c0f"
integrity sha512-UnGm9vjQvG918SZVNvgiUlNimLqawdYPq0aPRXDpEB1VksvqegVFy/GKdA8ShXJaEpOMPSt7YD4uK21jaMs3kA==
dependencies:
"@vuepress/core" "1.9.9"
"@vuepress/theme-default" "1.9.9"
"@vuepress/types" "1.9.9"
"@vuepress/core" "1.9.10"
"@vuepress/theme-default" "1.9.10"
"@vuepress/types" "1.9.10"
cac "^6.5.6"
envinfo "^7.2.0"
opencollective-postinstall "^2.0.2"
Expand Down
Loading