Merge branch 'master' into ui-2

# Conflicts:
#	js/package.json
#	js/src/api/local/ethkey/worker.js
#	js/src/modals/FirstRun/TnC/tnc.js
#	js/src/modals/FirstRun/Welcome/welcome.js
#	js/src/ui/Form/Input/input.js
#	js/src/ui/VaultCard/Accounts/accounts.spec.js
#	js/src/views/Accounts/accounts.js
#	js/src/views/Application/TabBar/tabBar.js
#	js/src/views/Settings/Views/defaults.js
#	js/src/views/Settings/Views/views.js
#	js/webpack/app.js
#	js/webpack/libraries.js
This commit is contained in:
Jaco Greeff 2017-06-13 11:02:38 +02:00
parent 7f4a7abf49
commit 7bbd48a2bd
93 changed files with 1762 additions and 533 deletions

View File

@ -9,6 +9,7 @@ variables:
RUST_BACKTRACE: "1"
RUSTFLAGS: ""
CARGOFLAGS: ""
CI_SERVER_NAME: "GitLab CI"
cache:
key: "$CI_BUILD_STAGE/$CI_BUILD_REF_NAME"
untracked: true
@ -607,19 +608,6 @@ js-test:
tags:
- rust
- rust-stable
js-test-node_8:
stage: test
image: parity/rust-debian-node_8:gitlab-ci
before_script:
- git submodule update --init --recursive
- export JS_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep ^js/ | wc -l)
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS deps install since no JS files modified."; else ./js/scripts/install-deps.sh;fi
script:
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS lint since no JS files modified."; else ./js/scripts/lint.sh && ./js/scripts/test.sh && ./js/scripts/build.sh; fi
tags:
- rust
- rust-stable
allow_failure: true
test-rust-beta:
stage: test
only:

View File

