Merge branch 'master' of github.com:ethcore/parity into db
This commit is contained in:
commit
5a9bba3fa5
@ -60,9 +60,8 @@ after_success: |
|
|||||||
git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
|
git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- secure: 3sUjNi9mhdL5h1GTm8LONnDN/SYvUHT+WSkMl93h3nYiLCQXk8eZaPS98AS7oOaTsfW4UvnwckVFCFl49ttInsv4cd/TkAxmrJHe6kPyS9/4NWUdmP8BjicbBvL/ioSdXMECMEYzPDLV+I3KhtC2LcB6ceDEl/XwMOJlzbGf7RbtcXGVQgMLqSYY1YKjQA4vbT5nFgIS/sZu3Z9yFgN0GafnihKcizqoHhdJjs/zxmX+qJepnC6o3V6KcFnS7QHhM1JOr85twE6S422UlvNaEb5ovwLPqmOl5+fA+6shbx4AxFTY6E9Iors+OVY/JliFhrqOdCt0i2P1FUHN4kbGZQkf0rphN/ZOI2uKNFTOyXiPvppfo/ZemKmcqkwkqP9+lf5QqYmtE6hsAYagxn49xJZILl8tAYbdqxF5gxa+TEVrfsBFtz/Sv3q8QhKQNPAmjEcKyMatyEreLUIFEpFTGIco8jN4eXeSoLRdJ+Z75ihttfQWhNfUDgNL30iQLy0AgFSsh/cyb5M8y9lxrGDzDTogvaiKGwr/V45sPkcXWCkmOgMdINqBB6ZtdL3bGHdyjmYj+y3btjf3aP11k++BL0fXIaKn25aS/p/9iyGb1FyGCM03o4ZRQ3YhTOvfMRfRGf6nWbaMx9upv8o5ShSdysewhrnh3082r7u896ny1Ho=
|
# GH_TOKEN
|
||||||
- secure: 0/FeVvFl3AhBW0TCPoujY9zOAYoUNMlAz3XjC04vlc4Ksfx0lGU3KFi97LlALxMWV0lfwQc7ixSe2vTgQVQuLVSU9XEW40fQgEjJlmLca2RcRx1kfzJDypuWSiCME7MWmLPH0ac4COdTDS1z5WGggv5YB7GQPCzFvcmOOaPYtF29ngCtkyB2HmNkY/W3omHFEk7Si6bsmOSHZiOAhivPl6ixnGpFyTEKPyraMMqPIj5rbEGkzgeLTiXf2ur143n/tnSr8tmP1MfQi9yS8/ONidMqnxUeuLkeNnb82zj9pVJhVXq0xF44WXJ8Za1jm0ByiTakgqpm8Juk822qjvtNulJ1XZW/fyZQZaN1dy3uq5Ud3W8wS9M7VIVl8CoXozzDpIsdPeUAtkAxeHBsZqL1vAH2yC1YJA7HPySMYzCjYqkJ2r62xYk0gXmNXphfU+F/X/rHzHsTMJPONJ54HQwu12m7zVlKIYBGHgEXg/HAM/g4ljUzl6WWR/nHH/tQM8ND/8FpHluJSZJWacq/1QNhVdTq2x6cqws2fs5A7nVpccR9+6RRgYgv6+YS2LxvFzByuZveGGoKif+uMECXN876j40araUqU528Yz9i8bHJlnM3coRBndaLNWByLcUyXCB9r9IUosUu41rr+L2mVzkSDm0GicuNCzqvzYQ9Q6QY4uQ=
|
- secure: bumJASbZSU8bxJ0EyPUJmu16AiV9EXOpyOj86Jlq/Ty9CfwGqsSXt96uDyE+OUJf34RUFQMsw0nk37/zC4lcn6kqk2wpuH3N/o85Zo/cVZY/NusBWLQqtT5VbYWsV+u2Ua4Tmmsw8yVYQhYwU2ZOejNpflL+Cs9XGgORp1L+/gMRMC2y5Se6ZhwnKPQlRJ8LGsG1dzjQULxzADIt3/zuspNBS8a2urJwlHfGMkvHDoUWCviP/GXoSqw3TZR7FmKyxE19I8n9+iSvm9+oZZquvcgfUxMHn8Gq/b44UbPvjtFOg2yam4xdWXF/RyWCHdc/R9EHorSABeCbefIsm+zcUF3/YQxwpSxM4IZEeH2rTiC7dcrsKw3XsO16xFQz5YI5Bay+CT/wTdMmJd7DdYz7Dyf+pOvcM9WOf/zorxYWSBOMYy0uzbusU2iyIghQ82s7E/Ahg+WARtPgkuTLSB5aL1oCTBKHqQscMr7lo5Ti6RpWLxEdTQMBznc+bMr+6dEtkEcG9zqc6cE9XX+ox3wTU6+HVMfQ1ltCntJ4UKcw3A6INEbw9wgocQa812CIASQ2fE+SCAbz6JxBjIAlFUnD1lUB7S8PdMPwn9plfQgKQ2A5YZqg6FnBdf0rQXIJYxQWKHXj/rBHSUCT0tHACDlzTA+EwWggvkP5AGIxRxm8jhw=
|
||||||
- secure: DglvLR27MrBKQO/8s7ZfGqfimXk1Iq5MreCTc+ZkWMkZ0sDP76YBUPq5j25hcg0Z09z09O2Q5OUOyYkhVD4AnRjoRLUplHdpDE9CBSz2vUGpMpzhgAqzBc6SDsEmWU2JlAPBraIODXQdP/Qo6tYY4zn3vwd/VFKo27GTb5b60WAkTVvT/0YPWycEXFIa7sNMgjNI0EnT+Se5USDYwb6MM1T9JxJot0q3WtOnsVyroCHJp4QDicpS8eQIu3Tl+SLE4d0EoJ4YYLOI+jWOybipuO1xM1xlHq/gpWfjKqbJh24xtAds524dN7ujfjAhyO2zQbuTOfi7QVOj/Go0tGYxNxobR4pYG783Aiq3Quj0GzSrLEAatkk5tGOcuVJ98EYIg3WPJuC93waTTXcS0xDyy09XHxWxZ/5PiXorRZjpHvnZfRF0X4Mus6jUJ7hqDuOUiF5BI1RHomHvJQQHUrLdmh7OHyrer3YUpKRs65tww6H+VM+lKNa3MnMkB5+or/co14svs7I4pni9S+aZg//bwuxGVXchK6bjLCP1X99Ar4fA5EGsTVdjp3PRqutM/P3RqNGkwTczat/PNZ8fFAD9y7pDs2L6YkqpflTC9d6vKTSl6gORGw6ltLUJs23ON6xRNIBMw1cXp67wN57vF46TPt1i3ZlIQsYn0pAVNKavbZE=
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
provider: releases
|
||||||
|
86
Cargo.lock
generated
86
Cargo.lock
generated
@ -2,8 +2,8 @@
|
|||||||
name = "parity"
|
name = "parity"
|
||||||
version = "0.9.99"
|
version = "0.9.99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ctrlc 1.0.1 (git+https://github.com/tomusdrw/rust-ctrlc.git)",
|
"ctrlc 1.1.1 (git+https://github.com/tomusdrw/rust-ctrlc.git)",
|
||||||
"daemonize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"daemonize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"docopt 0.6.78 (registry+https://github.com/rust-lang/crates.io-index)",
|
"docopt 0.6.78 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -15,6 +15,7 @@ dependencies = [
|
|||||||
"fdlimit 0.1.0",
|
"fdlimit 0.1.0",
|
||||||
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -69,10 +70,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clippy"
|
name = "clippy"
|
||||||
version = "0.0.42"
|
version = "0.0.44"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"regex-syntax 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex-syntax 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
@ -107,11 +108,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ctrlc"
|
name = "ctrlc"
|
||||||
version = "1.0.1"
|
version = "1.1.1"
|
||||||
source = "git+https://github.com/tomusdrw/rust-ctrlc.git#d8751b66b31d9698cbb11f8ef37155a8211a0683"
|
source = "git+https://github.com/tomusdrw/rust-ctrlc.git#f4927770f89eca80ec250911eea3adcbf579ac48"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
@ -129,7 +129,7 @@ name = "docopt"
|
|||||||
version = "0.6.78"
|
version = "0.6.78"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"regex 0.1.52 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"strsim 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"strsim 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
@ -145,7 +145,7 @@ version = "0.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"regex 0.1.52 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -158,7 +158,7 @@ dependencies = [
|
|||||||
"libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -174,16 +174,16 @@ dependencies = [
|
|||||||
name = "ethcore"
|
name = "ethcore"
|
||||||
version = "0.9.99"
|
version = "0.9.99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"crossbeam 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"crossbeam 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethash 0.9.99",
|
"ethash 0.9.99",
|
||||||
"ethcore-devtools 0.9.99",
|
"ethcore-devtools 0.9.99",
|
||||||
"ethcore-util 0.9.99",
|
"ethcore-util 0.9.99",
|
||||||
"heapsize 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num_cpus 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -200,14 +200,14 @@ dependencies = [
|
|||||||
name = "ethcore-rpc"
|
name = "ethcore-rpc"
|
||||||
version = "0.9.99"
|
version = "0.9.99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethcore 0.9.99",
|
"ethcore 0.9.99",
|
||||||
"ethcore-util 0.9.99",
|
"ethcore-util 0.9.99",
|
||||||
"ethsync 0.9.99",
|
"ethsync 0.9.99",
|
||||||
"jsonrpc-core 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"jsonrpc-core 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"jsonrpc-http-server 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"jsonrpc-http-server 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_codegen 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_codegen 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -218,15 +218,15 @@ name = "ethcore-util"
|
|||||||
version = "0.9.99"
|
version = "0.9.99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"arrayvec 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"crossbeam 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"crossbeam 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"elastic-array 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"elastic-array 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"eth-secp256k1 0.5.4 (git+https://github.com/arkpar/rust-secp256k1.git)",
|
"eth-secp256k1 0.5.4 (git+https://github.com/arkpar/rust-secp256k1.git)",
|
||||||
"ethcore-devtools 0.9.99",
|
"ethcore-devtools 0.9.99",
|
||||||
"heapsize 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"igd 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"igd 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"itertools 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"itertools 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"json-tests 0.1.0",
|
"json-tests 0.1.0",
|
||||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -237,7 +237,7 @@ dependencies = [
|
|||||||
"rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"sha3 0.1.0",
|
"sha3 0.1.0",
|
||||||
"slab 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"slab 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -250,7 +250,7 @@ dependencies = [
|
|||||||
name = "ethsync"
|
name = "ethsync"
|
||||||
version = "0.9.99"
|
version = "0.9.99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethcore 0.9.99",
|
"ethcore 0.9.99",
|
||||||
"ethcore-util 0.9.99",
|
"ethcore-util 0.9.99",
|
||||||
@ -278,8 +278,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "heapsize"
|
name = "heapsize"
|
||||||
version = "0.3.2"
|
version = "0.3.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"regex 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hpack"
|
name = "hpack"
|
||||||
@ -304,13 +308,13 @@ dependencies = [
|
|||||||
"language-tags 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"language-tags 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mime 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"mime 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num_cpus 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicase 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicase 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -324,13 +328,13 @@ dependencies = [
|
|||||||
"language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mime 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"mime 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num_cpus 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicase 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicase 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"url 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -341,14 +345,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"hyper 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
"hyper 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"regex 0.1.52 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"xml-rs 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
"xml-rs 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"xmltree 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"xmltree 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itertools"
|
name = "itertools"
|
||||||
version = "0.4.8"
|
version = "0.4.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -364,7 +368,7 @@ name = "jsonrpc-core"
|
|||||||
version = "1.1.4"
|
version = "1.1.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_codegen 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_codegen 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -416,7 +420,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "librocksdb-sys"
|
name = "librocksdb-sys"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/arkpar/rust-rocksdb.git#a745277de9848a1ce374fee037a3cf3cacdf9b67"
|
source = "git+https://github.com/arkpar/rust-rocksdb.git#4986bcec0d2907ebd2cae64c6753cf9291b08e86"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"pkg-config 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"pkg-config 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -449,7 +453,7 @@ version = "0.1.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -510,7 +514,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "1.2.0"
|
version = "1.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -524,12 +528,10 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num_cpus"
|
name = "num_cpus"
|
||||||
version = "0.2.10"
|
version = "0.2.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -570,24 +572,24 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "0.1.52"
|
version = "0.1.54"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"aho-corasick 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"memchr 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"memchr 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"regex-syntax 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex-syntax 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.2.3"
|
version = "0.2.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rocksdb"
|
name = "rocksdb"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
source = "git+https://github.com/arkpar/rust-rocksdb.git#a745277de9848a1ce374fee037a3cf3cacdf9b67"
|
source = "git+https://github.com/arkpar/rust-rocksdb.git#4986bcec0d2907ebd2cae64c6753cf9291b08e86"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"librocksdb-sys 0.1.0 (git+https://github.com/arkpar/rust-rocksdb.git)",
|
"librocksdb-sys 0.1.0 (git+https://github.com/arkpar/rust-rocksdb.git)",
|
||||||
@ -628,12 +630,12 @@ name = "semver"
|
|||||||
version = "0.2.3"
|
version = "0.2.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nom 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"nom 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "0.6.14"
|
version = "0.6.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -657,7 +659,7 @@ version = "0.6.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -748,7 +750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicase"
|
name = "unicase"
|
||||||
version = "1.2.1"
|
version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -10,8 +10,9 @@ log = "0.3"
|
|||||||
env_logger = "0.3"
|
env_logger = "0.3"
|
||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
docopt = "0.6"
|
docopt = "0.6"
|
||||||
|
time = "0.1"
|
||||||
ctrlc = { git = "https://github.com/tomusdrw/rust-ctrlc.git" }
|
ctrlc = { git = "https://github.com/tomusdrw/rust-ctrlc.git" }
|
||||||
clippy = { version = "0.0.42", optional = true }
|
clippy = { version = "0.0.44", optional = true }
|
||||||
ethcore-util = { path = "util" }
|
ethcore-util = { path = "util" }
|
||||||
ethcore = { path = "ethcore" }
|
ethcore = { path = "ethcore" }
|
||||||
ethsync = { path = "sync" }
|
ethsync = { path = "sync" }
|
||||||
|
@ -17,7 +17,7 @@ ethcore-util = { path = "../util" }
|
|||||||
evmjit = { path = "../evmjit", optional = true }
|
evmjit = { path = "../evmjit", optional = true }
|
||||||
ethash = { path = "../ethash" }
|
ethash = { path = "../ethash" }
|
||||||
num_cpus = "0.2"
|
num_cpus = "0.2"
|
||||||
clippy = { version = "0.0.42", optional = true }
|
clippy = { version = "0.0.44", optional = true }
|
||||||
crossbeam = "0.1.5"
|
crossbeam = "0.1.5"
|
||||||
lazy_static = "0.1"
|
lazy_static = "0.1"
|
||||||
ethcore-devtools = { path = "../devtools" }
|
ethcore-devtools = { path = "../devtools" }
|
||||||
|
@ -48,7 +48,7 @@ impl Block {
|
|||||||
if urlp.at(1).unwrap().iter().find(|i| i.as_val::<Transaction>().is_err()).is_some() {
|
if urlp.at(1).unwrap().iter().find(|i| i.as_val::<Transaction>().is_err()).is_some() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !urlp.at(2).unwrap().is_list() { return false; }
|
if !urlp.at(2).unwrap().is_list() { return false; }
|
||||||
if urlp.at(2).unwrap().iter().find(|i| i.as_val::<Header>().is_err()).is_some() {
|
if urlp.at(2).unwrap().iter().find(|i| i.as_val::<Header>().is_err()).is_some() {
|
||||||
return false;
|
return false;
|
||||||
@ -61,7 +61,7 @@ impl Block {
|
|||||||
impl Decodable for Block {
|
impl Decodable for Block {
|
||||||
fn decode<D>(decoder: &D) -> Result<Self, DecoderError> where D: Decoder {
|
fn decode<D>(decoder: &D) -> Result<Self, DecoderError> where D: Decoder {
|
||||||
if decoder.as_raw().len() != try!(decoder.as_rlp().payload_info()).total() {
|
if decoder.as_raw().len() != try!(decoder.as_rlp().payload_info()).total() {
|
||||||
return Err(DecoderError::RlpIsTooBig);
|
return Err(DecoderError::RlpIsTooBig);
|
||||||
}
|
}
|
||||||
let d = decoder.as_rlp();
|
let d = decoder.as_rlp();
|
||||||
if d.item_count() != 3 {
|
if d.item_count() != 3 {
|
||||||
@ -87,7 +87,7 @@ pub struct ExecutedBlock {
|
|||||||
state: State,
|
state: State,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A set of references to `ExecutedBlock` fields that are publicly accessible.
|
/// A set of references to `ExecutedBlock` fields that are publicly accessible.
|
||||||
pub struct BlockRefMut<'a> {
|
pub struct BlockRefMut<'a> {
|
||||||
/// Block header.
|
/// Block header.
|
||||||
pub header: &'a Header,
|
pub header: &'a Header,
|
||||||
@ -171,7 +171,7 @@ pub struct SealedBlock {
|
|||||||
|
|
||||||
impl<'x, 'y> OpenBlock<'x, 'y> {
|
impl<'x, 'y> OpenBlock<'x, 'y> {
|
||||||
/// Create a new OpenBlock ready for transaction pushing.
|
/// Create a new OpenBlock ready for transaction pushing.
|
||||||
pub fn new<'a, 'b>(engine: &'a Engine, db: JournalDB, parent: &Header, last_hashes: &'b LastHashes, author: Address, extra_data: Bytes) -> OpenBlock<'a, 'b> {
|
pub fn new(engine: &'x Engine, db: JournalDB, parent: &Header, last_hashes: &'y LastHashes, author: Address, extra_data: Bytes) -> Self {
|
||||||
let mut r = OpenBlock {
|
let mut r = OpenBlock {
|
||||||
block: ExecutedBlock::new(State::from_existing(db, parent.state_root().clone(), engine.account_start_nonce())),
|
block: ExecutedBlock::new(State::from_existing(db, parent.state_root().clone(), engine.account_start_nonce())),
|
||||||
engine: engine,
|
engine: engine,
|
||||||
@ -284,7 +284,7 @@ impl<'x, 'y> IsBlock for ClosedBlock<'x, 'y> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'x, 'y> ClosedBlock<'x, 'y> {
|
impl<'x, 'y> ClosedBlock<'x, 'y> {
|
||||||
fn new<'a, 'b>(open_block: OpenBlock<'a, 'b>, uncle_bytes: Bytes) -> ClosedBlock<'a, 'b> {
|
fn new(open_block: OpenBlock<'x, 'y>, uncle_bytes: Bytes) -> Self {
|
||||||
ClosedBlock {
|
ClosedBlock {
|
||||||
open_block: open_block,
|
open_block: open_block,
|
||||||
uncle_bytes: uncle_bytes,
|
uncle_bytes: uncle_bytes,
|
||||||
|
@ -87,13 +87,10 @@ impl Engine for Ethash {
|
|||||||
|
|
||||||
fn schedule(&self, env_info: &EnvInfo) -> Schedule {
|
fn schedule(&self, env_info: &EnvInfo) -> Schedule {
|
||||||
trace!(target: "client", "Creating schedule. param={:?}, fCML={}", self.spec().engine_params.get("frontierCompatibilityModeLimit"), self.u64_param("frontierCompatibilityModeLimit"));
|
trace!(target: "client", "Creating schedule. param={:?}, fCML={}", self.spec().engine_params.get("frontierCompatibilityModeLimit"), self.u64_param("frontierCompatibilityModeLimit"));
|
||||||
match env_info.number < self.u64_param("frontierCompatibilityModeLimit") {
|
if env_info.number < self.u64_param("frontierCompatibilityModeLimit") {
|
||||||
true => {
|
Schedule::new_frontier()
|
||||||
Schedule::new_frontier()
|
} else {
|
||||||
},
|
Schedule::new_homestead()
|
||||||
_ => {
|
|
||||||
Schedule::new_homestead()
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +144,7 @@ impl Engine for Ethash {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let difficulty = Ethash::boundary_to_difficulty(&Ethash::from_ethash(quick_get_difficulty(
|
let difficulty = Ethash::boundary_to_difficulty(&Ethash::from_ethash(quick_get_difficulty(
|
||||||
&Ethash::to_ethash(header.bare_hash()),
|
&Ethash::to_ethash(header.bare_hash()),
|
||||||
header.nonce().low_u64(),
|
header.nonce().low_u64(),
|
||||||
&Ethash::to_ethash(header.mix_hash()))));
|
&Ethash::to_ethash(header.mix_hash()))));
|
||||||
if difficulty < header.difficulty {
|
if difficulty < header.difficulty {
|
||||||
@ -189,7 +186,7 @@ impl Engine for Ethash {
|
|||||||
let min_gas = parent.gas_limit - parent.gas_limit / gas_limit_divisor;
|
let min_gas = parent.gas_limit - parent.gas_limit / gas_limit_divisor;
|
||||||
let max_gas = parent.gas_limit + parent.gas_limit / gas_limit_divisor;
|
let max_gas = parent.gas_limit + parent.gas_limit / gas_limit_divisor;
|
||||||
if header.gas_limit <= min_gas || header.gas_limit >= max_gas {
|
if header.gas_limit <= min_gas || header.gas_limit >= max_gas {
|
||||||
return Err(From::from(BlockError::InvalidGasLimit(OutOfBounds { min: Some(min_gas), max: Some(max_gas), found: header.gas_limit })));
|
return Err(From::from(BlockError::InvalidGasLimit(OutOfBounds { min: Some(min_gas), max: Some(max_gas), found: header.gas_limit })));
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -220,8 +217,8 @@ impl Ethash {
|
|||||||
let frontier_limit = self.u64_param("frontierCompatibilityModeLimit");
|
let frontier_limit = self.u64_param("frontierCompatibilityModeLimit");
|
||||||
let mut target = if header.number < frontier_limit {
|
let mut target = if header.number < frontier_limit {
|
||||||
if header.timestamp >= parent.timestamp + duration_limit {
|
if header.timestamp >= parent.timestamp + duration_limit {
|
||||||
parent.difficulty - (parent.difficulty / difficulty_bound_divisor)
|
parent.difficulty - (parent.difficulty / difficulty_bound_divisor)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
parent.difficulty + (parent.difficulty / difficulty_bound_divisor)
|
parent.difficulty + (parent.difficulty / difficulty_bound_divisor)
|
||||||
}
|
}
|
||||||
@ -243,7 +240,7 @@ impl Ethash {
|
|||||||
}
|
}
|
||||||
target
|
target
|
||||||
}
|
}
|
||||||
|
|
||||||
fn boundary_to_difficulty(boundary: &H256) -> U256 {
|
fn boundary_to_difficulty(boundary: &H256) -> U256 {
|
||||||
U256::from((U512::one() << 256) / x!(U256::from(boundary.as_slice())))
|
U256::from((U512::one() << 256) / x!(U256::from(boundary.as_slice())))
|
||||||
}
|
}
|
||||||
|
@ -581,9 +581,10 @@ impl Interpreter {
|
|||||||
let code_address = stack.pop_back();
|
let code_address = stack.pop_back();
|
||||||
let code_address = u256_to_address(&code_address);
|
let code_address = u256_to_address(&code_address);
|
||||||
|
|
||||||
let value = match instruction == instructions::DELEGATECALL {
|
let value = if instruction == instructions::DELEGATECALL {
|
||||||
true => None,
|
None
|
||||||
false => Some(stack.pop_back())
|
} else {
|
||||||
|
Some(stack.pop_back())
|
||||||
};
|
};
|
||||||
|
|
||||||
let in_off = stack.pop_back();
|
let in_off = stack.pop_back();
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
// TODO [todr] not really sure
|
// TODO [todr] not really sure
|
||||||
#![cfg_attr(feature="dev", allow(needless_range_loop))]
|
#![cfg_attr(feature="dev", allow(needless_range_loop))]
|
||||||
// Shorter than if-else
|
// Shorter than if-else
|
||||||
#![cfg_attr(feautre="dev", allow(match_bool))]
|
#![cfg_attr(feature="dev", allow(match_bool))]
|
||||||
// Keeps consistency (all lines with `.clone()`) and helpful when changing ref to non-ref.
|
// Keeps consistency (all lines with `.clone()`) and helpful when changing ref to non-ref.
|
||||||
#![cfg_attr(feature="dev", allow(clone_on_copy))]
|
#![cfg_attr(feature="dev", allow(clone_on_copy))]
|
||||||
|
|
||||||
|
@ -37,10 +37,11 @@ impl Default for Action {
|
|||||||
impl Decodable for Action {
|
impl Decodable for Action {
|
||||||
fn decode<D>(decoder: &D) -> Result<Self, DecoderError> where D: Decoder {
|
fn decode<D>(decoder: &D) -> Result<Self, DecoderError> where D: Decoder {
|
||||||
let rlp = decoder.as_rlp();
|
let rlp = decoder.as_rlp();
|
||||||
match rlp.is_empty() {
|
if rlp.is_empty() {
|
||||||
true => Ok(Action::Create),
|
Ok(Action::Create)
|
||||||
false => Ok(Action::Call(try!(rlp.as_val())))
|
} else {
|
||||||
}
|
Ok(Action::Call(try!(rlp.as_val())))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,6 +80,7 @@ impl Transaction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl FromJson for SignedTransaction {
|
impl FromJson for SignedTransaction {
|
||||||
|
#[cfg_attr(feature="dev", allow(single_char_pattern))]
|
||||||
fn from_json(json: &Json) -> SignedTransaction {
|
fn from_json(json: &Json) -> SignedTransaction {
|
||||||
let t = Transaction {
|
let t = Transaction {
|
||||||
nonce: xjson!(&json["nonce"]),
|
nonce: xjson!(&json["nonce"]),
|
||||||
@ -110,7 +112,7 @@ impl FromJson for SignedTransaction {
|
|||||||
|
|
||||||
impl Transaction {
|
impl Transaction {
|
||||||
/// The message hash of the transaction.
|
/// The message hash of the transaction.
|
||||||
pub fn hash(&self) -> H256 {
|
pub fn hash(&self) -> H256 {
|
||||||
let mut stream = RlpStream::new();
|
let mut stream = RlpStream::new();
|
||||||
self.rlp_append_unsigned_transaction(&mut stream);
|
self.rlp_append_unsigned_transaction(&mut stream);
|
||||||
stream.out().sha3()
|
stream.out().sha3()
|
||||||
|
2
hook.sh
2
hook.sh
@ -1,3 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo "#!/bin/sh\ncargo test -p ethcore" >> ./.git/hooks/pre-push
|
echo "#!/bin/sh\ncargo test -p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity --features dev" > ./.git/hooks/pre-push
|
||||||
chmod +x ./.git/hooks/pre-push
|
chmod +x ./.git/hooks/pre-push
|
||||||
|
@ -30,6 +30,7 @@ extern crate env_logger;
|
|||||||
extern crate ctrlc;
|
extern crate ctrlc;
|
||||||
extern crate fdlimit;
|
extern crate fdlimit;
|
||||||
extern crate daemonize;
|
extern crate daemonize;
|
||||||
|
extern crate time;
|
||||||
|
|
||||||
#[cfg(feature = "rpc")]
|
#[cfg(feature = "rpc")]
|
||||||
extern crate ethcore_rpc as rpc;
|
extern crate ethcore_rpc as rpc;
|
||||||
@ -38,7 +39,6 @@ use std::net::{SocketAddr};
|
|||||||
use std::env;
|
use std::env;
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use rlog::{LogLevelFilter};
|
|
||||||
use env_logger::LogBuilder;
|
use env_logger::LogBuilder;
|
||||||
use ctrlc::CtrlC;
|
use ctrlc::CtrlC;
|
||||||
use util::*;
|
use util::*;
|
||||||
@ -74,7 +74,7 @@ Options:
|
|||||||
--peers NUM Try to manintain that many peers [default: 25].
|
--peers NUM Try to manintain that many peers [default: 25].
|
||||||
--no-discovery Disable new peer discovery.
|
--no-discovery Disable new peer discovery.
|
||||||
--upnp Use UPnP to try to figure out the correct network settings.
|
--upnp Use UPnP to try to figure out the correct network settings.
|
||||||
--node-key KEY Specify node secret key as hex string.
|
--node-key KEY Specify node secret key, either as 64-character hex string or input to SHA3 operation.
|
||||||
|
|
||||||
--cache-pref-size BYTES Specify the prefered size of the blockchain cache in bytes [default: 16384].
|
--cache-pref-size BYTES Specify the prefered size of the blockchain cache in bytes [default: 16384].
|
||||||
--cache-max-size BYTES Specify the maximum size of the blockchain cache in bytes [default: 262144].
|
--cache-max-size BYTES Specify the maximum size of the blockchain cache in bytes [default: 262144].
|
||||||
@ -112,6 +112,8 @@ struct Args {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn setup_log(init: &Option<String>) {
|
fn setup_log(init: &Option<String>) {
|
||||||
|
use rlog::*;
|
||||||
|
|
||||||
let mut builder = LogBuilder::new();
|
let mut builder = LogBuilder::new();
|
||||||
builder.filter(None, LogLevelFilter::Info);
|
builder.filter(None, LogLevelFilter::Info);
|
||||||
|
|
||||||
@ -123,6 +125,15 @@ fn setup_log(init: &Option<String>) {
|
|||||||
builder.parse(s);
|
builder.parse(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let format = |record: &LogRecord| {
|
||||||
|
let timestamp = time::strftime("%Y-%m-%d %H:%M:%S %Z", &time::now()).unwrap();
|
||||||
|
if max_log_level() <= LogLevelFilter::Info {
|
||||||
|
format!("{}{}", timestamp, record.args())
|
||||||
|
} else {
|
||||||
|
format!("{}{}:{}: {}", timestamp, record.level(), record.target(), record.args())
|
||||||
|
}
|
||||||
|
};
|
||||||
|
builder.format(format);
|
||||||
builder.init().unwrap();
|
builder.init().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +192,7 @@ impl Configuration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn _keys_path(&self) -> String {
|
fn _keys_path(&self) -> String {
|
||||||
self.args.flag_keys_path.replace("$HOME", env::home_dir().unwrap().to_str().unwrap())
|
self.args.flag_keys_path.replace("$HOME", env::home_dir().unwrap().to_str().unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn spec(&self) -> Spec {
|
fn spec(&self) -> Spec {
|
||||||
@ -194,9 +205,10 @@ impl Configuration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn normalize_enode(e: &str) -> Option<String> {
|
fn normalize_enode(e: &str) -> Option<String> {
|
||||||
match is_valid_node_url(e) {
|
if is_valid_node_url(e) {
|
||||||
true => Some(e.to_owned()),
|
Some(e.to_owned())
|
||||||
false => None,
|
} else {
|
||||||
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,22 +221,23 @@ impl Configuration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature="dev", allow(useless_format))]
|
||||||
fn net_addresses(&self) -> (Option<SocketAddr>, Option<SocketAddr>) {
|
fn net_addresses(&self) -> (Option<SocketAddr>, Option<SocketAddr>) {
|
||||||
let mut listen_address = None;
|
let mut listen_address = None;
|
||||||
let mut public_address = None;
|
let mut public_address = None;
|
||||||
|
|
||||||
if let Some(ref a) = self.args.flag_address {
|
if let Some(ref a) = self.args.flag_address {
|
||||||
public_address = Some(SocketAddr::from_str(a.as_ref()).expect("Invalid listen/public address given with --address"));
|
public_address = Some(SocketAddr::from_str(a.as_ref()).unwrap_or_else(|_| die!("{}: Invalid listen/public address given with --address", a)));
|
||||||
listen_address = public_address;
|
listen_address = public_address;
|
||||||
}
|
}
|
||||||
if listen_address.is_none() {
|
if listen_address.is_none() {
|
||||||
listen_address = Some(SocketAddr::from_str(self.args.flag_listen_address.as_ref()).expect("Invalid listen address given with --listen-address"));
|
listen_address = Some(SocketAddr::from_str(self.args.flag_listen_address.as_ref()).unwrap_or_else(|_| die!("{}: Invalid listen/public address given with --listen-address", self.args.flag_listen_address)));
|
||||||
}
|
}
|
||||||
if let Some(ref a) = self.args.flag_public_address {
|
if let Some(ref a) = self.args.flag_public_address {
|
||||||
if public_address.is_some() {
|
if public_address.is_some() {
|
||||||
panic!("Conflicting flags: --address and --public-address");
|
die!("Conflicting flags provided: --address and --public-address");
|
||||||
}
|
}
|
||||||
public_address = Some(SocketAddr::from_str(a.as_ref()).expect("Invalid listen address given with --public-address"));
|
public_address = Some(SocketAddr::from_str(a.as_ref()).unwrap_or_else(|_| die!("{}: Invalid listen/public address given with --public-address", a)));
|
||||||
}
|
}
|
||||||
(listen_address, public_address)
|
(listen_address, public_address)
|
||||||
}
|
}
|
||||||
@ -236,7 +249,7 @@ impl Configuration {
|
|||||||
let (listen, public) = self.net_addresses();
|
let (listen, public) = self.net_addresses();
|
||||||
ret.listen_address = listen;
|
ret.listen_address = listen;
|
||||||
ret.public_address = public;
|
ret.public_address = public;
|
||||||
ret.use_secret = self.args.flag_node_key.as_ref().map(|s| Secret::from_str(&s).expect("Invalid key string"));
|
ret.use_secret = self.args.flag_node_key.as_ref().map(|s| Secret::from_str(&s).unwrap_or_else(|_| s.sha3()));
|
||||||
ret.discovery_enabled = !self.args.flag_no_discovery;
|
ret.discovery_enabled = !self.args.flag_no_discovery;
|
||||||
ret.ideal_peers = self.args.flag_peers;
|
ret.ideal_peers = self.args.flag_peers;
|
||||||
let mut net_path = PathBuf::from(&self.path());
|
let mut net_path = PathBuf::from(&self.path());
|
||||||
@ -279,6 +292,7 @@ impl Configuration {
|
|||||||
|
|
||||||
// Setup rpc
|
// Setup rpc
|
||||||
if self.args.flag_jsonrpc {
|
if self.args.flag_jsonrpc {
|
||||||
|
SocketAddr::from_str(&self.args.flag_jsonrpc_url).unwrap_or_else(|_|die!("{}: Invalid JSONRPC listen address given with --jsonrpc-url. Should be of the form 'IP:port'.", self.args.flag_jsonrpc_url));
|
||||||
setup_rpc_server(service.client(), sync.clone(), &self.args.flag_jsonrpc_url);
|
setup_rpc_server(service.client(), sync.clone(), &self.args.flag_jsonrpc_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ jsonrpc-http-server = "1.1"
|
|||||||
ethcore-util = { path = "../util" }
|
ethcore-util = { path = "../util" }
|
||||||
ethcore = { path = "../ethcore" }
|
ethcore = { path = "../ethcore" }
|
||||||
ethsync = { path = "../sync" }
|
ethsync = { path = "../sync" }
|
||||||
clippy = { version = "0.0.42", optional = true }
|
clippy = { version = "0.0.44", optional = true }
|
||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
serde_macros = { version = "0.6.13", optional = true }
|
serde_macros = { version = "0.6.13", optional = true }
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ authors = ["Ethcore <admin@ethcore.io"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
ethcore-util = { path = "../util" }
|
ethcore-util = { path = "../util" }
|
||||||
ethcore = { path = ".." }
|
ethcore = { path = ".." }
|
||||||
clippy = { version = "0.0.42", optional = true }
|
clippy = { version = "0.0.44", optional = true }
|
||||||
log = "0.3"
|
log = "0.3"
|
||||||
env_logger = "0.3"
|
env_logger = "0.3"
|
||||||
time = "0.1.34"
|
time = "0.1.34"
|
||||||
@ -18,4 +18,4 @@ rand = "0.3.13"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
dev = ["clippy", "ethcore/dev", "ethcore-util/dev"]
|
dev = ["clippy", "ethcore/dev", "ethcore-util/dev"]
|
||||||
|
@ -27,7 +27,7 @@ crossbeam = "0.2"
|
|||||||
slab = "0.1"
|
slab = "0.1"
|
||||||
sha3 = { path = "sha3" }
|
sha3 = { path = "sha3" }
|
||||||
serde = "0.6.7"
|
serde = "0.6.7"
|
||||||
clippy = { version = "0.0.42", optional = true }
|
clippy = { version = "0.0.44", optional = true }
|
||||||
json-tests = { path = "json-tests" }
|
json-tests = { path = "json-tests" }
|
||||||
rustc_version = "0.1.0"
|
rustc_version = "0.1.0"
|
||||||
igd = "0.4.2"
|
igd = "0.4.2"
|
||||||
|
@ -305,7 +305,7 @@ fn uuid_to_string(uuid: &Uuid) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn uuid_from_string(s: &str) -> Result<Uuid, UtilError> {
|
fn uuid_from_string(s: &str) -> Result<Uuid, UtilError> {
|
||||||
let parts: Vec<&str> = s.split("-").collect();
|
let parts: Vec<&str> = s.split('-').collect();
|
||||||
if parts.len() != 5 { return Err(UtilError::BadSize); }
|
if parts.len() != 5 { return Err(UtilError::BadSize); }
|
||||||
|
|
||||||
let mut uuid = H128::zero();
|
let mut uuid = H128::zero();
|
||||||
|
@ -276,9 +276,6 @@ impl Discovery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn writable(&mut self) {
|
pub fn writable(&mut self) {
|
||||||
if self.send_queue.is_empty() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
while !self.send_queue.is_empty() {
|
while !self.send_queue.is_empty() {
|
||||||
let data = self.send_queue.pop_front().unwrap();
|
let data = self.send_queue.pop_front().unwrap();
|
||||||
match self.udp_socket.send_to(&data.payload, &data.address) {
|
match self.udp_socket.send_to(&data.payload, &data.address) {
|
||||||
|
@ -500,7 +500,7 @@ impl<Message> Host<Message> where Message: Send + Sync + Clone {
|
|||||||
match TcpStream::connect(&address) {
|
match TcpStream::connect(&address) {
|
||||||
Ok(socket) => socket,
|
Ok(socket) => socket,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!("Can't connect to node: {:?}", e);
|
warn!("Can't connect to address {:?}: {:?}", address, e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ impl Display for Node {
|
|||||||
impl FromStr for Node {
|
impl FromStr for Node {
|
||||||
type Err = UtilError;
|
type Err = UtilError;
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
let (id, endpoint) = if &s[0..8] == "enode://" && s.len() > 136 && &s[136..137] == "@" {
|
let (id, endpoint) = if s.len() > 136 && &s[0..8] == "enode://" && &s[136..137] == "@" {
|
||||||
(try!(NodeId::from_str(&s[8..136])), try!(NodeEndpoint::from_str(&s[137..])))
|
(try!(NodeId::from_str(&s[8..136])), try!(NodeEndpoint::from_str(&s[137..])))
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -69,13 +69,13 @@ impl<'a> Iterator for NibbleSliceIterator<'a> {
|
|||||||
|
|
||||||
impl<'a, 'view> NibbleSlice<'a> where 'a: 'view {
|
impl<'a, 'view> NibbleSlice<'a> where 'a: 'view {
|
||||||
/// Create a new nibble slice with the given byte-slice.
|
/// Create a new nibble slice with the given byte-slice.
|
||||||
pub fn new(data: &[u8]) -> NibbleSlice { NibbleSlice::new_offset(data, 0) }
|
pub fn new(data: &'a [u8]) -> Self { NibbleSlice::new_offset(data, 0) }
|
||||||
|
|
||||||
/// Create a new nibble slice with the given byte-slice with a nibble offset.
|
/// Create a new nibble slice with the given byte-slice with a nibble offset.
|
||||||
pub fn new_offset(data: &'a [u8], offset: usize) -> NibbleSlice { NibbleSlice{data: data, offset: offset, data_encode_suffix: &b""[..], offset_encode_suffix: 0} }
|
pub fn new_offset(data: &'a [u8], offset: usize) -> Self { NibbleSlice{data: data, offset: offset, data_encode_suffix: &b""[..], offset_encode_suffix: 0} }
|
||||||
|
|
||||||
/// Create a composed nibble slice; one followed by the other.
|
/// Create a composed nibble slice; one followed by the other.
|
||||||
pub fn new_composed(a: &'a NibbleSlice, b: &'a NibbleSlice) -> NibbleSlice<'a> { NibbleSlice{data: a.data, offset: a.offset, data_encode_suffix: b.data, offset_encode_suffix: b.offset} }
|
pub fn new_composed(a: &'a NibbleSlice, b: &'a NibbleSlice) -> Self { NibbleSlice{data: a.data, offset: a.offset, data_encode_suffix: b.data, offset_encode_suffix: b.offset} }
|
||||||
|
|
||||||
/*pub fn new_composed_bytes_offset(a: &NibbleSlice, b: &NibbleSlice) -> (Bytes, usize) {
|
/*pub fn new_composed_bytes_offset(a: &NibbleSlice, b: &NibbleSlice) -> (Bytes, usize) {
|
||||||
let r: Vec<u8>::with_capacity((a.len() + b.len() + 1) / 2);
|
let r: Vec<u8>::with_capacity((a.len() + b.len() + 1) / 2);
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
//! Big unsigned integer types
|
//! Big unsigned integer types
|
||||||
//!
|
//!
|
||||||
//! Implementation of a various large-but-fixed sized unsigned integer types.
|
//! Implementation of a various large-but-fixed sized unsigned integer types.
|
||||||
//! The functions here are designed to be fast.
|
//! The functions here are designed to be fast.
|
||||||
//!
|
//!
|
||||||
@ -99,7 +99,7 @@ pub trait Uint: Sized + Default + FromStr + From<u64> + FromJson + fmt::Debug +
|
|||||||
|
|
||||||
/// Conversion to u64 with overflow checking
|
/// Conversion to u64 with overflow checking
|
||||||
fn as_u64(&self) -> u64;
|
fn as_u64(&self) -> u64;
|
||||||
|
|
||||||
/// Return the least number of bits needed to represent the number
|
/// Return the least number of bits needed to represent the number
|
||||||
fn bits(&self) -> usize;
|
fn bits(&self) -> usize;
|
||||||
/// Return if specific bit is set
|
/// Return if specific bit is set
|
||||||
@ -124,7 +124,7 @@ pub trait Uint: Sized + Default + FromStr + From<u64> + FromJson + fmt::Debug +
|
|||||||
|
|
||||||
/// Multiple this `Uint` with other returning result and possible overflow
|
/// Multiple this `Uint` with other returning result and possible overflow
|
||||||
fn overflowing_mul(self, other: Self) -> (Self, bool);
|
fn overflowing_mul(self, other: Self) -> (Self, bool);
|
||||||
|
|
||||||
/// Divide this `Uint` by other returning result and possible overflow
|
/// Divide this `Uint` by other returning result and possible overflow
|
||||||
fn overflowing_div(self, other: Self) -> (Self, bool);
|
fn overflowing_div(self, other: Self) -> (Self, bool);
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ pub trait Uint: Sized + Default + FromStr + From<u64> + FromJson + fmt::Debug +
|
|||||||
|
|
||||||
/// Returns negation of this `Uint` and overflow (always true)
|
/// Returns negation of this `Uint` and overflow (always true)
|
||||||
fn overflowing_neg(self) -> (Self, bool);
|
fn overflowing_neg(self) -> (Self, bool);
|
||||||
|
|
||||||
/// Shifts this `Uint` and returns overflow
|
/// Shifts this `Uint` and returns overflow
|
||||||
fn overflowing_shl(self, shift: u32) -> (Self, bool);
|
fn overflowing_shl(self, shift: u32) -> (Self, bool);
|
||||||
}
|
}
|
||||||
@ -175,7 +175,7 @@ macro_rules! construct_uint {
|
|||||||
fn as_u32(&self) -> u32 {
|
fn as_u32(&self) -> u32 {
|
||||||
let &$name(ref arr) = self;
|
let &$name(ref arr) = self;
|
||||||
if (arr[0] & (0xffffffffu64 << 32)) != 0 {
|
if (arr[0] & (0xffffffffu64 << 32)) != 0 {
|
||||||
panic!("Integer overflow when casting U256")
|
panic!("Integer overflow when casting U256")
|
||||||
}
|
}
|
||||||
self.as_u64() as u32
|
self.as_u64() as u32
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ macro_rules! construct_uint {
|
|||||||
let &$name(ref arr) = self;
|
let &$name(ref arr) = self;
|
||||||
for i in 1..$n_words {
|
for i in 1..$n_words {
|
||||||
if arr[i] != 0 {
|
if arr[i] != 0 {
|
||||||
panic!("Integer overflow when casting U256")
|
panic!("Integer overflow when casting U256")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
arr[0]
|
arr[0]
|
||||||
@ -320,7 +320,7 @@ macro_rules! construct_uint {
|
|||||||
if b_carry {
|
if b_carry {
|
||||||
let ret = overflowing!($name(ret).overflowing_add($name(carry)), overflow);
|
let ret = overflowing!($name(ret).overflowing_add($name(carry)), overflow);
|
||||||
(ret, overflow)
|
(ret, overflow)
|
||||||
} else {
|
} else {
|
||||||
($name(ret), overflow)
|
($name(ret), overflow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -448,7 +448,7 @@ macro_rules! construct_uint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl serde::Serialize for $name {
|
impl serde::Serialize for $name {
|
||||||
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error>
|
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error>
|
||||||
where S: serde::Serializer {
|
where S: serde::Serializer {
|
||||||
let mut hex = "0x".to_owned();
|
let mut hex = "0x".to_owned();
|
||||||
let mut bytes = [0u8; 8 * $n_words];
|
let mut bytes = [0u8; 8 * $n_words];
|
||||||
@ -791,6 +791,7 @@ macro_rules! construct_uint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature="dev", allow(derive_hash_xor_eq))] // We are pretty sure it's ok.
|
||||||
impl Hash for $name {
|
impl Hash for $name {
|
||||||
fn hash<H>(&self, state: &mut H) where H: Hasher {
|
fn hash<H>(&self, state: &mut H) where H: Hasher {
|
||||||
unsafe { state.write(::std::slice::from_raw_parts(self.0.as_ptr() as *mut u8, self.0.len() * 8)); }
|
unsafe { state.write(::std::slice::from_raw_parts(self.0.as_ptr() as *mut u8, self.0.len() * 8)); }
|
||||||
|
Loading…
Reference in New Issue
Block a user