diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c1fdabd12..d6fc6b2b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -136,7 +136,6 @@ linux-armv7: stage: build image: ethcore/rust-armv7:latest only: - - master - beta - tags - stable @@ -176,7 +175,6 @@ linux-arm: stage: build image: ethcore/rust-arm:latest only: - - master - beta - tags - stable @@ -248,7 +246,6 @@ linux-aarch64: stage: build image: ethcore/rust-aarch64:latest only: - - master - beta - tags - stable @@ -287,7 +284,6 @@ linux-aarch64: darwin: stage: build only: - - master - beta - tags - stable @@ -308,7 +304,6 @@ darwin: windows: stage: build only: - - master - beta - tags - stable @@ -322,6 +317,8 @@ windows: - curl -sL --url "https://github.com/ethcore/win-build/raw/master/SimpleFC.dll" -o nsis\SimpleFC.dll - curl -sL --url "https://github.com/ethcore/win-build/raw/master/vc_redist.x64.exe" -o nsis\vc_redist.x64.exe - signtool sign /f %keyfile% /p %certpass% target\release\parity.exe + - msbuild windows\ptray\ptray.vcxproj /p:Platform=x86 /p:Configuration=Release + - signtool sign /f %keyfile% /p %certpass% windows\ptray\release\ptray.exe - cd nsis - makensis.exe installer.nsi - copy installer.exe InstallParity.exe @@ -393,30 +390,14 @@ js-release: - ./js/scripts/release.sh tags: - javascript -js-lint: +js-tests: stage: build image: ethcore/javascript:latest before_script: - ./js/scripts/install-deps.sh script: - ./js/scripts/lint.sh - tags: - - javascript-test -js-test: - stage: build - image: ethcore/javascript:latest - before_script: - - ./js/scripts/install-deps.sh - script: - ./js/scripts/test.sh - tags: - - javascript-test -js-pack: - stage: build - image: ethcore/javascript:latest - before_script: - - ./js/scripts/install-deps.sh - script: - ./js/scripts/build.sh tags: - javascript-test diff --git a/Cargo.lock b/Cargo.lock index cf860c18e..7f9c73d6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,7 +185,7 @@ version = "1.1.1" source = "git+https://github.com/ethcore/rust-ctrlc.git#f4927770f89eca80ec250911eea3adcbf579ac48" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -194,7 +194,7 @@ name = "daemonize" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -244,7 +244,7 @@ source = "git+https://github.com/ethcore/rust-secp256k1#a9a0b1be1f39560ca86e8fc8 dependencies = [ "arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -352,6 +352,7 @@ dependencies = [ "serde 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde_codegen 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "zip 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", @@ -370,7 +371,7 @@ version = "1.4.0" dependencies = [ "crossbeam 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.0 (git+https://github.com/carllerche/mio)", + "mio 0.6.1 (git+https://github.com/carllerche/mio)", "parking_lot 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -458,9 +459,9 @@ dependencies = [ "ethcrypto 0.1.0", "ethkey 0.2.0", "igd 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.0 (git+https://github.com/carllerche/mio)", + "mio 0.6.1 (git+https://github.com/carllerche/mio)", "parking_lot 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.1.0", @@ -554,7 +555,7 @@ dependencies = [ "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -618,7 +619,7 @@ dependencies = [ "ethkey 0.2.0", "itertools 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", @@ -663,7 +664,7 @@ dependencies = [ name = "fdlimit" version = "0.1.0" dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -681,7 +682,7 @@ name = "flate2" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "miniz-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -802,7 +803,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -894,7 +895,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -930,7 +931,7 @@ name = "memchr" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -958,7 +959,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -967,7 +968,7 @@ version = "0.5.1" source = "git+https://github.com/ethcore/mio?branch=v0.5.x#3842d3b250ffd7bd9b16f9586b875ddcbac2b0dd" dependencies = [ "bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", @@ -983,7 +984,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", @@ -999,7 +1000,7 @@ version = "0.6.0-dev" source = "git+https://github.com/ethcore/mio?branch=timer-fix#31eccc40ece3d47abaefaf23bb2114033175b972" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1010,16 +1011,16 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.0" -source = "git+https://github.com/carllerche/mio#9f17b70d6fecbf912168267ea74cf536f2cba705" +version = "0.6.1" +source = "git+https://github.com/carllerche/mio#56f8663510196fdca04bdf7c5f4d60b24297826f" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "nix 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1050,7 +1051,7 @@ name = "nanomsg" version = "0.5.1" source = "git+https://github.com/ethcore/nanomsg.rs.git#c40fe442c9afaea5b38009a3d992ca044dcceb00" dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "nanomsg-sys 0.5.0 (git+https://github.com/ethcore/nanomsg.rs.git)", ] @@ -1060,7 +1061,7 @@ version = "0.5.0" source = "git+https://github.com/ethcore/nanomsg.rs.git#c40fe442c9afaea5b38009a3d992ca044dcceb00" dependencies = [ "gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1070,7 +1071,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1081,7 +1082,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1091,7 +1092,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nix" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1181,7 +1195,7 @@ name = "num_cpus" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1235,7 +1249,7 @@ dependencies = [ [[package]] name = "parity-ui-precompiled" version = "1.4.0" -source = "git+https://github.com/ethcore/js-precompiled.git#10a57a7df153360b4abeddff99e5b8f34a85ff53" +source = "git+https://github.com/ethcore/js-precompiled.git#f8bd7fa67e91daea3ac698ebcc447fae494802cb" dependencies = [ "parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1246,7 +1260,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1266,7 +1280,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1405,7 +1419,7 @@ name = "rand" version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1459,7 +1473,7 @@ name = "rocksdb" version = "0.4.5" source = "git+https://github.com/ethcore/rust-rocksdb#64c63ccbe1f62c2e2b39262486f9ba813793af58" dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "rocksdb-sys 0.3.0 (git+https://github.com/ethcore/rust-rocksdb)", ] @@ -1469,7 +1483,7 @@ version = "0.3.0" source = "git+https://github.com/ethcore/rust-rocksdb#64c63ccbe1f62c2e2b39262486f9ba813793af58" dependencies = [ "gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1489,7 +1503,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "termios 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1500,7 +1514,7 @@ version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1671,7 +1685,7 @@ name = "syntex_errors" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_pos 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1693,7 +1707,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1706,7 +1720,7 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1747,7 +1761,7 @@ name = "termios" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1756,7 +1770,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1773,7 +1787,7 @@ version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2012,7 +2026,7 @@ dependencies = [ "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" "checksum lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "49247ec2a285bb3dcb23cbd9c35193c025e7251bfce77c1d5da97e6362dffe7f" "checksum lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce12306c4739d86ee97c23139f3a34ddf0387bbf181bc7929d287025a8c3ef6b" -"checksum libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "23e3757828fa702a20072c37ff47938e9dd331b92fac6e223d26d4b7a55f7ee2" +"checksum libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)" = "408014cace30ee0f767b1c4517980646a573ec61a57957aeeabcac8ac0a02e8d" "checksum linked-hash-map 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bda158e0dabeb97ee8a401f4d17e479d6b891a14de0bba79d5cc2d4d325b5e48" "checksum linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d262045c5b87c0861b3f004610afd0e2c851e2908d08b6c870cbb9d5f494ecd" "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" @@ -2024,8 +2038,8 @@ dependencies = [ "checksum miniz-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d1f4d337a01c32e1f2122510fed46393d53ca35a7f429cb0450abaedfa3ed54" "checksum mio 0.5.1 (git+https://github.com/ethcore/mio?branch=v0.5.x)" = "" "checksum mio 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a637d1ca14eacae06296a008fa7ad955347e34efcb5891cfd8ba05491a37907e" -"checksum mio 0.6.0 (git+https://github.com/carllerche/mio)" = "" "checksum mio 0.6.0-dev (git+https://github.com/ethcore/mio?branch=timer-fix)" = "" +"checksum mio 0.6.1 (git+https://github.com/carllerche/mio)" = "" "checksum miow 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d5bfc6782530ac8ace97af10a540054a37126b63b0702ddaaa243b73b5745b9a" "checksum msdos_time 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c04b68cc63a8480fb2550343695f7be72effdec953a9d4508161c3e69041c7d8" "checksum nanomsg 0.5.1 (git+https://github.com/ethcore/nanomsg.rs.git)" = "" @@ -2033,6 +2047,7 @@ dependencies = [ "checksum net2 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)" = "6a816012ca11cb47009693c1e0c6130e26d39e4d97ee2a13c50e868ec83e3204" "checksum nix 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f05c2fc965fc1cd6b73fa57fa7b89f288178737f2f3ce9e63e4a6a141189000e" "checksum nix 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a7bb1da2be7da3cbffda73fc681d509ffd9e665af478d2bee1907cee0bc64b2" +"checksum nix 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0d95c5fa8b641c10ad0b8887454ebaafa3c92b5cd5350f8fc693adafd178e7b" "checksum nodrop 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4d9a22dbcebdeef7bf275cbf444d6521d4e7a2fee187b72d80dba0817120dd8f" "checksum nom 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6caab12c5f97aa316cb249725aa32115118e1522b445e26c257dd77cad5ffd4e" "checksum num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "c04bd954dbf96f76bab6e5bd6cef6f1ce1262d15268ce4f926d2b5b778fa7af2" diff --git a/appveyor.yml b/appveyor.yml index 75a2da7cb..e04caf233 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -38,6 +38,8 @@ after_test: - cargo build --verbose --release - ps: if($env:cert) { Start-FileDownload $env:cert -FileName $env:keyfile } - ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass target\release\parity.exe } + - msbuild windows\ptray\ptray.vcxproj /p:Platform=x86 /p:Configuration=Release + - ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass windows\ptray\release\ptray.exe } - makensis.exe nsis\installer.nsi - ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass nsis\installer.exe } diff --git a/dapps/Cargo.toml b/dapps/Cargo.toml index ddc23c87c..274c7b87b 100644 --- a/dapps/Cargo.toml +++ b/dapps/Cargo.toml @@ -24,6 +24,7 @@ ethabi = "0.2.2" linked-hash-map = "0.3" parity-dapps-glue = "1.4" mime = "0.2" +time = "0.1.35" serde_macros = { version = "0.8", optional = true } zip = { version = "0.1", default-features = false } ethcore-devtools = { path = "../devtools" } diff --git a/dapps/src/apps/fetcher.rs b/dapps/src/apps/fetcher.rs index e4ee63fea..041064121 100644 --- a/dapps/src/apps/fetcher.rs +++ b/dapps/src/apps/fetcher.rs @@ -32,14 +32,15 @@ use random_filename; use SyncStatus; use util::{Mutex, H256}; use util::sha3::sha3; -use page::LocalPageEndpoint; +use page::{LocalPageEndpoint, PageCache}; use handlers::{ContentHandler, ContentFetcherHandler, ContentValidator}; use endpoint::{Endpoint, EndpointPath, Handler}; use apps::cache::{ContentCache, ContentStatus}; use apps::manifest::{MANIFEST_FILENAME, deserialize_manifest, serialize_manifest, Manifest}; use apps::urlhint::{URLHintContract, URLHint, URLHintResult}; -const MAX_CACHED_DAPPS: usize = 10; +/// Limit of cached dapps/content +const MAX_CACHED_DAPPS: usize = 20; pub struct ContentFetcher { dapps_path: PathBuf, @@ -71,12 +72,13 @@ impl ContentFetcher { } } - fn still_syncing() -> Box { + fn still_syncing(port: Option) -> Box { Box::new(ContentHandler::error( StatusCode::ServiceUnavailable, "Sync In Progress", "Your node is still syncing. We cannot resolve any content before it's fully synced.", - Some("Refresh") + Some("Refresh"), + port, )) } @@ -143,19 +145,19 @@ impl ContentFetcher { match content { // Don't serve dapps if we are still syncing (but serve content) Some(URLHintResult::Dapp(_)) if self.sync.is_major_importing() => { - (None, Self::still_syncing()) + (None, Self::still_syncing(self.embeddable_at)) }, Some(URLHintResult::Dapp(dapp)) => { let (handler, fetch_control) = ContentFetcherHandler::new( dapp.url(), control, - path.using_dapps_domains, DappInstaller { id: content_id.clone(), dapps_path: self.dapps_path.clone(), on_done: Box::new(on_done), embeddable_at: self.embeddable_at, - } + }, + self.embeddable_at, ); (Some(ContentStatus::Fetching(fetch_control)), Box::new(handler) as Box) @@ -164,19 +166,19 @@ impl ContentFetcher { let (handler, fetch_control) = ContentFetcherHandler::new( content.url, control, - path.using_dapps_domains, ContentInstaller { id: content_id.clone(), mime: content.mime, content_path: self.dapps_path.clone(), on_done: Box::new(on_done), - } + }, + self.embeddable_at, ); (Some(ContentStatus::Fetching(fetch_control)), Box::new(handler) as Box) }, None if self.sync.is_major_importing() => { - (None, Self::still_syncing()) + (None, Self::still_syncing(self.embeddable_at)) }, None => { // This may happen when sync status changes in between @@ -185,7 +187,8 @@ impl ContentFetcher { StatusCode::NotFound, "Resource Not Found", "Requested resource was not found.", - None + None, + self.embeddable_at, )) as Box) }, } @@ -255,6 +258,17 @@ impl ContentValidator for ContentInstaller { // Create dir try!(fs::create_dir_all(&self.content_path)); + // Validate hash + let mut file_reader = io::BufReader::new(try!(fs::File::open(&path))); + let hash = try!(sha3(&mut file_reader)); + let id = try!(self.id.as_str().parse().map_err(|_| ValidationError::InvalidContentId)); + if id != hash { + return Err(ValidationError::HashMismatch { + expected: id, + got: hash, + }); + } + // And prepare path for a file let filename = path.file_name().expect("We always fetch a file."); let mut content_path = self.content_path.clone(); @@ -266,7 +280,7 @@ impl ContentValidator for ContentInstaller { try!(fs::copy(&path, &content_path)); - Ok((self.id.clone(), LocalPageEndpoint::single_file(content_path, self.mime.clone()))) + Ok((self.id.clone(), LocalPageEndpoint::single_file(content_path, self.mime.clone(), PageCache::Enabled))) } fn done(&self, endpoint: Option) { @@ -372,7 +386,7 @@ impl ContentValidator for DappInstaller { try!(manifest_file.write_all(manifest_str.as_bytes())); // Create endpoint - let app = LocalPageEndpoint::new(target, manifest.clone().into(), self.embeddable_at); + let app = LocalPageEndpoint::new(target, manifest.clone().into(), PageCache::Enabled, self.embeddable_at); // Return modified app manifest Ok((manifest.id.clone(), app)) @@ -412,7 +426,7 @@ mod tests { version: "".into(), author: "".into(), icon_url: "".into(), - }, None); + }, Default::default(), None); // when fetcher.set_status("test", ContentStatus::Ready(handler)); diff --git a/dapps/src/apps/fs.rs b/dapps/src/apps/fs.rs index e7a11fc8e..104b33035 100644 --- a/dapps/src/apps/fs.rs +++ b/dapps/src/apps/fs.rs @@ -18,7 +18,7 @@ use std::io; use std::io::Read; use std::fs; use std::path::PathBuf; -use page::LocalPageEndpoint; +use page::{LocalPageEndpoint, PageCache}; use endpoint::{Endpoints, EndpointInfo}; use apps::manifest::{MANIFEST_FILENAME, deserialize_manifest}; @@ -102,7 +102,7 @@ pub fn local_endpoints(dapps_path: String, signer_port: Option) -> Endpoint for dapp in local_dapps(dapps_path) { pages.insert( dapp.id, - Box::new(LocalPageEndpoint::new(dapp.path, dapp.info, signer_port)) + Box::new(LocalPageEndpoint::new(dapp.path, dapp.info, PageCache::Disabled, signer_port)) ); } pages diff --git a/dapps/src/apps/mod.rs b/dapps/src/apps/mod.rs index a7b97d37c..11919d6d2 100644 --- a/dapps/src/apps/mod.rs +++ b/dapps/src/apps/mod.rs @@ -33,14 +33,6 @@ pub const RPC_PATH : &'static str = "rpc"; pub const API_PATH : &'static str = "api"; pub const UTILS_PATH : &'static str = "parity-utils"; -pub fn redirection_address(using_dapps_domains: bool, app_id: &str) -> String { - if using_dapps_domains { - format!("http://{}{}/", app_id, DAPPS_DOMAIN) - } else { - format!("/{}/", app_id) - } -} - pub fn utils() -> Box { Box::new(PageEndpoint::with_prefix(parity_ui::App::default(), UTILS_PATH.to_owned())) } diff --git a/dapps/src/handlers/content.rs b/dapps/src/handlers/content.rs index 6bde9cf84..a67fbcd0b 100644 --- a/dapps/src/handlers/content.rs +++ b/dapps/src/handlers/content.rs @@ -48,11 +48,7 @@ impl ContentHandler { Self::new_embeddable(code, content, mime!(Text/Html), embeddable_at) } - pub fn error(code: StatusCode, title: &str, message: &str, details: Option<&str>) -> Self { - Self::error_embeddable(code, title, message, details, None) - } - - pub fn error_embeddable(code: StatusCode, title: &str, message: &str, details: Option<&str>, embeddable_at: Option) -> Self { + pub fn error(code: StatusCode, title: &str, message: &str, details: Option<&str>, embeddable_at: Option) -> Self { Self::html(code, format!( include_str!("../error_tpl.html"), title=title, diff --git a/dapps/src/handlers/fetch.rs b/dapps/src/handlers/fetch.rs index 639fc7497..1a0221bff 100644 --- a/dapps/src/handlers/fetch.rs +++ b/dapps/src/handlers/fetch.rs @@ -22,14 +22,14 @@ use std::sync::{mpsc, Arc}; use std::sync::atomic::{AtomicBool, Ordering}; use std::time::{Instant, Duration}; use util::Mutex; +use url::Url; use fetch::{Client, Fetch, FetchResult}; use hyper::{server, Decoder, Encoder, Next, Method, Control}; use hyper::net::HttpStream; use hyper::status::StatusCode; -use handlers::{ContentHandler, Redirection}; -use apps::redirection_address; +use handlers::{ContentHandler, Redirection, extract_url}; use page::LocalPageEndpoint; const FETCH_TIMEOUT: u64 = 30; @@ -136,8 +136,9 @@ pub struct ContentFetcherHandler { control: Option, status: FetchState, client: Option, - using_dapps_domains: bool, installer: H, + request_url: Option, + embeddable_at: Option, } impl Drop for ContentFetcherHandler { @@ -155,8 +156,9 @@ impl ContentFetcherHandler { pub fn new( url: String, control: Control, - using_dapps_domains: bool, - handler: H) -> (Self, Arc) { + handler: H, + embeddable_at: Option, + ) -> (Self, Arc) { let fetch_control = Arc::new(FetchControl::default()); let client = Client::default(); @@ -165,8 +167,9 @@ impl ContentFetcherHandler { control: Some(control), client: Some(client), status: FetchState::NotStarted(url), - using_dapps_domains: using_dapps_domains, installer: handler, + request_url: None, + embeddable_at: embeddable_at, }; (handler, fetch_control) @@ -189,6 +192,7 @@ impl ContentFetcherHandler { impl server::Handler for ContentFetcherHandler { fn on_request(&mut self, request: server::Request) -> Next { + self.request_url = extract_url(&request); let status = if let FetchState::NotStarted(ref url) = self.status { Some(match *request.method() { // Start fetching content @@ -204,6 +208,7 @@ impl server::Handler for ContentFetcherHandler< "Unable To Start Dapp Download", "Could not initialize download of the dapp. It might be a problem with the remote server.", Some(&format!("{}", e)), + self.embeddable_at, )), } }, @@ -213,6 +218,7 @@ impl server::Handler for ContentFetcherHandler< "Method Not Allowed", "Only GET requests are allowed.", None, + self.embeddable_at, )), }) } else { None }; @@ -234,7 +240,8 @@ impl server::Handler for ContentFetcherHandler< StatusCode::GatewayTimeout, "Download Timeout", &format!("Could not fetch content within {} seconds.", FETCH_TIMEOUT), - None + None, + self.embeddable_at, ); Self::close_client(&mut self.client); (Some(FetchState::Error(timeout)), Next::write()) @@ -255,12 +262,15 @@ impl server::Handler for ContentFetcherHandler< StatusCode::BadGateway, "Invalid Dapp", "Downloaded bundle does not contain a valid content.", - Some(&format!("{:?}", e)) + Some(&format!("{:?}", e)), + self.embeddable_at, )) }, Ok((id, result)) => { - let address = redirection_address(self.using_dapps_domains, &id); - FetchState::Done(id, result, Redirection::new(&address)) + let url: String = self.request_url.take() + .map(|url| url.raw.into_string()) + .expect("Request URL always read in on_request; qed"); + FetchState::Done(id, result, Redirection::new(&url)) }, }; // Remove temporary zip file @@ -274,6 +284,7 @@ impl server::Handler for ContentFetcherHandler< "Download Error", "There was an error when fetching the content.", Some(&format!("{:?}", e)), + self.embeddable_at, ); (Some(FetchState::Error(error)), Next::write()) }, diff --git a/dapps/src/lib.rs b/dapps/src/lib.rs index 0041dbedf..4394d1183 100644 --- a/dapps/src/lib.rs +++ b/dapps/src/lib.rs @@ -44,6 +44,7 @@ #![cfg_attr(feature="nightly", plugin(clippy))] extern crate hyper; +extern crate time; extern crate url as url_lib; extern crate unicase; extern crate serde; diff --git a/dapps/src/page/builtin.rs b/dapps/src/page/builtin.rs index c4f56556e..bf5bf088f 100644 --- a/dapps/src/page/builtin.rs +++ b/dapps/src/page/builtin.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use page::handler; +use page::{handler, PageCache}; use std::sync::Arc; use endpoint::{Endpoint, EndpointInfo, EndpointPath, Handler}; use parity_dapps::{WebApp, File, Info}; @@ -80,6 +80,7 @@ impl Endpoint for PageEndpoint { prefix: self.prefix.clone(), path: path, file: handler::ServedFile::new(self.safe_to_embed_at_port.clone()), + cache: PageCache::Disabled, safe_to_embed_at_port: self.safe_to_embed_at_port.clone(), }) } diff --git a/dapps/src/page/handler.rs b/dapps/src/page/handler.rs index 0962f22c7..f908a69c5 100644 --- a/dapps/src/page/handler.rs +++ b/dapps/src/page/handler.rs @@ -15,6 +15,8 @@ // along with Parity. If not, see . use std::io::Write; +use time::{self, Duration}; + use hyper::header; use hyper::server; use hyper::uri::RequestUri; @@ -59,7 +61,7 @@ pub enum ServedFile { impl ServedFile { pub fn new(embeddable_at: Option) -> Self { - ServedFile::Error(ContentHandler::error_embeddable( + ServedFile::Error(ContentHandler::error( StatusCode::NotFound, "404 Not Found", "Requested dapp resource was not found.", @@ -69,6 +71,19 @@ impl ServedFile { } } +/// Defines what cache headers should be appended to returned resources. +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum PageCache { + Enabled, + Disabled, +} + +impl Default for PageCache { + fn default() -> Self { + PageCache::Disabled + } +} + /// A handler for a single webapp. /// Resolves correct paths and serves as a plumbing code between /// hyper server and dapp. @@ -83,6 +98,8 @@ pub struct PageHandler { pub path: EndpointPath, /// Flag indicating if the file can be safely embeded (put in iframe). pub safe_to_embed_at_port: Option, + /// Cache settings for this page. + pub cache: PageCache, } impl PageHandler { @@ -129,9 +146,19 @@ impl server::Handler for PageHandler { ServedFile::File(ref f) => { res.set_status(StatusCode::Ok); + if let PageCache::Enabled = self.cache { + let mut headers = res.headers_mut(); + let validity = Duration::days(365); + headers.set(header::CacheControl(vec![ + header::CacheDirective::Public, + header::CacheDirective::MaxAge(validity.num_seconds() as u32), + ])); + headers.set(header::Expires(header::HttpDate(time::now() + validity))); + } + match f.content_type().parse() { Ok(mime) => res.headers_mut().set(header::ContentType(mime)), - Err(()) => debug!(target: "page_handler", "invalid MIME type: {}", f.content_type()), + Err(()) => debug!(target: "dapps", "invalid MIME type: {}", f.content_type()), } // Security headers: @@ -218,6 +245,7 @@ fn should_extract_path_with_appid() { using_dapps_domains: true, }, file: ServedFile::new(None), + cache: Default::default(), safe_to_embed_at_port: None, }; diff --git a/dapps/src/page/local.rs b/dapps/src/page/local.rs index 5390f5aac..aa98a68cd 100644 --- a/dapps/src/page/local.rs +++ b/dapps/src/page/local.rs @@ -18,7 +18,7 @@ use mime_guess; use std::io::{Seek, Read, SeekFrom}; use std::fs; use std::path::{Path, PathBuf}; -use page::handler; +use page::handler::{self, PageCache}; use endpoint::{Endpoint, EndpointInfo, EndpointPath, Handler}; #[derive(Debug, Clone)] @@ -26,24 +26,27 @@ pub struct LocalPageEndpoint { path: PathBuf, mime: Option, info: Option, + cache: PageCache, embeddable_at: Option, } impl LocalPageEndpoint { - pub fn new(path: PathBuf, info: EndpointInfo, embeddable_at: Option) -> Self { + pub fn new(path: PathBuf, info: EndpointInfo, cache: PageCache, embeddable_at: Option) -> Self { LocalPageEndpoint { path: path, mime: None, info: Some(info), + cache: cache, embeddable_at: embeddable_at, } } - pub fn single_file(path: PathBuf, mime: String) -> Self { + pub fn single_file(path: PathBuf, mime: String, cache: PageCache) -> Self { LocalPageEndpoint { path: path, mime: Some(mime), info: None, + cache: cache, embeddable_at: None, } } @@ -66,6 +69,7 @@ impl Endpoint for LocalPageEndpoint { path: path, file: handler::ServedFile::new(None), safe_to_embed_at_port: self.embeddable_at, + cache: self.cache, }) } else { Box::new(handler::PageHandler { @@ -74,6 +78,7 @@ impl Endpoint for LocalPageEndpoint { path: path, file: handler::ServedFile::new(None), safe_to_embed_at_port: self.embeddable_at, + cache: self.cache, }) } } diff --git a/dapps/src/page/mod.rs b/dapps/src/page/mod.rs index 349c979c7..92c066df3 100644 --- a/dapps/src/page/mod.rs +++ b/dapps/src/page/mod.rs @@ -21,4 +21,5 @@ mod handler; pub use self::local::LocalPageEndpoint; pub use self::builtin::PageEndpoint; +pub use self::handler::PageCache; diff --git a/dapps/src/router/auth.rs b/dapps/src/router/auth.rs index ff05420bc..a220e2ab0 100644 --- a/dapps/src/router/auth.rs +++ b/dapps/src/router/auth.rs @@ -59,7 +59,8 @@ impl Authorization for HttpBasicAuth { status::StatusCode::Unauthorized, "Unauthorized", "You need to provide valid credentials to access this page.", - None + None, + None, ))) }, Access::AuthRequired => { diff --git a/dapps/src/router/host_validation.rs b/dapps/src/router/host_validation.rs index 2b7e6c9e4..802466efd 100644 --- a/dapps/src/router/host_validation.rs +++ b/dapps/src/router/host_validation.rs @@ -41,6 +41,7 @@ pub fn host_invalid_response() -> Box + Send> { Box::new(ContentHandler::error(StatusCode::Forbidden, "Current Host Is Disallowed", "You are trying to access your node using incorrect address.", - Some("Use allowed URL or specify different hosts CLI options.") + Some("Use allowed URL or specify different hosts CLI options."), + None, )) } diff --git a/dapps/src/router/mod.rs b/dapps/src/router/mod.rs index 6ca453d6d..fe8061ef0 100644 --- a/dapps/src/router/mod.rs +++ b/dapps/src/router/mod.rs @@ -117,6 +117,7 @@ impl server::Handler for Router { "404 Not Found", "Requested content was not found.", None, + self.signer_port, )) }, // Redirect any other GET request to signer. @@ -131,6 +132,7 @@ impl server::Handler for Router { "404 Not Found", "Your homepage is not available when Trusted Signer is disabled.", Some("You can still access dapps by writing a correct address, though. Re-enabled Signer to get your homepage back."), + self.signer_port, )) } }, diff --git a/dapps/src/tests/fetch.rs b/dapps/src/tests/fetch.rs index 1cabca5cb..d50b2bdde 100644 --- a/dapps/src/tests/fetch.rs +++ b/dapps/src/tests/fetch.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use tests::helpers::{serve_with_registrar, serve_with_registrar_and_sync, request, assert_security_headers}; +use tests::helpers::{serve_with_registrar, serve_with_registrar_and_sync, request, assert_security_headers_for_embed}; #[test] fn should_resolve_dapp() { @@ -34,7 +34,7 @@ fn should_resolve_dapp() { // then assert_eq!(response.status, "HTTP/1.1 404 Not Found".to_owned()); assert_eq!(registrar.calls.lock().len(), 2); - assert_security_headers(&response.headers); + assert_security_headers_for_embed(&response.headers); } #[test] @@ -63,5 +63,5 @@ fn should_return_503_when_syncing_but_should_make_the_calls() { // then assert_eq!(response.status, "HTTP/1.1 503 Service Unavailable".to_owned()); assert_eq!(registrar.calls.lock().len(), 4); - assert_security_headers(&response.headers); + assert_security_headers_for_embed(&response.headers); } diff --git a/dapps/src/tests/redirection.rs b/dapps/src/tests/redirection.rs index 398d08774..b0a5ca9a2 100644 --- a/dapps/src/tests/redirection.rs +++ b/dapps/src/tests/redirection.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use tests::helpers::{serve, request, assert_security_headers}; +use tests::helpers::{serve, request, assert_security_headers, assert_security_headers_for_embed}; #[test] fn should_redirect_to_home() { @@ -93,7 +93,7 @@ fn should_display_404_on_invalid_dapp() { // then assert_eq!(response.status, "HTTP/1.1 404 Not Found".to_owned()); - assert_security_headers(&response.headers); + assert_security_headers_for_embed(&response.headers); } #[test] @@ -113,7 +113,7 @@ fn should_display_404_on_invalid_dapp_with_domain() { // then assert_eq!(response.status, "HTTP/1.1 404 Not Found".to_owned()); - assert_security_headers(&response.headers); + assert_security_headers_for_embed(&response.headers); } #[test] diff --git a/js/package.json b/js/package.json index ec66486d9..367434260 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "parity.js", - "version": "0.1.37", + "version": "0.1.47", "main": "release/index.js", "jsnext:main": "src/index.js", "author": "Parity Team ", diff --git a/js/src/api/rpc/ethcore/ethcore.js b/js/src/api/rpc/ethcore/ethcore.js index 663143f0d..e21c83193 100644 --- a/js/src/api/rpc/ethcore/ethcore.js +++ b/js/src/api/rpc/ethcore/ethcore.js @@ -58,6 +58,11 @@ export default class Ethcore { .execute('ethcore_dropNonReservedPeers'); } + enode () { + return this._transport + .execute('ethcore_enode'); + } + extraData () { return this._transport .execute('ethcore_extraData'); diff --git a/js/src/dapps/tokenreg/Actions/Register/register.js b/js/src/dapps/tokenreg/Actions/Register/register.js index 78d823326..5eb2d9e1b 100644 --- a/js/src/dapps/tokenreg/Actions/Register/register.js +++ b/js/src/dapps/tokenreg/Actions/Register/register.js @@ -80,7 +80,9 @@ export default class RegisterAction extends Component { modal={ sending || complete } className={ styles.dialog } onRequestClose={ this.onClose } - actions={ this.renderActions() } > + actions={ this.renderActions() } + autoScrollBodyContent + > { this.renderContent() } ); diff --git a/js/src/jsonrpc/interfaces/ethcore.js b/js/src/jsonrpc/interfaces/ethcore.js index c81a82f76..ce1761382 100644 --- a/js/src/jsonrpc/interfaces/ethcore.js +++ b/js/src/jsonrpc/interfaces/ethcore.js @@ -85,6 +85,15 @@ export default { } }, + enode: { + desc: 'Returns the node enode URI', + params: [], + returns: { + type: String, + desc: 'Enode URI' + } + }, + extraData: { desc: 'Returns currently set extra data', params: [], diff --git a/js/src/modals/AddAddress/addAddress.js b/js/src/modals/AddAddress/addAddress.js index 5ab8bbe80..ebcf78815 100644 --- a/js/src/modals/AddAddress/addAddress.js +++ b/js/src/modals/AddAddress/addAddress.js @@ -136,6 +136,7 @@ export default class AddAddress extends Component { api.personal.setAccountName(address, name), api.personal.setAccountMeta(address, { description, + timestamp: Date.now(), deleted: false }) ]).catch((error) => { diff --git a/js/src/modals/AddContract/addContract.js b/js/src/modals/AddContract/addContract.js index ebad86807..ad7345430 100644 --- a/js/src/modals/AddContract/addContract.js +++ b/js/src/modals/AddContract/addContract.js @@ -145,6 +145,7 @@ export default class AddContract extends Component { api.personal.setAccountMeta(address, { contract: true, deleted: false, + timestamp: Date.now(), abi: abiParsed, description }) diff --git a/js/src/modals/CreateAccount/createAccount.js b/js/src/modals/CreateAccount/createAccount.js index e0808b47b..aacc91d5e 100644 --- a/js/src/modals/CreateAccount/createAccount.js +++ b/js/src/modals/CreateAccount/createAccount.js @@ -214,7 +214,10 @@ export default class CreateAccount extends Component { this.setState({ address }); return api.personal .setAccountName(address, this.state.name) - .then(() => api.personal.setAccountMeta(address, { passwordHint: this.state.passwordHint })); + .then(() => api.personal.setAccountMeta(address, { + timestamp: Date.now(), + passwordHint: this.state.passwordHint + })); }) .then(() => { this.onNext(); @@ -236,7 +239,10 @@ export default class CreateAccount extends Component { this.setState({ address }); return api.personal .setAccountName(address, this.state.name) - .then(() => api.personal.setAccountMeta(address, { passwordHint: this.state.passwordHint })); + .then(() => api.personal.setAccountMeta(address, { + timestamp: Date.now(), + passwordHint: this.state.passwordHint + })); }) .then(() => { this.onNext(); @@ -285,7 +291,10 @@ export default class CreateAccount extends Component { return api.personal .setAccountName(address, this.state.name) - .then(() => api.personal.setAccountMeta(address, { passwordHint: this.state.passwordHint })); + .then(() => api.personal.setAccountMeta(address, { + timestamp: Date.now(), + passwordHint: this.state.passwordHint + })); }) .then(() => { this.onNext(); diff --git a/js/src/modals/DeployContract/deployContract.js b/js/src/modals/DeployContract/deployContract.js index 3e1b10599..c62b968b5 100644 --- a/js/src/modals/DeployContract/deployContract.js +++ b/js/src/modals/DeployContract/deployContract.js @@ -216,6 +216,7 @@ export default class DeployContract extends Component { api.personal.setAccountMeta(address, { abi: abiParsed, contract: true, + timestamp: Date.now(), deleted: false, description }) diff --git a/js/src/modals/ExecuteContract/executeContract.js b/js/src/modals/ExecuteContract/executeContract.js index 67f350feb..e0462982d 100644 --- a/js/src/modals/ExecuteContract/executeContract.js +++ b/js/src/modals/ExecuteContract/executeContract.js @@ -19,7 +19,7 @@ import ActionDoneAll from 'material-ui/svg-icons/action/done-all'; import ContentClear from 'material-ui/svg-icons/content/clear'; import { BusyStep, CompletedStep, Button, IdentityIcon, Modal, TxHash } from '../../ui'; -import { validateAddress } from '../../util/validation'; +import { validateAddress, validateUint } from '../../util/validation'; import DetailsStep from './DetailsStep'; @@ -41,6 +41,7 @@ export default class ExecuteContract extends Component { state = { amount: '0', amountError: null, + fromAddressError: null, func: null, funcError: null, values: [], @@ -77,7 +78,8 @@ export default class ExecuteContract extends Component { renderDialogActions () { const { onClose, fromAddress } = this.props; - const { sending, step } = this.state; + const { sending, step, fromAddressError, valuesError } = this.state; + const hasError = fromAddressError || valuesError.find((error) => error); const cancelBtn = (