@ -1,3 +1,41 @@
## Parity [v1.6.8](https://github.com/paritytech/parity/releases/tag/v1.6.8) (2017-06-08)
This release addresses:
- a rare condition where quickly creating a new account was generating an account not matching the recovery phrase.
- compressed RLP strings caused wrong/empty transaction receipts on Classic network.
- blacklisting the _empty phrase_ account from UI and RPC on non-development chains. See also [this blog post](https://blog.parity.io/restoring-blank-seed-phrase/).
- canceling transactions that didn't have a condition.
- the updated Expanse fork block and chain ID.
Full changelog:
- Backporting to beta [#5791](https://github.com/paritytech/parity/pull/5791)
- Bump to v1.6.8
- Update expanse json with fork at block 600000 [#5351](https://github.com/paritytech/parity/pull/5351)
- Update expanse json with fork at block 600000
- Update exp chainID to 2
- Bumped mio [#5763](https://github.com/paritytech/parity/pull/5763)
- Fixed default UI port for mac installer [#5782](https://github.com/paritytech/parity/pull/5782)
- Blacklist empty phrase account. [#5730](https://github.com/paritytech/parity/pull/5730)
- Update Cid/multihash/ring/tinykeccak [#5785](https://github.com/paritytech/parity/pull/5785)
- Updating ring,multihash,tiny-keccak
- Updating CID in ipfs.
- Disable compression for RLP strings [#5786](https://github.com/paritytech/parity/pull/5786)
- Beta Backports [#5789](https://github.com/paritytech/parity/pull/5789)
- Fix local transactions without condition. [#5716](https://github.com/paritytech/parity/pull/5716)
- Block invalid account name creation [#5784](https://github.com/paritytech/parity/pull/5784)
- Additional non-empty phrase check (fromNew)
- Explicit canCreate check in create (not only on UI)
- BN instance check (fixes Geth imports)
- Fixup tests after better checks
- Recover from empty phrase in dev mode [#5698](https://github.com/paritytech/parity/pull/5698)
- Add dev chain to isTest
- Fix signer
- Fix no condition transactions
- Fix case: old parity
- Fix propTypes.
## Parity [v1.6.7](https://github.com/paritytech/parity/releases/tag/v1.6.7) (2017-05-18)
This release addresses:

80
Cargo.lock generated
View File

@ -120,6 +120,11 @@ name = "bitflags"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bitflags"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "blastfig"
version = "0.3.3"
@ -800,6 +805,11 @@ name = "fnv"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "foreign-types"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "futures"
version = "0.1.11"
@ -942,7 +952,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
"native-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"native-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1017,7 +1027,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "jsonrpc-core"
version = "7.0.0"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#900b528213ffd1aaaefd29e2b99dfab892b15ab4"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#87db29043826f152cce171351fa34fada287764d"
dependencies = [
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1029,7 +1039,7 @@ dependencies = [
[[package]]
name = "jsonrpc-http-server"
version = "7.0.0"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#900b528213ffd1aaaefd29e2b99dfab892b15ab4"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#87db29043826f152cce171351fa34fada287764d"
dependencies = [
"hyper 0.10.0-a.0 (git+https://github.com/paritytech/hyper)",
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
@ -1042,7 +1052,7 @@ dependencies = [
[[package]]
name = "jsonrpc-ipc-server"
version = "7.0.0"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#900b528213ffd1aaaefd29e2b99dfab892b15ab4"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#87db29043826f152cce171351fa34fada287764d"
dependencies = [
"bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
@ -1055,7 +1065,7 @@ dependencies = [
[[package]]
name = "jsonrpc-macros"
version = "7.0.0"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#900b528213ffd1aaaefd29e2b99dfab892b15ab4"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#87db29043826f152cce171351fa34fada287764d"
dependencies = [
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
"jsonrpc-pubsub 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
@ -1065,7 +1075,7 @@ dependencies = [
[[package]]
name = "jsonrpc-minihttp-server"
version = "7.0.0"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#900b528213ffd1aaaefd29e2b99dfab892b15ab4"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#87db29043826f152cce171351fa34fada287764d"
dependencies = [
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
"jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
@ -1079,7 +1089,7 @@ dependencies = [
[[package]]
name = "jsonrpc-pubsub"
version = "7.0.0"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#900b528213ffd1aaaefd29e2b99dfab892b15ab4"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#87db29043826f152cce171351fa34fada287764d"
dependencies = [
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1089,7 +1099,7 @@ dependencies = [
[[package]]
name = "jsonrpc-server-utils"
version = "7.0.0"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#900b528213ffd1aaaefd29e2b99dfab892b15ab4"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#87db29043826f152cce171351fa34fada287764d"
dependencies = [
"globset 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
@ -1101,7 +1111,7 @@ dependencies = [
[[package]]
name = "jsonrpc-tcp-server"
version = "7.0.0"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#900b528213ffd1aaaefd29e2b99dfab892b15ab4"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#87db29043826f152cce171351fa34fada287764d"
dependencies = [
"bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
@ -1115,7 +1125,7 @@ dependencies = [
[[package]]
name = "jsonrpc-ws-server"
version = "7.0.0"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#900b528213ffd1aaaefd29e2b99dfab892b15ab4"
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#87db29043826f152cce171351fa34fada287764d"
dependencies = [
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
"jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
@ -1366,13 +1376,13 @@ dependencies = [
[[package]]
name = "native-tls"
version = "0.1.0"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"openssl 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
"schannel 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.9.13 (registry+https://github.com/rust-lang/crates.io-index)",
"schannel 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1499,23 +1509,25 @@ dependencies = [
[[package]]
name = "openssl"
version = "0.9.3"
version = "0.9.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.13 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl-sys"
version = "0.9.3"
version = "0.9.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)",
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1791,7 +1803,7 @@ dependencies = [
[[package]]
name = "parity-ui-precompiled"
version = "1.4.0"
source = "git+https://github.com/paritytech/js-precompiled.git#52ba0075a974e89a723e04c55dd5d5b9941d9a11"
source = "git+https://github.com/paritytech/js-precompiled.git#0811e57083d75d8e93e03ccd9bba3432703236ce"
dependencies = [
"parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1887,7 +1899,7 @@ dependencies = [
[[package]]
name = "pkg-config"
version = "0.3.8"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -2184,7 +2196,7 @@ dependencies = [
[[package]]
name = "schannel"
version = "0.1.1"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2212,18 +2224,18 @@ dependencies = [
[[package]]
name = "security-framework"
version = "0.1.9"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"core-foundation 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "security-framework-sys"
version = "0.1.9"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"core-foundation-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2857,6 +2869,7 @@ dependencies = [
"checksum bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5b97c2c8e8bbb4251754f559df8af22fb264853c7d009084a576cdf12565089d"
"checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23"
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum blastfig 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "09640e0509d97d5cdff03a9f5daf087a8e04c735c3b113a75139634a19cfc7b2"
"checksum bloomchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f421095d2a76fc24cd3fb3f912b90df06be7689912b1bdb423caefae59c258d"
"checksum bn 0.4.4 (git+https://github.com/paritytech/bn)" = "<none>"
@ -2888,6 +2901,7 @@ dependencies = [
"checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa"
"checksum flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "3eeb481e957304178d2e782f2da1257f1434dfecbae883bafb61ada2a9fea3bb"
"checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344"
"checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d"
"checksum futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8e51e7f9c150ba7fd4cee9df8bf6ea3dea5b63b68955ddad19ccd35b71dcfb4d"
"checksum futures-cpupool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bb982bb25cd8fa5da6a8eb3a460354c984ff1113da82bcb4f0b0862b5795db82"
"checksum gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)" = "c07c758b972368e703a562686adb39125707cc1ef3399da8c019fc6c2498a75d"
@ -2945,7 +2959,7 @@ dependencies = [
"checksum multihash 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d14363c7695e2e5adbbb8fe139d806a19b8b13f02b9b1fb770fab0c12edaff58"
"checksum nanomsg 0.5.1 (git+https://github.com/paritytech/nanomsg.rs.git?branch=parity-1.7)" = "<none>"
"checksum nanomsg-sys 0.5.0 (git+https://github.com/paritytech/nanomsg.rs.git?branch=parity-1.7)" = "<none>"
"checksum native-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aa4e52995154bb6f0b41e4379a279482c9387c1632e3798ba4e511ef8c54ee09"
"checksum native-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e94a2fc65a44729fe969cc973da87c1052ae3f000b2cb33029f14aeb85550d5"
"checksum net2 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)" = "bc01404e7568680f1259aa5729539f221cb1e6d047a0d9053cab4be8a73b5d67"
"checksum nodrop 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "52cd74cd09beba596430cc6e3091b74007169a56246e1262f0ba451ea95117b2"
"checksum nom 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6caab12c5f97aa316cb249725aa32115118e1522b445e26c257dd77cad5ffd4e"
@ -2960,8 +2974,8 @@ dependencies = [
"checksum number_prefix 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "084d05f4bf60621a9ac9bde941a410df548f4de9545f06e5ee9d3aef4b97cd77"
"checksum odds 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "b28c06e81b0f789122d415d6394b5fe849bde8067469f4c2980d3cdc10c78ec1"
"checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c"
"checksum openssl 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "12be61c7eaa23228316ff02c39807e4c1b1af84ba81420f19fd58dade304b25c"
"checksum openssl-sys 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d2845e841700e7b04282ceaa115407ea84e0db918ae689ad9ceb6f06fa6046bd"
"checksum openssl 0.9.13 (registry+https://github.com/rust-lang/crates.io-index)" = "b34cd77cf91301fff3123fbd46b065c3b728b17a392835de34c397315dce5586"
"checksum openssl-sys 0.9.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e035022a50faa380bd7ccdbd184d946ce539ebdb0a358780de92a995882af97a"
"checksum order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "efa535d5117d3661134dbf1719b6f0ffe06f2375843b13935db186cd094105eb"
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
"checksum parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1d06f6ee0fda786df3784a96ee3f0629f529b91cbfb7d142f6410e6bcd1ce2c"
@ -2974,7 +2988,7 @@ dependencies = [
"checksum phf_codegen 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)" = "8af7ae7c3f75a502292b491e5cc0a1f69e3407744abe6e57e2a3b712bb82f01d"
"checksum phf_generator 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)" = "db005608fd99800c8c74106a7c894cf582055b689aa14a79462cefdcb7dc1cc3"
"checksum phf_shared 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)" = "fee4d039930e4f45123c9b15976cf93a499847b6483dc09c42ea0ec4940f2aa6"
"checksum pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8cee804ecc7eaf201a4a207241472cc870e825206f6c031e3ee2a72fa425f2fa"
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903"
"checksum podio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e5422a1ee1bc57cc47ae717b0137314258138f38fd5f3cea083f43a9725383a0"
"checksum pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2412f3332a07c7a2a50168988dcc184f32180a9758ad470390e5f55e089f6b6e"
"checksum primal 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0e31b86efadeaeb1235452171a66689682783149a6249ff334a2c5d8218d00a4"
@ -3006,11 +3020,11 @@ dependencies = [
"checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b"
"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
"checksum rustc_version 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e114e275f7c9b5d50bb52b28f9aac1921209f02aa6077c8b255e21eefaf8ffa"
"checksum schannel 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "167852e03fcd0029c3ddebb5afb0715b2996f6e262b2c2aceaa7cd84edd4b158"
"checksum schannel 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4e45ac5e9e4698c1c138d2972bedcd90b81fe1efeba805449d2bdd54512de5f9"
"checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d"
"checksum secur32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f412dfa83308d893101dd59c10d6fda8283465976c28c287c5c855bf8d216bc"
"checksum security-framework 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "52186fcf3b391c9f0ccdce9a2ac708f7cc81b3f89e149b34bd9279fb1b23f9fa"
"checksum security-framework-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c84067e6297c1f09514a8666d8bbc1268817ec4a6c0f30f12f6201e1f34bd2a1"
"checksum security-framework 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "42ddf098d78d0b64564b23ee6345d07573e7d10e52ad86875d89ddf5f8378a02"
"checksum security-framework-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "5bacdada57ea62022500c457c8571c17dfb5e6240b7c8eac5916ffa8c7138a55"
"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
"checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f"
"checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537"

View File

@ -72,13 +72,14 @@ daemonize = "0.2"
[features]
default = ["ui-precompiled"]
ui = [
"dapps",
"ui-enabled",
"parity-dapps/ui",
]
ui-precompiled = [
"dapps",
"ui-enabled",
"parity-dapps/ui-precompiled",
]
ui-enabled = ["dapps"]
dapps = ["parity-dapps"]
ipc = ["ethcore/ipc", "ethsync/ipc"]
jit = ["ethcore/jit"]

View File

@ -53,7 +53,7 @@ below to build from source.
## Build dependencies
**Parity requires Rust version 1.16.0 to build**
**Parity requires Rust version 1.17.0 to build**
We recommend installing Rust through [rustup](https://www.rustup.rs/). If you don't already have rustup, you can install it like this:

View File

@ -168,7 +168,10 @@ fn verify_external(header: &Header, validators: &ValidatorSet, step: &Step) -> R
} else {
let proposer_signature = header_signature(header)?;
let correct_proposer = validators.get(header.parent_hash(), header_step);
if !verify_address(&correct_proposer, &proposer_signature, &header.bare_hash())? {
let is_invalid_proposer = *header.author() != correct_proposer ||
!verify_address(&correct_proposer, &proposer_signature, &header.bare_hash())?;
if is_invalid_proposer {
trace!(target: "engine", "verify_block_unordered: bad proposer for step: {}", header_step);
Err(EngineError::NotProposer(Mismatch { expected: correct_proposer, found: header.author().clone() }))?
} else {

View File

@ -69,6 +69,10 @@ fn verify_external(header: &Header, validators: &ValidatorSet) -> Result<(), Err
let sig = UntrustedRlp::new(&header.seal()[0]).as_val::<H520>()?;
let signer = public_to_address(&recover(&sig.into(), &header.bare_hash())?);
if *header.author() != signer {
return Err(EngineError::NotAuthorized(*header.author()).into())
}
match validators.contains(header.parent_hash(), &signer) {
false => Err(BlockError::InvalidSeal.into()),
true => Ok(())

View File

@ -60,7 +60,7 @@ pub const DEFAULT_BLOCKHASH_CONTRACT: &'static str = "73ffffffffffffffffffffffff
/// Voting errors.
#[derive(Debug)]
pub enum EngineError {
/// Signature does not belong to an authority.
/// Signature or author field does not belong to an authority.
NotAuthorized(Address),
/// The same author issued different votes at the same step.
DoubleVote(Address),

View File

@ -106,7 +106,7 @@ impl From<ethjson::spec::EthashParams> for EthashParams {
difficulty_bound_divisor: p.difficulty_bound_divisor.into(),
difficulty_increment_divisor: p.difficulty_increment_divisor.map_or(10, Into::into),
metropolis_difficulty_increment_divisor: p.metropolis_difficulty_increment_divisor.map_or(9, Into::into),
duration_limit: p.duration_limit.into(),
duration_limit: p.duration_limit.map_or(0, Into::into),
block_reward: p.block_reward.into(),
registrar: p.registrar.map_or_else(Address::new, Into::into),
homestead_transition: p.homestead_transition.map_or(0, Into::into),

View File

@ -131,7 +131,7 @@ pub trait Ext {
fn inc_sstore_clears(&mut self);
/// Prepare to trace an operation. Passthrough for the VM trace.
fn trace_prepare_execute(&mut self, _pc: usize, _instruction: u8, _stack_pop: usize, _gas_cost: &U256) -> bool { false }
fn trace_prepare_execute(&mut self, _pc: usize, _instruction: u8, _gas_cost: &U256) -> bool { false }
/// Trace the finalised execution of a single instruction.
fn trace_executed(&mut self, _gas_used: U256, _stack_push: &[U256], _mem_diff: Option<(usize, &[u8])>, _store_diff: Option<(U256, U256)>) {}

View File

@ -37,6 +37,15 @@ pub fn get_push_bytes(i: Instruction) -> usize {
(i - PUSH1 + 1) as usize
}
/// Returns number of bytes to read for `PUSHN` instruction or 0.
pub fn push_bytes(i: Instruction) -> usize {
if is_push(i) {
get_push_bytes(i)
} else {
0
}
}
#[test]
fn test_get_push_bytes() {
assert_eq!(get_push_bytes(PUSH1), 1);
@ -129,166 +138,172 @@ pub fn get_tier_idx (tier: GasPriceTier) -> usize {
}
}
/// EVM instruction information.
#[derive(Copy, Clone, Default)]
pub struct InstructionInfo {
/// Mnemonic name.
pub name: &'static str,
/// Additional code bytes used. Used only for PUSHxx.
pub additional: usize,
/// Number of stack arguments.
pub args: usize,
/// Number of returned stack items.
pub ret: usize,
pub side_effects: bool,
/// Gas price tier.
pub tier: GasPriceTier
}
impl InstructionInfo {
pub fn new(name: &'static str, additional: usize, args: usize, ret: usize, side_effects: bool, tier: GasPriceTier) -> Self {
/// Create new instruction info.
pub fn new(name: &'static str, additional: usize, args: usize, ret: usize, tier: GasPriceTier) -> Self {
InstructionInfo {
name: name,
additional: additional,
args: args,
ret: ret,
side_effects: side_effects,
tier: tier
}
}
}
lazy_static! {
/// Static instruction table.
pub static ref INSTRUCTIONS: [InstructionInfo; 0x100] = {
let mut arr = [InstructionInfo::default(); 0x100];
arr[STOP as usize] = InstructionInfo::new("STOP", 0, 0, 0, true, GasPriceTier::Zero);
arr[ADD as usize] = InstructionInfo::new("ADD", 0, 2, 1, false, GasPriceTier::VeryLow);
arr[SUB as usize] = InstructionInfo::new("SUB", 0, 2, 1, false, GasPriceTier::VeryLow);
arr[MUL as usize] = InstructionInfo::new("MUL", 0, 2, 1, false, GasPriceTier::Low);
arr[DIV as usize] = InstructionInfo::new("DIV", 0, 2, 1, false, GasPriceTier::Low);
arr[SDIV as usize] = InstructionInfo::new("SDIV", 0, 2, 1, false, GasPriceTier::Low);
arr[MOD as usize] = InstructionInfo::new("MOD", 0, 2, 1, false, GasPriceTier::Low);
arr[SMOD as usize] = InstructionInfo::new("SMOD", 0, 2, 1, false, GasPriceTier::Low);
arr[EXP as usize] = InstructionInfo::new("EXP", 0, 2, 1, false, GasPriceTier::Special);
arr[NOT as usize] = InstructionInfo::new("NOT", 0, 1, 1, false, GasPriceTier::VeryLow);
arr[LT as usize] = InstructionInfo::new("LT", 0, 2, 1, false, GasPriceTier::VeryLow);
arr[GT as usize] = InstructionInfo::new("GT", 0, 2, 1, false, GasPriceTier::VeryLow);
arr[SLT as usize] = InstructionInfo::new("SLT", 0, 2, 1, false, GasPriceTier::VeryLow);
arr[SGT as usize] = InstructionInfo::new("SGT", 0, 2, 1, false, GasPriceTier::VeryLow);
arr[EQ as usize] = InstructionInfo::new("EQ", 0, 2, 1, false, GasPriceTier::VeryLow);
arr[ISZERO as usize] = InstructionInfo::new("ISZERO", 0, 1, 1, false, GasPriceTier::VeryLow);
arr[AND as usize] = InstructionInfo::new("AND", 0, 2, 1, false, GasPriceTier::VeryLow);
arr[OR as usize] = InstructionInfo::new("OR", 0, 2, 1, false, GasPriceTier::VeryLow);
arr[XOR as usize] = InstructionInfo::new("XOR", 0, 2, 1, false, GasPriceTier::VeryLow);
arr[BYTE as usize] = InstructionInfo::new("BYTE", 0, 2, 1, false, GasPriceTier::VeryLow);
arr[ADDMOD as usize] = InstructionInfo::new("ADDMOD", 0, 3, 1, false, GasPriceTier::Mid);
arr[MULMOD as usize] = InstructionInfo::new("MULMOD", 0, 3, 1, false, GasPriceTier::Mid);
arr[SIGNEXTEND as usize] = InstructionInfo::new("SIGNEXTEND", 0, 2, 1, false, GasPriceTier::Low);
arr[RETURNDATASIZE as usize] = InstructionInfo::new("RETURNDATASIZE", 0, 0, 1, false, GasPriceTier::Base);
arr[RETURNDATACOPY as usize] = InstructionInfo::new("RETURNDATACOPY", 0, 3, 0, true, GasPriceTier::VeryLow);
arr[SHA3 as usize] = InstructionInfo::new("SHA3", 0, 2, 1, false, GasPriceTier::Special);
arr[ADDRESS as usize] = InstructionInfo::new("ADDRESS", 0, 0, 1, false, GasPriceTier::Base);
arr[BALANCE as usize] = InstructionInfo::new("BALANCE", 0, 1, 1, false, GasPriceTier::Special);
arr[ORIGIN as usize] = InstructionInfo::new("ORIGIN", 0, 0, 1, false, GasPriceTier::Base);
arr[CALLER as usize] = InstructionInfo::new("CALLER", 0, 0, 1, false, GasPriceTier::Base);
arr[CALLVALUE as usize] = InstructionInfo::new("CALLVALUE", 0, 0, 1, false, GasPriceTier::Base);
arr[CALLDATALOAD as usize] = InstructionInfo::new("CALLDATALOAD", 0, 1, 1, false, GasPriceTier::VeryLow);
arr[CALLDATASIZE as usize] = InstructionInfo::new("CALLDATASIZE", 0, 0, 1, false, GasPriceTier::Base);
arr[CALLDATACOPY as usize] = InstructionInfo::new("CALLDATACOPY", 0, 3, 0, true, GasPriceTier::VeryLow);
arr[CODESIZE as usize] = InstructionInfo::new("CODESIZE", 0, 0, 1, false, GasPriceTier::Base);
arr[CODECOPY as usize] = InstructionInfo::new("CODECOPY", 0, 3, 0, true, GasPriceTier::VeryLow);
arr[GASPRICE as usize] = InstructionInfo::new("GASPRICE", 0, 0, 1, false, GasPriceTier::Base);
arr[EXTCODESIZE as usize] = InstructionInfo::new("EXTCODESIZE", 0, 1, 1, false, GasPriceTier::Special);
arr[EXTCODECOPY as usize] = InstructionInfo::new("EXTCODECOPY", 0, 4, 0, true, GasPriceTier::Special);
arr[BLOCKHASH as usize] = InstructionInfo::new("BLOCKHASH", 0, 1, 1, false, GasPriceTier::Ext);
arr[COINBASE as usize] = InstructionInfo::new("COINBASE", 0, 0, 1, false, GasPriceTier::Base);
arr[TIMESTAMP as usize] = InstructionInfo::new("TIMESTAMP", 0, 0, 1, false, GasPriceTier::Base);
arr[NUMBER as usize] = InstructionInfo::new("NUMBER", 0, 0, 1, false, GasPriceTier::Base);
arr[DIFFICULTY as usize] = InstructionInfo::new("DIFFICULTY", 0, 0, 1, false, GasPriceTier::Base);
arr[GASLIMIT as usize] = InstructionInfo::new("GASLIMIT", 0, 0, 1, false, GasPriceTier::Base);
arr[POP as usize] = InstructionInfo::new("POP", 0, 1, 0, false, GasPriceTier::Base);
arr[MLOAD as usize] = InstructionInfo::new("MLOAD", 0, 1, 1, false, GasPriceTier::VeryLow);
arr[MSTORE as usize] = InstructionInfo::new("MSTORE", 0, 2, 0, true, GasPriceTier::VeryLow);
arr[MSTORE8 as usize] = InstructionInfo::new("MSTORE8", 0, 2, 0, true, GasPriceTier::VeryLow);
arr[SLOAD as usize] = InstructionInfo::new("SLOAD", 0, 1, 1, false, GasPriceTier::Special);
arr[SSTORE as usize] = InstructionInfo::new("SSTORE", 0, 2, 0, true, GasPriceTier::Special);
arr[JUMP as usize] = InstructionInfo::new("JUMP", 0, 1, 0, true, GasPriceTier::Mid);
arr[JUMPI as usize] = InstructionInfo::new("JUMPI", 0, 2, 0, true, GasPriceTier::High);
arr[PC as usize] = InstructionInfo::new("PC", 0, 0, 1, false, GasPriceTier::Base);
arr[MSIZE as usize] = InstructionInfo::new("MSIZE", 0, 0, 1, false, GasPriceTier::Base);
arr[GAS as usize] = InstructionInfo::new("GAS", 0, 0, 1, false, GasPriceTier::Base);
arr[JUMPDEST as usize] = InstructionInfo::new("JUMPDEST", 0, 0, 0, true, GasPriceTier::Special);
arr[PUSH1 as usize] = InstructionInfo::new("PUSH1", 1, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH2 as usize] = InstructionInfo::new("PUSH2", 2, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH3 as usize] = InstructionInfo::new("PUSH3", 3, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH4 as usize] = InstructionInfo::new("PUSH4", 4, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH5 as usize] = InstructionInfo::new("PUSH5", 5, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH6 as usize] = InstructionInfo::new("PUSH6", 6, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH7 as usize] = InstructionInfo::new("PUSH7", 7, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH8 as usize] = InstructionInfo::new("PUSH8", 8, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH9 as usize] = InstructionInfo::new("PUSH9", 9, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH10 as usize] = InstructionInfo::new("PUSH10", 10, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH11 as usize] = InstructionInfo::new("PUSH11", 11, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH12 as usize] = InstructionInfo::new("PUSH12", 12, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH13 as usize] = InstructionInfo::new("PUSH13", 13, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH14 as usize] = InstructionInfo::new("PUSH14", 14, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH15 as usize] = InstructionInfo::new("PUSH15", 15, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH16 as usize] = InstructionInfo::new("PUSH16", 16, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH17 as usize] = InstructionInfo::new("PUSH17", 17, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH18 as usize] = InstructionInfo::new("PUSH18", 18, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH19 as usize] = InstructionInfo::new("PUSH19", 19, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH20 as usize] = InstructionInfo::new("PUSH20", 20, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH21 as usize] = InstructionInfo::new("PUSH21", 21, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH22 as usize] = InstructionInfo::new("PUSH22", 22, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH23 as usize] = InstructionInfo::new("PUSH23", 23, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH24 as usize] = InstructionInfo::new("PUSH24", 24, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH25 as usize] = InstructionInfo::new("PUSH25", 25, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH26 as usize] = InstructionInfo::new("PUSH26", 26, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH27 as usize] = InstructionInfo::new("PUSH27", 27, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH28 as usize] = InstructionInfo::new("PUSH28", 28, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH29 as usize] = InstructionInfo::new("PUSH29", 29, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH30 as usize] = InstructionInfo::new("PUSH30", 30, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH31 as usize] = InstructionInfo::new("PUSH31", 31, 0, 1, false, GasPriceTier::VeryLow);
arr[PUSH32 as usize] = InstructionInfo::new("PUSH32", 32, 0, 1, false, GasPriceTier::VeryLow);
arr[DUP1 as usize] = InstructionInfo::new("DUP1", 0, 1, 2, false, GasPriceTier::VeryLow);
arr[DUP2 as usize] = InstructionInfo::new("DUP2", 0, 2, 3, false, GasPriceTier::VeryLow);
arr[DUP3 as usize] = InstructionInfo::new("DUP3", 0, 3, 4, false, GasPriceTier::VeryLow);
arr[DUP4 as usize] = InstructionInfo::new("DUP4", 0, 4, 5, false, GasPriceTier::VeryLow);
arr[DUP5 as usize] = InstructionInfo::new("DUP5", 0, 5, 6, false, GasPriceTier::VeryLow);
arr[DUP6 as usize] = InstructionInfo::new("DUP6", 0, 6, 7, false, GasPriceTier::VeryLow);
arr[DUP7 as usize] = InstructionInfo::new("DUP7", 0, 7, 8, false, GasPriceTier::VeryLow);
arr[DUP8 as usize] = InstructionInfo::new("DUP8", 0, 8, 9, false, GasPriceTier::VeryLow);
arr[DUP9 as usize] = InstructionInfo::new("DUP9", 0, 9, 10, false, GasPriceTier::VeryLow);
arr[DUP10 as usize] = InstructionInfo::new("DUP10", 0, 10, 11, false, GasPriceTier::VeryLow);
arr[DUP11 as usize] = InstructionInfo::new("DUP11", 0, 11, 12, false, GasPriceTier::VeryLow);
arr[DUP12 as usize] = InstructionInfo::new("DUP12", 0, 12, 13, false, GasPriceTier::VeryLow);
arr[DUP13 as usize] = InstructionInfo::new("DUP13", 0, 13, 14, false, GasPriceTier::VeryLow);
arr[DUP14 as usize] = InstructionInfo::new("DUP14", 0, 14, 15, false, GasPriceTier::VeryLow);
arr[DUP15 as usize] = InstructionInfo::new("DUP15", 0, 15, 16, false, GasPriceTier::VeryLow);
arr[DUP16 as usize] = InstructionInfo::new("DUP16", 0, 16, 17, false, GasPriceTier::VeryLow);
arr[SWAP1 as usize] = InstructionInfo::new("SWAP1", 0, 2, 2, false, GasPriceTier::VeryLow);
arr[SWAP2 as usize] = InstructionInfo::new("SWAP2", 0, 3, 3, false, GasPriceTier::VeryLow);
arr[SWAP3 as usize] = InstructionInfo::new("SWAP3", 0, 4, 4, false, GasPriceTier::VeryLow);
arr[SWAP4 as usize] = InstructionInfo::new("SWAP4", 0, 5, 5, false, GasPriceTier::VeryLow);
arr[SWAP5 as usize] = InstructionInfo::new("SWAP5", 0, 6, 6, false, GasPriceTier::VeryLow);
arr[SWAP6 as usize] = InstructionInfo::new("SWAP6", 0, 7, 7, false, GasPriceTier::VeryLow);
arr[SWAP7 as usize] = InstructionInfo::new("SWAP7", 0, 8, 8, false, GasPriceTier::VeryLow);
arr[SWAP8 as usize] = InstructionInfo::new("SWAP8", 0, 9, 9, false, GasPriceTier::VeryLow);
arr[SWAP9 as usize] = InstructionInfo::new("SWAP9", 0, 10, 10, false, GasPriceTier::VeryLow);
arr[SWAP10 as usize] = InstructionInfo::new("SWAP10", 0, 11, 11, false, GasPriceTier::VeryLow);
arr[SWAP11 as usize] = InstructionInfo::new("SWAP11", 0, 12, 12, false, GasPriceTier::VeryLow);
arr[SWAP12 as usize] = InstructionInfo::new("SWAP12", 0, 13, 13, false, GasPriceTier::VeryLow);
arr[SWAP13 as usize] = InstructionInfo::new("SWAP13", 0, 14, 14, false, GasPriceTier::VeryLow);
arr[SWAP14 as usize] = InstructionInfo::new("SWAP14", 0, 15, 15, false, GasPriceTier::VeryLow);
arr[SWAP15 as usize] = InstructionInfo::new("SWAP15", 0, 16, 16, false, GasPriceTier::VeryLow);
arr[SWAP16 as usize] = InstructionInfo::new("SWAP16", 0, 17, 17, false, GasPriceTier::VeryLow);
arr[LOG0 as usize] = InstructionInfo::new("LOG0", 0, 2, 0, true, GasPriceTier::Special);
arr[LOG1 as usize] = InstructionInfo::new("LOG1", 0, 3, 0, true, GasPriceTier::Special);
arr[LOG2 as usize] = InstructionInfo::new("LOG2", 0, 4, 0, true, GasPriceTier::Special);
arr[LOG3 as usize] = InstructionInfo::new("LOG3", 0, 5, 0, true, GasPriceTier::Special);
arr[LOG4 as usize] = InstructionInfo::new("LOG4", 0, 6, 0, true, GasPriceTier::Special);
arr[CREATE as usize] = InstructionInfo::new("CREATE", 0, 3, 1, true, GasPriceTier::Special);
arr[CALL as usize] = InstructionInfo::new("CALL", 0, 7, 1, true, GasPriceTier::Special);
arr[CALLCODE as usize] = InstructionInfo::new("CALLCODE", 0, 7, 1, true, GasPriceTier::Special);
arr[RETURN as usize] = InstructionInfo::new("RETURN", 0, 2, 0, true, GasPriceTier::Zero);
arr[DELEGATECALL as usize] = InstructionInfo::new("DELEGATECALL", 0, 6, 1, true, GasPriceTier::Special);
arr[SUICIDE as usize] = InstructionInfo::new("SUICIDE", 0, 1, 0, true, GasPriceTier::Special);
arr[CREATE2 as usize] = InstructionInfo::new("CREATE2", 0, 3, 1, true, GasPriceTier::Special);
arr[REVERT as usize] = InstructionInfo::new("REVERT", 0, 2, 0, true, GasPriceTier::Zero);
arr[STOP as usize] = InstructionInfo::new("STOP", 0, 0, 0, GasPriceTier::Zero);
arr[ADD as usize] = InstructionInfo::new("ADD", 0, 2, 1, GasPriceTier::VeryLow);
arr[SUB as usize] = InstructionInfo::new("SUB", 0, 2, 1, GasPriceTier::VeryLow);
arr[MUL as usize] = InstructionInfo::new("MUL", 0, 2, 1, GasPriceTier::Low);
arr[DIV as usize] = InstructionInfo::new("DIV", 0, 2, 1, GasPriceTier::Low);
arr[SDIV as usize] = InstructionInfo::new("SDIV", 0, 2, 1, GasPriceTier::Low);
arr[MOD as usize] = InstructionInfo::new("MOD", 0, 2, 1, GasPriceTier::Low);
arr[SMOD as usize] = InstructionInfo::new("SMOD", 0, 2, 1, GasPriceTier::Low);
arr[EXP as usize] = InstructionInfo::new("EXP", 0, 2, 1, GasPriceTier::Special);
arr[NOT as usize] = InstructionInfo::new("NOT", 0, 1, 1, GasPriceTier::VeryLow);
arr[LT as usize] = InstructionInfo::new("LT", 0, 2, 1, GasPriceTier::VeryLow);
arr[GT as usize] = InstructionInfo::new("GT", 0, 2, 1, GasPriceTier::VeryLow);
arr[SLT as usize] = InstructionInfo::new("SLT", 0, 2, 1, GasPriceTier::VeryLow);
arr[SGT as usize] = InstructionInfo::new("SGT", 0, 2, 1, GasPriceTier::VeryLow);
arr[EQ as usize] = InstructionInfo::new("EQ", 0, 2, 1, GasPriceTier::VeryLow);
arr[ISZERO as usize] = InstructionInfo::new("ISZERO", 0, 1, 1, GasPriceTier::VeryLow);
arr[AND as usize] = InstructionInfo::new("AND", 0, 2, 1, GasPriceTier::VeryLow);
arr[OR as usize] = InstructionInfo::new("OR", 0, 2, 1, GasPriceTier::VeryLow);
arr[XOR as usize] = InstructionInfo::new("XOR", 0, 2, 1, GasPriceTier::VeryLow);
arr[BYTE as usize] = InstructionInfo::new("BYTE", 0, 2, 1, GasPriceTier::VeryLow);
arr[ADDMOD as usize] = InstructionInfo::new("ADDMOD", 0, 3, 1, GasPriceTier::Mid);
arr[MULMOD as usize] = InstructionInfo::new("MULMOD", 0, 3, 1, GasPriceTier::Mid);
arr[SIGNEXTEND as usize] = InstructionInfo::new("SIGNEXTEND", 0, 2, 1, GasPriceTier::Low);
arr[RETURNDATASIZE as usize] = InstructionInfo::new("RETURNDATASIZE", 0, 0, 1, GasPriceTier::Base);
arr[RETURNDATACOPY as usize] = InstructionInfo::new("RETURNDATACOPY", 0, 3, 0, GasPriceTier::VeryLow);
arr[SHA3 as usize] = InstructionInfo::new("SHA3", 0, 2, 1, GasPriceTier::Special);
arr[ADDRESS as usize] = InstructionInfo::new("ADDRESS", 0, 0, 1, GasPriceTier::Base);
arr[BALANCE as usize] = InstructionInfo::new("BALANCE", 0, 1, 1, GasPriceTier::Special);
arr[ORIGIN as usize] = InstructionInfo::new("ORIGIN", 0, 0, 1, GasPriceTier::Base);
arr[CALLER as usize] = InstructionInfo::new("CALLER", 0, 0, 1, GasPriceTier::Base);
arr[CALLVALUE as usize] = InstructionInfo::new("CALLVALUE", 0, 0, 1, GasPriceTier::Base);
arr[CALLDATALOAD as usize] = InstructionInfo::new("CALLDATALOAD", 0, 1, 1, GasPriceTier::VeryLow);
arr[CALLDATASIZE as usize] = InstructionInfo::new("CALLDATASIZE", 0, 0, 1, GasPriceTier::Base);
arr[CALLDATACOPY as usize] = InstructionInfo::new("CALLDATACOPY", 0, 3, 0, GasPriceTier::VeryLow);
arr[CODESIZE as usize] = InstructionInfo::new("CODESIZE", 0, 0, 1, GasPriceTier::Base);
arr[CODECOPY as usize] = InstructionInfo::new("CODECOPY", 0, 3, 0, GasPriceTier::VeryLow);
arr[GASPRICE as usize] = InstructionInfo::new("GASPRICE", 0, 0, 1, GasPriceTier::Base);
arr[EXTCODESIZE as usize] = InstructionInfo::new("EXTCODESIZE", 0, 1, 1, GasPriceTier::Special);
arr[EXTCODECOPY as usize] = InstructionInfo::new("EXTCODECOPY", 0, 4, 0, GasPriceTier::Special);
arr[BLOCKHASH as usize] = InstructionInfo::new("BLOCKHASH", 0, 1, 1, GasPriceTier::Ext);
arr[COINBASE as usize] = InstructionInfo::new("COINBASE", 0, 0, 1, GasPriceTier::Base);
arr[TIMESTAMP as usize] = InstructionInfo::new("TIMESTAMP", 0, 0, 1, GasPriceTier::Base);
arr[NUMBER as usize] = InstructionInfo::new("NUMBER", 0, 0, 1, GasPriceTier::Base);
arr[DIFFICULTY as usize] = InstructionInfo::new("DIFFICULTY", 0, 0, 1, GasPriceTier::Base);
arr[GASLIMIT as usize] = InstructionInfo::new("GASLIMIT", 0, 0, 1, GasPriceTier::Base);
arr[POP as usize] = InstructionInfo::new("POP", 0, 1, 0, GasPriceTier::Base);
arr[MLOAD as usize] = InstructionInfo::new("MLOAD", 0, 1, 1, GasPriceTier::VeryLow);
arr[MSTORE as usize] = InstructionInfo::new("MSTORE", 0, 2, 0, GasPriceTier::VeryLow);
arr[MSTORE8 as usize] = InstructionInfo::new("MSTORE8", 0, 2, 0, GasPriceTier::VeryLow);
arr[SLOAD as usize] = InstructionInfo::new("SLOAD", 0, 1, 1, GasPriceTier::Special);
arr[SSTORE as usize] = InstructionInfo::new("SSTORE", 0, 2, 0, GasPriceTier::Special);
arr[JUMP as usize] = InstructionInfo::new("JUMP", 0, 1, 0, GasPriceTier::Mid);
arr[JUMPI as usize] = InstructionInfo::new("JUMPI", 0, 2, 0, GasPriceTier::High);
arr[PC as usize] = InstructionInfo::new("PC", 0, 0, 1, GasPriceTier::Base);
arr[MSIZE as usize] = InstructionInfo::new("MSIZE", 0, 0, 1, GasPriceTier::Base);
arr[GAS as usize] = InstructionInfo::new("GAS", 0, 0, 1, GasPriceTier::Base);
arr[JUMPDEST as usize] = InstructionInfo::new("JUMPDEST", 0, 0, 0, GasPriceTier::Special);
arr[PUSH1 as usize] = InstructionInfo::new("PUSH1", 1, 0, 1, GasPriceTier::VeryLow);
arr[PUSH2 as usize] = InstructionInfo::new("PUSH2", 2, 0, 1, GasPriceTier::VeryLow);
arr[PUSH3 as usize] = InstructionInfo::new("PUSH3", 3, 0, 1, GasPriceTier::VeryLow);
arr[PUSH4 as usize] = InstructionInfo::new("PUSH4", 4, 0, 1, GasPriceTier::VeryLow);
arr[PUSH5 as usize] = InstructionInfo::new("PUSH5", 5, 0, 1, GasPriceTier::VeryLow);
arr[PUSH6 as usize] = InstructionInfo::new("PUSH6", 6, 0, 1, GasPriceTier::VeryLow);
arr[PUSH7 as usize] = InstructionInfo::new("PUSH7", 7, 0, 1, GasPriceTier::VeryLow);
arr[PUSH8 as usize] = InstructionInfo::new("PUSH8", 8, 0, 1, GasPriceTier::VeryLow);
arr[PUSH9 as usize] = InstructionInfo::new("PUSH9", 9, 0, 1, GasPriceTier::VeryLow);
arr[PUSH10 as usize] = InstructionInfo::new("PUSH10", 10, 0, 1, GasPriceTier::VeryLow);
arr[PUSH11 as usize] = InstructionInfo::new("PUSH11", 11, 0, 1, GasPriceTier::VeryLow);
arr[PUSH12 as usize] = InstructionInfo::new("PUSH12", 12, 0, 1, GasPriceTier::VeryLow);
arr[PUSH13 as usize] = InstructionInfo::new("PUSH13", 13, 0, 1, GasPriceTier::VeryLow);
arr[PUSH14 as usize] = InstructionInfo::new("PUSH14", 14, 0, 1, GasPriceTier::VeryLow);
arr[PUSH15 as usize] = InstructionInfo::new("PUSH15", 15, 0, 1, GasPriceTier::VeryLow);
arr[PUSH16 as usize] = InstructionInfo::new("PUSH16", 16, 0, 1, GasPriceTier::VeryLow);
arr[PUSH17 as usize] = InstructionInfo::new("PUSH17", 17, 0, 1, GasPriceTier::VeryLow);
arr[PUSH18 as usize] = InstructionInfo::new("PUSH18", 18, 0, 1, GasPriceTier::VeryLow);
arr[PUSH19 as usize] = InstructionInfo::new("PUSH19", 19, 0, 1, GasPriceTier::VeryLow);
arr[PUSH20 as usize] = InstructionInfo::new("PUSH20", 20, 0, 1, GasPriceTier::VeryLow);
arr[PUSH21 as usize] = InstructionInfo::new("PUSH21", 21, 0, 1, GasPriceTier::VeryLow);
arr[PUSH22 as usize] = InstructionInfo::new("PUSH22", 22, 0, 1, GasPriceTier::VeryLow);
arr[PUSH23 as usize] = InstructionInfo::new("PUSH23", 23, 0, 1, GasPriceTier::VeryLow);
arr[PUSH24 as usize] = InstructionInfo::new("PUSH24", 24, 0, 1, GasPriceTier::VeryLow);
arr[PUSH25 as usize] = InstructionInfo::new("PUSH25", 25, 0, 1, GasPriceTier::VeryLow);
arr[PUSH26 as usize] = InstructionInfo::new("PUSH26", 26, 0, 1, GasPriceTier::VeryLow);
arr[PUSH27 as usize] = InstructionInfo::new("PUSH27", 27, 0, 1, GasPriceTier::VeryLow);
arr[PUSH28 as usize] = InstructionInfo::new("PUSH28", 28, 0, 1, GasPriceTier::VeryLow);
arr[PUSH29 as usize] = InstructionInfo::new("PUSH29", 29, 0, 1, GasPriceTier::VeryLow);
arr[PUSH30 as usize] = InstructionInfo::new("PUSH30", 30, 0, 1, GasPriceTier::VeryLow);
arr[PUSH31 as usize] = InstructionInfo::new("PUSH31", 31, 0, 1, GasPriceTier::VeryLow);
arr[PUSH32 as usize] = InstructionInfo::new("PUSH32", 32, 0, 1, GasPriceTier::VeryLow);
arr[DUP1 as usize] = InstructionInfo::new("DUP1", 0, 1, 2, GasPriceTier::VeryLow);
arr[DUP2 as usize] = InstructionInfo::new("DUP2", 0, 2, 3, GasPriceTier::VeryLow);
arr[DUP3 as usize] = InstructionInfo::new("DUP3", 0, 3, 4, GasPriceTier::VeryLow);
arr[DUP4 as usize] = InstructionInfo::new("DUP4", 0, 4, 5, GasPriceTier::VeryLow);
arr[DUP5 as usize] = InstructionInfo::new("DUP5", 0, 5, 6, GasPriceTier::VeryLow);
arr[DUP6 as usize] = InstructionInfo::new("DUP6", 0, 6, 7, GasPriceTier::VeryLow);
arr[DUP7 as usize] = InstructionInfo::new("DUP7", 0, 7, 8, GasPriceTier::VeryLow);
arr[DUP8 as usize] = InstructionInfo::new("DUP8", 0, 8, 9, GasPriceTier::VeryLow);
arr[DUP9 as usize] = InstructionInfo::new("DUP9", 0, 9, 10, GasPriceTier::VeryLow);
arr[DUP10 as usize] = InstructionInfo::new("DUP10", 0, 10, 11, GasPriceTier::VeryLow);
arr[DUP11 as usize] = InstructionInfo::new("DUP11", 0, 11, 12, GasPriceTier::VeryLow);
arr[DUP12 as usize] = InstructionInfo::new("DUP12", 0, 12, 13, GasPriceTier::VeryLow);
arr[DUP13 as usize] = InstructionInfo::new("DUP13", 0, 13, 14, GasPriceTier::VeryLow);
arr[DUP14 as usize] = InstructionInfo::new("DUP14", 0, 14, 15, GasPriceTier::VeryLow);
arr[DUP15 as usize] = InstructionInfo::new("DUP15", 0, 15, 16, GasPriceTier::VeryLow);
arr[DUP16 as usize] = InstructionInfo::new("DUP16", 0, 16, 17, GasPriceTier::VeryLow);
arr[SWAP1 as usize] = InstructionInfo::new("SWAP1", 0, 2, 2, GasPriceTier::VeryLow);
arr[SWAP2 as usize] = InstructionInfo::new("SWAP2", 0, 3, 3, GasPriceTier::VeryLow);
arr[SWAP3 as usize] = InstructionInfo::new("SWAP3", 0, 4, 4, GasPriceTier::VeryLow);
arr[SWAP4 as usize] = InstructionInfo::new("SWAP4", 0, 5, 5, GasPriceTier::VeryLow);
arr[SWAP5 as usize] = InstructionInfo::new("SWAP5", 0, 6, 6, GasPriceTier::VeryLow);
arr[SWAP6 as usize] = InstructionInfo::new("SWAP6", 0, 7, 7, GasPriceTier::VeryLow);
arr[SWAP7 as usize] = InstructionInfo::new("SWAP7", 0, 8, 8, GasPriceTier::VeryLow);
arr[SWAP8 as usize] = InstructionInfo::new("SWAP8", 0, 9, 9, GasPriceTier::VeryLow);
arr[SWAP9 as usize] = InstructionInfo::new("SWAP9", 0, 10, 10, GasPriceTier::VeryLow);
arr[SWAP10 as usize] = InstructionInfo::new("SWAP10", 0, 11, 11, GasPriceTier::VeryLow);
arr[SWAP11 as usize] = InstructionInfo::new("SWAP11", 0, 12, 12, GasPriceTier::VeryLow);
arr[SWAP12 as usize] = InstructionInfo::new("SWAP12", 0, 13, 13, GasPriceTier::VeryLow);
arr[SWAP13 as usize] = InstructionInfo::new("SWAP13", 0, 14, 14, GasPriceTier::VeryLow);
arr[SWAP14 as usize] = InstructionInfo::new("SWAP14", 0, 15, 15, GasPriceTier::VeryLow);
arr[SWAP15 as usize] = InstructionInfo::new("SWAP15", 0, 16, 16, GasPriceTier::VeryLow);
arr[SWAP16 as usize] = InstructionInfo::new("SWAP16", 0, 17, 17, GasPriceTier::VeryLow);
arr[LOG0 as usize] = InstructionInfo::new("LOG0", 0, 2, 0, GasPriceTier::Special);
arr[LOG1 as usize] = InstructionInfo::new("LOG1", 0, 3, 0, GasPriceTier::Special);
arr[LOG2 as usize] = InstructionInfo::new("LOG2", 0, 4, 0, GasPriceTier::Special);
arr[LOG3 as usize] = InstructionInfo::new("LOG3", 0, 5, 0, GasPriceTier::Special);
arr[LOG4 as usize] = InstructionInfo::new("LOG4", 0, 6, 0, GasPriceTier::Special);
arr[CREATE as usize] = InstructionInfo::new("CREATE", 0, 3, 1, GasPriceTier::Special);
arr[CALL as usize] = InstructionInfo::new("CALL", 0, 7, 1, GasPriceTier::Special);
arr[CALLCODE as usize] = InstructionInfo::new("CALLCODE", 0, 7, 1, GasPriceTier::Special);
arr[RETURN as usize] = InstructionInfo::new("RETURN", 0, 2, 0, GasPriceTier::Zero);
arr[DELEGATECALL as usize] = InstructionInfo::new("DELEGATECALL", 0, 6, 1, GasPriceTier::Special);
arr[SUICIDE as usize] = InstructionInfo::new("SUICIDE", 0, 1, 0, GasPriceTier::Special);
arr[CREATE2 as usize] = InstructionInfo::new("CREATE2", 0, 3, 1, GasPriceTier::Special);
arr[REVERT as usize] = InstructionInfo::new("REVERT", 0, 2, 0, GasPriceTier::Zero);
arr
};
}

View File

@ -89,10 +89,11 @@ impl Memory for Vec<u8> {
}
fn write_slice(&mut self, offset: U256, slice: &[u8]) {
if !slice.is_empty() {
let off = offset.low_u64() as usize;
self[off..off+slice.len()].copy_from_slice(slice);
}
}
fn write(&mut self, offset: U256, value: U256) {
let off = offset.low_u64() as usize;
@ -183,5 +184,12 @@ mod tests {
assert_eq!(mem.read_slice(U256::from(0), U256::from(7)), "a67890g".as_bytes());
}
// write empty slice out of bounds
{
let slice = [];
mem.write_slice(U256::from(0x1000), &slice);
assert_eq!(mem.size(), 32);
}
}
}

View File

@ -130,7 +130,7 @@ impl<Cost: CostType> evm::Evm for Interpreter<Cost> {
// Calculate gas cost
let requirements = gasometer.requirements(ext, instruction, info, &stack, self.mem.size())?;
// TODO: make compile-time removable if too much of a performance hit.
let trace_executed = ext.trace_prepare_execute(reader.position - 1, instruction, info.args, &requirements.gas_cost.as_u256());
let trace_executed = ext.trace_prepare_execute(reader.position - 1, instruction, &requirements.gas_cost.as_u256());
gasometer.verify_gas(&requirements.gas_cost)?;
self.mem.expand(requirements.memory_required_size);

View File

@ -35,6 +35,7 @@ mod benches;
pub use self::evm::{Evm, Error, Finalize, FinalizationResult, GasLeft, Result, CostType, ReturnData};
pub use self::ext::{Ext, ContractCreateResult, MessageCallResult, CreateContractAddress};
pub use self::instructions::{InstructionInfo, INSTRUCTIONS, push_bytes};
pub use self::vmtype::VMType;
pub use self::factory::Factory;
pub use self::schedule::Schedule;

View File

@ -357,7 +357,7 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
self.exec_vm(params, &mut unconfirmed_substate, OutputPolicy::Return(output, trace_output.as_mut()), &mut subtracer, &mut subvmtracer)
};
vm_tracer.done_subtrace(subvmtracer);
vm_tracer.done_subtrace(subvmtracer, res.is_ok());
trace!(target: "executive", "res={:?}", res);
@ -432,7 +432,7 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
self.exec_vm(params, &mut unconfirmed_substate, OutputPolicy::InitContract(trace_output.as_mut()), &mut subtracer, &mut subvmtracer)
};
vm_tracer.done_subtrace(subvmtracer);
vm_tracer.done_subtrace(subvmtracer, res.is_ok());
match res {
Ok(ref res) => tracer.trace_create(

View File

@ -361,8 +361,8 @@ impl<'a, T: 'a, V: 'a, B: 'a, E: 'a> Ext for Externalities<'a, T, V, B, E>
self.substate.sstore_clears_count = self.substate.sstore_clears_count + U256::one();
}
fn trace_prepare_execute(&mut self, pc: usize, instruction: u8, stack_pop: usize, gas_cost: &U256) -> bool {
self.vm_tracer.trace_prepare_execute(pc, instruction, stack_pop, gas_cost)
fn trace_prepare_execute(&mut self, pc: usize, instruction: u8, gas_cost: &U256) -> bool {
self.vm_tracer.trace_prepare_execute(pc, instruction, gas_cost)
}
fn trace_executed(&mut self, gas_used: U256, stack_push: &[U256], mem_diff: Option<(usize, &[u8])>, store_diff: Option<(U256, U256)>) {

View File

@ -192,7 +192,7 @@ impl ExecutiveVMTracer {
}
impl VMTracer for ExecutiveVMTracer {
fn trace_prepare_execute(&mut self, pc: usize, instruction: u8, _stack_pop: usize, gas_cost: &U256) -> bool {
fn trace_prepare_execute(&mut self, pc: usize, instruction: u8, gas_cost: &U256) -> bool {
self.data.operations.push(VMOperation {
pc: pc,
instruction: instruction,
@ -221,7 +221,7 @@ impl VMTracer for ExecutiveVMTracer {
}}
}
fn done_subtrace(&mut self, sub: Self) {
fn done_subtrace(&mut self, sub: Self, _is_successful: bool) {
self.data.subs.push(sub.data);
}

View File

@ -89,7 +89,7 @@ pub trait Tracer: Send {
pub trait VMTracer: Send {
/// Trace the preparation to execute a single instruction.
/// @returns true if `trace_executed` should be called.
fn trace_prepare_execute(&mut self, _pc: usize, _instruction: u8, _stack_pop: usize, _gas_cost: &U256) -> bool { false }
fn trace_prepare_execute(&mut self, _pc: usize, _instruction: u8, _gas_cost: &U256) -> bool { false }
/// Trace the finalised execution of a single instruction.
fn trace_executed(&mut self, _gas_used: U256, _stack_push: &[U256], _mem_diff: Option<(usize, &[u8])>, _store_diff: Option<(U256, U256)>) {}
@ -98,7 +98,7 @@ pub trait VMTracer: Send {
fn prepare_subtrace(&self, code: &[u8]) -> Self where Self: Sized;
/// Finalize subtracer.
fn done_subtrace(&mut self, sub: Self) where Self: Sized;
fn done_subtrace(&mut self, sub: Self, is_successful: bool) where Self: Sized;
/// Consumes self and returns the VM trace.
fn drain(self) -> Option<VMTrace>;

View File

@ -72,7 +72,7 @@ pub struct NoopVMTracer;
impl VMTracer for NoopVMTracer {
/// Trace the preparation to execute a single instruction.
fn trace_prepare_execute(&mut self, _pc: usize, _instruction: u8, _stack_pop: usize, _gas_cost: &U256) -> bool { false }
fn trace_prepare_execute(&mut self, _pc: usize, _instruction: u8, _gas_cost: &U256) -> bool { false }
/// Trace the finalised execution of a single instruction.
fn trace_executed(&mut self, _gas_used: U256, _stack_push: &[U256], _mem_diff: Option<(usize, &[u8])>, _store_diff: Option<(U256, U256)>) {}
@ -81,7 +81,7 @@ impl VMTracer for NoopVMTracer {
fn prepare_subtrace(&self, _code: &[u8]) -> Self { NoopVMTracer }
/// Spawn subtracer which will be used to trace deeper levels of execution.
fn done_subtrace(&mut self, _sub: Self) {}
fn done_subtrace(&mut self, _sub: Self, _is_successful: bool) {}
/// Consumes self and returns all VM traces.
fn drain(self) -> Option<VMTrace> { None }

View File

@ -16,7 +16,7 @@
//! JSON VM output.
use ethcore::trace;
use ethcore::{evm, trace};
use std::collections::HashMap;
use util::{U256, H256, ToPretty};
@ -26,11 +26,14 @@ use vm;
/// JSON formatting informant.
#[derive(Default)]
pub struct Informant {
code: Vec<u8>,
depth: usize,
pc: usize,
instruction: u8,
name: &'static str,
gas_cost: U256,
gas_used: U256,
stack_pop: usize,
stack: Vec<U256>,
memory: Vec<u8>,
storage: HashMap<H256, H256>,
@ -55,38 +58,44 @@ impl Informant {
}
impl vm::Informant for Informant {
fn set_gas(&mut self, gas: U256) {
self.gas_used = gas;
}
fn finish(&mut self, result: Result<vm::Success, vm::Failure>) {
match result {
Ok(success) => println!(
"{{\"output\":\"0x{output}\",\"gasUsed\":\"{gas:x}\",\"time\":\"{time}\"}}",
"{{\"output\":\"0x{output}\",\"gasUsed\":\"{gas:x}\",\"time\":{time}}}",
output = success.output.to_hex(),
gas = success.gas_used,
time = display::format_time(&success.time),
time = display::as_micros(&success.time),
),
Err(failure) => println!(
"{{\"error\":\"{error}\",\"time\":\"{time}\"}}",
"{{\"error\":\"{error}\",\"gasUsed\":\"{gas:x}\",\"time\":{time}}}",
error = failure.error,
time = display::format_time(&failure.time),
gas = failure.gas_used,
time = display::as_micros(&failure.time),
),
}
}
}
impl trace::VMTracer for Informant {
fn trace_prepare_execute(&mut self, pc: usize, instruction: u8, stack_pop: usize, gas_cost: &U256) -> bool {
fn trace_prepare_execute(&mut self, pc: usize, instruction: u8, gas_cost: &U256) -> bool {
self.pc = pc;
self.instruction = instruction;
self.gas_cost = *gas_cost;
let len = self.stack.len();
self.stack.truncate(len - stack_pop);
true
}
fn trace_executed(&mut self, gas_used: U256, stack_push: &[U256], mem_diff: Option<(usize, &[u8])>, store_diff: Option<(U256, U256)>) {
let info = evm::INSTRUCTIONS[self.instruction as usize];
println!(
"{{\"pc\":{pc},\"op\":{op},\"gas\":{gas},\"gasCost\":{gas_cost},\"memory\":{memory},\"stack\":{stack},\"storage\":{storage},\"depth\":{depth}}}",
"{{\"pc\":{pc},\"op\":{op},\"opName\":\"{name}\",\"gas\":{gas},\"gasCost\":{gas_cost},\"memory\":{memory},\"stack\":{stack},\"storage\":{storage},\"depth\":{depth}}}",
pc = self.pc,
op = self.instruction,
name = info.name,
gas = display::u256_as_str(&(gas_used + self.gas_cost)),
gas_cost = display::u256_as_str(&self.gas_cost),
memory = self.memory(),
@ -96,6 +105,9 @@ impl trace::VMTracer for Informant {
);
self.gas_used = gas_used;
let len = self.stack.len();
self.stack.truncate(len - info.args);
self.stack.extend_from_slice(stack_push);
if let Some((pos, data)) = mem_diff {
@ -107,17 +119,25 @@ impl trace::VMTracer for Informant {
}
}
fn prepare_subtrace(&self, _code: &[u8]) -> Self where Self: Sized {
fn prepare_subtrace(&self, code: &[u8]) -> Self where Self: Sized {
let mut vm = Informant::default();
vm.depth = self.depth + 1;
vm.code = code.to_vec();
vm.gas_used = self.gas_used;
vm
}
fn done_subtrace(&mut self, mut sub: Self) where Self: Sized {
fn done_subtrace(&mut self, mut sub: Self, is_successful: bool) where Self: Sized {
if sub.depth == 1 {
// print last line with final state:
if is_successful {
sub.pc += 1;
sub.instruction = 0;
} else {
let push_bytes = evm::push_bytes(sub.instruction);
sub.pc += if push_bytes > 0 { push_bytes + 1 } else { 0 };
sub.instruction = if sub.pc < sub.code.len() { sub.code[sub.pc] } else { 0 };
}
sub.gas_cost = 0.into();
let gas_used = sub.gas_used;
trace::VMTracer::trace_executed(&mut sub, gas_used, &[], None, None);

View File

@ -27,6 +27,11 @@ pub fn format_time(time: &Duration) -> String {
format!("{}.{:.9}s", time.as_secs(), time.subsec_nanos())
}
/// Formats the time as microseconds.
pub fn as_micros(time: &Duration) -> u64 {
time.as_secs() * 1_000_000 + time.subsec_nanos() as u64 / 1_000
}
/// Converts U256 into string.
/// TODO Overcomes: https://github.com/paritytech/bigint/issues/13
pub fn u256_as_str(v: &U256) -> String {

View File

@ -44,6 +44,6 @@ impl vm::Informant for Informant {
impl trace::VMTracer for Informant {
fn prepare_subtrace(&self, _code: &[u8]) -> Self where Self: Sized { Default::default() }
fn done_subtrace(&mut self, _sub: Self) where Self: Sized {}
fn done_subtrace(&mut self, _sub: Self, _is_successful: bool) where Self: Sized {}
fn drain(self) -> Option<trace::VMTrace> { None }
}

View File

@ -81,6 +81,7 @@ fn run<T: Informant>(args: Args, mut informant: T) {
params.code = Some(Arc::new(code));
params.data = data;
informant.set_gas(gas);
let result = vm::run(&mut informant, spec, params);
informant.finish(result);
}

View File

@ -24,6 +24,8 @@ use ethcore::action_params::ActionParams;
/// VM execution informant
pub trait Informant: trace::VMTracer {
/// Set initial gas.
fn set_gas(&mut self, _gas: U256) {}
/// Display final result.
fn finish(&mut self, result: Result<Success, Failure>);
}
@ -40,6 +42,8 @@ pub struct Success {
/// Execution failed
pub struct Failure {
/// Used gas
pub gas_used: U256,
/// Internal error
pub error: EvmTestError,
/// Duration
@ -49,6 +53,7 @@ pub struct Failure {
/// Execute VM with given `ActionParams`
pub fn run<T: trace::VMTracer>(vm_tracer: &mut T, spec: spec::Spec, params: ActionParams) -> Result<Success, Failure> {
let mut test_client = EvmTestClient::new(spec).map_err(|error| Failure {
gas_used: 0.into(),
error,
time: Duration::from_secs(0)
})?;
@ -65,6 +70,7 @@ pub fn run<T: trace::VMTracer>(vm_tracer: &mut T, spec: spec::Spec, params: Acti
time: duration,
}),
Err(e) => Err(Failure {
gas_used: initial_gas,
error: e,
time: duration,
}),

View File

@ -1,6 +1,6 @@
{
"name": "parity.js",
"version": "1.7.87",
"version": "1.7.89",
"main": "release/index.js",
"jsnext:main": "src/index.js",
"author": "Parity Team <admin@parity.io>",
@ -68,6 +68,7 @@
"qrcode-generator": "kazuhikoarase/qrcode-generator"
},
"devDependencies": {
"arraybuffer-loader": "0.2.2",
"babel-cli": "6.23.0",
"babel-core": "6.23.1",
"babel-eslint": "7.1.1",
@ -127,6 +128,7 @@
"mocha": "3.2.0",
"mock-local-storage": "1.0.2",
"mock-socket": "6.0.4",
"napa": "2.3.0",
"nock": "9.0.7",
"postcss-import": "9.1.0",
"postcss-loader": "1.3.2",
@ -169,6 +171,7 @@
"@parity/ui": "file:src/ui",
"@parity/views": "file:src/views",
"@parity/wordlist": "1.0.1",
"es6-error": "4.0.0",
"es6-promise": "4.0.5",
"flat": "2.0.1",
"flow": "^0.2.3",
@ -178,7 +181,6 @@
"lodash": "4.17.2",
"loglevel": "1.4.1",
"moment": "2.17.0",
"napa": "2.3.0",
"promise-worker": "1.1.1",
"react": "15.4.2",
"react-dom": "15.4.2",
@ -188,6 +190,10 @@
"react-router-redux": "4.0.7",
"react-tap-event-plugin": "2.0.1",
"react-tooltip": "3.2.2",
"recharts": "0.15.2",
"redux": "3.6.0",
"redux-actions": "1.1.0",
"redux-thunk": "2.1.0",
"store": "1.3.20",
"sw-toolbox": "^3.6.0",
"u2f-api": "0.0.9",

View File

@ -24,7 +24,7 @@ import { Db, Eth, Parity, Net, Personal, Shh, Signer, Trace, Web3 } from './rpc'
import Subscriptions from './subscriptions';
import util from './util';
import { isFunction } from './util/types';
// import { LocalAccountsMiddleware } from './local';
import { LocalAccountsMiddleware } from './local';
export default class Api extends EventEmitter {
constructor (provider, allowSubscriptions = true) {
@ -59,9 +59,9 @@ export default class Api extends EventEmitter {
const middleware = this.parity
.nodeKind()
.then((nodeKind) => {
// if (nodeKind.availability === 'public') {
// return LocalAccountsMiddleware;
// }
if (nodeKind.availability === 'public') {
return LocalAccountsMiddleware;
}
return null;
})

View File

@ -17,9 +17,9 @@
import { createKeyObject, decryptPrivateKey } from '../ethkey';
export default class Account {
constructor (persist, data) {
constructor (persist, data = {}) {
const {
keyObject,
keyObject = null,
meta = {},
name = ''
} = data;
@ -41,6 +41,15 @@ export default class Account {
});
}
export () {
const exported = Object.assign({}, this._keyObject);
exported.meta = JSON.stringify(this._meta);
exported.name = this._name;
return exported;
}
get address () {
return `0x${this._keyObject.address.toLowerCase()}`;
}
@ -66,6 +75,10 @@ export default class Account {
}
get uuid () {
if (!this._keyObject) {
return null;
}
return this._keyObject.id;
}

View File

@ -17,23 +17,74 @@
import Account from './account';
import localStore from 'store';
import { debounce } from 'lodash';
import { decryptPrivateKey } from '../ethkey';
const NULL_ADDRESS = '0x0000000000000000000000000000000000000000';
const LS_STORE_KEY = '_parity::localAccounts';
export default class Accounts {
constructor (data = localStore.get(LS_STORE_KEY) || {}) {
const {
last = NULL_ADDRESS,
store = []
} = data;
persist = debounce(() => {
this._lastState = JSON.stringify(this);
this.persist = debounce(() => {
localStore.set(LS_STORE_KEY, this);
}, 100);
constructor (data = localStore.get(LS_STORE_KEY) || {}) {
this._lastState = JSON.stringify(data);
window.addEventListener('storage', ({ key, newValue }) => {
if (key !== LS_STORE_KEY) {
return;
}
if (newValue !== this._lastState) {
console.log('Data changed in a second tab, syncing state');
this.restore(JSON.parse(newValue));
}
});
this.restore(data);
}
restore (data) {
const {
last = NULL_ADDRESS,
dappsDefault = NULL_ADDRESS,
store = {}
} = data;
this._last = last;
this._store = store.map((data) => new Account(this.persist, data));
this._dappsDefaultAddress = dappsDefault;
this._store = {};
if (Array.isArray(store)) {
// Recover older version that stored accounts as an array
store.forEach((data) => {
const account = new Account(this.persist, data);
this._store[account.address] = account;
});
} else {
Object.keys(store).forEach((key) => {
this._store[key] = new Account(this.persist, store[key]);
});
}
}
_addAccount = (account) => {
const { address } = account;
if (address in this._store && this._store[address].uuid) {
throw new Error(`Account ${address} already exists!`);
}
this._store[address] = account;
this.lastAddress = address;
this.persist();
return account.address;
}
create (secret, password) {
@ -41,20 +92,19 @@ export default class Accounts {
return Account
.fromPrivateKey(this.persist, privateKey, password)
.then((account) => {
const { address } = account;
if (this._store.find((account) => account.address === address)) {
throw new Error(`Account ${address} already exists!`);
.then(this._addAccount);
}
this._store.push(account);
this.lastAddress = address;
restoreFromWallet (wallet, password) {
return decryptPrivateKey(wallet, password)
.then((privateKey) => {
if (!privateKey) {
throw new Error('Invalid password');
}
this.persist();
return account.address;
});
return Account.fromPrivateKey(this.persist, privateKey, password);
})
.then(this._addAccount);
}
set lastAddress (value) {
@ -65,20 +115,48 @@ export default class Accounts {
return this._last;
}
get dappsDefaultAddress () {
if (this._dappsDefaultAddress === NULL_ADDRESS) {
return this._last;
}
if (this._dappsDefaultAddress in this._store) {
return this._dappsDefaultAddress;
}
return NULL_ADDRESS;
}
set dappsDefaultAddress (value) {
this._dappsDefaultAddress = value.toLowerCase();
}
get (address) {
address = address.toLowerCase();
this.lastAddress = address;
const account = this._store.find((account) => account.address === address);
const account = this._store[address];
if (!account) {
throw new Error(`Account not found: ${address}`);
}
this.lastAddress = address;
return account;
}
getLazyCreate (address) {
address = address.toLowerCase();
this.lastAddress = address;
if (!(address in this._store)) {
this._store[address] = new Account(this.persist);
}
return this._store[address];
}
remove (address, password) {
address = address.toLowerCase();
@ -108,26 +186,20 @@ export default class Accounts {
removeUnsafe (address) {
address = address.toLowerCase();
const index = this._store.findIndex((account) => account.address === address);
if (index === -1) {
return;
}
this._store.splice(index, 1);
delete this._store[address];
this.persist();
}
mapArray (mapper) {
return this._store.map(mapper);
addresses () {
return Object.keys(this._store);
}
mapObject (mapper) {
map (mapper) {
const result = {};
this._store.forEach((account) => {
result[account.address] = mapper(account);
Object.keys(this._store).forEach((key) => {
result[key] = mapper(this._store[key]);
});
return result;
@ -136,6 +208,7 @@ export default class Accounts {
toJSON () {
return {
last: this._last,
dappsDefault: this._dappsDefaultAddress,
store: this._store
};
}

View File

@ -0,0 +1,147 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
/* global WebAssembly */
import wasmBuffer from './ethkey.wasm.js';
const NOOP = () => {};
// WASM memory setup
const WASM_PAGE_SIZE = 65536;
const STATIC_BASE = 1024;
const STATICTOP = STATIC_BASE + WASM_PAGE_SIZE * 2;
const STACK_BASE = align(STATICTOP + 16);
const STACKTOP = STACK_BASE;
const TOTAL_STACK = 5 * 1024 * 1024;
const TOTAL_MEMORY = 16777216;
const STACK_MAX = STACK_BASE + TOTAL_STACK;
const DYNAMIC_BASE = STACK_MAX + 64;
const DYNAMICTOP_PTR = STACK_MAX;
function mockWebAssembly () {
function throwWasmError () {
throw new Error('Missing WebAssembly support');
}
// Simple mock replacement
return {
Memory: class { buffer = new ArrayBuffer(2048) },
Table: class {},
Module: class {},
Instance: class {
exports = {
'_input_ptr': () => 0,
'_secret_ptr': () => 0,
'_public_ptr': () => 0,
'_address_ptr': () => 0,
'_ecpointg': NOOP,
'_brain': throwWasmError,
'_verify_secret': throwWasmError
}
}
};
}
const { Memory, Table, Module, Instance } = typeof WebAssembly !== 'undefined' ? WebAssembly : mockWebAssembly();
const wasmMemory = new Memory({
initial: TOTAL_MEMORY / WASM_PAGE_SIZE,
maximum: TOTAL_MEMORY / WASM_PAGE_SIZE
});
const wasmTable = new Table({
initial: 8,
maximum: 8,
element: 'anyfunc'
});
// TypedArray views into the memory
const wasmMemoryU8 = new Uint8Array(wasmMemory.buffer);
const wasmMemoryU32 = new Uint32Array(wasmMemory.buffer);
// Keep DYNAMIC_BASE in memory
wasmMemoryU32[DYNAMICTOP_PTR >> 2] = align(DYNAMIC_BASE);
function align (mem) {
const ALIGN_SIZE = 16;
return (Math.ceil(mem / ALIGN_SIZE) * ALIGN_SIZE) | 0;
}
export function slice (ptr, len) {
return wasmMemoryU8.subarray(ptr, ptr + len);
}
// Required by emscripten
function abort (what) {
throw new Error(what || 'WASM abort');
}
// Required by emscripten
function abortOnCannotGrowMemory () {
abort(`Cannot enlarge memory arrays.`);
}
// Required by emscripten
function enlargeMemory () {
abortOnCannotGrowMemory();
}
// Required by emscripten
function getTotalMemory () {
return TOTAL_MEMORY;
}
// Required by emscripten - used to perform memcpy on large data
function memcpy (dest, src, len) {
wasmMemoryU8.set(wasmMemoryU8.subarray(src, src + len), dest);
return dest;
}
// Synchronously compile WASM from the buffer
const module = new Module(wasmBuffer);
// Instantiated WASM module
const instance = new Instance(module, {
global: {},
env: {
DYNAMICTOP_PTR,
STACKTOP,
STACK_MAX,
abort,
enlargeMemory,
getTotalMemory,
abortOnCannotGrowMemory,
___lock: NOOP,
___syscall6: () => 0,
___setErrNo: (no) => no,
_abort: abort,
___syscall140: () => 0,
_emscripten_memcpy_big: memcpy,
___syscall54: () => 0,
___unlock: NOOP,
_llvm_trap: abort,
___syscall146: () => 0,
'memory': wasmMemory,
'table': wasmTable,
tableBase: 0,
memoryBase: STATIC_BASE
}
});
export const extern = instance.exports;

File diff suppressed because one or more lines are too long

View File

@ -17,13 +17,12 @@
import workerPool from './workerPool';
export function createKeyObject (key, password) {
return workerPool.getWorker().action('createKeyObject', { key, password })
return workerPool.action('createKeyObject', { key, password })
.then((obj) => JSON.parse(obj));
}
export function decryptPrivateKey (keyObject, password) {
return workerPool
.getWorker()
.action('decryptPrivateKey', { keyObject, password })
.then((privateKey) => {
if (privateKey) {
@ -40,9 +39,9 @@ export function phraseToAddress (phrase) {
}
export function phraseToWallet (phrase) {
return workerPool.getWorker().action('phraseToWallet', phrase);
return workerPool.action('phraseToWallet', phrase);
}
export function verifySecret (secret) {
return workerPool.getWorker().action('verifySecret', secret);
return workerPool.action('verifySecret', secret);
}

View File

@ -17,7 +17,8 @@
import { randomPhrase } from '@parity/wordlist';
import { phraseToAddress, phraseToWallet } from './';
describe('api/local/ethkey', () => {
// TODO: Skipping until Node.js 8.0 comes out and we can test WebAssembly
describe.skip('api/local/ethkey', () => {
describe('phraseToAddress', function () {
this.timeout(30000);

View File

@ -14,10 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import secp256k1 from 'secp256k1';
import { keccak_256 as keccak256 } from 'js-sha3';
import { bytesToHex } from '../../util/format';
import { bytesToHex } from '~/api/util/format';
import { extern, slice } from './ethkey.js';
const isWorker = typeof self !== 'undefined';
@ -43,43 +41,40 @@ function route ({ action, payload }) {
return null;
}
const input = slice(extern._input_ptr(), 1024);
const secret = slice(extern._secret_ptr(), 32);
const publicKey = slice(extern._public_ptr(), 64);
const address = slice(extern._address_ptr(), 20);
extern._ecpointg();
const actions = {
phraseToWallet (phrase) {
let secret = keccak256.array(phrase);
const phraseUtf8 = Buffer.from(phrase, 'utf8');
for (let i = 0; i < 16384; i++) {
secret = keccak256.array(secret);
if (phraseUtf8.length > input.length) {
throw new Error('Phrase is too long!');
}
while (true) {
secret = keccak256.array(secret);
input.set(phraseUtf8);
const secretBuf = Buffer.from(secret);
if (secp256k1.privateKeyVerify(secretBuf)) {
// No compression, slice out last 64 bytes
const publicBuf = secp256k1.publicKeyCreate(secretBuf, false).slice(-64);
const address = keccak256.array(publicBuf).slice(12);
if (address[0] !== 0) {
continue;
}
extern._brain(phraseUtf8.length);
const wallet = {
secret: bytesToHex(secretBuf),
public: bytesToHex(publicBuf),
secret: bytesToHex(secret),
public: bytesToHex(publicKey),
address: bytesToHex(address)
};
return wallet;
}
}
},
verifySecret (secret) {
const key = Buffer.from(secret.slice(2), 'hex');
verifySecret (key) {
const keyBuf = Buffer.from(key.slice(2), 'hex');
return secp256k1.privateKeyVerify(key);
secret.set(keyBuf);
return extern._verify_secret();
},
createKeyObject ({ key, password }) {
@ -113,7 +108,8 @@ self.onmessage = function ({ data }) {
postMessage([null, result]);
} catch (err) {
postMessage([err, null]);
console.error(err);
postMessage([err.toString(), null]);
}
};

View File

@ -38,7 +38,8 @@ class WorkerContainer {
this.busy = false;
if (err) {
reject(err);
// `err` ought to be a String
reject(new Error(err));
} else {
resolve(result);
}
@ -48,20 +49,56 @@ class WorkerContainer {
}
class WorkerPool {
pool = [];
pool = [
new WorkerContainer(),
new WorkerContainer()
];
getWorker () {
let container = this.pool.find((container) => !container.busy);
queue = [];
if (container) {
return container;
_getContainer () {
return this.pool.find((container) => !container.busy);
}
container = new WorkerContainer();
action (action, payload) {
let container = this.pool.find((container) => !container.busy);
this.pool.push(container);
let promise;
return container;
// const start = Date.now();
if (container) {
promise = container.action(action, payload);
} else {
promise = new Promise((resolve, reject) => {
this.queue.push([action, payload, resolve]);
});
}
return promise
.catch((err) => {
this.processQueue();
throw err;
})
.then((result) => {
this.processQueue();
// console.log('Work done in ', Date.now() - start);
return result;
});
}
processQueue () {
let container = this._getContainer();
while (container && this.queue.length > 0) {
const [action, payload, resolve] = this.queue.shift();
resolve(container.action(action, payload));
container = this._getContainer();
}
}
}

View File

@ -29,7 +29,7 @@ export default class LocalAccountsMiddleware extends Middleware {
const register = this.register.bind(this);
register('eth_accounts', () => {
return accounts.mapArray((account) => account.address);
return accounts.addresses();
});
register('eth_coinbase', () => {
@ -37,13 +37,13 @@ export default class LocalAccountsMiddleware extends Middleware {
});
register('parity_accountsInfo', () => {
return accounts.mapObject(({ name }) => {
return accounts.map(({ name }) => {
return { name };
});
});
register('parity_allAccountsInfo', () => {
return accounts.mapObject(({ name, meta, uuid }) => {
return accounts.map(({ name, meta, uuid }) => {
return { name, meta, uuid };
});
});
@ -68,10 +68,31 @@ export default class LocalAccountsMiddleware extends Middleware {
return transactions.hash(id) || Promise.resolve(null);
});
register('parity_dappsList', () => {
return [];
});
register('parity_defaultAccount', () => {
return accounts.lastAddress;
});
register('parity_exportAccount', ([address, password]) => {
const account = accounts.get(address);
if (!password) {
password = '';
}
return account.isValidPassword(password)
.then((isValid) => {
if (!isValid) {
throw new Error('Invalid password');
}
return account.export();
});
});
register('parity_generateSecretPhrase', () => {
return randomPhrase(12);
});
@ -80,6 +101,10 @@ export default class LocalAccountsMiddleware extends Middleware {
return [];
});
register('parity_getNewDappsDefaultAddress', () => {
return accounts.lastAddress;
});
register('parity_hardwareAccountsInfo', () => {
return {};
});
@ -102,18 +127,30 @@ export default class LocalAccountsMiddleware extends Middleware {
});
});
register('parity_newAccountFromWallet', ([json, password]) => {
if (!password) {
password = '';
}
return accounts.restoreFromWallet(JSON.parse(json), password);
});
register('parity_setAccountMeta', ([address, meta]) => {
accounts.get(address).meta = meta;
accounts.getLazyCreate(address).meta = meta;
return true;
});
register('parity_setAccountName', ([address, name]) => {
accounts.get(address).name = name;
accounts.getLazyCreate(address).name = name;
return true;
});
register('parity_setNewDappsDefaultAddress', ([address]) => {
accounts.dappsDefaultAddress = address;
});
register('parity_postTransaction', ([tx]) => {
if (!tx.from) {
tx.from = accounts.lastAddress;
@ -137,10 +174,32 @@ export default class LocalAccountsMiddleware extends Middleware {
return [];
});
register('parity_listOpenedVaults', () => {
return [];
});
register('parity_listRecentDapps', () => {
return {};
});
register('parity_listVaults', () => {
return [];
});
register('parity_wsUrl', () => {
// This is a hack, will be replaced by a `hostname` setting on the node itself
return `${window.location.hostname}:8546`;
});
register('parity_dappsUrl', () => {
// This is a hack, will be replaced by a `hostname` setting on the node itself
return `${window.location.hostname}:8545`;
});
register('parity_hashContent', () => {
throw new Error('Functionality unavailable on a public wallet.');
});
register('parity_killAccount', ([address, password]) => {
return accounts.remove(address, password);
});
@ -204,6 +263,10 @@ export default class LocalAccountsMiddleware extends Middleware {
});
});
register('signer_generateAuthorizationToken', () => {
return '';
});
register('signer_rejectRequest', ([id]) => {
return transactions.reject(id);
});

View File

@ -32,7 +32,8 @@ class MockedTransport extends JsonRpcBase {
}
}
describe('api/local/LocalAccountsMiddleware', function () {
// Skip till all CI runs on Node 8+
describe.skip('api/local/LocalAccountsMiddleware', function () {
this.timeout(30000);
let transport;
@ -71,7 +72,9 @@ describe('api/local/LocalAccountsMiddleware', function () {
'parity_phraseToAddress',
'parity_useLocalAccounts',
'parity_listGethAccounts',
'parity_listOpenedVaults',
'parity_listRecentDapps',
'parity_listVaults',
'parity_killAccount',
'parity_testPassword',
'signer_confirmRequest',

View File

@ -42,7 +42,7 @@ export default class Application extends Component {
return (
<div className={ styles.body }>
<div className={ styles.header }>
DAPP REGISTRY, a global view of distributed applications available on the network. Putting the puzzle together.
DAPP REGISTRY, a global view of decentralized applications available on the network. Putting the puzzle together.
</div>
<div>

View File

@ -43,7 +43,7 @@ export default class ModalDelete extends Component {
secondary
>
<div className={ styles.section }>
You are about to remove a distributed application from the registry,
You are about to remove a decentralized application from the registry,
the details of this application is given below. Removal does not return any fees,
however the application will not be available to users anymore.
</div>

View File

@ -50,7 +50,7 @@ export default class ModalRegister extends Component {
secondary
>
<div className={ styles.section }>
You are about to register a new distributed application on the network, the details of
You are about to register a new decentralized application on the network, the details of
this application is given below. This will require a non-refundable fee
of { api.util.fromWei(this.dappsStore.fee).toFormat(3) } <small>ETH</small>
</div>

View File

@ -16,5 +16,5 @@
export default {
install: `Install the extension now`,
intro: `Parity now has an extension available for Chrome that allows safe browsing of Ethereum-enabled distributed applications. It is highly recommended that you install this extension to further enhance your Parity experience.`
intro: `Parity now has an extension available for Chrome that allows safe browsing of Ethereum-enabled decentralized applications. It is highly recommended that you install this extension to further enhance your Parity experience.`
};

View File

@ -69,7 +69,7 @@ export default {
label: `Addressbook`
},
apps: {
description: `Distributed applications that interact with the underlying network. Add applications, manage you application portfolio and interact with application from around the network.`,
description: `Decentralized applications that interact with the underlying network. Add applications, manage you application portfolio and interact with application from around the network.`,
label: `Applications`
},
contracts: {
@ -85,7 +85,7 @@ export default {
label: `Settings`
},
signer: {
description: `The secure transaction management area of the application where you can approve any outgoing transactions made from the application as well as those placed into the queue by distributed applications.`,
description: `The secure transaction management area of the application where you can approve any outgoing transactions made from the application as well as those placed into the queue by decentralized applications.`,
label: `Signer`
},
status: {

View File

@ -16,6 +16,6 @@
export default {
tooltip: {
overview: `navigate between the different parts and views of the application, switching between an account view, token view and distributed application view`
overview: `navigate between the different parts and views of the application, switching between an account view, token view and decentralized application view`
}
};

View File

@ -17,6 +17,6 @@
export default {
install: `現在就安裝這個擴充套件`, // Install the extension now
intro: `Parity現在有一個Chrome的擴充套件可以安全的瀏覽以太坊所支援的分散式應用。我們強烈推薦你安裝這個擴充套件來進一步提升你的Parity使用體驗。`
// Parity now has an extension available for Chrome that allows safe browsing of Ethereum-enabled distributed applications.
// Parity now has an extension available for Chrome that allows safe browsing of Ethereum-enabled decentralized applications.
// It is highly recommended that you install this extension to further enhance your Parity experience.
};

View File

@ -82,7 +82,7 @@ export default {
},
apps: {
description: `與整個底層網路交流的分散式應用。新增應用,管理你的應用庫和與網路上的其他應用進行互動。`,
// Distributed applications that interact with the underlying network. Add applications, manage you application portfolio and
// Decentralized applications that interact with the underlying network. Add applications, manage you application portfolio and
// interact with application from around the network.
label: `應用` // Applications
},
@ -108,7 +108,7 @@ export default {
signer: {
description: `這個應用安全交易管理區域,你可以通過任何從本應用和其他分散式應用發起的即將傳送的交易`,
// The secure transaction management area of the application where you can approve any outgoing transactions made
// from the application as well as those placed into the queue by distributed applications.
// from the application as well as those placed into the queue by decentralized applications.
label: `Signer` // Signer
},
status: {

View File

@ -17,6 +17,6 @@
export default {
tooltip: {
overview: `在應用的不同部分和不同介面進行導航,在帳戶介面、代幣介面和分散式應用介面之間切換。`
// navigate between the different parts and views of the application, switching between an account view, token view and distributed application view
// navigate between the different parts and views of the application, switching between an account view, token view and decentralized application view
}
};

View File

@ -17,6 +17,6 @@
export default {
install: `现在就安装这个扩展`, // Install the extension now
intro: `Parity现在有一个Chrome的扩展可以安全的浏览以太坊所支持的分布式应用。我们强烈推荐你安装这个扩展来进一步提升你的Parity使用体验。`
// Parity now has an extension available for Chrome that allows safe browsing of Ethereum-enabled distributed applications.
// Parity now has an extension available for Chrome that allows safe browsing of Ethereum-enabled decentralized applications.
// It is highly recommended that you install this extension to further enhance your Parity experience.
};

View File

@ -82,7 +82,7 @@ export default {
},
apps: {
description: `与整个底层网络交流的分布式应用。添加应用,管理你的应用库和与网络上的其他应用进行交互。`,
// Distributed applications that interact with the underlying network. Add applications, manage you application portfolio and
// Decentralized applications that interact with the underlying network. Add applications, manage you application portfolio and
// interact with application from around the network.
label: `应用` // Applications
},
@ -108,7 +108,7 @@ export default {
signer: {
description: `这个应用安全交易管理区域,你可以通过任何从本应用和其他分布式应用发起的即将发送的交易`,
// The secure transaction management area of the application where you can approve any outgoing transactions made
// from the application as well as those placed into the queue by distributed applications.
// from the application as well as those placed into the queue by decentralized applications.
label: `Signer` // Signer
},
status: {

View File

@ -17,6 +17,6 @@
export default {
tooltip: {
overview: `在应用的不同部分和不同界面进行导航,在账户界面、代币界面和分布式应用界面之间切换。`
// navigate between the different parts and views of the application, switching between an account view, token view and distributed application view
// navigate between the different parts and views of the application, switching between an account view, token view and decentralized application view
}
};

View File

@ -42,7 +42,7 @@ impl WebApp for App {
Info {
name: "Parity UI",
version: env!("CARGO_PKG_VERSION"),
author: "Ethcore <admin@parity.io>",
author: "Parity <admin@parity.io>",
description: "New UI for Parity.",
icon_url: "icon.png",
}

View File

@ -64,7 +64,8 @@
"author": "Parity Team <admin@parity.io>",
"version": "1.0.0",
"visible": false,
"secure": true
"secure": true,
"onlyPersonal": true
},
{
"id": "0xae74ad174b95cdbd01c88ac5b73a296d33e9088fc2a200e76bcedf3a94a7815d",
@ -95,6 +96,7 @@
"version": "1.0.0",
"visible": true,
"skipBuild": true,
"skipHistory": true
"skipHistory": true,
"onlyPersonal": true
}
]

View File

@ -35,10 +35,11 @@ import styles from './dapps.css';
class Dapps extends Component {
static contextTypes = {
api: PropTypes.object.isRequired
}
};
static propTypes = {
accounts: PropTypes.object.isRequired
accounts: PropTypes.object.isRequired,
availability: PropTypes.string.isRequired
};
store = DappsStore.get(this.context.api);
@ -135,6 +136,10 @@ class Dapps extends Component {
}
renderApp = (app) => {
if (app.onlyPersonal && this.props.availability !== 'personal') {
return null;
}
return (
<DappCard
app={ app }
@ -158,6 +163,7 @@ class Dapps extends Component {
function mapStateToProps (state) {
const { accounts } = state.personal;
const { availability = 'unknown' } = state.nodeStatus.nodeKind || {};
/**
* Do not show the Wallet Accounts in the Dapps
@ -167,7 +173,8 @@ function mapStateToProps (state) {
const _accounts = omitBy(accounts, (account) => account.wallet);
return {
accounts: _accounts
accounts: _accounts,
availability
};
}

View File

@ -46,7 +46,7 @@ export default class Extension extends Component {
<p>
<FormattedMessage
id='extension.intro'
defaultMessage='Parity now has an extension available for Chrome that allows safe browsing of Ethereum-enabled distributed applications. It is highly recommended that you install this extension to further enhance your Parity experience.'
defaultMessage='Parity now has an extension available for Chrome that allows safe browsing of Ethereum-enabled decentralized applications. It is highly recommended that you install this extension to further enhance your Parity experience.'
/>
</p>
<p className={ styles.buttonrow }>

View File

@ -38,124 +38,124 @@ export default function TnC ({ hasAccepted, onAccept }) {
<li>The user represents that the user has an adequate understanding of the risks, usage and intricacies of cryptographic tokens and blockchain-based open source software, eth platform and eth.</li>
<li>The user acknowledges and agrees that, to the fullest extent permitted by any applicable law, the disclaimers of liability contained herein apply to any and all damages or injury whatsoever caused by or related to risks of, use of, or inability to use, Parity under any cause or action whatsoever of any kind in any jurisdiction, including, without limitation, actions for breach of warranty, breach of contract or tort (including negligence) and that Eth Core Limited shall be not liable for any indirect, incidental, special, exemplary or consequential damages, including for loss of profits, goodwill or data.</li>
<li>Some jurisdictions do not allow the exclusion of certain warranties or the limitation or exclusion of liability for certain types of damages. Therefore, some of the above limitations in this section may not apply to a user. In particular, nothing in these terms shall affect the statutory rights of any user or exclude injury arising from any wilful misconduct or fraud of Eth Core Limited.</li>
<li>All rights reserved by Ethcore. Licensed to the public under the GPL v3 <a href='https://www.gnu.org/licenses/gpl-3.0.txt' target='_blank'>https://www.gnu.org/licenses/gpl-3.0.txt</a></li>
<li>All rights reserved by Parity. Licensed to the public under the GPL v3 <a href='https://www.gnu.org/licenses/gpl-3.0.txt' target='_blank'>https://www.gnu.org/licenses/gpl-3.0.txt</a></li>
</ul>
<h2>LONG VERSION</h2>
<p>The following Terms and Conditions (Terms) govern the use of Parity Technologies Limiteds open source software product (Parity). Prior to any use of the Parity or any of Parity Technologies Limiteds products (EthCores Products), the user or anyone on whose behalf the software is used for directly or indirectly (User) confirms that they understand and expressly agree to all of the Terms. All capitalized terms in this agreement will be given the same effect and meaning as in the Terms. The group of developers and other personnel that is now, or will be, employed by, or contracted with, or affiliated with, Parity Technologies Limited (EthCore) is termed the EthCore Team.</p>
<p>The following Terms and Conditions (Terms) govern the use of Parity Technologies Limiteds open source software product (Parity). Prior to any use of the Parity or any of Parity Technologies Limiteds products (Paritys Products), the user or anyone on whose behalf the software is used for directly or indirectly (User) confirms that they understand and expressly agree to all of the Terms. All capitalized terms in this agreement will be given the same effect and meaning as in the Terms. The group of developers and other personnel that is now, or will be, employed by, or contracted with, or affiliated with, Parity Technologies Limited (Parity) is termed the Parity Team.</p>
<h3>Acknowledgement of Risks</h3>
<p>The user acknowledges the following serious risks to any use Parity and expressly agrees not to hold liable EthCore or the EthCore Team should any of these risks occur:</p>
<p>The user acknowledges the following serious risks to any use Parity and expressly agrees not to hold liable Parity or the Parity Team should any of these risks occur:</p>
<h3>Risk of Security Weaknesses in the Parity Core Infrastructure Software</h3>
<p>Parity rests on open-source software, and although it is professionally developed in line with industry standards (which include external audits of the code base), there is a risk that Ethcore or the Ethcore Team, may have introduce unintentional weaknesses or bugs into the core infrastructural elements of Parity causing the system to lose ETH stored in one or more User accounts or other accounts or lose sums of other valued tokens.</p>
<p>Parity rests on open-source software, and although it is professionally developed in line with industry standards (which include external audits of the code base), there is a risk that Parity or the Parity Team, may have introduce unintentional weaknesses or bugs into the core infrastructural elements of Parity causing the system to lose ETH stored in one or more User accounts or other accounts or lose sums of other valued tokens.</p>
<h3>Risk of Weaknesses or Exploitable Breakthroughs in the Field of Cryptography</h3>
<p>Cryptography is an art, not a science. And the state of the art can advance over time Advances in code cracking, or technical advances such as the development of quantum computers, could present risks to cryptocurrencies and Parity, which could result in the theft or loss of ETH. To the extent possible, EthCore intends to update the protocol underlying Parity to account for any advances in cryptography and to incorporate additional security measures, but it cannot predict the future of cryptography or guaranty that any security updates will be made, timely or successful.</p>
<p>Cryptography is an art, not a science. And the state of the art can advance over time Advances in code cracking, or technical advances such as the development of quantum computers, could present risks to cryptocurrencies and Parity, which could result in the theft or loss of ETH. To the extent possible, Parity intends to update the protocol underlying Parity to account for any advances in cryptography and to incorporate additional security measures, but it cannot predict the future of cryptography or guaranty that any security updates will be made, timely or successful.</p>
<h3>Risk of Ether Mining Attacks</h3>
<p>As with other cryptocurrencies, the blockchain used by Parity is susceptible to mining attacks, including but not limited to double-spend attacks, majority mining power attacks, selfish-mining attacks, and race condition attacks. Any successful attacks present a risk to the Ethereum ecosystem, expected proper execution and sequencing of ETH transactions, and expected proper execution and sequencing of contract computations. Despite the efforts of the EthCore and the EthCore Team, known or novel mining attacks may be successful.</p>
<p>As with other cryptocurrencies, the blockchain used by Parity is susceptible to mining attacks, including but not limited to double-spend attacks, majority mining power attacks, selfish-mining attacks, and race condition attacks. Any successful attacks present a risk to the Ethereum ecosystem, expected proper execution and sequencing of ETH transactions, and expected proper execution and sequencing of contract computations. Despite the efforts of the Parity and the Parity Team, known or novel mining attacks may be successful.</p>
<h3>Risk of Rapid Adoption and Insufficiency of Computational Application Processing Power on the Ethereum Network</h3>
<p>If Parity is rapidly adopted, the demand for transaction processing and distributed application computations could rise dramatically and at a pace that exceeds the rate with which ETH miners can bring online additional mining power. Under such a scenario, the entire Ethereum ecosystem could become destabilized, due to the increased cost of running distributed applications. In turn, this could dampen interest in the Ethereum ecosystem and ETH. Insufficiency of computational resources and an associated rise in the price of ETH could result in businesses being unable to acquire scarce computational resources to run their distributed applications. This would represent revenue losses to businesses or worst case, cause businesses to cease operations because such operations have become uneconomical due to distortions in the crypto-economy.</p>
<p>If Parity is rapidly adopted, the demand for transaction processing and decentralized application computations could rise dramatically and at a pace that exceeds the rate with which ETH miners can bring online additional mining power. Under such a scenario, the entire Ethereum ecosystem could become destabilized, due to the increased cost of running decentralized applications. In turn, this could dampen interest in the Ethereum ecosystem and ETH. Insufficiency of computational resources and an associated rise in the price of ETH could result in businesses being unable to acquire scarce computational resources to run their decentralized applications. This would represent revenue losses to businesses or worst case, cause businesses to cease operations because such operations have become uneconomical due to distortions in the crypto-economy.</p>
<h3>Risk of temporary network incoherence</h3>
<p>We recommend any groups handling large or important transactions to maintain a voluntary 24 hour waiting period on any ether deposited. In case the integrity of the network is at risk due to issues in the clients, we will endeavour to publish patches in a timely fashion to address the issues. We will endeavour to provide solutions within the voluntary 24 hour waiting period.</p>
<h3>Use of Parity by you</h3>
<p>You agree to use Party only for purposes that are permitted by (a) these Terms and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United Kingdom or other relevant countries).</p>
<p>You agree that you will not engage in any activity that interferes with or disrupts Paritys or EthCores Products functioning (or the networks which are connected to Parity).</p>
<p>Unless you have been specifically permitted to do so in a separate agreement with EthCore, you agree that you will not reproduce, duplicate, copy, sell, trade or resell the EthCores Products for any purpose unless than in accordance to the terms of the software licence terms available here: <a href='https://www.gnu.org/licenses/gpl-3.0.txt' target='_blank'>https://www.gnu.org/licenses/gpl-3.0.txt</a> (“Software Licence Terms”).</p>
<p>You agree that you are solely responsible for (and that EthCore has no responsibility to you or to any third party for) any breach of your obligations under these terms and for the consequences (including any loss or damage which EthCore may suffer) of any such breach.</p>
<p>You agree to use Parity only for purposes that are permitted by (a) these Terms and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United Kingdom or other relevant countries).</p>
<p>You agree that you will not engage in any activity that interferes with or disrupts Paritys or Paritys Products functioning (or the networks which are connected to Parity).</p>
<p>Unless you have been specifically permitted to do so in a separate agreement with Parity, you agree that you will not reproduce, duplicate, copy, sell, trade or resell the Paritys Products for any purpose unless than in accordance to the terms of the software licence terms available here: <a href='https://www.gnu.org/licenses/gpl-3.0.txt' target='_blank'>https://www.gnu.org/licenses/gpl-3.0.txt</a> (“Software Licence Terms”).</p>
<p>You agree that you are solely responsible for (and that Parity has no responsibility to you or to any third party for) any breach of your obligations under these terms and for the consequences (including any loss or damage which Parity may suffer) of any such breach.</p>
<h3>Privacy and your personal information</h3>
<p>You agree to the use of your data (if any is gathered) in accordance with EthCores privacy policies: <a href='https://ethcore.io/legal.html' target='_blank'>https://ethcore.io/legal.html</a>. This policy explains how EthCore treats your personal information (if any is gathered), and protects your privacy, when you use EthCores Products.</p>
<p>You agree to the use of your data (if any is gathered) in accordance with Paritys privacy policies: <a href='https://parity.io/legal.html' target='_blank'>https://parity.io/legal.html</a>. This policy explains how Parity treats your personal information (if any is gathered), and protects your privacy, when you use Paritys Products.</p>
<h3>Content in Parity</h3>
<p>You understand that all information and data (such as smart contracts, data files, written text, computer software, music, audio files or other sounds, photographs, videos or other images) which you may have access to as part of, or through your use of, EthCores Product are the sole responsibility of the person from which such content originated. All such information is referred to below as the Content.</p>
<p>You should be aware that Content presented to you through Parity or EthCores Product may be protected by intellectual property rights which are owned by thisrd parties who may provide that Content to EthCore (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this Content (either in whole or in part) unless you have been specifically told that you may do so by Ethcore or by the owners of that Content, in a separate agreement.</p>
<p>You understand that by using Parity or EthCores Products you may be exposed to Content that you may find offensive, indecent or objectionable and that, in this respect, you use Parity or EthCores Products at your own risk.</p>
<p>You agree that you are solely responsible for (and that EthCore has no responsibility to you or to any third party for) any Content that you create, transmit or display while using Parity or EthCores Products and for the consequences of your actions (including any loss or damage which EthCore may suffer) by doing so.</p>
<p>You understand that all information and data (such as smart contracts, data files, written text, computer software, music, audio files or other sounds, photographs, videos or other images) which you may have access to as part of, or through your use of, Paritys Product are the sole responsibility of the person from which such content originated. All such information is referred to below as the Content.</p>
<p>You should be aware that Content presented to you through Parity or Paritys Product may be protected by intellectual property rights which are owned by thisrd parties who may provide that Content to Parity (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this Content (either in whole or in part) unless you have been specifically told that you may do so by Parity or by the owners of that Content, in a separate agreement.</p>
<p>You understand that by using Parity or Paritys Products you may be exposed to Content that you may find offensive, indecent or objectionable and that, in this respect, you use Parity or Paritys Products at your own risk.</p>
<p>You agree that you are solely responsible for (and that Parity has no responsibility to you or to any third party for) any Content that you create, transmit or display while using Parity or Paritys Products and for the consequences of your actions (including any loss or damage which Parity may suffer) by doing so.</p>
<h3>Proprietary rights</h3>
<p>You acknowledge and agree that EthCore own all legal right, title and interest in and to the Parity and EthCores Products, including any intellectual property rights which subsist in Parity and EthCores Products (whether those rights happen to be registered or not, and wherever in the world those rights may exist).</p>
<p>Unless you have agreed otherwise in writing with EthCore, nothing in the Terms gives you a right to use any of EthCores trade names, trade marks, service marks, logos, domain names, and other distinctive brand features.</p>
<p>If you have been given an explicit right to use any of these brand features in a separate written agreement with EthCore, then you agree that your use of such features shall be in compliance with that agreement, any applicable provisions of these terms, and EthCores brand feature use guidelines as updated from time to time. These guidelines can be viewed online at <a href='https://ethcore.io/press.html' target='_blank'>https://ethcore.io/press.html</a>.</p>
<p>EthCore acknowledges and agrees that it obtains no right, title or interest from you (or your licensors) under these terms in or to any content that you submit, post, transmit or display on, or through, Parity, including any intellectual property rights which subsist in that content (whether those rights happen to be registered or not, and wherever in the world those rights may exist). Unless you have agreed otherwise in writing with EthCore, you agree that you are responsible for protecting and enforcing those rights and that EthCore has no obligation to do so on your behalf.</p>
<p>You agree that you shall not remove, obscure, or alter any proprietary rights notices (including copyright and trade mark notices) which may be affixed to or contained within Parity or EthCores Products.</p>
<p>Unless you have been expressly authorized to do so in writing by EthCore, you agree that in using Parity, you will not use any trade mark, service mark, trade name, logo of any company or organization in a way that is likely or intended to cause confusion about the owner or authorized user of such marks, names or logos.</p>
<p>You acknowledge and agree that Parity own all legal right, title and interest in and to the Parity and Paritys Products, including any intellectual property rights which subsist in Parity and Paritys Products (whether those rights happen to be registered or not, and wherever in the world those rights may exist).</p>
<p>Unless you have agreed otherwise in writing with Parity, nothing in the Terms gives you a right to use any of Paritys trade names, trade marks, service marks, logos, domain names, and other distinctive brand features.</p>
<p>If you have been given an explicit right to use any of these brand features in a separate written agreement with Parity, then you agree that your use of such features shall be in compliance with that agreement, any applicable provisions of these terms, and Paritys brand feature use guidelines as updated from time to time. These guidelines can be viewed online at <a href='https://parity.io/press.html' target='_blank'>https://parity.io/press.html</a>.</p>
<p>Parity acknowledges and agrees that it obtains no right, title or interest from you (or your licensors) under these terms in or to any content that you submit, post, transmit or display on, or through, Parity, including any intellectual property rights which subsist in that content (whether those rights happen to be registered or not, and wherever in the world those rights may exist). Unless you have agreed otherwise in writing with Parity, you agree that you are responsible for protecting and enforcing those rights and that Parity has no obligation to do so on your behalf.</p>
<p>You agree that you shall not remove, obscure, or alter any proprietary rights notices (including copyright and trade mark notices) which may be affixed to or contained within Parity or Paritys Products.</p>
<p>Unless you have been expressly authorized to do so in writing by Parity, you agree that in using Parity, you will not use any trade mark, service mark, trade name, logo of any company or organization in a way that is likely or intended to cause confusion about the owner or authorized user of such marks, names or logos.</p>
<h3>License Restrictions from EthCore</h3>
<p>You may not (and you may not permit anyone else to) copy, modify, create a derivative work of, reverse engineer, decompile or otherwise attempt to extract the source code of the Parity, EthCores Products or any part thereof, unless this is expressly permitted by our Software Licence Terms or required by law, or unless you have been specifically told that you may do so by EthCore, in writing.</p>
<p>Unless EthCore has given you specific written permission to do so, you may not assign (or grant a sub-licence of) your rights to use EthCores Products, grant a security interest in or over your rights to use the EthCores Products, or otherwise transfer any part of your rights to use the EthCores Products.</p>
<h3>License Restrictions from Parity</h3>
<p>You may not (and you may not permit anyone else to) copy, modify, create a derivative work of, reverse engineer, decompile or otherwise attempt to extract the source code of the Parity, Paritys Products or any part thereof, unless this is expressly permitted by our Software Licence Terms or required by law, or unless you have been specifically told that you may do so by Parity, in writing.</p>
<p>Unless Parity has given you specific written permission to do so, you may not assign (or grant a sub-licence of) your rights to use Paritys Products, grant a security interest in or over your rights to use the Paritys Products, or otherwise transfer any part of your rights to use the Paritys Products.</p>
<h3>Content licence from you</h3>
<p>You retain copyright and any other rights you already hold in content which you submit, post or display on or through, Parity.</p>
<h3>Ending your relationship with EthCore</h3>
<p>The Terms will continue to apply until terminated by either you or EthCore as set out below.</p>
<p>EthCore may at any time, terminate its legal agreement with you if:</p>
<h3>Ending your relationship with Parity</h3>
<p>The Terms will continue to apply until terminated by either you or Parity as set out below.</p>
<p>Parity may at any time, terminate its legal agreement with you if:</p>
<ol>
<li>you have breached any provision of these Terms (or have acted in manner which clearly shows that you do not intend to, or are unable to comply with the provisions of these terms); or</li>
<li>EthCore is required to do so by law (for example, where the provision of EthCores Product to you is, or becomes, unlawful); or</li>
<li>the partner with whom EthCore offered products or services to you has terminated its relationship with EthCore or ceased to offer products or services to you; or</li>
<li>EthCore is transitioning to no longer providing products or services to users in the country in which you are resident or from which you use the service; or</li>
<li>the provision of products or services to you by EthCore is, in EthCores opinion, no longer commercially viable.</li>
<li>When these Terms come to an end, all of the legal rights, obligations and liabilities that you and EthCore have benefited from, been subject to (or which have accrued over time whilst the Terms have been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the England and Wales jurisdiction choice shall continue to apply to such rights, obligations and liabilities indefinitely.</li>
<li>Parity is required to do so by law (for example, where the provision of Paritys Product to you is, or becomes, unlawful); or</li>
<li>the partner with whom Parity offered products or services to you has terminated its relationship with Parity or ceased to offer products or services to you; or</li>
<li>Parity is transitioning to no longer providing products or services to users in the country in which you are resident or from which you use the service; or</li>
<li>the provision of products or services to you by Parity is, in Paritys opinion, no longer commercially viable.</li>
<li>When these Terms come to an end, all of the legal rights, obligations and liabilities that you and Parity have benefited from, been subject to (or which have accrued over time whilst the Terms have been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the England and Wales jurisdiction choice shall continue to apply to such rights, obligations and liabilities indefinitely.</li>
</ol>
<h3>ACKNOWLEDGEMENT AND ACCEPTANCE OF ALL RISKS, EXCLUSION OF WARRANTIES</h3>
<p>THE USER EXPRESSLY KNOWS AND AGREES THAT THE USER IS USING PARITY OR ETHCORES PRODUCTS AT THE USERS SOLE RISK. THE USER REPRESENTS THAT THE USER HAS AN ADEQUATE UNDERSTANDING OF THE RISKS, USAGE AND INTRICACIES OF CRYPTOGRAPHIC TOKENS AND BLOCKCHAIN-BASED OPEN SOURCE SOFTWARE, PARITY.</p>
<p>YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF ETHCORES PRODUCTS IS AT YOUR SOLE RISK AND THAT ETHCORES PRODUCTS ARE PROVIDED "AS IS" AND AS AVAILABLE.</p>
<p>IN PARTICULAR, ETHCORE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS DO NOT REPRESENT OR WARRANT TO YOU THAT:</p>
<p>(A) YOUR USE OF PARITY OR ETHCORES PRODUCTS WILL MEET YOUR REQUIREMENTS,</p>
<p>(B) YOUR USE OF PARITY OR ETHCORES PRODUCTS WILL BE UNINTERRUPTED, TIMELY, SECURE OR FREE FROM ERROR,</p>
<p>(C) ANY INFORMATION OBTAINED BY YOU AS A RESULT OF YOUR USE OF PARITY OR ETHCORES PRODUCTS WILL BE ACCURATE OR RELIABLE, AND</p>
<p>(D) THAT DEFECTS IN THE OPERATION OR FUNCTIONALITY OF ANY SOFTWARE PROVIDED TO YOU AS PART OF ETHCORES PRODUCTS WILL BE CORRECTED.</p>
<p>ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF PARITY OR ETHCORES PRODUCTS IS DONE AT YOUR OWN DISCRETION AND RISK AND THAT YOU WILL BE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA OR ECONOMIC LOSS THAT RESULTS FROM THE DOWNLOAD OF ANY SUCH MATERIAL.</p>
<p>NO ADVICE OR INFORMATION, WHETHER ORAL OR WRITTEN, OBTAINED BY YOU FROM ETHCORE OR THROUGH OR FROM ETHCORES PRODUCTS SHALL CREATE ANY WARRANTY NOT EXPRESSLY STATED IN THE TERMS.</p>
<p>ETHCORE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.</p>
<p>THE USER EXPRESSLY KNOWS AND AGREES THAT THE USER IS USING PARITY OR PARITYS PRODUCTS AT THE USERS SOLE RISK. THE USER REPRESENTS THAT THE USER HAS AN ADEQUATE UNDERSTANDING OF THE RISKS, USAGE AND INTRICACIES OF CRYPTOGRAPHIC TOKENS AND BLOCKCHAIN-BASED OPEN SOURCE SOFTWARE, PARITY.</p>
<p>YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF PARITYS PRODUCTS IS AT YOUR SOLE RISK AND THAT PARITYS PRODUCTS ARE PROVIDED "AS IS" AND AS AVAILABLE.</p>
<p>IN PARTICULAR, PARITY, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS DO NOT REPRESENT OR WARRANT TO YOU THAT:</p>
<p>(A) YOUR USE OF PARITY OR PARITYS PRODUCTS WILL MEET YOUR REQUIREMENTS,</p>
<p>(B) YOUR USE OF PARITY OR PARITYS PRODUCTS WILL BE UNINTERRUPTED, TIMELY, SECURE OR FREE FROM ERROR,</p>
<p>(C) ANY INFORMATION OBTAINED BY YOU AS A RESULT OF YOUR USE OF PARITY OR PARITYS PRODUCTS WILL BE ACCURATE OR RELIABLE, AND</p>
<p>(D) THAT DEFECTS IN THE OPERATION OR FUNCTIONALITY OF ANY SOFTWARE PROVIDED TO YOU AS PART OF PARITYS PRODUCTS WILL BE CORRECTED.</p>
<p>ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF PARITY OR PARITYS PRODUCTS IS DONE AT YOUR OWN DISCRETION AND RISK AND THAT YOU WILL BE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA OR ECONOMIC LOSS THAT RESULTS FROM THE DOWNLOAD OF ANY SUCH MATERIAL.</p>
<p>NO ADVICE OR INFORMATION, WHETHER ORAL OR WRITTEN, OBTAINED BY YOU FROM PARITY OR THROUGH OR FROM PARITYS PRODUCTS SHALL CREATE ANY WARRANTY NOT EXPRESSLY STATED IN THE TERMS.</p>
<p>PARITY FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.</p>
<h3>EXCLUSION AND LIMITATION OF LIABILITY</h3>
<p>THE USER ACKNOWLEDGES AND AGREES THAT, TO THE FULLEST EXTENT PERMITTED BY ANY APPLICABLE LAW, THE DISCLAIMERS AND EXCLUSION OF LIABILITY CONTAINED HEREIN APPLY TO ANY AND ALL DAMAGES OR INJURY WHATSOEVER CAUSED BY OR RELATED TO RISKS OF, USE OF, OR INABILITY TO USE, PARITY UNDER ANY CAUSE OF ACTION WHATSOEVER OF ANY KIND IN ANY JURISDICTION, INCLUDING, WITHOUT LIMITATION, ACTIONS FOR BREACH OF WARRANTY, BREACH OF CONTRACT OR TORT (INCLUDING NEGLIGENCE) AND THAT NEITHER ETHCORE NOR THE ETHCORE TEAM SHALL BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES, INCLUDING FOR LOSS OF PROFITS, GOODWILL OR DATA.</p>
<p>SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF CERTAIN WARRANTIES OR THE LIMITATION OR EXCLUSION OF LIABILITY FOR CERTAIN TYPES OF DAMAGES. THEREFORE, SOME OF THE ABOVE LIMITATIONS IN THIS SECTION MAY NOT APPLY TO A USER. IN PARTICULAR, NOTHING IN THESE TERMS SHALL AFFECT THE STATUTORY RIGHTS OF ANY USER OR EXCLUDE INJURY ARISING FROM ANY WILLFUL MISCONDUCT OR FRAUD OF ETHCORE.</p>
<p>SUBJECT TO ANY LIABILITY WHICH MAY NOT BE EXCLUDED, YOU EXPRESSLY UNDERSTAND AND AGREE THAT ETHCORE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU FOR:</p>
<p>THE USER ACKNOWLEDGES AND AGREES THAT, TO THE FULLEST EXTENT PERMITTED BY ANY APPLICABLE LAW, THE DISCLAIMERS AND EXCLUSION OF LIABILITY CONTAINED HEREIN APPLY TO ANY AND ALL DAMAGES OR INJURY WHATSOEVER CAUSED BY OR RELATED TO RISKS OF, USE OF, OR INABILITY TO USE, PARITY UNDER ANY CAUSE OF ACTION WHATSOEVER OF ANY KIND IN ANY JURISDICTION, INCLUDING, WITHOUT LIMITATION, ACTIONS FOR BREACH OF WARRANTY, BREACH OF CONTRACT OR TORT (INCLUDING NEGLIGENCE) AND THAT NEITHER PARITY NOR THE PARITY TEAM SHALL BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES, INCLUDING FOR LOSS OF PROFITS, GOODWILL OR DATA.</p>
<p>SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF CERTAIN WARRANTIES OR THE LIMITATION OR EXCLUSION OF LIABILITY FOR CERTAIN TYPES OF DAMAGES. THEREFORE, SOME OF THE ABOVE LIMITATIONS IN THIS SECTION MAY NOT APPLY TO A USER. IN PARTICULAR, NOTHING IN THESE TERMS SHALL AFFECT THE STATUTORY RIGHTS OF ANY USER OR EXCLUDE INJURY ARISING FROM ANY WILLFUL MISCONDUCT OR FRAUD OF PARITY.</p>
<p>SUBJECT TO ANY LIABILITY WHICH MAY NOT BE EXCLUDED, YOU EXPRESSLY UNDERSTAND AND AGREE THAT PARITY, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU FOR:</p>
<p>(A) ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES WHICH MAY BE INCURRED BY YOU, HOWEVER CAUSED AND UNDER ANY THEORY OF LIABILITY. THIS SHALL INCLUDE, BUT NOT BE LIMITED TO, ANY LOSS OF PROFIT (WHETHER INCURRED DIRECTLY OR INDIRECTLY), ANY LOSS OF GOODWILL OR BUSINESS REPUTATION, ANY LOSS OF DATA SUFFERED, COST OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR OTHER INTANGIBLE LOSS;</p>
<p>(B) ANY LOSS OR DAMAGE WHICH MAY BE INCURRED BY YOU, INCLUDING BUT NOT LIMITED TO LOSS OR DAMAGE AS A RESULT OF:</p>
<p>(I) ANY RELIANCE PLACED BY YOU ON THE COMPLETENESS, ACCURACY OR EXISTENCE OF ANY ADVERTISING, OR AS A RESULT OF ANY RELATIONSHIP OR TRANSACTION BETWEEN YOU AND ANY ADVERTISER OR SPONSOR WHOSE ADVERTISING APPEARS ON ETHCORES PRODUCTS;</p>
<p>(II) ANY CHANGES WHICH ETHCORE MAY MAKE TO ETHCORES PRODUCTS, OR FOR ANY PERMANENT OR TEMPORARY CESSATION IN THE PROVISION OF ETHCORES PRODUCTS (OR ANY FEATURES WITHIN ETHCORES PRODUCTS);</p>
<p>(III) THE DELETION OF, CORRUPTION OF, OR FAILURE TO STORE, ANY CONTENT AND OTHER COMMUNICATIONS DATA MAINTAINED OR TRANSMITTED BY OR THROUGH YOUR USE OF ETHCORES PRODUCTS;</p>
<p>(IV) YOUR FAILURE TO PROVIDE ETHCORE WITH ACCURATE ACCOUNT INFORMATION (IF THIS IS REQUIRED);</p>
<p>(I) ANY RELIANCE PLACED BY YOU ON THE COMPLETENESS, ACCURACY OR EXISTENCE OF ANY ADVERTISING, OR AS A RESULT OF ANY RELATIONSHIP OR TRANSACTION BETWEEN YOU AND ANY ADVERTISER OR SPONSOR WHOSE ADVERTISING APPEARS ON PARITYS PRODUCTS;</p>
<p>(II) ANY CHANGES WHICH PARITY MAY MAKE TO PARITYS PRODUCTS, OR FOR ANY PERMANENT OR TEMPORARY CESSATION IN THE PROVISION OF PARITYS PRODUCTS (OR ANY FEATURES WITHIN PARITYS PRODUCTS);</p>
<p>(III) THE DELETION OF, CORRUPTION OF, OR FAILURE TO STORE, ANY CONTENT AND OTHER COMMUNICATIONS DATA MAINTAINED OR TRANSMITTED BY OR THROUGH YOUR USE OF PARITYS PRODUCTS;</p>
<p>(IV) YOUR FAILURE TO PROVIDE PARITY WITH ACCURATE ACCOUNT INFORMATION (IF THIS IS REQUIRED);</p>
<p>(V) YOUR FAILURE TO KEEP YOUR PASSWORD OR ACCOUNT DETAILS SECURE AND CONFIDENTIAL;</p>
<p>THE LIMITATIONS ON ETHCORES LIABILITY TO YOU SHALL APPLY WHETHER OR NOT ETHCORE HAS BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.</p>
<p>THE LIMITATIONS ON PARITYS LIABILITY TO YOU SHALL APPLY WHETHER OR NOT PARITY HAS BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.</p>
<h3>Copyright and trade mark policies</h3>
<p>It is EthCores policy to respond to notices of alleged copyright infringement that comply with applicable international intellectual property law (including, in the United States, the Digital Millennium Copyright Act) and if EthCore is put on notice and it is under EthCores control and terminating the accounts of repeat infringers.</p>
<p>It is Paritys policy to respond to notices of alleged copyright infringement that comply with applicable international intellectual property law (including, in the United States, the Digital Millennium Copyright Act) and if Parity is put on notice and it is under Paritys control and terminating the accounts of repeat infringers.</p>
<h3>Other content</h3>
<p>Services provided may include hyperlinks to other web sites, smart contracts or content or resources. EthCore may have no control over any web sites or resources which are provided by companies or persons other than EthCore.</p>
<p>You acknowledge and agree that EthCore is not responsible for the availability of any such external sites or resources, and does not endorse any advertising, products or other materials on or available from such web sites or resources.</p>
<p>You acknowledge and agree that EthCore is not liable for any loss or damage which may be incurred by you as a result of the availability of those external sites or resources, or as a result of any reliance placed by you on the completeness, accuracy or existence of any advertising, products or other materials on, or available from, such web sites or resources.</p>
<p>Services provided may include hyperlinks to other web sites, smart contracts or content or resources. Parity may have no control over any web sites or resources which are provided by companies or persons other than Parity.</p>
<p>You acknowledge and agree that Parity is not responsible for the availability of any such external sites or resources, and does not endorse any advertising, products or other materials on or available from such web sites or resources.</p>
<p>You acknowledge and agree that Parity is not liable for any loss or damage which may be incurred by you as a result of the availability of those external sites or resources, or as a result of any reliance placed by you on the completeness, accuracy or existence of any advertising, products or other materials on, or available from, such web sites or resources.</p>
<h3>Changes to the Terms</h3>
<p>EthCore may make changes to these from time to time. When these changes are made, EthCore will make a new copy of these terms available at https://ethcore.io/legal.html and any new terms will be made available to you from within, or through, the affected EthCores Product.</p>
<p>You understand and agree that if you use Parity or EthCores Products after the date on which the Terms have changed, EthCore will treat your use as acceptance of the updated terms.</p>
<p>Parity may make changes to these from time to time. When these changes are made, Parity will make a new copy of these terms available at https://parity.io/legal.html and any new terms will be made available to you from within, or through, the affected Paritys Product.</p>
<p>You understand and agree that if you use Parity or Paritys Products after the date on which the Terms have changed, Parity will treat your use as acceptance of the updated terms.</p>
<h3>General legal terms</h3>
<p>Sometimes when you use Parity or EthCores Products, you may (as a result of, or in connection with your use of these products) use a service or download a piece of software, or smart contract, or purchase goods, which are provided by another person or company. Your use of these other services, software, smart contract or goods may be subject to separate terms between you and the company or person concerned. If so, these Terms do not affect your legal relationship with these other companies or individuals.</p>
<p>These Terms constitute the whole legal agreement between you and EthCore and govern your use of Parity and EthCores Products (but excluding any products or services which EthCore may provide to you under a separate written agreement), and completely replace any prior agreements between you and EthCore in relation to Parity and EthCores Products.</p>
<p>You agree that EthCore may provide you with notices, including those regarding changes to the Terms, by postings on the affected EthCores Product.</p>
<p>You agree that if EthCore does not exercise or enforce any legal right or remedy which is contained in these Terms (or which EthCore has the benefit of under any applicable law), this will not be taken to be a formal waiver of EthCores rights and that those rights or remedies will still be available to EthCore.</p>
<p>Sometimes when you use Parity or Paritys Products, you may (as a result of, or in connection with your use of these products) use a service or download a piece of software, or smart contract, or purchase goods, which are provided by another person or company. Your use of these other services, software, smart contract or goods may be subject to separate terms between you and the company or person concerned. If so, these Terms do not affect your legal relationship with these other companies or individuals.</p>
<p>These Terms constitute the whole legal agreement between you and Parity and govern your use of Parity and Paritys Products (but excluding any products or services which Parity may provide to you under a separate written agreement), and completely replace any prior agreements between you and Parity in relation to Parity and Paritys Products.</p>
<p>You agree that Parity may provide you with notices, including those regarding changes to the Terms, by postings on the affected Paritys Product.</p>
<p>You agree that if Parity does not exercise or enforce any legal right or remedy which is contained in these Terms (or which Parity has the benefit of under any applicable law), this will not be taken to be a formal waiver of Paritys rights and that those rights or remedies will still be available to Parity.</p>
<p>If any court of law, having the jurisdiction to decide on this matter, rules that any provision of these Terms is invalid, then that provision will be removed from the Terms without affecting the rest of the Terms. The remaining provisions of the Terms will continue to be valid and enforceable.</p>
<p>You acknowledge and agree that each member of the group of companies of which EthCore is the parent shall be third party beneficiaries to these Terms and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the Terms which confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to these Terms.</p>
<p>These Terms, and your relationship with EthCore under these Terms, shall be governed by the laws of England and Wales, United Kingdom without regard to its conflict of laws provisions. You and EthCore agree to submit to the exclusive jurisdiction of the courts located within England, United Kingdom to resolve any legal matter arising from these Terms (subject to the Dispute Resolution clause below). Notwithstanding this, you agree that EthCore shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.</p>
<p>You acknowledge and agree that each member of the group of companies of which Parity is the parent shall be third party beneficiaries to these Terms and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the Terms which confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to these Terms.</p>
<p>These Terms, and your relationship with Parity under these Terms, shall be governed by the laws of England and Wales, United Kingdom without regard to its conflict of laws provisions. You and Parity agree to submit to the exclusive jurisdiction of the courts located within England, United Kingdom to resolve any legal matter arising from these Terms (subject to the Dispute Resolution clause below). Notwithstanding this, you agree that Parity shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.</p>
<h3>Dispute Resolution</h3>
<p>All disputes or claims arising out of, relating to, or in connection with the Terms, the breach thereof, or use of Parity shall be finally settled under the Rules of Arbitration of the International Chamber of Commerce by one or more arbitrators appointed in accordance with said Rules. All claims between the parties relating to these Terms that are capable of being resolved by arbitration, whether sounding in contract, tort, or otherwise, shall be submitted to ICC arbitration. Prior to commencing arbitration, the parties have a duty to negotiate in good faith and attempt to resolve their dispute in a manner other than by submission to ICC arbitration. The arbitration panel shall consist of one arbitrator only, unless the ICC Court of Arbitration determines that the dispute is such as to warrant three arbitrators. If the Court determines that one arbitrator is sufficient, then such arbitrator shall be a UK resident. If the Court determines that three arbitrators are necessary, then each party shall have 30 days to nominate an arbitrator of its choice - in the case of the Claimant, measured from receipt of notification of the ICC Courts decision to have three arbitrators; in the case of Respondent, measured from receipt of notification of Claimants nomination. All nominations must be UK residents. If a party fails to nominate an arbitrator, the Court will do so. The Court shall also appoint the chairman. All arbitrators shall be and remain independent of the parties involved in the arbitration. The place of arbitration shall be England, United Kingdom. The language of the arbitration shall be English. In deciding the merits of the dispute, the tribunal shall apply the laws of England and Wales and any discovery shall be limited and shall not involve any depositions or any other examinations outside of a formal hearing. The tribunal shall not assume the powers of amiable compositeur or decide the case ex aequo et bono. In the final award, the tribunal shall fix the costs of the arbitration and decide which of the parties shall bear such costs in what proportion. Every award shall be binding on the parties. The parties undertake to carry out the award without delay and waive their right to any form of recourse against the award in so far as such waiver can validly be made.</p>
<h3>Additional Terms for Enterprise Use</h3>
<p>If you are a business entity, then the individual accepting on behalf of the entity (for the avoidance of doubt, for business entities, in these Terms, "you" means the entity) represents and warrants that he or she has the authority to act on your behalf, that you represent that you are duly authorized to do business in the country or countries where you operate, and that your employees, officers, representatives, and other agents accessing EthCores Products are duly authorized to access Parity and to legally bind you to these Terms.</p>
<p>Subject to these Terms and subject to the Software Licence Terms, EthCore grants you a non-exclusive, non-transferable licence to install and use Parity solely on machines intended for use by your employees, officers, representatives, and agents in connection with your business entity, and provided that their use of EthCore will be subject to these Terms and EthCores Products software licence terms.</p>
<p>If you are a business entity, then the individual accepting on behalf of the entity (for the avoidance of doubt, for business entities, in these Terms, "you" means the entity) represents and warrants that he or she has the authority to act on your behalf, that you represent that you are duly authorized to do business in the country or countries where you operate, and that your employees, officers, representatives, and other agents accessing Paritys Products are duly authorized to access Parity and to legally bind you to these Terms.</p>
<p>Subject to these Terms and subject to the Software Licence Terms, Parity grants you a non-exclusive, non-transferable licence to install and use Parity solely on machines intended for use by your employees, officers, representatives, and agents in connection with your business entity, and provided that their use of Parity will be subject to these Terms and Paritys Products software licence terms.</p>
<Checkbox
className={ styles.accept }
@ -166,7 +166,7 @@ export default function TnC ({ hasAccepted, onAccept }) {
/>
}
checked={ hasAccepted }
onClick={ onAccept }
onClict={ onAccept }
/>
</div>
);

View File

@ -33,7 +33,7 @@ export default function FirstRun () {
<div className={ styles.welcome }>
<img
src={ imagesEthcore }
alt='Ethcore Ltd.'
alt='Parity Ltd.'
style={ LOGO_STYLE }
/>
<p>

View File

@ -54,6 +54,10 @@ const STAGE_NAMES = [
id='firstRun.title.recovery'
defaultMessage='recovery'
/>,
<FormattedMessage
id='firstRun.title.confirmation'
defaultMessage='confirmation'
/>,
<FormattedMessage
id='firstRun.title.completed'
defaultMessage='completed'
@ -131,9 +135,19 @@ class FirstRun extends Component {
);
case 3:
return (
<AccountDetails createStore={ this.createStore } />
<AccountDetails
createStore={ this.createStore }
withRequiredBackup
/>
);
case 4:
return (
<AccountDetails
createStore={ this.createStore }
isConfirming
/>
);
case 5:
return (
<Completed />
);
@ -143,7 +157,7 @@ class FirstRun extends Component {
renderDialogActions () {
const { hasAccounts } = this.props;
const { stage, hasAcceptedTnc } = this.state;
const { canCreate } = this.createStore;
const { canCreate, phraseBackedUpError } = this.createStore;
switch (stage) {
case 0:
@ -171,15 +185,10 @@ class FirstRun extends Component {
const buttons = [
<Button
disabled={ !canCreate }
icon={ <CheckIcon /> }
key='create'
label={
<FormattedMessage
id='firstRun.button.create'
defaultMessage='Create'
/>
}
onClick={ this.onCreate }
icon={ <NextIcon /> }
key='next'
label={ BUTTON_LABEL_NEXT }
onClick={ this.onNext }
/>
];
@ -214,14 +223,30 @@ class FirstRun extends Component {
onClick={ this.printPhrase }
/>,
<Button
disabled={ !!phraseBackedUpError }
icon={ <NextIcon /> }
key='next'
label={ BUTTON_LABEL_NEXT }
onClick={ this.onNext }
onClick={ this.onConfirmPhraseBackup }
/>
];
case 4:
return (
<Button
icon={ <CheckIcon /> }
key='create'
label={
<FormattedMessage
id='firstRun.button.create'
defaultMessage='Create'
/>
}
onClick={ this.onCreate }
/>
);
case 5:
return (
<Button
icon={ <DoneIcon /> }
@ -246,6 +271,11 @@ class FirstRun extends Component {
}, onClose);
}
onConfirmPhraseBackup = () => {
this.createStore.clearPhrase();
this.onNext();
}
onNext = () => {
const { stage } = this.state;
@ -263,11 +293,19 @@ class FirstRun extends Component {
onCreate = () => {
this.createStore.setBusy(true);
return this.createStore
.createAccount()
.then(() => {
this.onNext();
this.createStore.computeBackupPhraseAddress()
.then(err => {
if (err) {
this.createStore.setBusy(false);
return;
}
return this.createStore.createAccount()
.then(() => {
this.createStore.clearPhrase();
this.createStore.setBusy(false);
this.onNext();
});
})
.catch((error) => {
this.createStore.setBusy(false);

View File

@ -39,6 +39,7 @@ export default class Input extends Component {
PropTypes.bool,
PropTypes.string
]),
allowPaste: PropTypes.bool,
autoFocus: PropTypes.bool,
children: PropTypes.node,
className: PropTypes.string,
@ -76,6 +77,7 @@ export default class Input extends Component {
static defaultProps = {
allowCopy: false,
allowPaste: true,
escape: 'initial',
onBlur: noop,
onFocus: noop,
@ -170,7 +172,17 @@ export default class Input extends Component {
);
}
<<<<<<< HEAD
onChange = (event, { value }) => {
=======
onChange = (event, value) => {
if (!this.props.allowPaste) {
if (value.length - this.state.value.length > 8) {
return;
}
}
>>>>>>> master
event.persist();
this.setValue(value, () => {

View File

@ -20,6 +20,33 @@ import React from 'react';
import Accounts from './';
let component;
<<<<<<< HEAD:js/src/ui/VaultCard/Accounts/accounts.spec.js
=======
let store;
function createStore () {
store = {
dispatch: sinon.stub(),
subscribe: sinon.stub(),
getState: () => {
return {
settings: {
views: {
settings: { fixed: true }
}
},
nodeStatus: {
nodeKind: {
'availability': 'personal'
}
}
};
}
};
return store;
}
>>>>>>> master:js/src/views/Application/TabBar/tabBar.spec.js
function render (props = {}) {
component = shallow(

View File

@ -25,9 +25,16 @@ import styles from '../createAccount.css';
@observer
export default class AccountDetails extends Component {
static propTypes = {
isConfirming: PropTypes.bool,
withRequiredBackup: PropTypes.bool,
createStore: PropTypes.object.isRequired
}
static defaultPropTypes = {
isConfirming: false,
withRequiredBackup: false
}
render () {
const { address, description, name } = this.props.createStore;
@ -78,16 +85,17 @@ export default class AccountDetails extends Component {
);
}
renderPhrase () {
const { phrase } = this.props.createStore;
renderRequiredBackup () {
const { phraseBackedUp, phraseBackedUpError } = this.props.createStore;
if (!phrase) {
if (!this.props.withRequiredBackup) {
return null;
}
return (
<div>
<Input
allowCopy
error={ phraseBackedUpError }
hint={
<FormattedMessage
id='createAccount.accountDetails.phrase.hint'
@ -96,13 +104,84 @@ export default class AccountDetails extends Component {
}
label={
<FormattedMessage
id='createAccount.accountDetails.phrase.label'
defaultMessage='owner recovery phrase (keep private and secure, it allows full and unlimited access to the account)'
id='createAccount.accountDetails.phrase.backedUp'
defaultMessage='Type "I have written down the phrase" below to confirm it is backed up.'
/>
}
onChange={ this.onEditPhraseBackedUp }
value={ phraseBackedUp }
/>
</div>
);
}
renderPhrase () {
const { isConfirming } = this.props;
const { isTest, phrase, backupPhraseError } = this.props.createStore;
const hint = (
<FormattedMessage
id='createAccount.accountDetails.phrase.hint'
defaultMessage='the account recovery phrase'
/>
);
const label = (
<FormattedMessage
id='createAccount.accountDetails.phrase.label'
defaultMessage='owner recovery phrase'
/>
);
if (!isConfirming) {
if (!phrase) {
return null;
}
return (
<div>
<Input
allowCopy
hint={ hint }
label={ label }
readOnly
value={ phrase }
/>
<div className={ styles.backupPhrase }>
<FormattedMessage
id='createAccount.accountDetails.phrase.backup'
defaultMessage='Please back up the recovery phrase now. Make sure to keep it private and secure, it allows full and unlimited access to the account.'
/>
</div>
{ this.renderRequiredBackup() }
</div>
);
}
return (
<div>
<Input
allowPaste={ isTest }
error={ backupPhraseError }
hint={ hint }
label={ label }
onChange={ this.onEditPhrase }
value={ phrase }
/>
<div className={ styles.backupPhrase }>
<FormattedMessage
id='createAccount.accountDetails.phrase.backupConfirm'
defaultMessage='Type your recovery phrase now.'
/>
</div>
</div>
);
}
onEditPhraseBackedUp = (ev) => {
this.props.createStore.setPhraseBackedUp(ev.target.value);
}
onEditPhrase = (ev) => {
this.props.createStore.setPhrase(ev.target.value);
}
}

View File

@ -130,3 +130,8 @@
padding: 0 4em 1.5em 4em;
text-align: center;
}
.backupPhrase {
line-height: 1.618em;
margin-top: 1.5em;
}

View File

@ -37,7 +37,7 @@ import NewImport from './NewImport';
import NewQr from './NewQr';
import RawKey from './RawKey';
import RecoveryPhrase from './RecoveryPhrase';
import Store, { STAGE_CREATE, STAGE_INFO, STAGE_SELECT_TYPE } from './store';
import Store, { STAGE_CREATE, STAGE_INFO, STAGE_SELECT_TYPE, STAGE_CONFIRM_BACKUP } from './store';
import TypeIcon from './TypeIcon';
import print from './print';
import recoveryPage from './recoveryPage.ejs';
@ -61,6 +61,12 @@ const TITLES = {
defaultMessage='account information'
/>
),
backup: (
<FormattedMessage
id='createAccount.title.backupPhrase'
defaultMessage='confirm recovery phrase'
/>
),
import: (
<FormattedMessage
id='createAccount.title.importAccount'
@ -80,7 +86,7 @@ const TITLES = {
/>
)
};
const STAGE_NAMES = [TITLES.type, TITLES.create, TITLES.info];
const STAGE_NAMES = [TITLES.type, TITLES.create, TITLES.info, TITLES.backup];
const STAGE_IMPORT = [TITLES.type, TITLES.import, TITLES.info];
const STAGE_RESTORE = [TITLES.restore, TITLES.info];
const STAGE_QR = [TITLES.type, TITLES.qr, TITLES.info];
@ -213,14 +219,25 @@ class CreateAccount extends Component {
}
return (
<AccountDetails createStore={ this.createStore } />
<AccountDetails
createStore={ this.createStore }
withRequiredBackup={ createType === 'fromNew' }
/>
);
case STAGE_CONFIRM_BACKUP:
return (
<AccountDetails
createStore={ this.createStore }
isConfirming
/>
);
}
}
renderDialogActions () {
const { restore } = this.props;
const { createType, canCreate, isBusy, stage } = this.createStore;
const { createType, canCreate, isBusy, stage, phraseBackedUpError } = this.createStore;
const cancelBtn = (
<Button
@ -281,8 +298,8 @@ class CreateAccount extends Component {
createType === 'fromNew'
? (
<FormattedMessage
id='createAccount.button.create'
defaultMessage='Create'
id='createAccount.button.next'
defaultMessage='Next'
/>
)
: (
@ -292,7 +309,7 @@ class CreateAccount extends Component {
/>
)
}
onClick={ this.onCreate }
onClick={ createType === 'fromNew' ? this.createStore.nextStage : this.onCreate }
/>
];
@ -314,6 +331,7 @@ class CreateAccount extends Component {
)
: null,
<Button
disabled={ createType === 'fromNew' && !!phraseBackedUpError }
icon={ <DoneIcon /> }
key='done'
label={
@ -322,12 +340,55 @@ class CreateAccount extends Component {
defaultMessage='Done'
/>
}
onClick={ this.onClose }
onClick={ createType === 'fromNew' ? this.onConfirmPhraseBackup : this.onClose }
/>
];
case STAGE_CONFIRM_BACKUP:
return [
<Button
icon={ <DoneIcon /> }
key='done'
label={
<FormattedMessage
id='createAccount.button.create'
defaultMessage='Create'
/>
}
onClick={ this.onCreateNew }
/>
];
}
}
onConfirmPhraseBackup = () => {
this.createStore.clearPhrase();
this.createStore.nextStage();
}
onCreateNew = () => {
this.createStore.setBusy(true);
this.createStore.computeBackupPhraseAddress()
.then(err => {
if (err) {
this.createStore.setBusy(false);
return;
}
return this.createStore.createAccount(this.vaultStore)
.then(() => {
this.createStore.clearPhrase();
this.createStore.setBusy(false);
this.props.onUpdate && this.props.onUpdate();
this.onClose();
});
})
.catch((error) => {
this.createStore.setBusy(false);
this.props.newError(error);
});
}
onCreate = () => {
return this.createStore
.createAccount(this.vaultStore)
@ -341,6 +402,7 @@ class CreateAccount extends Component {
}
onClose = () => {
this.createStore.clearPhrase();
this.props.onClose && this.props.onClose();
}

View File

@ -46,6 +46,20 @@ export default {
/>
),
noMatchBackupPhrase: (
<FormattedMessage
id='errors.noMatchBackupPhrase'
defaultMessage='the supplied recovery phrase does not match'
/>
),
noMatchPhraseBackedUp: (
<FormattedMessage
id='errors.noMatchPhraseBackedUp'
defaultMessage='type "I have written down the phrase"'
/>
),
noName: (
<FormattedMessage
id='errors.noName'
@ -59,4 +73,5 @@ export default {
defaultMessage='the raw key needs to be hex, 64 characters in length and contain the prefix "0x"'
/>
)
};

View File

@ -24,6 +24,7 @@ const FAKEPATH = 'C:\\fakepath\\';
const STAGE_SELECT_TYPE = 0;
const STAGE_CREATE = 1;
const STAGE_INFO = 2;
const STAGE_CONFIRM_BACKUP = 3;
export default class Store {
@observable accounts = null;
@ -41,6 +42,8 @@ export default class Store {
@observable passwordHint = '';
@observable passwordRepeat = '';
@observable phrase = '';
@observable backupPhraseAddress = null;
@observable phraseBackedUp = '';
@observable qrAddress = null;
@observable rawKey = '';
@observable rawKeyError = ERRORS.nokey;
@ -104,17 +107,39 @@ export default class Store {
: ERRORS.noMatchPassword;
}
@computed get backupPhraseError () {
return !this.backupPhraseAddress || this.address === this.backupPhraseAddress
? null
: ERRORS.noMatchBackupPhrase;
}
@computed get phraseBackedUpError () {
return this.phraseBackedUp === 'I have written down the phrase'
? null
: ERRORS.noMatchPhraseBackedUp;
}
@computed get qrAddressValid () {
console.log('qrValid', this.qrAddress, this._api.util.isAddressValid(this.qrAddress));
return this._api.util.isAddressValid(this.qrAddress);
}
@action clearPhrase = () => {
transaction(() => {
this.phrase = '';
this.phraseBackedUp = '';
});
}
@action clearErrors = () => {
transaction(() => {
this.address = '';
this.description = '';
this.password = '';
this.passwordRepeat = '';
this.phrase = '';
this.backupPhraseAddress = null;
this.phraseBackedUp = '';
this.name = '';
this.nameError = ERRORS.noName;
this.qrAddress = null;
@ -192,6 +217,26 @@ export default class Store {
});
}
@action setBackupPhraseAddress = (address) => {
this.backupPhraseAddress = address;
}
@action computeBackupPhraseAddress = () => {
return this._api.parity.phraseToAddress(this.phrase)
.then(address => {
this.setBackupPhraseAddress(address);
return address !== this.address;
})
.catch((error) => {
console.error('createAccount', error);
throw error;
});
}
@action setPhraseBackedUp = (backedUp) => {
this.phraseBackedUp = backedUp;
}
@action setPassword = (password) => {
this.password = password;
}
@ -217,6 +262,7 @@ export default class Store {
.filter((part) => part.length);
this.phrase = phraseParts.join(' ');
this.backupPhraseAddress = null;
}
@action setRawKey = (rawKey) => {
@ -460,7 +506,8 @@ export default class Store {
}
export {
STAGE_CREATE,
STAGE_INFO,
STAGE_CONFIRM_BACKUP,
STAGE_CREATE,
STAGE_SELECT_TYPE
};

View File

@ -42,6 +42,7 @@ class Accounts extends Component {
static propTypes = {
accounts: PropTypes.object.isRequired,
accountsInfo: PropTypes.object.isRequired,
availability: PropTypes.string.isRequired,
hasAccounts: PropTypes.bool.isRequired,
setVisibleAccounts: PropTypes.func.isRequired
}
@ -240,6 +241,10 @@ class Accounts extends Component {
renderActionbar () {
const buttons = [
<<<<<<< HEAD
=======
this.renderVaultsButton(),
>>>>>>> master
<Button
key='newAccount'
icon={ <AddIcon /> }
@ -251,17 +256,7 @@ class Accounts extends Component {
}
onClick={ this.onNewAccountClick }
/>,
<Button
key='newWallet'
icon={ <AddIcon /> }
label={
<FormattedMessage
id='accounts.button.newWallet'
defaultMessage='wallet'
/>
}
onClick={ this.onNewWalletClick }
/>,
this.renderNewWalletButton(),
<Button
key='restoreAccount'
icon={ <AddIcon /> }
@ -335,6 +330,50 @@ class Accounts extends Component {
);
}
renderVaultsButton () {
if (this.props.availability !== 'personal') {
return null;
}
return (
<Link
to='/vaults'
key='vaults'
>
<Button
icon={ <KeyIcon /> }
label={
<FormattedMessage
id='accounts.button.vaults'
defaultMessage='vaults'
/>
}
onClick={ this.onVaultsClick }
/>
</Link>
);
}
renderNewWalletButton () {
if (this.props.availability !== 'personal') {
return null;
}
return (
<Button
key='newWallet'
icon={ <AddIcon /> }
label={
<FormattedMessage
id='accounts.button.newWallet'
defaultMessage='wallet'
/>
}
onClick={ this.onNewWalletClick }
/>
);
}
renderNewWalletDialog () {
const { accounts } = this.props;
const { newWalletDialog } = this.state;
@ -439,10 +478,12 @@ class Accounts extends Component {
function mapStateToProps (state) {
const { accounts, accountsInfo, hasAccounts } = state.personal;
const { availability = 'unknown' } = state.nodeStatus.nodeKind || {};
return {
accounts,
accountsInfo,
availability,
hasAccounts
};
}

View File

@ -60,6 +60,11 @@ function createRedux () {
},
balances: {
balances: {}
},
nodeStatus: {
nodeKind: {
'availability': 'personal'
}
}
};
}

View File

@ -0,0 +1,133 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import { FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import { Toolbar, ToolbarGroup } from 'material-ui/Toolbar';
import { isEqual } from 'lodash';
import { Tooltip } from '~/ui';
import Tab from './Tab';
import styles from './tabBar.css';
class TabBar extends Component {
static contextTypes = {
router: PropTypes.object.isRequired
};
static propTypes = {
pending: PropTypes.array,
views: PropTypes.array.isRequired
};
static defaultProps = {
pending: []
};
render () {
return (
<Toolbar className={ styles.toolbar }>
<ToolbarGroup className={ styles.first }>
<div />
</ToolbarGroup>
<div className={ styles.tabs }>
{ this.renderTabItems() }
<Tooltip
className={ styles.tabbarTooltip }
text={
<FormattedMessage
id='tabBar.tooltip.overview'
defaultMessage='navigate between the different parts and views of the application, switching between an account view, token view and decentralized application view'
/>
}
/>
</div>
<ToolbarGroup className={ styles.last }>
<div />
</ToolbarGroup>
</Toolbar>
);
}
renderTabItems () {
const { views, pending } = this.props;
return views.map((view, index) => {
return (
<Link
activeClassName={ styles.tabactive }
className={ styles.tabLink }
key={ view.id }
to={ view.route }
>
<Tab
pendings={ pending.length }
view={ view }
/>
</Link>
);
});
}
}
function mapStateToProps (initState) {
const { views } = initState.settings;
let filteredViewIds = Object
.keys(views)
.filter((id) => views[id].fixed || views[id].active);
let filteredViews = filteredViewIds.map((id) => ({
...views[id],
id
}));
return (state) => {
const { availability = 'unknown' } = state.nodeStatus.nodeKind || {};
const { views } = state.settings;
const viewIds = Object
.keys(views)
.filter((id) => {
const view = views[id];
const isEnabled = view.fixed || view.active;
const isAllowed = !view.onlyPersonal || availability === 'personal';
return isEnabled && isAllowed;
});
if (isEqual(viewIds, filteredViewIds)) {
return { views: filteredViews };
}
filteredViewIds = viewIds;
filteredViews = viewIds.map((id) => ({
...views[id],
id
}));
return { views: filteredViews };
};
}
export default connect(
mapStateToProps,
null
)(TabBar);

View File

@ -16,6 +16,7 @@
import { observer } from 'mobx-react';
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { FormattedMessage } from 'react-intl';
import HistoryStore from '@parity/shared/mobx/historyStore';
@ -34,11 +35,15 @@ import Urls from './Urls';
import styles from './home.css';
@observer
export default class Home extends Component {
class Home extends Component {
static contextTypes = {
api: PropTypes.object.isRequired
};
static propTypes = {
availability: PropTypes.string.isRequired
};
dappsStore = DappsStore.get(this.context.api);
extensionStore = ExtensionStore.get();
webStore = WebStore.get(this.context.api);
@ -51,6 +56,13 @@ export default class Home extends Component {
}
render () {
const urls = this.props.availability !== 'personal' ? null : (
<Urls
extensionStore={ this.extensionStore }
store={ this.webStore }
/>
);
return (
<Page
className={ styles.body }
@ -62,10 +74,7 @@ export default class Home extends Component {
}
>
<News />
<Urls
extensionStore={ this.extensionStore }
store={ this.webStore }
/>
{ urls }
<div className={ styles.row }>
<div className={ styles.column }>
<Dapps
@ -81,3 +90,16 @@ export default class Home extends Component {
);
}
}
function mapStateToProps (initState) {
return (state) => {
const { availability = 'unknown' } = state.nodeStatus.nodeKind || {};
return { availability };
};
}
export default connect(
mapStateToProps,
null
)(Home);

View File

@ -25,6 +25,25 @@ const TEST_APP_HISTORY = [];
let api;
let component;
let instance;
let store;
function createStore () {
store = {
dispatch: sinon.stub(),
subscribe: sinon.stub(),
getState: () => {
return {
nodeStatus: {
nodeKind: {
'availability': 'personal'
}
}
};
}
};
return store;
}
function createApi () {
api = {
@ -40,11 +59,15 @@ function render () {
component = shallow(
<Home />,
{
context: {
store: createStore()
}
}
).find('Home').shallow({
context: {
api: createApi()
}
}
);
});
instance = component.instance();
return component;

View File

@ -24,6 +24,41 @@ const defaultViews = {
icon: <AppsIcon />,
route: '/apps',
value: 'app'
<<<<<<< HEAD
=======
},
contracts: {
active: false,
onlyPersonal: true,
icon: <ContactsIcon />,
route: '/contracts',
value: 'contract'
},
status: {
active: false,
onlyPersonal: true,
icon: <StatusIcon />,
route: '/status',
value: 'status'
},
signer: {
active: true,
fixed: true,
icon: <FingerprintIcon />,
route: '/signer',
value: 'signer'
},
settings: {
active: true,
fixed: true,
icon: <SettingsIcon />,
route: '/settings',
value: 'settings'
>>>>>>> master
}
};

View File

@ -28,7 +28,8 @@ import styles from './views.css';
class Views extends Component {
static propTypes = {
settings: PropTypes.object.isRequired,
toggleView: PropTypes.func.isRequired
toggleView: PropTypes.func.isRequired,
availability: PropTypes.string.isRequired
}
render () {
@ -73,10 +74,57 @@ class Views extends Component {
/>,
<FormattedMessage
id='settings.views.apps.description'
defaultMessage='Distributed applications that interact with the underlying network. Add applications, manage you application portfolio and interact with application from around the network.'
defaultMessage='Decentralized applications that interact with the underlying network. Add applications, manage you application portfolio and interact with application from around the network.'
/>
)
}
<<<<<<< HEAD
=======
{
this.renderView('contracts',
<FormattedMessage
id='settings.views.contracts.label'
/>,
<FormattedMessage
id='settings.views.contracts.description'
defaultMessage='Watch and interact with specific contracts that have been deployed on the network. This is a more technically-focused environment, specifically for advanced users that understand the inner working of certain contracts.'
/>
)
}
{
this.renderView('status',
<FormattedMessage
id='settings.views.status.label'
/>,
<FormattedMessage
id='settings.views.status.description'
defaultMessage='See how the Parity node is performing in terms of connections to the network, logs from the actual running instance and details of mining (if enabled and configured).'
/>
)
}
{
this.renderView('signer',
<FormattedMessage
id='settings.views.signer.label'
/>,
<FormattedMessage
id='settings.views.signer.description'
defaultMessage='The secure transaction management area of the application where you can approve any outgoing transactions made from the application as well as those placed into the queue by decentralized applications.'
/>
)
}
{
this.renderView('settings',
<FormattedMessage
id='settings.views.settings.label'
/>,
<FormattedMessage
id='settings.views.settings.description'
defaultMessage='This view. Allows you to customize the application in term of options, operation and look and feel.'
/>
)
}
>>>>>>> master
</div>
</div>
</Container>
@ -100,6 +148,10 @@ class Views extends Component {
const toggle = () => toggleView(id);
const view = settings.views[id];
if (view.onlyPersonal && this.props.availability !== 'personal') {
return null;
}
return (
<div className={ styles.view } key={ id }>
<Checkbox
@ -128,8 +180,9 @@ class Views extends Component {
function mapStateToProps (state) {
const { settings } = state;
const { availability = 'unknown' } = state.nodeStatus.nodeKind || {};
return { settings };
return { settings, availability };
}
function mapDispatchToProps (dispatch) {

3
js/wasm/README.md Normal file
View File

@ -0,0 +1,3 @@
# WASM modules
- `ethkey` -> `/js/src/api/local/ethkey/ethkey.wasm`

2
js/wasm/ethkey/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
target
Cargo.lock

17
js/wasm/ethkey/Cargo.toml Normal file
View File

@ -0,0 +1,17 @@
[package]
description = "Parity ethkey WASM module."
name = "parity-ethkey-wasm"
version = "1.7.0"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
[workspace]
members = []
[dependencies]
tiny-keccak = "1.0"
tiny-secp256k1 = "0.1"
libc = { version = "0.2.14", default-features = false }
[profile.release]
panic = "abort"

View File

@ -0,0 +1,5 @@
const fs = require('fs');
const file = fs.readFileSync('./ethkey.opt.wasm', { encoding: 'base64' });
fs.writeFileSync('../../src/api/local/ethkey/ethkey.wasm.js', `module.exports = new Buffer('${file}', 'base64');\n`);

16
js/wasm/ethkey/build.sh Executable file
View File

@ -0,0 +1,16 @@
# Remove previous build to avoid name conflicts
rm -rf target/wasm32-unknown-emscripten/*
# Build using nightly rustc + emscripten
rustup run nightly cargo build --release --target=wasm32-unknown-emscripten
# Copy final WASM file over
cp ./target/wasm32-unknown-emscripten/release/deps/parity_ethkey_wasm-*.wasm ./ethkey.wasm
# Create a Base64-encoded JS version of the wasm file for easy inclusion in Webpack
node base64ify
# Copy Base64-encoded JS version to src
cp ./ethkey.wasm.js ../../src/api/local/ethkey/ethkey.wasm.js
# rm -f ./ethkey.wasm ./ethkey.opt.wasm ./ethkey.wasm.js

Binary file not shown.

BIN
js/wasm/ethkey/ethkey.wasm Normal file

Binary file not shown.

153
js/wasm/ethkey/src/main.rs Normal file
View File

@ -0,0 +1,153 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
#![feature(lang_items, core_intrinsics)]
#![feature(start)]
#![feature(link_args)]
#![no_std]
use core::intrinsics;
// Pull in the system libc library for what crt0.o likely requires.
extern crate libc;
extern crate tiny_keccak;
extern crate tiny_secp256k1;
use tiny_secp256k1::{is_valid_secret, create_public_key, ECPointG};
// #[link_args = "-s EXPORTED_FUNCTIONS=['_input_ptr','_secret_ptr','_public_ptr','_address_ptr','_ecpointg','_verify_secret','_brain']"]
// extern {}
use tiny_keccak::Keccak;
pub trait Keccak256<T: Sized> {
fn keccak256(&self) -> T;
}
impl Keccak256<[u8; 32]> for [u8] {
#[inline]
fn keccak256(&self) -> [u8; 32] {
let mut keccak = Keccak::new_keccak256();
let mut result = [0u8; 32];
keccak.update(self);
keccak.finalize(&mut result);
result
}
}
static mut INPUT: [u8; 1024] = [0; 1024];
static mut SECRET: [u8; 32] = [0; 32];
static mut PUBLIC: [u8; 64] = [0; 64];
static mut ADDRESS: [u8; 20] = [0; 20];
static mut G: Option<ECPointG> = None;
#[no_mangle]
pub extern "C" fn ecpointg() -> &'static ECPointG {
let g = unsafe { &G };
if let Some(ref g) = *g {
return g;
}
unsafe { G = Some(ECPointG::new()) };
g.as_ref().expect("value set above; qed")
}
#[no_mangle]
pub extern "C" fn input_ptr() -> *const u8 {
unsafe { INPUT.as_ptr() }
}
#[no_mangle]
pub extern "C" fn secret_ptr() -> *const u8 {
unsafe { SECRET.as_ptr() }
}
#[no_mangle]
pub extern "C" fn public_ptr() -> *const u8 {
unsafe { PUBLIC.as_ptr() }
}
#[no_mangle]
pub extern "C" fn address_ptr() -> *const u8 {
unsafe { ADDRESS.as_ptr() }
}
#[no_mangle]
pub extern "C" fn verify_secret() -> bool {
is_valid_secret(unsafe { &SECRET })
}
#[no_mangle]
pub extern "C" fn brain(input_len: usize) {
let data = unsafe { &INPUT[..input_len] };
let mut secret_out = unsafe { &mut SECRET };
let mut public_out = unsafe { &mut PUBLIC };
let mut address_out = unsafe { &mut ADDRESS };
let g = ecpointg();
let mut secret = data.keccak256();
let mut i = 0;
loop {
secret = secret.keccak256();
match i > 16384 {
false => i += 1,
true => {
if let Some(public) = create_public_key(g, &secret) {
let public = &public[1..];
let hash = public.keccak256();
address_out.copy_from_slice(&hash[12..]);
if address_out[0] == 0 {
public_out.copy_from_slice(&public);
secret_out.copy_from_slice(&secret);
return;
}
}
}
}
}
}
// Entry point for this program.
#[start]
fn start(_argc: isize, _argv: *const *const u8) -> isize {
0
}
// These functions are used by the compiler, but not
// for a bare-bones hello world. These are normally
// provided by libstd.
#[lang = "eh_personality"]
#[no_mangle]
pub extern fn rust_eh_personality() {
}
// This function may be needed based on the compilation target.
#[lang = "eh_unwind_resume"]
#[no_mangle]
pub extern fn rust_eh_unwind_resume() {
}
#[lang = "panic_fmt"]
#[no_mangle]
pub extern fn rust_begin_panic(_msg: core::fmt::Arguments,
_file: &'static str,
_line: u32) -> ! {
unsafe { intrinsics::abort() }
}

View File

@ -147,9 +147,12 @@ module.exports = {
resolve: {
alias: {
'~': path.resolve(__dirname, '../src'),
<<<<<<< HEAD
'@parity/wordlist': path.resolve(__dirname, '../node_modules/@parity/wordlist'),
'@parity': path.resolve(__dirname, '../src'),
'secp256k1': path.resolve(__dirname, '../node_modules/secp256k1/js'),
=======
>>>>>>> master
'keythereum': path.resolve(__dirname, '../node_modules/keythereum/dist/keythereum')
},
modules: [

View File

@ -44,9 +44,12 @@ module.exports = {
resolve: {
alias: {
'~': path.resolve(__dirname, '../src'),
<<<<<<< HEAD
'@parity/wordlist': path.resolve(__dirname, '../node_modules/@parity/wordlist'),
'@parity': path.resolve(__dirname, '../src'),
'secp256k1': path.resolve(__dirname, '../node_modules/secp256k1/js'),
=======
>>>>>>> master
'keythereum': path.resolve(__dirname, '../node_modules/keythereum/dist/keythereum')
}
},

View File

@ -39,7 +39,7 @@ pub struct EthashParams {
pub metropolis_difficulty_increment_divisor: Option<Uint>,
/// See main EthashParams docs.
#[serde(rename="durationLimit")]
pub duration_limit: Uint,
pub duration_limit: Option<Uint>,
/// See main EthashParams docs.
#[serde(rename="blockReward")]
pub block_reward: Uint,
@ -193,7 +193,7 @@ mod tests {
difficulty_bound_divisor: Uint(U256::from(0x0800)),
difficulty_increment_divisor: None,
metropolis_difficulty_increment_divisor: None,
duration_limit: Uint(U256::from(0x0d)),
duration_limit: Some(Uint(U256::from(0x0d))),
block_reward: Uint(U256::from(0x4563918244F40000u64)),
registrar: Some(Address(H160::from("0xc6d9d2cd449a754c494264e1809c50e34d64562b"))),
homestead_transition: Some(Uint(U256::from(0x42))),
@ -248,7 +248,6 @@ mod tests {
"gasLimitBoundDivisor": "0x0400",
"minimumDifficulty": "0x020000",
"difficultyBoundDivisor": "0x0800",
"durationLimit": "0x0d",
"blockReward": "0x4563918244F40000"
}
}"#;
@ -261,7 +260,7 @@ mod tests {
difficulty_bound_divisor: Uint(U256::from(0x0800)),
difficulty_increment_divisor: None,
metropolis_difficulty_increment_divisor: None,
duration_limit: Uint(U256::from(0x0d)),
duration_limit: None,
block_reward: Uint(U256::from(0x4563918244F40000u64)),
registrar: None,
homestead_transition: None,

View File

@ -6,7 +6,7 @@
!define SYNC_TERM 0x00100001
!define APPNAME "Parity"
!define COMPANYNAME "Ethcore"
!define COMPANYNAME "Parity"
!define DESCRIPTION "Fast, light, robust Ethereum implementation"
!define VERSIONMAJOR 1
!define VERSIONMINOR 7

View File

@ -840,6 +840,7 @@ impl Configuration {
hosts: self.ws_hosts(),
origins: self.ws_origins(),
signer_path: self.directories().signer.into(),
support_token_api: !self.args.flag_public_node,
ui_address: ui.address(),
};
@ -1036,7 +1037,7 @@ impl Configuration {
self.args.flag_geth ||
self.args.flag_no_ui;
!ui_disabled
!ui_disabled && cfg!(feature = "ui-enabled")
}
fn verifier_settings(&self) -> VerifierSettings {
@ -1247,6 +1248,7 @@ mod tests {
hosts: Some(vec![]),
signer_path: expected.into(),
ui_address: Some(("127.0.0.1".to_owned(), 8180)),
support_token_api: true
}, UiConfiguration {
enabled: true,
interface: "127.0.0.1".into(),

View File

@ -102,7 +102,7 @@ impl From<UiConfiguration> for HttpConfiguration {
impl Default for UiConfiguration {
fn default() -> Self {
UiConfiguration {
enabled: true,
enabled: true && cfg!(feature = "ui-enabled"),
port: 8180,
interface: "127.0.0.1".into(),
hosts: Some(vec![]),
@ -141,6 +141,7 @@ pub struct WsConfiguration {
pub origins: Option<Vec<String>>,
pub hosts: Option<Vec<String>>,
pub signer_path: PathBuf,
pub support_token_api: bool,
pub ui_address: Option<(String, u16)>,
}
@ -155,6 +156,7 @@ impl Default for WsConfiguration {
origins: Some(vec!["chrome-extension://*".into()]),
hosts: Some(Vec::new()),
signer_path: replace_home(&data_dir, "$BASE/signer").into(),
support_token_api: true,
ui_address: Some(("127.0.0.1".to_owned(), 8180)),
}
}
@ -207,9 +209,14 @@ pub fn new_ws<D: rpc_apis::Dependencies>(
let allowed_origins = into_domains(with_domain(conf.origins, domain, &[ui_address]));
let allowed_hosts = into_domains(with_domain(conf.hosts, domain, &[Some(ws_address)]));
let signer_path = conf.signer_path;
let signer_path = conf.ui_address.map(move |_| ::signer::codes_path(&signer_path));
let path = signer_path.as_ref().map(|p| p.as_path());
let signer_path;
let path = match conf.support_token_api && conf.ui_address.is_some() {
true => {
signer_path = ::signer::codes_path(&conf.signer_path);
Some(signer_path.as_path())
},
false => None
};
let start_result = rpc::start_ws(
&addr,
handler,

View File

@ -51,10 +51,10 @@ impl HttpMetaExtractor for RpcExtractor {
}
impl ipc::MetaExtractor<Metadata> for RpcExtractor {
fn extract(&self, _req: &ipc::RequestContext) -> Metadata {
fn extract(&self, req: &ipc::RequestContext) -> Metadata {
let mut metadata = Metadata::default();
// TODO [ToDr] Extract proper session id when it's available in context.
metadata.origin = Origin::Ipc(1.into());
metadata.origin = Origin::Ipc(req.session_id.into());
metadata.session = Some(Arc::new(Session::new(req.sender.clone())));
metadata
}
}
@ -77,8 +77,8 @@ impl ws::MetaExtractor<Metadata> for WsExtractor {
fn extract(&self, req: &ws::RequestContext) -> Metadata {
let mut metadata = Metadata::default();
let id = req.session_id as u64;
// TODO [ToDr] Extract dapp from Origin
let dapp = "".into();
let dapp = req.origin.as_ref().map(|origin| (&**origin).into()).unwrap_or_default();
metadata.origin = match self.authcodes_path {
Some(ref path) => {
let authorization = req.protocols.get(0).and_then(|p| auth_token_hash(&path, p));

View File

@ -74,10 +74,10 @@ impl<C> ChainNotificationHandler<C> {
for subscriber in self.heads_subscribers.lock().values() {
for &(ref block, ref extra_info) in &blocks {
self.remote.spawn(subscriber
.notify(pubsub::Result::Header(RichHeader {
.notify(Ok(pubsub::Result::Header(RichHeader {
inner: block.into(),
extra_info: extra_info.clone(),
}))
})))
.map(|_| ())
.map_err(|e| warn!(target: "rpc", "Unable to send notification: {}", e))
);

View File

@ -307,6 +307,11 @@ impl<C, M, S: ?Sized, U> Parity for ParityClient<C, M, S, U> where
}
fn local_transactions(&self) -> Result<BTreeMap<H256, LocalTransactionStatus>, Error> {
// Return nothing if accounts are disabled (running as public node)
if self.accounts.is_none() {
return Ok(BTreeMap::new());
}
let transactions = self.miner.local_transactions();
let block_number = self.client.chain_info().best_block_number;
Ok(transactions

View File

@ -72,13 +72,7 @@ impl<S: core::Middleware<Metadata>> PubSub for PubSubClient<S> {
let (id, receiver) = poll_manager.subscribe(meta, method, params);
match subscriber.assign_id(id.clone()) {
Ok(sink) => {
self.remote.spawn(receiver.map(|res| match res {
Ok(val) => val,
Err(error) => {
warn!(target: "pubsub", "Subscription error: {:?}", error);
core::Value::Null
},
}).forward(sink.sink_map_err(|e| {
self.remote.spawn(receiver.forward(sink.sink_map_err(|e| {
warn!("Cannot send notification: {:?}", e);
})).map(|_| ()));
},

View File

@ -61,7 +61,7 @@ impl<D: Dispatcher + 'static> SignerClient<D> {
for subscription in subs.lock().values() {
let subscription: &Sink<_> = subscription;
remote.spawn(subscription
.notify(requests.clone())
.notify(Ok(requests.clone()))
.map(|_| ())
.map_err(|e| warn!(target: "rpc", "Unable to send notification: {}", e))
);

View File

@ -1,5 +1,5 @@
[package]
authors = ["Ethcore <admin@parity.io>"]
authors = ["Parity <admin@parity.io>"]
description = "Parity Cli Tool"
homepage = "http://parity.io"
license = "GPL-3.0"

View File

@ -1,5 +1,5 @@
[package]
authors = ["Ethcore <admin@parity.io>"]
authors = ["Parity <admin@parity.io>"]
description = "Parity Rpc Client"
homepage = "http://parity.io"
license = "GPL-3.0"

View File

@ -21,7 +21,7 @@ if ! type $KCOV > /dev/null; then
fi
. ./scripts/targets.sh
cargo test $TARGETS --no-run || exit $?
RUSTFLAGS="-C link-dead-code" cargo test $TARGETS --no-run || exit $?
KCOV_TARGET="target/cov"
@ -31,14 +31,7 @@ EXCLUDE="/usr/lib,\
$HOME/.cargo,\
$HOME/.multirust,\
rocksdb,\
secp256k1,\
util/json-tests,\
util/src/network/tests,\
ethcore/src/evm/tests,\
ethstore/tests,\
target/debug/build,\
target/release/build,\
*.db
secp256k1
"
rm -rf $KCOV_TARGET

File diff suppressed because one or more lines are too long