Compare commits
514 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7b1484f2e | ||
|
|
da8c4df8cc | ||
|
|
06287c478a | ||
|
|
6ad6c3cbf9 | ||
|
|
25936ae0f6 | ||
|
|
7bfbe41c72 | ||
|
|
e38293b085 | ||
|
|
4bb517ec94 | ||
|
|
de906d4afd | ||
|
|
fafb534cd3 | ||
|
|
a5a06e49ba | ||
|
|
9f96fa0a73 | ||
|
|
bbae075c60 | ||
|
|
bacc0f0b9a | ||
|
|
582a4ea339 | ||
|
|
09edb94d53 | ||
|
|
02e33c4f91 | ||
|
|
8d24b4e804 | ||
|
|
895574b774 | ||
|
|
b4af8df535 | ||
|
|
5f064a9076 | ||
|
|
5b30f22011 | ||
|
|
9d9e2b43f2 | ||
|
|
5dc5be1e58 | ||
|
|
306c1764eb | ||
|
|
f6a390849b | ||
|
|
cd088a4345 | ||
|
|
bd9a8aa22b | ||
|
|
8fc504eb1a | ||
|
|
c1b3d5fe1a | ||
|
|
e53bf9a95e | ||
|
|
decc9eaa85 | ||
|
|
3f61f2d8d9 | ||
|
|
7f02a08741 | ||
|
|
cff1bc88fa | ||
|
|
59f0eb7e6b | ||
|
|
a729ca3223 | ||
|
|
afe14b42e2 | ||
|
|
62832c93b0 | ||
|
|
1887080990 | ||
|
|
edc38c2cee | ||
|
|
16e0ad1288 | ||
|
|
5a561997cf | ||
|
|
413442d7be | ||
|
|
4489ca0a38 | ||
|
|
3a2c173fe1 | ||
|
|
9c051ab756 | ||
|
|
63221c5152 | ||
|
|
8714a40d84 | ||
|
|
825c7990f2 | ||
|
|
d743df549b | ||
|
|
6022c47b53 | ||
|
|
02eb046774 | ||
|
|
f2dd032884 | ||
|
|
55c046cb88 | ||
|
|
7701f73cdf | ||
|
|
213e007a4b | ||
|
|
78d0a8696f | ||
|
|
e1333ea1e9 | ||
|
|
4ee217ba7c | ||
|
|
6fc5014b4d | ||
|
|
859a41308c | ||
|
|
d2120ded56 | ||
|
|
be5db14160 | ||
|
|
1786b6eedd | ||
|
|
2d693be735 | ||
|
|
35c607f6be | ||
|
|
20248c443b | ||
|
|
bf55db4c7e | ||
|
|
dbdb57a8c0 | ||
|
|
78a1d8b7b4 | ||
|
|
1c076af5ee | ||
|
|
bf4fa658f3 | ||
|
|
5da8da68cc | ||
|
|
083dcc369b | ||
|
|
7827cc048e | ||
|
|
9de1afeeb6 | ||
|
|
eed630a002 | ||
|
|
6be45367e9 | ||
|
|
f7dae48c17 | ||
|
|
44161874ff | ||
|
|
faf6f1f9ea | ||
|
|
425dcd45c2 | ||
|
|
dae5d75dd6 | ||
|
|
33d3bfae8b | ||
|
|
7e89bab4aa | ||
|
|
9584faee55 | ||
|
|
9bbf8b6c0f | ||
|
|
bf242552f3 | ||
|
|
752031a657 | ||
|
|
d250f348a3 | ||
|
|
26d1303034 | ||
|
|
89987745f6 | ||
|
|
c31ffab22e | ||
|
|
21a27fee9f | ||
|
|
10c121a299 | ||
|
|
67e75e1da1 | ||
|
|
412e2ce3a0 | ||
|
|
73f2ff38ec | ||
|
|
981ad0bc53 | ||
|
|
5a581c1c90 | ||
|
|
87699f8de0 | ||
|
|
42268fd1ef | ||
|
|
2cf0d7d775 | ||
|
|
de91a5532d | ||
|
|
e91eb337c9 | ||
|
|
8dfa46f4f0 | ||
|
|
e04a2f926a | ||
|
|
98b89c8e4f | ||
|
|
b30b54e446 | ||
|
|
4723ea69a1 | ||
|
|
64fd64fd6b | ||
|
|
28eb05f032 | ||
|
|
969a9815e4 | ||
|
|
4cc274e75f | ||
|
|
c5fa7aab43 | ||
|
|
e7cdad6146 | ||
|
|
92e770e916 | ||
|
|
6fcd775d48 | ||
|
|
944bf6a59e | ||
|
|
90a7ca9d10 | ||
|
|
9e2b2b361c | ||
|
|
08f0573fb5 | ||
|
|
8132d38b50 | ||
|
|
10e1787ad1 | ||
|
|
69085aa282 | ||
|
|
fba63de974 | ||
|
|
288d73789a | ||
|
|
002496603c | ||
|
|
d9673b0d6b | ||
|
|
89f828be1c | ||
|
|
ec56b1f09d | ||
|
|
95236d25b2 | ||
|
|
7b2afdfc8c | ||
|
|
440e52f410 | ||
|
|
8840a293dd | ||
|
|
89d627769e | ||
|
|
4e2e88a620 | ||
|
|
ebf51c0be0 | ||
|
|
04c6867660 | ||
|
|
0199acbece | ||
|
|
e4c2fe9e72 | ||
|
|
407de5e8c4 | ||
|
|
7d26a82232 | ||
|
|
3b23817936 | ||
|
|
aa8487c1d0 | ||
|
|
9cb8606103 | ||
|
|
6cf3ba7efd | ||
|
|
023e511f83 | ||
|
|
17042e9c32 | ||
|
|
f2c34f7ca2 | ||
|
|
375a8daeb4 | ||
|
|
b700ff3501 | ||
|
|
9519493e32 | ||
|
|
037fd1b309 | ||
|
|
78a534633d | ||
|
|
effead9ba5 | ||
|
|
a8ee3c97e6 | ||
|
|
fb461659c7 | ||
|
|
a574df3132 | ||
|
|
d83143d0ba | ||
|
|
f875175325 | ||
|
|
c9db8ea21d | ||
|
|
a16bad4175 | ||
|
|
595dac6c3f | ||
|
|
82a148a99b | ||
|
|
4320c9bc4f | ||
|
|
23d977ecce | ||
|
|
ab27848dc4 | ||
|
|
742a6007fe | ||
|
|
91933d857d | ||
|
|
3e1d73126c | ||
|
|
7014642815 | ||
|
|
1bd4564216 | ||
|
|
97cb010df8 | ||
|
|
ed18c7b54c | ||
|
|
e71598d876 | ||
|
|
3d0ce10fa6 | ||
|
|
cfc8df156b | ||
|
|
94cb3b6e0e | ||
|
|
fefec000fb | ||
|
|
c7ded6a785 | ||
|
|
2fbb952cdd | ||
|
|
e2ab3e4f5b | ||
|
|
1871275ecd | ||
|
|
afc1b72611 | ||
|
|
c5c3fb6a75 | ||
|
|
bceb883d99 | ||
|
|
fcccbf3b75 | ||
|
|
9ad71b7baa | ||
|
|
4311d43497 | ||
|
|
0815cc3b83 | ||
|
|
b21844b371 | ||
|
|
f825048efa | ||
|
|
2cbffe36e2 | ||
|
|
6bb106a784 | ||
|
|
4e0ec4e66b | ||
|
|
b58a3ed0ad | ||
|
|
b803f57db6 | ||
|
|
b457f46c81 | ||
|
|
b4520c5886 | ||
|
|
ca67dc251f | ||
|
|
aea289e79e | ||
|
|
ef0eda0c39 | ||
|
|
af7dc3676b | ||
|
|
fa570f297e | ||
|
|
9cce6a47d4 | ||
|
|
bff0bedfa9 | ||
|
|
d6c80c1672 | ||
|
|
512343003d | ||
|
|
3adb640d2b | ||
|
|
ea589a17a4 | ||
|
|
a3883ca5d9 | ||
|
|
5be0163cde | ||
|
|
55454b2f2d | ||
|
|
a4dc85543b | ||
|
|
d8394bded7 | ||
|
|
d89b8d904f | ||
|
|
8e866ee551 | ||
|
|
6dfc1bd474 | ||
|
|
c84e5745fa | ||
|
|
751d15e4be | ||
|
|
8b6c5be6a9 | ||
|
|
3502b36232 | ||
|
|
046b8bbc8a | ||
|
|
6fa4b2dec5 | ||
|
|
83bcb819da | ||
|
|
b7e8621846 | ||
|
|
d5c19f8719 | ||
|
|
8fa56add47 | ||
|
|
e45ee6cd72 | ||
|
|
e344286c32 | ||
|
|
45d7c60608 | ||
|
|
a3e39c9858 | ||
|
|
8ab6d89810 | ||
|
|
1b3b9b2887 | ||
|
|
89ae0f0ea0 | ||
|
|
06cae8a535 | ||
|
|
12ac992ffb | ||
|
|
3b23c2e86d | ||
|
|
0f9b2218da | ||
|
|
12c42bce9b | ||
|
|
eb3d33ed6f | ||
|
|
a139c6d216 | ||
|
|
50f5ccc4f2 | ||
|
|
94db961975 | ||
|
|
38f3747cde | ||
|
|
4fec2f2fc2 | ||
|
|
c96d8a742b | ||
|
|
c2de31e586 | ||
|
|
4b11d79829 | ||
|
|
c35abe4196 | ||
|
|
a9a278a6e1 | ||
|
|
fb07ffa676 | ||
|
|
940a88fa4e | ||
|
|
708e495c28 | ||
|
|
460681ead9 | ||
|
|
2a7ed457dc | ||
|
|
35bbf11ba5 | ||
|
|
4f1e1e8870 | ||
|
|
cf505139f1 | ||
|
|
cdba22a2cb | ||
|
|
1df6361753 | ||
|
|
a6c6c7c070 | ||
|
|
ed6f2877d7 | ||
|
|
53c408f549 | ||
|
|
64704c456f | ||
|
|
0edf8e3f1b | ||
|
|
53a04e1686 | ||
|
|
d356c6640d | ||
|
|
e8e087fc37 | ||
|
|
181738a736 | ||
|
|
1ac1224cd3 | ||
|
|
3687df8da2 | ||
|
|
67eee6aeb7 | ||
|
|
83ba9df85b | ||
|
|
83f706186f | ||
|
|
eea5f6f232 | ||
|
|
38af7f35fc | ||
|
|
eea3de00c1 | ||
|
|
4d66e8d06d | ||
|
|
010cfb7d67 | ||
|
|
f9a8aac036 | ||
|
|
3d28823be7 | ||
|
|
492317abd7 | ||
|
|
ab22d5e278 | ||
|
|
ce5f704dd5 | ||
|
|
696dc05dda | ||
|
|
589083ad7a | ||
|
|
1fda997370 | ||
|
|
7c335e8764 | ||
|
|
5b1d33d5fa | ||
|
|
e435407080 | ||
|
|
b180be7526 | ||
|
|
90fb473d87 | ||
|
|
3650f2d51c | ||
|
|
3090324366 | ||
|
|
130901e820 | ||
|
|
801b8191ef | ||
|
|
469f9c26e7 | ||
|
|
b5f510ead7 | ||
|
|
b4f8bba843 | ||
|
|
2bb79614f6 | ||
|
|
c077dc652d | ||
|
|
1b6f2a3e92 | ||
|
|
9136c81f05 | ||
|
|
912e5599d9 | ||
|
|
ff0095ac5e | ||
|
|
bf9fedc4ee | ||
|
|
78ba54da6b | ||
|
|
c90e279ab5 | ||
|
|
215602de08 | ||
|
|
13b832f959 | ||
|
|
789bb9c852 | ||
|
|
aada1f547b | ||
|
|
60718225ac | ||
|
|
1a2fc03083 | ||
|
|
61e8baee0c | ||
|
|
dbc5f55da9 | ||
|
|
81b7698428 | ||
|
|
4ce4bad383 | ||
|
|
23d25a079b | ||
|
|
d19bdb642e | ||
|
|
2e0246a6c2 | ||
|
|
349098e7b2 | ||
|
|
dc3b1ecdd0 | ||
|
|
7fb33796b1 | ||
|
|
ec886ddefb | ||
|
|
4ded4181a6 | ||
|
|
60691d03e0 | ||
|
|
869fa399b1 | ||
|
|
7af953fd62 | ||
|
|
5acbcb0d57 | ||
|
|
7000c394b2 | ||
|
|
7c0d894ccf | ||
|
|
f092c10de5 | ||
|
|
7f5e6b3a0a | ||
|
|
5e9dc185a5 | ||
|
|
0e94ac0111 | ||
|
|
0b5bbf6048 | ||
|
|
14c9cbd40e | ||
|
|
c4466878cf | ||
|
|
c584221fa2 | ||
|
|
70ba050c06 | ||
|
|
f2281dc38a | ||
|
|
18a2e6265d | ||
|
|
0d593199d0 | ||
|
|
832c4a7565 | ||
|
|
34d22a35dd | ||
|
|
c880716f16 | ||
|
|
f20f4c74d2 | ||
|
|
1fdfa1e6c6 | ||
|
|
4ee49f03df | ||
|
|
52d5278a62 | ||
|
|
35a2b87174 | ||
|
|
664bb2becd | ||
|
|
8865b95818 | ||
|
|
03600dce97 | ||
|
|
8b607efc40 | ||
|
|
9f1af6b3e8 | ||
|
|
c0952ba44b | ||
|
|
9475a2e474 | ||
|
|
5baed0c158 | ||
|
|
97c259858c | ||
|
|
0f90696528 | ||
|
|
ac974a180d | ||
|
|
052380b8de | ||
|
|
23a29439c0 | ||
|
|
a8617e2862 | ||
|
|
6945a6b320 | ||
|
|
b375c9adbf | ||
|
|
88a727739b | ||
|
|
5f3ae4dee3 | ||
|
|
5cbe834024 | ||
|
|
eea5b86cc4 | ||
|
|
09c512abaa | ||
|
|
d42d816e7f | ||
|
|
17effd15ab | ||
|
|
9982eba188 | ||
|
|
aafe527d4a | ||
|
|
e4c53a460e | ||
|
|
ca01596a65 | ||
|
|
4f2415b483 | ||
|
|
f680eacdf2 | ||
|
|
f6dcca3ebb | ||
|
|
1a642fc624 | ||
|
|
c4469514db | ||
|
|
59daf95859 | ||
|
|
3a6e04ba15 | ||
|
|
b26f86d6ff | ||
|
|
570215acae | ||
|
|
a511264433 | ||
|
|
06f25d2b27 | ||
|
|
a3bd355b16 | ||
|
|
1c1cd8b164 | ||
|
|
a898109522 | ||
|
|
3694b10e22 | ||
|
|
39f25d20a8 | ||
|
|
61c1646b43 | ||
|
|
1b9396dcbb | ||
|
|
05be4b5b0e | ||
|
|
f8f8bf0fea | ||
|
|
6643b6a306 | ||
|
|
7036ab26d7 | ||
|
|
9b55169251 | ||
|
|
ff13c9c186 | ||
|
|
879e7305ca | ||
|
|
1ff827b2ea | ||
|
|
e7f1204fa4 | ||
|
|
9a2c4a34ee | ||
|
|
f4c421f77a | ||
|
|
fe84718b55 | ||
|
|
15d71a01d5 | ||
|
|
abe30f2578 | ||
|
|
fdae48547b | ||
|
|
68ca8df22f | ||
|
|
b8da38f4e4 | ||
|
|
1f103ab7f1 | ||
|
|
da6cf33aac | ||
|
|
73f08b376f | ||
|
|
ed34d1fee7 | ||
|
|
e9f4f1d13c | ||
|
|
e5bb330be5 | ||
|
|
e23e22cb81 | ||
|
|
7434026f5f | ||
|
|
5319d33bc6 | ||
|
|
702311b6b2 | ||
|
|
2511bc20e0 | ||
|
|
ce5a6eabae | ||
|
|
581cd97ba1 | ||
|
|
fa2f99641f | ||
|
|
c40f7db1ab | ||
|
|
be1363e943 | ||
|
|
c313039526 | ||
|
|
73db5dda8c | ||
|
|
5a8fb77fb2 | ||
|
|
4b6ebcbb61 | ||
|
|
bc056c41bc | ||
|
|
5b54442a48 | ||
|
|
dc14cce7a9 | ||
|
|
4f278ba715 | ||
|
|
1036fcca36 | ||
|
|
6b286a5dee | ||
|
|
c8ae675b95 | ||
|
|
4186467129 | ||
|
|
726884afcb | ||
|
|
5a2f3e700b | ||
|
|
911fc74346 | ||
|
|
1388f4d27e | ||
|
|
5b87327a43 | ||
|
|
2fc1679886 | ||
|
|
7ba5652bea | ||
|
|
1e9aebbc86 | ||
|
|
61ec361182 | ||
|
|
7781cbbc57 | ||
|
|
f3b806b471 | ||
|
|
6496405f30 | ||
|
|
85a6dc5e8c | ||
|
|
856bbfc9c8 | ||
|
|
ebaa43fa4c | ||
|
|
2d44b3ebea | ||
|
|
984493db30 | ||
|
|
47848769ff | ||
|
|
a8f6f5b974 | ||
|
|
1e13f474cb | ||
|
|
c69c3a9a46 | ||
|
|
3216b143c2 | ||
|
|
cc963d42a0 | ||
|
|
3f95a62e4f | ||
|
|
7f9a9e2e82 | ||
|
|
375ecd4ada | ||
|
|
8875dccd11 | ||
|
|
4c2301fdf6 | ||
|
|
346594c406 | ||
|
|
2609e2db5c | ||
|
|
692d5b4e08 | ||
|
|
c4af7464e5 | ||
|
|
5a1dc3eb8a | ||
|
|
adcbfcf8d6 | ||
|
|
b57607e7d3 | ||
|
|
2f159d4f45 | ||
|
|
93e1040d07 | ||
|
|
403c07c305 | ||
|
|
6253308e2e | ||
|
|
33a014013a | ||
|
|
4637215ab2 | ||
|
|
ceaedbbd7f | ||
|
|
52f8b1a1d7 | ||
|
|
e6d1250185 | ||
|
|
d04e5e49d0 | ||
|
|
a72436f330 | ||
|
|
467403f437 | ||
|
|
bbaac0c6a9 | ||
|
|
753fd4bda3 | ||
|
|
57d2c8c94a | ||
|
|
870ec89e9a | ||
|
|
0c3b70f2fb | ||
|
|
7a367698fe | ||
|
|
c77e99814b | ||
|
|
4ddd69cc55 | ||
|
|
ef4a61c769 | ||
|
|
7dfb5ff5bd | ||
|
|
6b391312ab | ||
|
|
6e62d77e4d | ||
|
|
0281cca9af | ||
|
|
018e2403b1 | ||
|
|
61f4534e2a | ||
|
|
69667317c1 | ||
|
|
530aac0682 | ||
|
|
6e7d8f90b5 | ||
|
|
65bf1086a2 | ||
|
|
98220442b4 | ||
|
|
3c3d2ef2b9 | ||
|
|
67066eb32a |
@@ -1,3 +1,27 @@
|
|||||||
|
# NOTE: if you make changes here, remember to also update:
|
||||||
|
# scripts/test-linux.sh
|
||||||
|
# scripts/build-linux.sh
|
||||||
|
# scripts/build-windows.sh
|
||||||
|
|
||||||
|
# Using 'cfg` is broken, see https://github.com/rust-lang/cargo/issues/6858
|
||||||
|
#[target.'cfg(target_arch = "x86_64")']
|
||||||
|
#rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"]
|
||||||
|
|
||||||
|
# …so instead we list all target triples (Tier 1 64-bit platforms)
|
||||||
|
[target.x86_64-unknown-linux-gnu]
|
||||||
|
# Enables the aes-ni instructions for RustCrypto dependency.
|
||||||
|
rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"]
|
||||||
|
|
||||||
|
[target.x86_64-pc-windows-gnu]
|
||||||
|
# Enables the aes-ni instructions for RustCrypto dependency.
|
||||||
|
rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"]
|
||||||
|
|
||||||
[target.x86_64-pc-windows-msvc]
|
[target.x86_64-pc-windows-msvc]
|
||||||
|
# Enables the aes-ni instructions for RustCrypto dependency.
|
||||||
# Link the C runtime statically ; https://github.com/paritytech/parity-ethereum/issues/6643
|
# Link the C runtime statically ; https://github.com/paritytech/parity-ethereum/issues/6643
|
||||||
rustflags = ["-Ctarget-feature=+crt-static"]
|
rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3", "-Ctarget-feature=+crt-static"]
|
||||||
|
|
||||||
|
[target.x86_64-apple-darwin]
|
||||||
|
# Enables the aes-ni instructions for RustCrypto dependency.
|
||||||
|
rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"]
|
||||||
|
|
||||||
|
|||||||
37
.github/CONTRIBUTING.md
vendored
37
.github/CONTRIBUTING.md
vendored
@@ -24,7 +24,42 @@ Also, try to include **steps to reproduce** the issue and expand on the **actual
|
|||||||
|
|
||||||
If you would like to contribute to Parity Ethereum, please **fork it**, fix bugs or implement features, and [propose a pull request](https://github.com/paritytech/parity-ethereum/compare).
|
If you would like to contribute to Parity Ethereum, please **fork it**, fix bugs or implement features, and [propose a pull request](https://github.com/paritytech/parity-ethereum/compare).
|
||||||
|
|
||||||
Please, refer to the [Coding Guide](https://wiki.parity.io/Coding-guide) in our wiki for more details about hacking on Parity.
|
### Labels & Milestones
|
||||||
|
|
||||||
|
We use [labels](https://github.com/paritytech/parity-ethereum/labels) to manage PRs and issues and communicate the state of a PR. Please familiarize yourself with them. Furthermore we are organizing issues in [milestones](https://github.com/paritytech/parity-ethereum/milestones). Best way to get started is to a pick a ticket from the current milestone tagged [`easy`](https://github.com/paritytech/parity-ethereum/labels/Q2-easy%20%F0%9F%92%83) and get going, or [`mentor`](https://github.com/paritytech/parity-ethereum/labels/Q1-mentor%20%F0%9F%95%BA) and get in contact with the mentor offering their support on that larger task.
|
||||||
|
|
||||||
|
### Rules
|
||||||
|
|
||||||
|
There are a few basic ground-rules for contributors (including the maintainer(s) of the project):
|
||||||
|
|
||||||
|
* **No pushing directly to the master branch**.
|
||||||
|
* **All modifications** must be made in a **pull-request** to solicit feedback from other contributors.
|
||||||
|
* Pull-requests cannot be merged before CI runs green and two reviewers have given their approval.
|
||||||
|
* Contributors should adhere to the [Parity Ethereum Style Guide](https://wiki.parity.io/Parity-Ethereum-Style-Guide).
|
||||||
|
|
||||||
|
### Recommendations
|
||||||
|
|
||||||
|
* **Non-master branch names** *should* be prefixed with a short name moniker, followed by the associated Github Issue ID (if any), and a brief description of the task using the format `<GITHUB_USERNAME>-<ISSUE_ID>-<BRIEF_DESCRIPTION>` (e.g. `gavin-123-readme`). The name moniker helps people to inquiry about their unfinished work, and the GitHub Issue ID helps your future self and other developers (particularly those who are onboarding) find out about and understand the original scope of the task, and where it fits into Parity Ethereum [Projects](https://github.com/paritytech/parity-ethereum/projects).
|
||||||
|
* **Remove stale branches periodically**
|
||||||
|
|
||||||
|
### Preparing Pull Requests
|
||||||
|
|
||||||
|
* If your PR does not alter any logic (e.g. comments, dependencies, docs), then it may be tagged [`insubstantial`](https://github.com/paritytech/parity-ethereum/pulls?q=is%3Aopen+is%3Apr+label%3A%22A2-insubstantial+%F0%9F%91%B6%22).
|
||||||
|
|
||||||
|
* Once a PR is ready for review please add the [`pleasereview`](https://github.com/paritytech/parity-ethereum/pulls?utf8=%E2%9C%93&q=is%3Aopen+is%3Apr+label%3A%22A0-pleasereview+%F0%9F%A4%93%22+) label.
|
||||||
|
|
||||||
|
### Reviewing Pull Requests*:
|
||||||
|
|
||||||
|
* At least two reviewers are required to review PRs (even for PRs tagged [`insubstantial`](https://github.com/paritytech/parity-ethereum/pulls?q=is%3Aopen+is%3Apr+label%3A%22A2-insubstantial+%F0%9F%91%B6%22)).
|
||||||
|
|
||||||
|
When doing a review, make sure to look for any:
|
||||||
|
|
||||||
|
* Buggy behavior.
|
||||||
|
* Undue maintenance burden.
|
||||||
|
* Breaking with house coding style.
|
||||||
|
* Pessimization (i.e. reduction of speed as measured in the projects benchmarks).
|
||||||
|
* Breaking changes should be carefuly reviewed and tagged as such so they end up in the [changelog](../CHANGELOG.md).
|
||||||
|
* Uselessness (i.e. it does not strictly add a feature or fix a known issue).
|
||||||
|
|
||||||
## License.
|
## License.
|
||||||
|
|
||||||
|
|||||||
6
.github/ISSUE_TEMPLATE.md
vendored
6
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,10 +1,14 @@
|
|||||||
_Before filing a new issue, please **provide the following information**._
|
_Before filing a new issue, please **provide the following information**._
|
||||||
|
|
||||||
|
_If you think that your issue is an exploitable security vulnerability, please mail your bugreport to security@parity.io instead; your submission might be eligible for our Bug Bounty._
|
||||||
|
_You can find mode info on the reporting process in [SECURITY.md](https://github.com/paritytech/parity-ethereum/blob/master/SECURITY.md)_
|
||||||
|
|
||||||
|
|
||||||
- **Parity Ethereum version**: 0.0.0
|
- **Parity Ethereum version**: 0.0.0
|
||||||
- **Operating system**: Windows / MacOS / Linux
|
- **Operating system**: Windows / MacOS / Linux
|
||||||
- **Installation**: homebrew / one-line installer / built from source
|
- **Installation**: homebrew / one-line installer / built from source
|
||||||
- **Fully synchronized**: no / yes
|
- **Fully synchronized**: no / yes
|
||||||
- **Network**: ethereum / ropsten / kovan / ...
|
- **Network**: ethereum / ropsten / goerli / ...
|
||||||
- **Restarted**: no / yes
|
- **Restarted**: no / yes
|
||||||
|
|
||||||
_Your issue description goes here below. Try to include **actual** vs. **expected behavior** and **steps to reproduce** the issue._
|
_Your issue description goes here below. Try to include **actual** vs. **expected behavior** and **steps to reproduce** the issue._
|
||||||
|
|||||||
21
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
21
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
Thank you for your Pull Request!
|
||||||
|
|
||||||
|
Before you submitting, please check that:
|
||||||
|
|
||||||
|
- [ ] You added a brief description of the PR, e.g.:
|
||||||
|
- What does it do?
|
||||||
|
- What important points reviewers should know?
|
||||||
|
- Is there something left for follow-up PRs?
|
||||||
|
- [ ] You labeled the PR with appropriate labels if you have permissions to do so.
|
||||||
|
- [ ] You mentioned a related issue if this PR related to it, e.g. `Fixes #228` or `Related #1337`.
|
||||||
|
- [ ] You asked any particular reviewers to review. If you aren't sure, start with GH suggestions.
|
||||||
|
- [ ] Your PR adheres [the style guide](https://wiki.parity.io/Coding-guide)
|
||||||
|
- In particular, mind the maximal line length.
|
||||||
|
- There is no commented code checked in unless necessary.
|
||||||
|
- Any panickers have a proof or removed.
|
||||||
|
- [ ] You updated any rustdocs which may have changed
|
||||||
|
|
||||||
|
After you've read this notice feel free to remove it.
|
||||||
|
Thank you!
|
||||||
|
|
||||||
|
✄ -----------------------------------------------------------------------------
|
||||||
503
.gitlab-ci.yml
503
.gitlab-ci.yml
@@ -1,303 +1,372 @@
|
|||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
- build
|
- build
|
||||||
- package
|
|
||||||
- publish
|
- publish
|
||||||
- docs
|
- optional
|
||||||
|
|
||||||
image: parity/rust:gitlab-ci
|
|
||||||
|
|
||||||
|
image: parity/parity-ci-linux:latest
|
||||||
variables:
|
variables:
|
||||||
|
GIT_STRATEGY: fetch
|
||||||
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
CI_SERVER_NAME: "GitLab CI"
|
CI_SERVER_NAME: "GitLab CI"
|
||||||
CARGO_HOME: "${CI_PROJECT_DIR}/cargo"
|
CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}"
|
||||||
|
SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache"
|
||||||
BUILD_TARGET: ubuntu
|
|
||||||
BUILD_ARCH: amd64
|
|
||||||
CARGO_TARGET: x86_64-unknown-linux-gnu
|
CARGO_TARGET: x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
cache:
|
|
||||||
key: "${CI_JOB_NAME}"
|
|
||||||
paths:
|
|
||||||
- ${CI_PROJECT_DIR}/target/
|
|
||||||
- ${CI_PROJECT_DIR}/cargo/
|
|
||||||
|
|
||||||
.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries")
|
.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries")
|
||||||
only: &releaseable_branches
|
only: &releaseable_branches
|
||||||
- master
|
|
||||||
- stable
|
- stable
|
||||||
- beta
|
- beta
|
||||||
- tags
|
- tags
|
||||||
|
- schedules
|
||||||
.publishable_branches: # list of git refs for publishing builds to the "production" locations
|
|
||||||
only: &publishable_branches
|
|
||||||
- nightly # Our nightly builds from schedule, on `master`
|
|
||||||
- "v2*" # Our version tags
|
|
||||||
|
|
||||||
.collect_artifacts: &collect_artifacts
|
.collect_artifacts: &collect_artifacts
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
|
name: "${CI_JOB_NAME}_${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}"
|
||||||
when: on_success
|
when: on_success
|
||||||
expire_in: 1 mos
|
expire_in: 1 mos
|
||||||
paths:
|
paths:
|
||||||
- artifacts/
|
- artifacts/
|
||||||
|
- tools/
|
||||||
|
|
||||||
.determine_version:
|
.docker-cache-status: &docker-cache-status
|
||||||
before_script: &determine_version
|
variables:
|
||||||
- >
|
CARGO_HOME: "/ci-cache/parity-ethereum/cargo/${CI_JOB_NAME}"
|
||||||
VERSION="$(sed -r -n '1,/^version/s/^version = "([^"]+)".*$/\1/p' < Cargo.toml)";
|
dependencies: []
|
||||||
if [ "${CI_COMMIT_REF_NAME}" = "nightly" ]; then
|
before_script:
|
||||||
COMMIT_REF_SHORT="echo ${CI_COMMIT_REF} | grep -oE '^.{7}')";
|
- rustup show
|
||||||
DATE_STRING="$(date +%Y%m%d)";
|
- cargo --version
|
||||||
export VERSION="${VERSION}-${COMMIT_REF_SHORT}-${DATE_STRING}";
|
- SCCACHE_ERROR_LOG=/builds/parity/parity-ethereum/sccache_debug.log
|
||||||
fi;
|
RUST_LOG=sccache=debug
|
||||||
export VERSION;
|
sccache --start-server
|
||||||
echo "Version: $VERSION"
|
- sccache -s
|
||||||
|
after_script:
|
||||||
|
# sccache debug info
|
||||||
#### stage: test
|
- if test -e sccache_debug.log;
|
||||||
|
then
|
||||||
test-rust-stable: &test
|
echo "_____All crate-types:_____";
|
||||||
stage: test
|
grep 'parse_arguments.*--crate-type' sccache_debug.log | sed -re 's/.*"--crate-type", "([^"]+)".*/\1/' | sort | uniq -c;
|
||||||
script:
|
echo "_____Non-cacheable reasons:_____";
|
||||||
- scripts/gitlab/test.sh stable
|
grep CannotCache sccache_debug.log | sed -re 's/.*CannotCache\((.+)\).*/\1/' | sort | uniq -c;
|
||||||
|
else
|
||||||
|
echo "_____No logs from sccache_____";
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
tags:
|
tags:
|
||||||
- rust-stable
|
- linux-docker
|
||||||
|
|
||||||
.optional_test: &optional_test
|
.build-on-linux: &build-on-linux
|
||||||
<<: *test
|
stage: build
|
||||||
allow_failure: true
|
<<: *docker-cache-status
|
||||||
only:
|
<<: *collect_artifacts
|
||||||
- master
|
|
||||||
|
|
||||||
test-rust-beta:
|
|
||||||
<<: *optional_test
|
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/test.sh beta
|
- scripts/gitlab/build-linux.sh
|
||||||
|
- sccache -s
|
||||||
|
after_script:
|
||||||
|
- mkdir -p tools
|
||||||
|
- cp -r scripts/docker/hub/* ./tools
|
||||||
|
- cp scripts/gitlab/publish-snap.sh ./tools
|
||||||
|
- cp scripts/gitlab/publish-onchain.sh ./tools
|
||||||
|
- cp scripts/gitlab/safe-curl.sh ./tools
|
||||||
|
- echo v"$(sed -r -n '1,/^version/s/^version\s*=\s*"([^"]+)".*$/\1/p' Cargo.toml)" |
|
||||||
|
tee ./tools/VERSION
|
||||||
|
- echo "$(sed -r -n '1,/^track/s/^track\s*=\s*"([^"]+)".*$/\1/p' ./util/version/Cargo.toml)" |
|
||||||
|
tee ./tools/TRACK
|
||||||
|
|
||||||
test-rust-nightly:
|
|
||||||
<<: *optional_test
|
|
||||||
script:
|
|
||||||
- scripts/gitlab/test.sh nightly
|
|
||||||
|
|
||||||
test-lint-rustfmt:
|
cargo-check 0 3:
|
||||||
<<: *optional_test
|
|
||||||
script:
|
|
||||||
- scripts/gitlab/rustfmt.sh
|
|
||||||
|
|
||||||
test-lint-clippy:
|
|
||||||
<<: *optional_test
|
|
||||||
script:
|
|
||||||
- scripts/gitlab/clippy.sh
|
|
||||||
|
|
||||||
test-coverage-kcov:
|
|
||||||
stage: test
|
stage: test
|
||||||
only:
|
<<: *docker-cache-status
|
||||||
- master
|
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/coverage.sh
|
- time cargo check --target $CARGO_TARGET --locked --no-default-features --verbose --color=always
|
||||||
tags:
|
- sccache -s
|
||||||
- shell
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
|
cargo-check 1 3:
|
||||||
|
stage: test
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --no-default-features --verbose --color=always
|
||||||
|
- sccache -s
|
||||||
|
|
||||||
#### stage: build
|
cargo-check 2 3:
|
||||||
|
stage: test
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --features "mio" --verbose --color=always
|
||||||
|
- sccache -s
|
||||||
|
|
||||||
build-linux-ubuntu-amd64: &build
|
cargo-audit:
|
||||||
|
stage: test
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- cargo audit
|
||||||
|
allow_failure: true # failed cargo audit shouldn't prevent a PR from being merged
|
||||||
|
|
||||||
|
validate-chainspecs:
|
||||||
|
stage: test
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- ./scripts/gitlab/validate-chainspecs.sh
|
||||||
|
- sccache -s
|
||||||
|
|
||||||
|
test-cpp:
|
||||||
|
stage: build
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- ./scripts/gitlab/test-cpp.sh
|
||||||
|
- sccache -s
|
||||||
|
|
||||||
|
test-linux:
|
||||||
|
stage: build
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- ./scripts/gitlab/test-linux.sh stable
|
||||||
|
- sccache -s
|
||||||
|
|
||||||
|
test-linux-beta:
|
||||||
stage: build
|
stage: build
|
||||||
only: *releaseable_branches
|
only: *releaseable_branches
|
||||||
variables:
|
<<: *docker-cache-status
|
||||||
CARGO_TARGET: x86_64-unknown-linux-gnu
|
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/build-unix.sh
|
- ./scripts/gitlab/test-linux.sh beta
|
||||||
<<: *collect_artifacts
|
- sccache -s
|
||||||
tags:
|
|
||||||
- rust-stable
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
build-linux-ubuntu-i386:
|
test-linux-nightly:
|
||||||
<<: *build
|
stage: build
|
||||||
image: parity/rust-i686:gitlab-ci
|
only: *releaseable_branches
|
||||||
variables:
|
<<: *docker-cache-status
|
||||||
CARGO_TARGET: i686-unknown-linux-gnu
|
script:
|
||||||
tags:
|
- ./scripts/gitlab/test-linux.sh nightly
|
||||||
- rust-i686
|
- sccache -s
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
build-linux-ubuntu-arm64:
|
build-android:
|
||||||
<<: *build
|
<<: *build-on-linux
|
||||||
image: parity/rust-arm64:gitlab-ci
|
image: parity/parity-ci-android:stretch
|
||||||
variables:
|
|
||||||
CARGO_TARGET: aarch64-unknown-linux-gnu
|
|
||||||
tags:
|
|
||||||
- rust-arm
|
|
||||||
|
|
||||||
build-linux-ubuntu-armhf:
|
|
||||||
<<: *build
|
|
||||||
image: parity/rust-armv7:gitlab-ci
|
|
||||||
variables:
|
|
||||||
CARGO_TARGET: armv7-unknown-linux-gnueabihf
|
|
||||||
tags:
|
|
||||||
- rust-arm
|
|
||||||
|
|
||||||
build-linux-android-armhf:
|
|
||||||
<<: *build
|
|
||||||
image: parity/rust-android:gitlab-ci
|
|
||||||
variables:
|
variables:
|
||||||
CARGO_TARGET: armv7-linux-androideabi
|
CARGO_TARGET: armv7-linux-androideabi
|
||||||
tags:
|
|
||||||
- rust-arm
|
|
||||||
|
|
||||||
build-darwin-macos-x86_64:
|
build-linux:
|
||||||
<<: *build
|
<<: *build-on-linux
|
||||||
|
only: *releaseable_branches
|
||||||
|
|
||||||
|
build-linux-i386:
|
||||||
|
<<: *build-on-linux
|
||||||
|
only: *releaseable_branches
|
||||||
|
image: parity/parity-ci-i386:latest
|
||||||
|
variables:
|
||||||
|
CARGO_TARGET: i686-unknown-linux-gnu
|
||||||
|
|
||||||
|
build-linux-arm64:
|
||||||
|
<<: *build-on-linux
|
||||||
|
only: *releaseable_branches
|
||||||
|
image: parity/parity-ci-arm64:latest
|
||||||
|
variables:
|
||||||
|
CARGO_TARGET: aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
|
build-linux-armhf:
|
||||||
|
<<: *build-on-linux
|
||||||
|
only: *releaseable_branches
|
||||||
|
image: parity/parity-ci-armhf:latest
|
||||||
|
variables:
|
||||||
|
CARGO_TARGET: armv7-unknown-linux-gnueabihf
|
||||||
|
|
||||||
|
build-darwin:
|
||||||
|
stage: build
|
||||||
|
<<: *collect_artifacts
|
||||||
|
only: *releaseable_branches
|
||||||
variables:
|
variables:
|
||||||
CARGO_TARGET: x86_64-apple-darwin
|
CARGO_TARGET: x86_64-apple-darwin
|
||||||
|
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo"
|
||||||
CC: gcc
|
CC: gcc
|
||||||
CXX: g++
|
CXX: g++
|
||||||
|
script:
|
||||||
|
- scripts/gitlab/build-linux.sh
|
||||||
tags:
|
tags:
|
||||||
- osx
|
- rust-osx
|
||||||
<<: *collect_artifacts
|
|
||||||
|
|
||||||
build-windows-msvc-x86_64:
|
build-windows:
|
||||||
stage: build
|
stage: build
|
||||||
|
<<: *collect_artifacts
|
||||||
only: *releaseable_branches
|
only: *releaseable_branches
|
||||||
cache:
|
|
||||||
key: "%CI_JOB_NAME%"
|
|
||||||
paths:
|
|
||||||
- "%CI_PROJECT_DIR%/target/"
|
|
||||||
- "%CI_PROJECT_DIR%/cargo/"
|
|
||||||
# No cargo caching, since fetch-locking on Windows gets stuck
|
|
||||||
variables:
|
variables:
|
||||||
CARGO_TARGET: x86_64-pc-windows-msvc
|
CARGO_TARGET: x86_64-pc-windows-msvc
|
||||||
|
CARGO_HOME: "C:/ci-cache/parity-ethereum/cargo/$CI_JOB_NAME"
|
||||||
|
GIT_SUBMODULE_STRATEGY: none
|
||||||
script:
|
script:
|
||||||
- sh scripts/gitlab/build-windows.sh
|
- sh scripts/gitlab/build-windows.sh
|
||||||
tags:
|
tags:
|
||||||
- rust-windows
|
- rust-windows
|
||||||
<<: *collect_artifacts
|
|
||||||
|
|
||||||
|
publish-docker:
|
||||||
#### stage: package
|
|
||||||
|
|
||||||
package-linux-snap-amd64: &package_snap
|
|
||||||
stage: package
|
|
||||||
only: *releaseable_branches
|
|
||||||
cache: {}
|
|
||||||
before_script: *determine_version
|
|
||||||
variables:
|
|
||||||
CARGO_TARGET: x86_64-unknown-linux-gnu
|
|
||||||
dependencies:
|
|
||||||
- build-linux-ubuntu-amd64
|
|
||||||
script:
|
|
||||||
- scripts/gitlab/package-snap.sh
|
|
||||||
tags:
|
|
||||||
- rust-stable
|
|
||||||
<<: *collect_artifacts
|
|
||||||
|
|
||||||
package-linux-snap-i386:
|
|
||||||
<<: *package_snap
|
|
||||||
variables:
|
|
||||||
BUILD_ARCH: i386
|
|
||||||
CARGO_TARGET: i686-unknown-linux-gnu
|
|
||||||
dependencies:
|
|
||||||
- build-linux-ubuntu-i386
|
|
||||||
|
|
||||||
package-linux-snap-arm64:
|
|
||||||
<<: *package_snap
|
|
||||||
variables:
|
|
||||||
BUILD_ARCH: arm64
|
|
||||||
CARGO_TARGET: aarch64-unknown-linux-gnu
|
|
||||||
dependencies:
|
|
||||||
- build-linux-ubuntu-arm64
|
|
||||||
|
|
||||||
package-linux-snap-armhf:
|
|
||||||
<<: *package_snap
|
|
||||||
variables:
|
|
||||||
BUILD_ARCH: armhf
|
|
||||||
CARGO_TARGET: armv7-unknown-linux-gnueabihf
|
|
||||||
dependencies:
|
|
||||||
- build-linux-ubuntu-armhf
|
|
||||||
|
|
||||||
|
|
||||||
#### stage: publish
|
|
||||||
|
|
||||||
publish-linux-snap-amd64: &publish_snap
|
|
||||||
stage: publish
|
stage: publish
|
||||||
only: *publishable_branches
|
only: *releaseable_branches
|
||||||
image: snapcore/snapcraft:stable
|
except:
|
||||||
cache: {}
|
- nightly
|
||||||
before_script: *determine_version
|
when: manual
|
||||||
variables:
|
|
||||||
BUILD_ARCH: amd64
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- package-linux-snap-amd64
|
- build-linux
|
||||||
|
environment:
|
||||||
|
name: parity-build
|
||||||
|
cache: {}
|
||||||
|
image: docker:stable
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
DOCKER_HOST: tcp://localhost:2375
|
||||||
|
DOCKER_DRIVER: overlay2
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
# DOCKERFILE: tools/Dockerfile
|
||||||
|
# CONTAINER_IMAGE: parity/parity
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/publish-snap.sh
|
- ./tools/publish-docker.sh
|
||||||
tags:
|
tags:
|
||||||
- rust-stable
|
- kubernetes-parity-build
|
||||||
|
|
||||||
publish-linux-snap-i386:
|
publish-snap-nightly: &publish-snap
|
||||||
<<: *publish_snap
|
stage: publish
|
||||||
|
only:
|
||||||
|
- nightly
|
||||||
|
image: snapcore/snapcraft
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
BUILD_ARCH: amd64
|
||||||
|
cache: {}
|
||||||
|
dependencies:
|
||||||
|
- build-linux
|
||||||
|
tags:
|
||||||
|
- linux-docker
|
||||||
|
script:
|
||||||
|
- ./tools/publish-snap.sh
|
||||||
|
|
||||||
|
publish-snap-manually:
|
||||||
|
<<: *publish-snap
|
||||||
|
only: *releaseable_branches
|
||||||
|
when: manual
|
||||||
|
|
||||||
|
publish-snap-i386-nightly: &publish-snap-i386
|
||||||
|
<<: *publish-snap
|
||||||
variables:
|
variables:
|
||||||
BUILD_ARCH: i386
|
BUILD_ARCH: i386
|
||||||
|
CARGO_TARGET: i686-unknown-linux-gnu
|
||||||
dependencies:
|
dependencies:
|
||||||
- package-linux-snap-i386
|
- build-linux-i386
|
||||||
|
|
||||||
publish-linux-snap-arm64:
|
publish-snap-i386-manually:
|
||||||
<<: *publish_snap
|
<<: *publish-snap-i386
|
||||||
|
only: *releaseable_branches
|
||||||
|
when: manual
|
||||||
|
|
||||||
|
publish-snap-arm64-nightly: &publish-snap-arm64
|
||||||
|
<<: *publish-snap
|
||||||
variables:
|
variables:
|
||||||
BUILD_ARCH: arm64
|
BUILD_ARCH: arm64
|
||||||
|
CARGO_TARGET: aarch64-unknown-linux-gnu
|
||||||
dependencies:
|
dependencies:
|
||||||
- package-linux-snap-arm64
|
- build-linux-arm64
|
||||||
|
|
||||||
publish-linux-snap-armhf:
|
publish-snap-arm64-manually:
|
||||||
<<: *publish_snap
|
<<: *publish-snap-arm64
|
||||||
|
only: *releaseable_branches
|
||||||
|
when: manual
|
||||||
|
|
||||||
|
publish-snap-armhf-nightly: &publish-snap-armhf
|
||||||
|
<<: *publish-snap
|
||||||
variables:
|
variables:
|
||||||
BUILD_ARCH: armhf
|
BUILD_ARCH: armhf
|
||||||
|
CARGO_TARGET: armv7-unknown-linux-gnueabihf
|
||||||
dependencies:
|
dependencies:
|
||||||
- package-linux-snap-armhf
|
- build-linux-armhf
|
||||||
|
|
||||||
publish-docker-parity-amd64: &publish_docker
|
publish-snap-armhf-manually:
|
||||||
|
<<: *publish-snap-armhf
|
||||||
|
only: *releaseable_branches
|
||||||
|
when: manual
|
||||||
|
|
||||||
|
publish-onchain-nightly: &publish-onchain
|
||||||
stage: publish
|
stage: publish
|
||||||
only: *publishable_branches
|
only:
|
||||||
cache: {}
|
- nightly
|
||||||
|
cache: {}
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
dependencies:
|
dependencies:
|
||||||
- build-linux-ubuntu-amd64
|
- build-linux
|
||||||
|
- build-darwin
|
||||||
|
- build-windows
|
||||||
|
script:
|
||||||
|
- ./tools/publish-onchain.sh
|
||||||
tags:
|
tags:
|
||||||
- shell
|
- linux-docker
|
||||||
allow_failure: true
|
|
||||||
script:
|
|
||||||
- scripts/gitlab/publish-docker.sh parity
|
|
||||||
|
|
||||||
publish-docker-parityevm-amd64:
|
publish-onchain-manually:
|
||||||
<<: *publish_docker
|
<<: *publish-onchain
|
||||||
script:
|
only: *releaseable_branches
|
||||||
- scripts/gitlab/publish-docker.sh parity-evm
|
when: manual
|
||||||
|
|
||||||
publish-github-and-s3:
|
publish-release-awss3-nightly: &publish-release-awss3
|
||||||
|
image: parity/awscli:latest
|
||||||
stage: publish
|
stage: publish
|
||||||
only: *publishable_branches
|
only:
|
||||||
cache: {}
|
- nightly
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
cache: {}
|
||||||
dependencies:
|
dependencies:
|
||||||
- build-linux-ubuntu-amd64
|
- build-linux
|
||||||
- build-linux-ubuntu-i386
|
- build-darwin
|
||||||
- build-linux-ubuntu-armhf
|
- build-windows
|
||||||
- build-linux-ubuntu-arm64
|
|
||||||
- build-darwin-macos-x86_64
|
|
||||||
- build-windows-msvc-x86_64
|
|
||||||
before_script: *determine_version
|
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/push.sh
|
- echo "__________Push binaries to AWS S3____________"
|
||||||
|
- case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in
|
||||||
|
(beta|stable|nightly)
|
||||||
|
export BUCKET=releases.parity.io/ethereum;
|
||||||
|
;;
|
||||||
|
(*)
|
||||||
|
export BUCKET=builds-parity;
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
- aws s3 sync ./artifacts s3://${BUCKET}/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}/
|
||||||
|
- echo "__________Read from S3____________"
|
||||||
|
- aws s3 ls s3://${BUCKET}/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}} --recursive --human-readable --summarize
|
||||||
tags:
|
tags:
|
||||||
- shell
|
- linux-docker
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
|
publish-release-awss3-manually:
|
||||||
|
<<: *publish-release-awss3
|
||||||
|
only: *releaseable_branches
|
||||||
|
when: manual
|
||||||
|
|
||||||
####stage: docs
|
publish-docs:
|
||||||
|
stage: publish
|
||||||
docs-rpc-json:
|
image: parity/parity-ci-docs:latest
|
||||||
stage: docs
|
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
cache: {}
|
except:
|
||||||
|
- nightly
|
||||||
|
when: manual
|
||||||
|
cache: {}
|
||||||
|
dependencies: []
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/rpc-docs.sh
|
- scripts/gitlab/publish-docs.sh
|
||||||
tags:
|
tags:
|
||||||
- shell
|
- linux-docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
publish-av-whitelist:
|
||||||
|
stage: publish
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
only: *releaseable_branches
|
||||||
|
except:
|
||||||
|
- nightly
|
||||||
|
when: manual
|
||||||
|
cache: {}
|
||||||
|
dependencies:
|
||||||
|
- build-windows
|
||||||
|
script:
|
||||||
|
- scripts/gitlab/publish-av-whitelists.sh
|
||||||
|
tags:
|
||||||
|
- linux-docker
|
||||||
|
|||||||
541
CHANGELOG.md
541
CHANGELOG.md
@@ -1,370 +1,209 @@
|
|||||||
## Parity-Ethereum [v2.0.1](https://github.com/paritytech/parity-ethereum/releases/tag/v2.0.1) (2018-07-27)
|
## Parity-Ethereum [v2.6.3](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.3)
|
||||||
|
|
||||||
Parity-Ethereum 2.0.1-beta is a bug-fix release to improve performance and stability.
|
Parity Ethereum v2.6.3-stable is a patch release that improves security, stability and performance.
|
||||||
|
|
||||||
Note, authorities in PoA networks based on the Aura engine, should upgrade their nodes to 1.11.8-stable or 2.0.1-beta as this release includes a critical fix.
|
* The most noteworthy improvement in this release is incorporating all the EIPs required for the Istanbul hard fork.
|
||||||
|
* This release also fixes certain security and performance issues, one of which was suspected to be consensus-threatening but turned out to be benign. Thanks to Martin Holst Swende and Felix Lange from the Ethereum Foundation for bringing the suspicious issue to our attention.
|
||||||
|
|
||||||
The full list of included changes:
|
The full list of included changes:
|
||||||
|
|
||||||
- Backports to 2.0.1-beta ([#9145](https://github.com/paritytech/parity-ethereum/pull/9145))
|
* add more tx tests (#11038)
|
||||||
- Parity-version: bump beta to 2.0.1
|
* Fix parallel transactions race-condition (#10995)
|
||||||
- Ci: update version strings for snaps ([#9160](https://github.com/paritytech/parity-ethereum/pull/9160))
|
* Add blake2_f precompile (#11017)
|
||||||
- Be more graceful on Aura difficulty validation ([#9164](https://github.com/paritytech/parity-ethereum/pull/9164))
|
* [trace] introduce trace failed to Ext (#11019)
|
||||||
- Be more graceful on Aura difficulty validation
|
* Edit publish-onchain.sh to use https (#11016)
|
||||||
- Test: rejects_step_backwards
|
* Fix deadlock in network-devp2p (#11013)
|
||||||
- Test: proposer_switching
|
* EIP 1108: Reduce alt_bn128 precompile gas costs (#11008)
|
||||||
- Test: rejects_future_block
|
* xDai chain support and nodes list update (#10989)
|
||||||
- Test: reports_skipped
|
* EIP 2028: transaction gas lowered from 68 to 16 (#10987)
|
||||||
- Test: verify_empty_seal_steps
|
* EIP-1344 Add CHAINID op-code (#10983)
|
||||||
- Remove node-health ([#9119](https://github.com/paritytech/parity-ethereum/pull/9119))
|
* manual publish jobs for releases, no changes for nightlies (#10977)
|
||||||
- Remove node-health
|
* [blooms-db] Fix benchmarks (#10974)
|
||||||
- Remove ntp_servers
|
* Verify transaction against its block during import (#10954)
|
||||||
- Add --ntp-servers as legacy instead of removing it
|
* Better error message for rpc gas price errors (#10931)
|
||||||
- Add --ntp-servers to deprecated args
|
* Fix fork choice (#10837)
|
||||||
- Remove unused stuff
|
* Fix compilation on recent nightlies (#10991)
|
||||||
- Remove _legacy_ntp_servers
|
* Don't build rpc with ethcore test-helpers (#11048)
|
||||||
- Parity: fix UserDefaults json parser ([#9189](https://github.com/paritytech/parity-ethereum/pull/9189))
|
* EIP 1884 Re-pricing of trie-size dependent operations (#10992)
|
||||||
- Parity: fix UserDefaults json parser
|
* Implement EIP-1283 reenable transition, EIP-1706 and EIP-2200 (#10191)
|
||||||
- Parity: use serde_derive for UserDefaults
|
|
||||||
- Parity: support deserialization of old UserDefault json format
|
|
||||||
- Parity: make UserDefaults serde backwards compatible
|
|
||||||
- Parity: tabify indentation in UserDefaults
|
|
||||||
- Fix bugfix hard fork logic ([#9138](https://github.com/paritytech/parity-ethereum/pull/9138))
|
|
||||||
- Fix bugfix hard fork logic
|
|
||||||
- Remove dustProtectionTransition from bugfix category
|
|
||||||
- Eip-168 is not enabled by default
|
|
||||||
- Remove unnecessary 'static
|
|
||||||
- Disable per-sender limit for local transactions. ([#9148](https://github.com/paritytech/parity-ethereum/pull/9148))
|
|
||||||
- Disable per-sender limit for local transactions.
|
|
||||||
- Add a missing new line.
|
|
||||||
- Rpc: fix is_major_importing sync state condition ([#9112](https://github.com/paritytech/parity-ethereum/pull/9112))
|
|
||||||
- Rpc: fix is_major_importing sync state condition
|
|
||||||
- Rpc: fix informant printout when waiting for peers
|
|
||||||
- Fix verification in ethcore-sync collect_blocks ([#9135](https://github.com/paritytech/parity-ethereum/pull/9135))
|
|
||||||
- Docker: update hub dockerfile ([#9173](https://github.com/paritytech/parity-ethereum/pull/9173))
|
|
||||||
- Update Dockerfile for hub
|
|
||||||
- Update to Ubuntu Xenial 16.04
|
|
||||||
- Fix cmake version
|
|
||||||
- Docker: fix tab indentation in hub dockerfile
|
|
||||||
- Rpc: fix broken merge
|
|
||||||
- Rpc: remove node_health leftover from merge
|
|
||||||
- Rpc: remove dapps leftover from merge
|
|
||||||
|
|
||||||
## Parity-Ethereum [v2.0.0](https://github.com/paritytech/parity-ethereum/releases/tag/v2.0.0) "Ethereum" (2018-07-18)
|
## Parity-Ethereum [v2.6.2](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.2)
|
||||||
|
|
||||||
This is the Parity-Ethereum//v2.0.0-beta release, code-named "Ethereum", **YOLO!**
|
Parity Ethereum v2.6.2-stable is a bugfix release that fixes a potential DoS attack in the trace_call RPC method. This is a critical upgrade for anyone running Parity nodes with RPC exposed to the public internet (and highly recommended for anyone else). For details see this blog post.
|
||||||
|
|
||||||
Please note, Parity-Ethereum//v2.0.0 comes with some breaking changes that might be interrupting your usual workflows. Please mind them before upgrading:
|
## Parity-Ethereum [v2.6.1](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.1)
|
||||||
|
|
||||||
- The Parity client is now called _Parity-Ethereum_ to distinguish it from other software we provide, such as [_Parity-Bitcoin_](https://github.com/paritytech/parity-bitcoin/) and [_Parity-Polkadot_](https://github.com/paritytech/polkadot) ([#9052](https://github.com/paritytech/parity-ethereum/pull/9052)).
|
Parity-Ethereum 2.6.1-beta is a patch release that improves stability.
|
||||||
- The public node and the user interface (a.k.a. _"Parity Wallet"_) are completely removed from the Parity-Ethereum//v2.0.0 client ([#8758](https://github.com/paritytech/parity-ethereum/pull/8758), [#8783](https://github.com/paritytech/parity-ethereum/pull/8783), [#8641](https://github.com/paritytech/parity-ethereum/pull/8641)). Users interested running a Parity Wallet, check out [the stand-alone UI application](https://github.com/Parity-JS/shell/releases).
|
|
||||||
- The DApps subsystem was completely removed from the client ([#9017](https://github.com/paritytech/parity-ethereum/pull/9017), [#9107](https://github.com/paritytech/parity-ethereum/pull/9107)). Again, use the standalone wallet if you wish to continue working with them.
|
|
||||||
- Windows and MacOS versions are not available as installer anymore and the system trays were removed ([#8778](https://github.com/paritytech/parity-ethereum/pull/8778)). If you desire to run Parity-Ethereum on Windows or MacOS, you still can get the binaries from our mirrors. Furthermore, MacOS users are encouraged [to use our homebrew tap](https://github.com/paritytech/homebrew-paritytech/).
|
|
||||||
- Linux versions are not available as deb-/rpm-packages anymore ([#8887](https://github.com/paritytech/parity-ethereum/pull/8887)). Communities are encouraged to provide their own packages or maintain their own repositories, such as [Arch Linux does](https://www.archlinux.org/packages/community/x86_64/parity/) for instance.
|
|
||||||
- MD5-checksums are completely replaced by SHA256-checksums ([#8884](https://github.com/paritytech/parity-ethereum/pull/8884)). This is also reflected on our homepage by now.
|
|
||||||
- Deprecated, removed, or replaced CLI-options are hidden from client `--help` to further discourage their usage ([#8967](https://github.com/paritytech/parity-ethereum/pull/8967)).
|
|
||||||
|
|
||||||
Additional noteworthy changes to the client:
|
This release includes:
|
||||||
|
* Allow specifying hostnames for node URLs
|
||||||
- Tracing of precompiled contracts when the transfer value is not zero ([#8486](https://github.com/paritytech/parity-ethereum/pull/8486))
|
* Fix a bug where archive nodes were losing peers
|
||||||
- _Parity-Ethereum_ as a library now provides APIs for running full and light nodes and a C interface ([#8412](https://github.com/paritytech/parity-ethereum/pull/8412)). Shared crates are now available in [_Parity-Common_](https://github.com/paritytech/parity-common) ([#9083](https://github.com/paritytech/parity-ethereum/pull/9083)).
|
* Add support for Energy Web Foundations new chains 'Volta' and 'EWC', and remove their deprecated 'Tobalaba' chain.
|
||||||
- The Morden database and keys are now moved to a `./Morden` subdirectory instead of `./test` which is by default used by Ropsten ([#8621](https://github.com/paritytech/parity-ethereum/pull/8621)).
|
|
||||||
- Adding support for having an on-chain contract calculating the block rewards ([#8419](https://github.com/paritytech/parity-ethereum/pull/8419)).
|
|
||||||
- Enforcing warp-only synchronization with `--warp-barrier [blocknumber]` flag ([#8228](https://github.com/paritytech/parity-ethereum/pull/8228)).
|
|
||||||
- Adding a fork-choice and meta-data framework suitable for implementing Casper ([#8401](https://github.com/paritytech/parity-ethereum/pull/8401)).
|
|
||||||
- Returning an error if RLP-size of a transaction exceeds a 300kB limit ([#8473](https://github.com/paritytech/parity-ethereum/pull/8473)).
|
|
||||||
- Warp-sync is now resumable by keeping the downloaded chunks between client restarts. Also, it seeds downloaded snapshots for other nodes ([#8544](https://github.com/paritytech/parity-ethereum/pull/8544)).
|
|
||||||
- The developer chain `--chain dev` now contains Byzantium features, this breaks existing developer chains ([#8717](https://github.com/paritytech/parity-ethereum/pull/8717)).
|
|
||||||
- The EIP150, EIP160 and EIP161 forks are now to be specified in common params section of a chain-spec file instead of the Ethash params to enable these features on non-proof-of-work chains ([#8614](https://github.com/paritytech/parity-ethereum/pull/8614)). Please update your chain specs.
|
|
||||||
- Allowing to disable local-by-default for transactions with new configurations ([#8882](https://github.com/paritytech/parity-ethereum/pull/8882)).
|
|
||||||
- Never drop local transactions from different senders ([#9002](https://github.com/paritytech/parity-ethereum/pull/9002)).
|
|
||||||
- Optimize pending transactions filter and fix ethstats reporting of pending transactions ([#9026](https://github.com/paritytech/parity-ethereum/pull/9026)).
|
|
||||||
- Add separate database directory for light client allowing to run full and light nodes at the same time ([#9064](https://github.com/paritytech/parity-ethereum/pull/9064)).
|
|
||||||
|
|
||||||
If you are upgrading directly from versions 1.10.9 or earlier, please note important changes to our transaction-queue implementation, namely:
|
|
||||||
|
|
||||||
- The pool now limits transactions per-sender (see `--tx-queue-per-sender`), local transactions also have to obey that limit. Consider increasing the limit via CLI-flag when running benchmarks or sending a lot of transactions at once.
|
|
||||||
- In case the pool is full, transactions received over the network, but originating from accounts that you have private keys for might not get accepted to the pool any more with higher priority. Consider running with larger pool size or submitting the transactions directly on the node via `eth_sendRawTransaction`.
|
|
||||||
|
|
||||||
The full list of included changes:
|
The full list of included changes:
|
||||||
|
* Add support for Energy Web Foundation's new chains (#10957)
|
||||||
|
* Kaspersky AV whitelisting (#10919)
|
||||||
|
* Avast whitelist script (#10900)
|
||||||
|
* Docker images renaming (#10863)
|
||||||
|
* Remove excessive warning (#10831)
|
||||||
|
* Allow --nat extip:your.host.here.org (#10830)
|
||||||
|
* When updating the client or when called from RPC, sleep should mean sleep (#10814)
|
||||||
|
* added new ropsten-bootnode and removed old one (#10794)
|
||||||
|
* ethkey no longer uses byteorder (#10786)
|
||||||
|
* docs: Update Readme with TOC, Contributor Guideline. Update Cargo package descriptions (#10652)
|
||||||
|
|
||||||
- Backports to 2.0.0-beta ([#9094](https://github.com/paritytech/parity-ethereum/pull/9094))
|
## Parity-Ethereum [v2.6.0](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.0)
|
||||||
- Parity-version: betalize 2.0
|
|
||||||
- Multiple improvements to discovery ping handling ([#8771](https://github.com/paritytech/parity-ethereum/pull/8771))
|
Parity-Ethereum 2.6.0-beta is a minor release that stabilizes the 2.6 branch by
|
||||||
- Discovery: Only add nodes to routing table after receiving pong.
|
marking it as a beta release.
|
||||||
- Discovery: Refactor packet creation into its own function.
|
|
||||||
- Discovery: Additional testing for new add_node behavior.
|
This release includes:
|
||||||
- Discovery: Track expiration of pings to non-yet-in-bucket nodes.
|
* Major refactoring of the codebase
|
||||||
- Discovery: Verify echo hash on pong packets.
|
* Many bugfixes
|
||||||
- Discovery: Track timeouts on FIND_NODE requests.
|
* Significant improvements to logging, error and warning message clarity.
|
||||||
- Discovery: Retry failed pings with exponential backoff.
|
* SecretStore: remove support of old database formats (#10757)
|
||||||
- !fixup Use slice instead of Vec for request_backoff.
|
* This is a potentially breaking change if you have not upgraded for
|
||||||
- Add separate database directory for light client ([#9064](https://github.com/paritytech/parity-ethereum/pull/9064))
|
quite some time.
|
||||||
- Add separate default DB path for light client ([#8927](https://github.com/paritytech/parity-ethereum/pull/8927))
|
|
||||||
- Improve readability
|
As of today, Parity-Ethereum 2.4 reaches end of life, and everyone is
|
||||||
- Revert "Replace `std::env::home_dir` with `dirs::home_dir` ([#9077](https://github.com/paritytech/parity-ethereum/pull/9077))" ([#9097](https://github.com/paritytech/parity-ethereum/pull/9097))
|
encouraged to upgrade.
|
||||||
- Revert "Replace `std::env::home_dir` with `dirs::home_dir` ([#9077](https://github.com/paritytech/parity-ethereum/pull/9077))"
|
|
||||||
- This reverts commit 7e77932.
|
The full list of included changes:
|
||||||
- Restore some of the changes
|
* update jsonrpc to 12.0 ([#10841](https://github.com/paritytech/parity-ethereum/pull/10841))
|
||||||
- Update parity-common
|
* Move more code into state-account ([#10840](https://github.com/paritytech/parity-ethereum/pull/10840))
|
||||||
- Offload cull to IoWorker. ([#9099](https://github.com/paritytech/parity-ethereum/pull/9099))
|
* Extract AccountDB to account-db ([#10839](https://github.com/paritytech/parity-ethereum/pull/10839))
|
||||||
- Fix work-notify. ([#9104](https://github.com/paritytech/parity-ethereum/pull/9104))
|
* Extricate PodAccount and state Account to own crates ([#10838](https://github.com/paritytech/parity-ethereum/pull/10838))
|
||||||
- Update hidapi, fixes [#7542](https://github.com/paritytech/parity-ethereum/issues/7542) ([#9108](https://github.com/paritytech/parity-ethereum/pull/9108))
|
* Fix fork choice ([#10837](https://github.com/paritytech/parity-ethereum/pull/10837))
|
||||||
- Docker: add cmake dependency ([#9111](https://github.com/paritytech/parity-ethereum/pull/9111))
|
* tests: Relates to #10655: Test instructions for Readme ([#10835](https://github.com/paritytech/parity-ethereum/pull/10835))
|
||||||
- Update light client hardcoded headers ([#9098](https://github.com/paritytech/parity-ethereum/pull/9098))
|
* idiomatic changes to PodState ([#10834](https://github.com/paritytech/parity-ethereum/pull/10834))
|
||||||
- Insert Kovan hardcoded headers until 7690241
|
* Break circular dependency between Client and Engine (part 1) ([#10833](https://github.com/paritytech/parity-ethereum/pull/10833))
|
||||||
- Insert Kovan hardcoded headers until block 7690241
|
* Remove excessive warning ([#10831](https://github.com/paritytech/parity-ethereum/pull/10831))
|
||||||
- Insert Ropsten hardcoded headers until 3612673
|
* Allow --nat extip:your.host.here.org ([#10830](https://github.com/paritytech/parity-ethereum/pull/10830))
|
||||||
- Insert Mainnet hardcoded headers until block 5941249
|
* ethcore does not use byteorder ([#10829](https://github.com/paritytech/parity-ethereum/pull/10829))
|
||||||
- Make sure to produce full blocks. ([#9115](https://github.com/paritytech/parity-ethereum/pull/9115))
|
* Fix typo in README.md ([#10828](https://github.com/paritytech/parity-ethereum/pull/10828))
|
||||||
- Insert ETC (classic) hardcoded headers until block 6170625 ([#9121](https://github.com/paritytech/parity-ethereum/pull/9121))
|
* Update wordlist to v1.3 ([#10823](https://github.com/paritytech/parity-ethereum/pull/10823))
|
||||||
- Fix verification in ethcore-sync collect_blocks ([#9135](https://github.com/paritytech/parity-ethereum/pull/9135))
|
* bump `smallvec 0.6.10` to fix vulnerability ([#10822](https://github.com/paritytech/parity-ethereum/pull/10822))
|
||||||
- Completely remove all dapps struct from rpc ([#9107](https://github.com/paritytech/parity-ethereum/pull/9107))
|
* removed additional_params method ([#10818](https://github.com/paritytech/parity-ethereum/pull/10818))
|
||||||
- Completely remove all dapps struct from rpc
|
* Improve logging when remote peer is unknown ([#10817](https://github.com/paritytech/parity-ethereum/pull/10817))
|
||||||
- Remove unused pub use
|
* replace memzero with zeroize crate ([#10816](https://github.com/paritytech/parity-ethereum/pull/10816))
|
||||||
- `evm bench` fix broken dependencies ([#9134](https://github.com/paritytech/parity-ethereum/pull/9134))
|
* When updating the client or when called from RPC, sleep should mean sleep ([#10814](https://github.com/paritytech/parity-ethereum/pull/10814))
|
||||||
- `evm bench` use valid dependencies
|
* Don't reimplement the logic from the Default impl ([#10813](https://github.com/paritytech/parity-ethereum/pull/10813))
|
||||||
- Benchmarks of the `evm` used stale versions of a couple a crates that this commit fixes!
|
* refactor: whisper: Add type aliases and update rustdocs in message.rs ([#10812](https://github.com/paritytech/parity-ethereum/pull/10812))
|
||||||
- Fix warnings
|
* test: whisper/cli `add invalid pool size test depending on processor` ([#10811](https://github.com/paritytech/parity-ethereum/pull/10811))
|
||||||
- Update snapcraft.yaml ([#9132](https://github.com/paritytech/parity-ethereum/pull/9132))
|
* Add Constantinople EIPs to the dev (instant_seal) config ([#10809](https://github.com/paritytech/parity-ethereum/pull/10809))
|
||||||
- Parity Ethereum 2.0.0 ([#9052](https://github.com/paritytech/parity-ethereum/pull/9052))
|
* fix spurious test failure ([#10808](https://github.com/paritytech/parity-ethereum/pull/10808))
|
||||||
- Don't fetch snapshot chunks at random ([#9088](https://github.com/paritytech/parity-ethereum/pull/9088))
|
* revert temp changes to .gitlab-ci.yml ([#10807](https://github.com/paritytech/parity-ethereum/pull/10807))
|
||||||
- Remove the dapps system ([#9017](https://github.com/paritytech/parity-ethereum/pull/9017))
|
* removed redundant fmt::Display implementations ([#10806](https://github.com/paritytech/parity-ethereum/pull/10806))
|
||||||
- Fix nightly warnings ([#9080](https://github.com/paritytech/parity-ethereum/pull/9080))
|
* removed EthEngine alias ([#10805](https://github.com/paritytech/parity-ethereum/pull/10805))
|
||||||
- Db: remove wal disabling / fast-and-loose option. ([#8963](https://github.com/paritytech/parity-ethereum/pull/8963))
|
* ethcore-bloom-journal updated to 2018 ([#10804](https://github.com/paritytech/parity-ethereum/pull/10804))
|
||||||
- Transactions hashes missing in trace_replayBlockTransactions method result [#8725](https://github.com/paritytech/parity-ethereum/issues/8725) ([#8883](https://github.com/paritytech/parity-ethereum/pull/8883))
|
* Fix a few typos and unused warnings. ([#10803](https://github.com/paritytech/parity-ethereum/pull/10803))
|
||||||
- Delete crates from parity-ethereum and fetch them from parity-common instead ([#9083](https://github.com/paritytech/parity-ethereum/pull/9083))
|
* updated price-info to edition 2018 ([#10801](https://github.com/paritytech/parity-ethereum/pull/10801))
|
||||||
- Updater verification ([#8787](https://github.com/paritytech/parity-ethereum/pull/8787))
|
* updated parity-local-store to edition 2018 ([#10800](https://github.com/paritytech/parity-ethereum/pull/10800))
|
||||||
- Phrasing, precisions and typos in CLI help ([#9060](https://github.com/paritytech/parity-ethereum/pull/9060))
|
* updated project to ansi_term 0.11 ([#10799](https://github.com/paritytech/parity-ethereum/pull/10799))
|
||||||
- Some work towards iOS build ([#9045](https://github.com/paritytech/parity-ethereum/pull/9045))
|
* ethcore-light uses bincode 1.1 ([#10798](https://github.com/paritytech/parity-ethereum/pull/10798))
|
||||||
- Clean up deprecated options and add CHECK macro ([#9036](https://github.com/paritytech/parity-ethereum/pull/9036))
|
* ethcore-network-devp2p uses igd 0.9 ([#10797](https://github.com/paritytech/parity-ethereum/pull/10797))
|
||||||
- Replace `std::env::home_dir` with `dirs::home_dir` ([#9077](https://github.com/paritytech/parity-ethereum/pull/9077))
|
* Better logging when backfilling ancient blocks fail ([#10796](https://github.com/paritytech/parity-ethereum/pull/10796))
|
||||||
- Fix warning in secret-store test ([#9074](https://github.com/paritytech/parity-ethereum/pull/9074))
|
* added new ropsten-bootnode and removed old one ([#10794](https://github.com/paritytech/parity-ethereum/pull/10794))
|
||||||
- Seedhashcompute remove needless `new` impl ([#9063](https://github.com/paritytech/parity-ethereum/pull/9063))
|
* Removed machine abstraction from ethcore ([#10791](https://github.com/paritytech/parity-ethereum/pull/10791))
|
||||||
- Remove trait bounds from several structs ([#9055](https://github.com/paritytech/parity-ethereum/pull/9055))
|
* Removed redundant ethcore-service error type ([#10788](https://github.com/paritytech/parity-ethereum/pull/10788))
|
||||||
- Docs: add changelog for 1.10.9 stable and 1.11.6 beta ([#9069](https://github.com/paritytech/parity-ethereum/pull/9069))
|
* Cleanup unused vm dependencies ([#10787](https://github.com/paritytech/parity-ethereum/pull/10787))
|
||||||
- Enable test in `miner/pool/test` ([#9072](https://github.com/paritytech/parity-ethereum/pull/9072))
|
* ethkey no longer uses byteorder ([#10786](https://github.com/paritytech/parity-ethereum/pull/10786))
|
||||||
- Fetch: replace futures-timer with tokio-timer ([#9066](https://github.com/paritytech/parity-ethereum/pull/9066))
|
* Updated blooms-db to rust 2018 and removed redundant deps ([#10785](https://github.com/paritytech/parity-ethereum/pull/10785))
|
||||||
- Remove util-error ([#9054](https://github.com/paritytech/parity-ethereum/pull/9054))
|
* Treat empty account the same as non-exist accounts in EIP-1052 ([#10775](https://github.com/paritytech/parity-ethereum/pull/10775))
|
||||||
- Fixes for misbehavior reporting in AuthorityRound ([#8998](https://github.com/paritytech/parity-ethereum/pull/8998))
|
* Do not drop the peer with None difficulty ([#10772](https://github.com/paritytech/parity-ethereum/pull/10772))
|
||||||
- A last bunch of txqueue performance optimizations ([#9024](https://github.com/paritytech/parity-ethereum/pull/9024))
|
* EIP-1702: Generalized Account Versioning Scheme ([#10771](https://github.com/paritytech/parity-ethereum/pull/10771))
|
||||||
- Reduce number of constraints for triedb types ([#9043](https://github.com/paritytech/parity-ethereum/pull/9043))
|
* Move Engine::register_client to be before other I/O handler registration ([#10767](https://github.com/paritytech/parity-ethereum/pull/10767))
|
||||||
- Bump fs-swap to 0.2.3 so it is compatible with osx 10.11 again ([#9050](https://github.com/paritytech/parity-ethereum/pull/9050))
|
* ethcore/res: activate atlantis classic hf on block 8772000 ([#10766](https://github.com/paritytech/parity-ethereum/pull/10766))
|
||||||
- Recursive test ([#9042](https://github.com/paritytech/parity-ethereum/pull/9042))
|
* Updated Bn128PairingImpl to use optimized batch pairing ([#10765](https://github.com/paritytech/parity-ethereum/pull/10765))
|
||||||
- Introduce more optional features in ethcore ([#9020](https://github.com/paritytech/parity-ethereum/pull/9020))
|
* Remove unused code ([#10762](https://github.com/paritytech/parity-ethereum/pull/10762))
|
||||||
- Update ETSC bootnodes ([#9038](https://github.com/paritytech/parity-ethereum/pull/9038))
|
* Initialize private tx logger only if private tx functionality is enabled ([#10758](https://github.com/paritytech/parity-ethereum/pull/10758))
|
||||||
- Optimize pending transactions filter ([#9026](https://github.com/paritytech/parity-ethereum/pull/9026))
|
* SecretStore: remove support of old database formats ([#10757](https://github.com/paritytech/parity-ethereum/pull/10757))
|
||||||
- Eip160/eip161 spec: u64 -> BlockNumber ([#9044](https://github.com/paritytech/parity-ethereum/pull/9044))
|
* Enable aesni ([#10756](https://github.com/paritytech/parity-ethereum/pull/10756))
|
||||||
- Move the C/C++ example to another directory ([#9032](https://github.com/paritytech/parity-ethereum/pull/9032))
|
* updater: fix static id hashes initialization ([#10755](https://github.com/paritytech/parity-ethereum/pull/10755))
|
||||||
- Bump parking_lot to 0.6 ([#9013](https://github.com/paritytech/parity-ethereum/pull/9013))
|
* Use fewer threads for snapshotting ([#10752](https://github.com/paritytech/parity-ethereum/pull/10752))
|
||||||
- Never drop local transactions from different senders. ([#9002](https://github.com/paritytech/parity-ethereum/pull/9002))
|
* Die error_chain, die ([#10747](https://github.com/paritytech/parity-ethereum/pull/10747))
|
||||||
- Precise HTTP or WebSockets for JSON-RPC options ([#9027](https://github.com/paritytech/parity-ethereum/pull/9027))
|
* Fix deprectation warnings on nightly ([#10746](https://github.com/paritytech/parity-ethereum/pull/10746))
|
||||||
- Recently rejected cache for transaction queue ([#9005](https://github.com/paritytech/parity-ethereum/pull/9005))
|
* Improve logging and cleanup in miner around block sealing ([#10745](https://github.com/paritytech/parity-ethereum/pull/10745))
|
||||||
- Make HashDB generic ([#8739](https://github.com/paritytech/parity-ethereum/pull/8739))
|
* Add a way to signal shutdown to snapshotting threads ([#10744](https://github.com/paritytech/parity-ethereum/pull/10744))
|
||||||
- Only return error log for rustls ([#9025](https://github.com/paritytech/parity-ethereum/pull/9025))
|
* fix docker tags for publishing ([#10741](https://github.com/paritytech/parity-ethereum/pull/10741))
|
||||||
- Update Changelogs for 1.10.8 and 1.11.5 ([#9012](https://github.com/paritytech/parity-ethereum/pull/9012))
|
* refactor: Fix indentation in ethjson ([#10740](https://github.com/paritytech/parity-ethereum/pull/10740))
|
||||||
- Attempt to graceful shutdown in case of panics ([#8999](https://github.com/paritytech/parity-ethereum/pull/8999))
|
* Log validator set changes in EpochManager ([#10734](https://github.com/paritytech/parity-ethereum/pull/10734))
|
||||||
- Simplify kvdb error types ([#8924](https://github.com/paritytech/parity-ethereum/pull/8924))
|
* Print warnings when using dangerous settings for ValidatorSet ([#10733](https://github.com/paritytech/parity-ethereum/pull/10733))
|
||||||
- Add option for user to set max size limit for RPC requests ([#9010](https://github.com/paritytech/parity-ethereum/pull/9010))
|
* ethcore: enable ECIP-1054 for classic ([#10731](https://github.com/paritytech/parity-ethereum/pull/10731))
|
||||||
- Bump ntp to 0.5.0 ([#9009](https://github.com/paritytech/parity-ethereum/pull/9009))
|
* Stop breaking out of loop if a non-canonical hash is found ([#10729](https://github.com/paritytech/parity-ethereum/pull/10729))
|
||||||
- Removed duplicate dependency ([#9021](https://github.com/paritytech/parity-ethereum/pull/9021))
|
* Removed secret_store folder ([#10722](https://github.com/paritytech/parity-ethereum/pull/10722))
|
||||||
- Minimal effective gas price in the queue ([#8934](https://github.com/paritytech/parity-ethereum/pull/8934))
|
* Revert "enable lto for release builds (#10717)" ([#10721](https://github.com/paritytech/parity-ethereum/pull/10721))
|
||||||
- Parity: fix db path when migrating to blooms db ([#8975](https://github.com/paritytech/parity-ethereum/pull/8975))
|
* fix: aura don't add `SystemTime::now()` ([#10720](https://github.com/paritytech/parity-ethereum/pull/10720))
|
||||||
- Preserve the current abort behavior ([#8995](https://github.com/paritytech/parity-ethereum/pull/8995))
|
* Use RUSTFLAGS to set the optimization level ([#10719](https://github.com/paritytech/parity-ethereum/pull/10719))
|
||||||
- Improve should_replace on NonceAndGasPrice ([#8980](https://github.com/paritytech/parity-ethereum/pull/8980))
|
* enable lto for release builds ([#10717](https://github.com/paritytech/parity-ethereum/pull/10717))
|
||||||
- Tentative fix for missing dependency error ([#8973](https://github.com/paritytech/parity-ethereum/pull/8973))
|
* [devp2p] Update to 2018 edition ([#10716](https://github.com/paritytech/parity-ethereum/pull/10716))
|
||||||
- Refactor evm Instruction to be a c-like enum ([#8914](https://github.com/paritytech/parity-ethereum/pull/8914))
|
* [devp2p] Don't use `rust-crypto` ([#10714](https://github.com/paritytech/parity-ethereum/pull/10714))
|
||||||
- Fix deadlock in blockchain. ([#8977](https://github.com/paritytech/parity-ethereum/pull/8977))
|
* [devp2p] Fix warnings and re-org imports ([#10710](https://github.com/paritytech/parity-ethereum/pull/10710))
|
||||||
- Snap: downgrade rust to revision 1.26.2, ref snapcraft/+bug/1778530 ([#8984](https://github.com/paritytech/parity-ethereum/pull/8984))
|
* DevP2p: Get node IP address and udp port from Socket, if not included in PING packet ([#10705](https://github.com/paritytech/parity-ethereum/pull/10705))
|
||||||
- Use local parity-dapps-glue instead of crate published at crates.io ([#8983](https://github.com/paritytech/parity-ethereum/pull/8983))
|
* introduce MissingParent Error, fixes #10699 ([#10700](https://github.com/paritytech/parity-ethereum/pull/10700))
|
||||||
- Parity: omit redundant last imported block number in light sync informant ([#8962](https://github.com/paritytech/parity-ethereum/pull/8962))
|
* Refactor Clique stepping ([#10691](https://github.com/paritytech/parity-ethereum/pull/10691))
|
||||||
- Disable hardware-wallets on platforms that don't support `libusb` ([#8464](https://github.com/paritytech/parity-ethereum/pull/8464))
|
* add_sync_notifier in EthPubSubClient holds on to a Client for too long ([#10689](https://github.com/paritytech/parity-ethereum/pull/10689))
|
||||||
- Bump error-chain and quick_error versions ([#8972](https://github.com/paritytech/parity-ethereum/pull/8972))
|
* Fix compiler warning (that will become an error) ([#10683](https://github.com/paritytech/parity-ethereum/pull/10683))
|
||||||
- Evm benchmark utilities ([#8944](https://github.com/paritytech/parity-ethereum/pull/8944))
|
* Don't panic if extra_data is longer than VANITY_LENGTH ([#10682](https://github.com/paritytech/parity-ethereum/pull/10682))
|
||||||
- Parity: hide legacy options from cli --help ([#8967](https://github.com/paritytech/parity-ethereum/pull/8967))
|
* Remove annoying compiler warnings ([#10679](https://github.com/paritytech/parity-ethereum/pull/10679))
|
||||||
- Scripts: fix docker build tag on latest using master ([#8952](https://github.com/paritytech/parity-ethereum/pull/8952))
|
* Remove support for hardware wallets ([#10678](https://github.com/paritytech/parity-ethereum/pull/10678))
|
||||||
- Add type for passwords. ([#8920](https://github.com/paritytech/parity-ethereum/pull/8920))
|
* [CI] allow cargo audit to fail ([#10676](https://github.com/paritytech/parity-ethereum/pull/10676))
|
||||||
- Deps: bump fs-swap ([#8953](https://github.com/paritytech/parity-ethereum/pull/8953))
|
* new image ([#10673](https://github.com/paritytech/parity-ethereum/pull/10673))
|
||||||
- Eliminate some more `transmute()` ([#8879](https://github.com/paritytech/parity-ethereum/pull/8879))
|
* Upgrade ethereum types ([#10670](https://github.com/paritytech/parity-ethereum/pull/10670))
|
||||||
- Restrict vault.json permssion to owner and using random suffix for temp vault.json file ([#8932](https://github.com/paritytech/parity-ethereum/pull/8932))
|
* Reset blockchain properly ([#10669](https://github.com/paritytech/parity-ethereum/pull/10669))
|
||||||
- Print SS.self_public when starting SS node ([#8949](https://github.com/paritytech/parity-ethereum/pull/8949))
|
* fix: Move PR template into .github/ folder ([#10663](https://github.com/paritytech/parity-ethereum/pull/10663))
|
||||||
- Scripts: minor improvements ([#8930](https://github.com/paritytech/parity-ethereum/pull/8930))
|
* docs: evmbin - Update Rust docs ([#10658](https://github.com/paritytech/parity-ethereum/pull/10658))
|
||||||
- Rpc: cap gas limit of local calls ([#8943](https://github.com/paritytech/parity-ethereum/pull/8943))
|
* refactor: Related #9459 - evmbin: replace untyped json! macro with fully typed serde serialization using Rust structs ([#10657](https://github.com/paritytech/parity-ethereum/pull/10657))
|
||||||
- Docs: update changelogs ([#8931](https://github.com/paritytech/parity-ethereum/pull/8931))
|
* docs: Add PR template ([#10654](https://github.com/paritytech/parity-ethereum/pull/10654))
|
||||||
- Ethcore: fix compilation when using slow-blocks or evm-debug features ([#8936](https://github.com/paritytech/parity-ethereum/pull/8936))
|
* docs: Add ProgPoW Rust docs to ethash module ([#10653](https://github.com/paritytech/parity-ethereum/pull/10653))
|
||||||
- Fixed blooms dir creation ([#8941](https://github.com/paritytech/parity-ethereum/pull/8941))
|
* docs: Update Readme with TOC, Contributor Guideline. Update Cargo package descriptions ([#10652](https://github.com/paritytech/parity-ethereum/pull/10652))
|
||||||
- Update hardcoded headers ([#8925](https://github.com/paritytech/parity-ethereum/pull/8925))
|
* Upgrade to parity-crypto 0.4 ([#10650](https://github.com/paritytech/parity-ethereum/pull/10650))
|
||||||
- New blooms database ([#8712](https://github.com/paritytech/parity-ethereum/pull/8712))
|
* fix(compilation warnings) ([#10649](https://github.com/paritytech/parity-ethereum/pull/10649))
|
||||||
- Ethstore: retry deduplication of wallet file names until success ([#8910](https://github.com/paritytech/parity-ethereum/pull/8910))
|
* [whisper] Move needed aes_gcm crypto in-crate ([#10647](https://github.com/paritytech/parity-ethereum/pull/10647))
|
||||||
- Update ropsten.json ([#8926](https://github.com/paritytech/parity-ethereum/pull/8926))
|
* Update publishing ([#10644](https://github.com/paritytech/parity-ethereum/pull/10644))
|
||||||
- Include node identity in the P2P advertised client version. ([#8830](https://github.com/paritytech/parity-ethereum/pull/8830))
|
* ci: publish docs debug ([#10638](https://github.com/paritytech/parity-ethereum/pull/10638))
|
||||||
- Allow disabling local-by-default for transactions with new config entry ([#8882](https://github.com/paritytech/parity-ethereum/pull/8882))
|
* Fix publish docs ([#10635](https://github.com/paritytech/parity-ethereum/pull/10635))
|
||||||
- Allow Poll Lifetime to be configured via CLI ([#8885](https://github.com/paritytech/parity-ethereum/pull/8885))
|
* Fix rinkeby petersburg fork ([#10632](https://github.com/paritytech/parity-ethereum/pull/10632))
|
||||||
- Cleanup nibbleslice ([#8915](https://github.com/paritytech/parity-ethereum/pull/8915))
|
* Update kovan.json to switch Kovan validator set to POA Consensus Contracts ([#10628](https://github.com/paritytech/parity-ethereum/pull/10628))
|
||||||
- Hardware-wallets `Clean up things I missed in the latest PR` ([#8890](https://github.com/paritytech/parity-ethereum/pull/8890))
|
* [ethcore] remove error_chain ([#10616](https://github.com/paritytech/parity-ethereum/pull/10616))
|
||||||
- Remove debian/.deb and centos/.rpm packaging scripts ([#8887](https://github.com/paritytech/parity-ethereum/pull/8887))
|
* Remove unused import ([#10615](https://github.com/paritytech/parity-ethereum/pull/10615))
|
||||||
- Remove a weird emoji in new_social docs ([#8913](https://github.com/paritytech/parity-ethereum/pull/8913))
|
* Adds parity_getRawBlockByNumber, parity_submitRawBlock ([#10609](https://github.com/paritytech/parity-ethereum/pull/10609))
|
||||||
- Minor fix in chain supplier and light provider ([#8906](https://github.com/paritytech/parity-ethereum/pull/8906))
|
* adds rpc error message for --no-ancient-blocks ([#10608](https://github.com/paritytech/parity-ethereum/pull/10608))
|
||||||
- Block 0 is valid in queries ([#8891](https://github.com/paritytech/parity-ethereum/pull/8891))
|
* Constantinople HF on POA Core ([#10606](https://github.com/paritytech/parity-ethereum/pull/10606))
|
||||||
- Fixed osx permissions ([#8901](https://github.com/paritytech/parity-ethereum/pull/8901))
|
* Clique: zero-fill extradata when the supplied value is less than 32 bytes in length ([#10605](https://github.com/paritytech/parity-ethereum/pull/10605))
|
||||||
- Atomic create new files with permissions to owner in ethstore ([#8896](https://github.com/paritytech/parity-ethereum/pull/8896))
|
* evm: add some mulmod benches ([#10600](https://github.com/paritytech/parity-ethereum/pull/10600))
|
||||||
- Add ETC Cooperative-run load balanced parity node ([#8892](https://github.com/paritytech/parity-ethereum/pull/8892))
|
* sccache logs to stdout ([#10596](https://github.com/paritytech/parity-ethereum/pull/10596))
|
||||||
- Add support for --chain tobalaba ([#8870](https://github.com/paritytech/parity-ethereum/pull/8870))
|
* update bootnodes ([#10595](https://github.com/paritytech/parity-ethereum/pull/10595))
|
||||||
- Fix some warns on nightly ([#8889](https://github.com/paritytech/parity-ethereum/pull/8889))
|
* Merge `Notifier` and `TransactionsPoolNotifier` ([#10591](https://github.com/paritytech/parity-ethereum/pull/10591))
|
||||||
- Add new ovh bootnodes and fix port for foundation bootnode 3.2 ([#8886](https://github.com/paritytech/parity-ethereum/pull/8886))
|
* fix(whisper): change expiry `unix_time + ttl + work` ([#10587](https://github.com/paritytech/parity-ethereum/pull/10587))
|
||||||
- Secretstore: service pack 1 ([#8435](https://github.com/paritytech/parity-ethereum/pull/8435))
|
* fix(evmbin): make benches compile again ([#10586](https://github.com/paritytech/parity-ethereum/pull/10586))
|
||||||
- Handle removed logs in filter changes and add geth compatibility field ([#8796](https://github.com/paritytech/parity-ethereum/pull/8796))
|
* fix issue with compilation when 'slow-blocks' feature enabled ([#10585](https://github.com/paritytech/parity-ethereum/pull/10585))
|
||||||
- Fixed ipc leak, closes [#8774](https://github.com/paritytech/parity-ethereum/issues/8774) ([#8876](https://github.com/paritytech/parity-ethereum/pull/8876))
|
* Allow CORS requests in Secret Store API ([#10584](https://github.com/paritytech/parity-ethereum/pull/10584))
|
||||||
- Scripts: remove md5 checksums ([#8884](https://github.com/paritytech/parity-ethereum/pull/8884))
|
* CI improvements ([#10579](https://github.com/paritytech/parity-ethereum/pull/10579))
|
||||||
- Hardware_wallet/Ledger `Sign messages` + some refactoring ([#8868](https://github.com/paritytech/parity-ethereum/pull/8868))
|
* ethcore: improve timestamp handling ([#10574](https://github.com/paritytech/parity-ethereum/pull/10574))
|
||||||
- Check whether we need resealing in miner and unwrap has_account in account_provider ([#8853](https://github.com/paritytech/parity-ethereum/pull/8853))
|
* Update Issue Template to direct security issue to email ([#10562](https://github.com/paritytech/parity-ethereum/pull/10562))
|
||||||
- Docker: Fix alpine build ([#8878](https://github.com/paritytech/parity-ethereum/pull/8878))
|
* version: bump master to 2.6 ([#10560](https://github.com/paritytech/parity-ethereum/pull/10560))
|
||||||
- Remove mac os installers etc ([#8875](https://github.com/paritytech/parity-ethereum/pull/8875))
|
* fix(light cull): poll light cull instead of timer ([#10559](https://github.com/paritytech/parity-ethereum/pull/10559))
|
||||||
- Readme.md: update the list of dependencies ([#8864](https://github.com/paritytech/parity-ethereum/pull/8864))
|
* Watch transactions pool ([#10558](https://github.com/paritytech/parity-ethereum/pull/10558))
|
||||||
- Fix concurrent access to signer queue ([#8854](https://github.com/paritytech/parity-ethereum/pull/8854))
|
* Add SealingState; don't prepare block when not ready. ([#10529](https://github.com/paritytech/parity-ethereum/pull/10529))
|
||||||
- Tx permission contract improvement ([#8400](https://github.com/paritytech/parity-ethereum/pull/8400))
|
* Explicitly enable or disable Stratum in config file (Issue 9785) ([#10521](https://github.com/paritytech/parity-ethereum/pull/10521))
|
||||||
- Limit the number of transactions in pending set ([#8777](https://github.com/paritytech/parity-ethereum/pull/8777))
|
* Add filtering capability to `parity_pendingTransactions` (issue 8269) ([#10506](https://github.com/paritytech/parity-ethereum/pull/10506))
|
||||||
- Use sealing.enabled to emit eth_mining information ([#8844](https://github.com/paritytech/parity-ethereum/pull/8844))
|
* Remove calls to heapsize ([#10432](https://github.com/paritytech/parity-ethereum/pull/10432))
|
||||||
- Don't allocate in expect_valid_rlp unless necessary ([#8867](https://github.com/paritytech/parity-ethereum/pull/8867))
|
* RPC: Implements eth_subscribe("syncing") ([#10311](https://github.com/paritytech/parity-ethereum/pull/10311))
|
||||||
- Fix Cli Return Code on --help for ethkey, ethstore & whisper ([#8863](https://github.com/paritytech/parity-ethereum/pull/8863))
|
* SecretStore: non-blocking wait of session completion ([#10303](https://github.com/paritytech/parity-ethereum/pull/10303))
|
||||||
- Fix subcrate test compile ([#8862](https://github.com/paritytech/parity-ethereum/pull/8862))
|
* Node table limiting and cache for node filter ([#10288](https://github.com/paritytech/parity-ethereum/pull/10288))
|
||||||
- Network-devp2p: downgrade logging to debug, add target ([#8784](https://github.com/paritytech/parity-ethereum/pull/8784))
|
* SecretStore: expose restore_key_public in HTTP API ([#10241](https://github.com/paritytech/parity-ethereum/pull/10241))
|
||||||
- Clearing up a comment about the prefix for signing ([#8828](https://github.com/paritytech/parity-ethereum/pull/8828))
|
* Trivial journal for private transactions ([#10056](https://github.com/paritytech/parity-ethereum/pull/10056))
|
||||||
- Disable parallel verification and skip verifiying already imported txs. ([#8834](https://github.com/paritytech/parity-ethereum/pull/8834))
|
|
||||||
- Devp2p: Move UDP socket handling from Discovery to Host. ([#8790](https://github.com/paritytech/parity-ethereum/pull/8790))
|
|
||||||
- Fixed AuthorityRound deadlock on shutdown, closes [#8088](https://github.com/paritytech/parity-ethereum/issues/8088) ([#8803](https://github.com/paritytech/parity-ethereum/pull/8803))
|
|
||||||
- Specify critical release flag per network ([#8821](https://github.com/paritytech/parity-ethereum/pull/8821))
|
|
||||||
- Fix `deadlock_detection` feature branch compilation ([#8824](https://github.com/paritytech/parity-ethereum/pull/8824))
|
|
||||||
- Use system allocator when profiling memory ([#8831](https://github.com/paritytech/parity-ethereum/pull/8831))
|
|
||||||
- Added from and to to Receipt ([#8756](https://github.com/paritytech/parity-ethereum/pull/8756))
|
|
||||||
- Ethcore: fix ancient block error msg handling ([#8832](https://github.com/paritytech/parity-ethereum/pull/8832))
|
|
||||||
- Ci: Fix docker tags ([#8822](https://github.com/paritytech/parity-ethereum/pull/8822))
|
|
||||||
- Parity: fix indentation in sync logging ([#8794](https://github.com/paritytech/parity-ethereum/pull/8794))
|
|
||||||
- Removed obsolete IpcMode enum ([#8819](https://github.com/paritytech/parity-ethereum/pull/8819))
|
|
||||||
- Remove UI related settings from CLI ([#8783](https://github.com/paritytech/parity-ethereum/pull/8783))
|
|
||||||
- Remove windows tray and installer ([#8778](https://github.com/paritytech/parity-ethereum/pull/8778))
|
|
||||||
- Docs: add changelogs for 1.10.6 and 1.11.3 ([#8810](https://github.com/paritytech/parity-ethereum/pull/8810))
|
|
||||||
- Fix ancient blocks queue deadlock ([#8751](https://github.com/paritytech/parity-ethereum/pull/8751))
|
|
||||||
- Disallow unsigned transactions in case EIP-86 is disabled ([#8802](https://github.com/paritytech/parity-ethereum/pull/8802))
|
|
||||||
- Fix evmbin compilation ([#8795](https://github.com/paritytech/parity-ethereum/pull/8795))
|
|
||||||
- Have space between feature cfg flag ([#8791](https://github.com/paritytech/parity-ethereum/pull/8791))
|
|
||||||
- Rpc: fix address formatting in TransactionRequest Display ([#8786](https://github.com/paritytech/parity-ethereum/pull/8786))
|
|
||||||
- Conditionally compile ethcore public test helpers ([#8743](https://github.com/paritytech/parity-ethereum/pull/8743))
|
|
||||||
- Remove Result wrapper from AccountProvider in RPC impls ([#8763](https://github.com/paritytech/parity-ethereum/pull/8763))
|
|
||||||
- Update `license header` and `scripts` ([#8666](https://github.com/paritytech/parity-ethereum/pull/8666))
|
|
||||||
- Remove HostTrait altogether ([#8681](https://github.com/paritytech/parity-ethereum/pull/8681))
|
|
||||||
- Ethcore-sync: fix connection to peers behind chain fork block ([#8710](https://github.com/paritytech/parity-ethereum/pull/8710))
|
|
||||||
- Remove public node settings from cli ([#8758](https://github.com/paritytech/parity-ethereum/pull/8758))
|
|
||||||
- Custom Error Messages on ENFILE and EMFILE IO Errors ([#8744](https://github.com/paritytech/parity-ethereum/pull/8744))
|
|
||||||
- Ci: Fixes for Android Pipeline ([#8745](https://github.com/paritytech/parity-ethereum/pull/8745))
|
|
||||||
- Remove NetworkService::config() ([#8653](https://github.com/paritytech/parity-ethereum/pull/8653))
|
|
||||||
- Fix XOR distance calculation in discovery Kademlia impl ([#8589](https://github.com/paritytech/parity-ethereum/pull/8589))
|
|
||||||
- Print warnings when fetching pending blocks ([#8711](https://github.com/paritytech/parity-ethereum/pull/8711))
|
|
||||||
- Fix PoW blockchains sealing notifications in chain_new_blocks ([#8656](https://github.com/paritytech/parity-ethereum/pull/8656))
|
|
||||||
- Remove -k/--insecure option from curl installer ([#8719](https://github.com/paritytech/parity-ethereum/pull/8719))
|
|
||||||
- Ease tiny-keccak version requirements (1.4.1 -> 1.4) ([#8726](https://github.com/paritytech/parity-ethereum/pull/8726))
|
|
||||||
- Bump tinykeccak to 1.4 ([#8728](https://github.com/paritytech/parity-ethereum/pull/8728))
|
|
||||||
- Remove a couple of unnecessary `transmute()` ([#8736](https://github.com/paritytech/parity-ethereum/pull/8736))
|
|
||||||
- Fix some nits using clippy ([#8731](https://github.com/paritytech/parity-ethereum/pull/8731))
|
|
||||||
- Add 'interface' option to cli ([#8699](https://github.com/paritytech/parity-ethereum/pull/8699))
|
|
||||||
- Remove unused function new_pow_test_spec ([#8735](https://github.com/paritytech/parity-ethereum/pull/8735))
|
|
||||||
- Add a deadlock detection thread ([#8727](https://github.com/paritytech/parity-ethereum/pull/8727))
|
|
||||||
- Fix local transactions policy. ([#8691](https://github.com/paritytech/parity-ethereum/pull/8691))
|
|
||||||
- Shutdown the Snapshot Service early ([#8658](https://github.com/paritytech/parity-ethereum/pull/8658))
|
|
||||||
- Network-devp2p: handle UselessPeer disconnect ([#8686](https://github.com/paritytech/parity-ethereum/pull/8686))
|
|
||||||
- Fix compilation error on nightly rust ([#8707](https://github.com/paritytech/parity-ethereum/pull/8707))
|
|
||||||
- Add a test for decoding corrupt data ([#8713](https://github.com/paritytech/parity-ethereum/pull/8713))
|
|
||||||
- Update dev chain ([#8717](https://github.com/paritytech/parity-ethereum/pull/8717))
|
|
||||||
- Remove unused imports ([#8722](https://github.com/paritytech/parity-ethereum/pull/8722))
|
|
||||||
- Implement recursive Debug for Nodes in patrica_trie::TrieDB ([#8697](https://github.com/paritytech/parity-ethereum/pull/8697))
|
|
||||||
- Parity: trim whitespace when parsing duration strings ([#8692](https://github.com/paritytech/parity-ethereum/pull/8692))
|
|
||||||
- Set the request index to that of the current request ([#8683](https://github.com/paritytech/parity-ethereum/pull/8683))
|
|
||||||
- Remove empty file ([#8705](https://github.com/paritytech/parity-ethereum/pull/8705))
|
|
||||||
- Update mod.rs ([#8695](https://github.com/paritytech/parity-ethereum/pull/8695))
|
|
||||||
- Use impl Future in the light client RPC helpers ([#8628](https://github.com/paritytech/parity-ethereum/pull/8628))
|
|
||||||
- Fix cli signer ([#8682](https://github.com/paritytech/parity-ethereum/pull/8682))
|
|
||||||
- Allow making direct RPC queries from the C API ([#8588](https://github.com/paritytech/parity-ethereum/pull/8588))
|
|
||||||
- Remove the error when stopping the network ([#8671](https://github.com/paritytech/parity-ethereum/pull/8671))
|
|
||||||
- Move connection_filter to the network crate ([#8674](https://github.com/paritytech/parity-ethereum/pull/8674))
|
|
||||||
- Remove HostInfo::client_version() and secret() ([#8677](https://github.com/paritytech/parity-ethereum/pull/8677))
|
|
||||||
- Refactor EIP150, EIP160 and EIP161 forks to be specified in CommonParams ([#8614](https://github.com/paritytech/parity-ethereum/pull/8614))
|
|
||||||
- Parity: improve cli help and logging ([#8665](https://github.com/paritytech/parity-ethereum/pull/8665))
|
|
||||||
- Updated tiny-keccak to 1.4.2 ([#8669](https://github.com/paritytech/parity-ethereum/pull/8669))
|
|
||||||
- Remove the Keccak C library and use the pure Rust impl ([#8657](https://github.com/paritytech/parity-ethereum/pull/8657))
|
|
||||||
- Remove HostInfo::next_nonce ([#8644](https://github.com/paritytech/parity-ethereum/pull/8644))
|
|
||||||
- Fix not downloading old blocks ([#8642](https://github.com/paritytech/parity-ethereum/pull/8642))
|
|
||||||
- Resumable warp-sync / Seed downloaded snapshots ([#8544](https://github.com/paritytech/parity-ethereum/pull/8544))
|
|
||||||
- Don't open Browser post-install on Mac ([#8641](https://github.com/paritytech/parity-ethereum/pull/8641))
|
|
||||||
- Changelog for 1.10.4-stable and 1.11.1-beta ([#8637](https://github.com/paritytech/parity-ethereum/pull/8637))
|
|
||||||
- Typo ([#8640](https://github.com/paritytech/parity-ethereum/pull/8640))
|
|
||||||
- Fork choice and metadata framework for Engine ([#8401](https://github.com/paritytech/parity-ethereum/pull/8401))
|
|
||||||
- Check that the Android build doesn't dep on c++_shared ([#8538](https://github.com/paritytech/parity-ethereum/pull/8538))
|
|
||||||
- Remove NetworkContext::io_channel() ([#8625](https://github.com/paritytech/parity-ethereum/pull/8625))
|
|
||||||
- Fix light sync with initial validator-set contract ([#8528](https://github.com/paritytech/parity-ethereum/pull/8528))
|
|
||||||
- Store morden db and keys in "path/to/parity/data/Morden" (ropsten uses "test", like before) ([#8621](https://github.com/paritytech/parity-ethereum/pull/8621))
|
|
||||||
- ´main.rs´ typo ([#8629](https://github.com/paritytech/parity-ethereum/pull/8629))
|
|
||||||
- Fix BlockReward contract "arithmetic operation overflow" ([#8611](https://github.com/paritytech/parity-ethereum/pull/8611))
|
|
||||||
- Gitlab test script fixes ([#8573](https://github.com/paritytech/parity-ethereum/pull/8573))
|
|
||||||
- Remove manually added text to the errors ([#8595](https://github.com/paritytech/parity-ethereum/pull/8595))
|
|
||||||
- Fix account list double 0x display ([#8596](https://github.com/paritytech/parity-ethereum/pull/8596))
|
|
||||||
- Typo: wrong indentation in kovan config ([#8610](https://github.com/paritytech/parity-ethereum/pull/8610))
|
|
||||||
- Fix packet count when talking with PAR2 peers ([#8555](https://github.com/paritytech/parity-ethereum/pull/8555))
|
|
||||||
- Use full qualified syntax for itertools::Itertools::flatten ([#8606](https://github.com/paritytech/parity-ethereum/pull/8606))
|
|
||||||
- 2 tiny modification on snapshot ([#8601](https://github.com/paritytech/parity-ethereum/pull/8601))
|
|
||||||
- Fix the mio test again ([#8602](https://github.com/paritytech/parity-ethereum/pull/8602))
|
|
||||||
- Remove inject.js server-side injection for dapps ([#8539](https://github.com/paritytech/parity-ethereum/pull/8539))
|
|
||||||
- Block_header can fail so return Result ([#8581](https://github.com/paritytech/parity-ethereum/pull/8581))
|
|
||||||
- Block::decode() returns Result ([#8586](https://github.com/paritytech/parity-ethereum/pull/8586))
|
|
||||||
- Fix compiler warning ([#8590](https://github.com/paritytech/parity-ethereum/pull/8590))
|
|
||||||
- Fix Parity UI link ([#8600](https://github.com/paritytech/parity-ethereum/pull/8600))
|
|
||||||
- Make mio optional in ethcore-io ([#8537](https://github.com/paritytech/parity-ethereum/pull/8537))
|
|
||||||
- Attempt to fix intermittent test failures ([#8584](https://github.com/paritytech/parity-ethereum/pull/8584))
|
|
||||||
- Changelog and Readme ([#8591](https://github.com/paritytech/parity-ethereum/pull/8591))
|
|
||||||
- Added Dockerfile for alpine linux by @andresilva, closes [#3565](https://github.com/paritytech/parity-ethereum/issues/3565) ([#8587](https://github.com/paritytech/parity-ethereum/pull/8587))
|
|
||||||
- Add whisper CLI to the pipelines ([#8578](https://github.com/paritytech/parity-ethereum/pull/8578))
|
|
||||||
- Rename `whisper-cli binary` to `whisper` ([#8579](https://github.com/paritytech/parity-ethereum/pull/8579))
|
|
||||||
- Changelog nit ([#8585](https://github.com/paritytech/parity-ethereum/pull/8585))
|
|
||||||
- Remove unnecessary cloning in overwrite_with ([#8580](https://github.com/paritytech/parity-ethereum/pull/8580))
|
|
||||||
- Handle socket address parsing errors ([#8545](https://github.com/paritytech/parity-ethereum/pull/8545))
|
|
||||||
- Update CHANGELOG for 1.9, 1.10, and 1.11 ([#8556](https://github.com/paritytech/parity-ethereum/pull/8556))
|
|
||||||
- Decoding headers can fail ([#8570](https://github.com/paritytech/parity-ethereum/pull/8570))
|
|
||||||
- Refactoring `ethcore-sync` - Fixing warp-sync barrier ([#8543](https://github.com/paritytech/parity-ethereum/pull/8543))
|
|
||||||
- Remove State::replace_backend ([#8569](https://github.com/paritytech/parity-ethereum/pull/8569))
|
|
||||||
- Make trace-time publishable. ([#8568](https://github.com/paritytech/parity-ethereum/pull/8568))
|
|
||||||
- Don't block sync when importing old blocks ([#8530](https://github.com/paritytech/parity-ethereum/pull/8530))
|
|
||||||
- Trace precompiled contracts when the transfer value is not zero ([#8486](https://github.com/paritytech/parity-ethereum/pull/8486))
|
|
||||||
- Parity as a library ([#8412](https://github.com/paritytech/parity-ethereum/pull/8412))
|
|
||||||
- Rlp decode returns Result ([#8527](https://github.com/paritytech/parity-ethereum/pull/8527))
|
|
||||||
- Node table sorting according to last contact data ([#8541](https://github.com/paritytech/parity-ethereum/pull/8541))
|
|
||||||
- Keep all enacted blocks notify in order ([#8524](https://github.com/paritytech/parity-ethereum/pull/8524))
|
|
||||||
- Ethcore, rpc, machine: refactor block reward application and tracing ([#8490](https://github.com/paritytech/parity-ethereum/pull/8490))
|
|
||||||
- Consolidate crypto functionality in `ethcore-crypto`. ([#8432](https://github.com/paritytech/parity-ethereum/pull/8432))
|
|
||||||
- Eip 145: Bitwise shifting instructions in EVM ([#8451](https://github.com/paritytech/parity-ethereum/pull/8451))
|
|
||||||
- Remove expect ([#8536](https://github.com/paritytech/parity-ethereum/pull/8536))
|
|
||||||
- Don't panic in import_block if invalid rlp ([#8522](https://github.com/paritytech/parity-ethereum/pull/8522))
|
|
||||||
- Pass on storage keys tracing to handle the case when it is not modified ([#8491](https://github.com/paritytech/parity-ethereum/pull/8491))
|
|
||||||
- Fetching logs by hash in blockchain database ([#8463](https://github.com/paritytech/parity-ethereum/pull/8463))
|
|
||||||
- Transaction Pool improvements ([#8470](https://github.com/paritytech/parity-ethereum/pull/8470))
|
|
||||||
- More changes for Android ([#8421](https://github.com/paritytech/parity-ethereum/pull/8421))
|
|
||||||
- Enable WebAssembly and Byzantium for Ellaism ([#8520](https://github.com/paritytech/parity-ethereum/pull/8520))
|
|
||||||
- Secretstore: merge two types of errors into single one + Error::is_non_fatal ([#8357](https://github.com/paritytech/parity-ethereum/pull/8357))
|
|
||||||
- Hardware Wallet trait ([#8071](https://github.com/paritytech/parity-ethereum/pull/8071))
|
|
||||||
- Directly return None if tracing is disabled ([#8504](https://github.com/paritytech/parity-ethereum/pull/8504))
|
|
||||||
- Show imported messages for light client ([#8517](https://github.com/paritytech/parity-ethereum/pull/8517))
|
|
||||||
- Remove unused dependency `bigint` ([#8505](https://github.com/paritytech/parity-ethereum/pull/8505))
|
|
||||||
- `duration_ns: u64 -> duration: Duration` ([#8457](https://github.com/paritytech/parity-ethereum/pull/8457))
|
|
||||||
- Return error if RLP size of transaction exceeds the limit ([#8473](https://github.com/paritytech/parity-ethereum/pull/8473))
|
|
||||||
- Remove three old warp boot nodes. ([#8497](https://github.com/paritytech/parity-ethereum/pull/8497))
|
|
||||||
- Update wasmi and pwasm-utils ([#8493](https://github.com/paritytech/parity-ethereum/pull/8493))
|
|
||||||
- Update hardcodedSync for Ethereum, Kovan, and Ropsten ([#8489](https://github.com/paritytech/parity-ethereum/pull/8489))
|
|
||||||
- Fix snap builds ([#8483](https://github.com/paritytech/parity-ethereum/pull/8483))
|
|
||||||
- Bump master to 1.12 ([#8477](https://github.com/paritytech/parity-ethereum/pull/8477))
|
|
||||||
- Don't require write lock when fetching status. ([#8481](https://github.com/paritytech/parity-ethereum/pull/8481))
|
|
||||||
- Use rename_all for RichBlock and RichHeader serialization ([#8471](https://github.com/paritytech/parity-ethereum/pull/8471))
|
|
||||||
|
|
||||||
## Previous releases
|
## Previous releases
|
||||||
|
|
||||||
- [CHANGELOG-1.11](docs/CHANGELOG-1.11.md) (_stable_)
|
- [CHANGELOG-2.5](docs/CHANGELOG-2.5.md) (_stable_)
|
||||||
|
- [CHANGELOG-2.4](docs/CHANGELOG-2.4.md) (EOL: 2019-07-08)
|
||||||
|
- [CHANGELOG-2.3](docs/CHANGELOG-2.3.md) (EOL: 2019-04-09)
|
||||||
|
- [CHANGELOG-2.2](docs/CHANGELOG-2.2.md) (EOL: 2019-02-25)
|
||||||
|
- [CHANGELOG-2.1](docs/CHANGELOG-2.1.md) (EOL: 2019-01-16)
|
||||||
|
- [CHANGELOG-2.0](docs/CHANGELOG-2.0.md) (EOL: 2018-11-15)
|
||||||
|
- [CHANGELOG-1.11](docs/CHANGELOG-1.11.md) (EOL: 2018-09-19)
|
||||||
- [CHANGELOG-1.10](docs/CHANGELOG-1.10.md) (EOL: 2018-07-18)
|
- [CHANGELOG-1.10](docs/CHANGELOG-1.10.md) (EOL: 2018-07-18)
|
||||||
- [CHANGELOG-1.9](docs/CHANGELOG-1.9.md) (EOL: 2018-05-09)
|
- [CHANGELOG-1.9](docs/CHANGELOG-1.9.md) (EOL: 2018-05-09)
|
||||||
- [CHANGELOG-1.8](docs/CHANGELOG-1.8.md) (EOL: 2018-03-22)
|
- [CHANGELOG-1.8](docs/CHANGELOG-1.8.md) (EOL: 2018-03-22)
|
||||||
|
|||||||
3934
Cargo.lock
generated
3934
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
79
Cargo.toml
79
Cargo.toml
@@ -2,16 +2,15 @@
|
|||||||
description = "Parity Ethereum client"
|
description = "Parity Ethereum client"
|
||||||
name = "parity-ethereum"
|
name = "parity-ethereum"
|
||||||
# NOTE Make sure to update util/version/Cargo.toml as well
|
# NOTE Make sure to update util/version/Cargo.toml as well
|
||||||
version = "2.1.0"
|
version = "2.6.3"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
blooms-db = { path = "util/blooms-db" }
|
blooms-db = { path = "util/blooms-db" }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
env_logger = "0.5"
|
|
||||||
rustc-hex = "1.0"
|
rustc-hex = "1.0"
|
||||||
docopt = "0.8"
|
docopt = "1.0"
|
||||||
clap = "2"
|
clap = "2"
|
||||||
term_size = "0.3"
|
term_size = "0.3"
|
||||||
textwrap = "0.9"
|
textwrap = "0.9"
|
||||||
@@ -19,57 +18,62 @@ num_cpus = "1.2"
|
|||||||
number_prefix = "0.2"
|
number_prefix = "0.2"
|
||||||
rpassword = "1.0"
|
rpassword = "1.0"
|
||||||
semver = "0.9"
|
semver = "0.9"
|
||||||
ansi_term = "0.10"
|
ansi_term = "0.11"
|
||||||
parking_lot = "0.6"
|
parking_lot = "0.7"
|
||||||
regex = "0.2"
|
regex = "1.0"
|
||||||
atty = "0.2.8"
|
atty = "0.2.8"
|
||||||
toml = "0.4"
|
toml = "0.4"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
futures = "0.1"
|
futures = "0.1"
|
||||||
futures-cpupool = "0.1"
|
|
||||||
fdlimit = "0.1"
|
fdlimit = "0.1"
|
||||||
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
|
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
|
||||||
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
|
jsonrpc-core = "12.0.0"
|
||||||
ethcore = { path = "ethcore", features = ["parity"] }
|
|
||||||
parity-bytes = "0.1"
|
parity-bytes = "0.1"
|
||||||
|
common-types = { path = "ethcore/types" }
|
||||||
|
ethcore = { path = "ethcore", features = ["parity"] }
|
||||||
|
ethcore-accounts = { path = "accounts", optional = true }
|
||||||
|
ethcore-blockchain = { path = "ethcore/blockchain" }
|
||||||
|
ethcore-call-contract = { path = "ethcore/call-contract"}
|
||||||
|
ethcore-db = { path = "ethcore/db" }
|
||||||
ethcore-io = { path = "util/io" }
|
ethcore-io = { path = "util/io" }
|
||||||
ethcore-light = { path = "ethcore/light" }
|
ethcore-light = { path = "ethcore/light" }
|
||||||
ethcore-logger = { path = "logger" }
|
ethcore-logger = { path = "parity/logger" }
|
||||||
ethcore-miner = { path = "miner" }
|
ethcore-miner = { path = "miner" }
|
||||||
ethcore-network = { path = "util/network" }
|
ethcore-network = { path = "util/network" }
|
||||||
ethcore-private-tx = { path = "ethcore/private-tx" }
|
ethcore-private-tx = { path = "ethcore/private-tx" }
|
||||||
ethcore-service = { path = "ethcore/service" }
|
ethcore-service = { path = "ethcore/service" }
|
||||||
ethcore-sync = { path = "ethcore/sync" }
|
ethcore-sync = { path = "ethcore/sync" }
|
||||||
ethcore-transaction = { path = "ethcore/transaction" }
|
ethereum-types = "0.6.0"
|
||||||
ethereum-types = "0.4"
|
ethkey = { path = "accounts/ethkey" }
|
||||||
node-filter = { path = "ethcore/node_filter" }
|
ethstore = { path = "accounts/ethstore" }
|
||||||
ethkey = { path = "ethkey" }
|
node-filter = { path = "ethcore/node-filter" }
|
||||||
rlp = { version = "0.2.4", features = ["ethereum"] }
|
rlp = "0.4.0"
|
||||||
rpc-cli = { path = "rpc_cli" }
|
cli-signer= { path = "cli-signer" }
|
||||||
parity-hash-fetch = { path = "hash-fetch" }
|
parity-daemonize = "0.3"
|
||||||
|
parity-hash-fetch = { path = "updater/hash-fetch" }
|
||||||
parity-ipfs-api = { path = "ipfs" }
|
parity-ipfs-api = { path = "ipfs" }
|
||||||
parity-local-store = { path = "local-store" }
|
parity-local-store = { path = "miner/local-store" }
|
||||||
parity-reactor = { path = "util/reactor" }
|
parity-runtime = { path = "util/runtime" }
|
||||||
parity-rpc = { path = "rpc" }
|
parity-rpc = { path = "rpc" }
|
||||||
parity-rpc-client = { path = "rpc_client" }
|
|
||||||
parity-updater = { path = "updater" }
|
parity-updater = { path = "updater" }
|
||||||
parity-version = { path = "util/version" }
|
parity-version = { path = "util/version" }
|
||||||
parity-whisper = { path = "whisper" }
|
parity-whisper = { path = "whisper" }
|
||||||
parity-path = "0.1"
|
parity-path = "0.1"
|
||||||
dir = { path = "util/dir" }
|
dir = { path = "util/dir" }
|
||||||
panic_hook = { path = "util/panic_hook" }
|
panic_hook = { path = "util/panic-hook" }
|
||||||
keccak-hash = "0.1"
|
keccak-hash = "0.2.0"
|
||||||
migration-rocksdb = { path = "util/migration-rocksdb" }
|
migration-rocksdb = { path = "util/migration-rocksdb" }
|
||||||
kvdb = "0.1"
|
kvdb = "0.1"
|
||||||
kvdb-rocksdb = "0.1.3"
|
kvdb-rocksdb = "0.1.3"
|
||||||
journaldb = { path = "util/journaldb" }
|
journaldb = { path = "util/journaldb" }
|
||||||
mem = { path = "util/mem" }
|
|
||||||
|
|
||||||
ethcore-secretstore = { path = "secret_store", optional = true }
|
ethcore-secretstore = { path = "secret-store", optional = true }
|
||||||
|
|
||||||
registrar = { path = "registrar" }
|
registrar = { path = "util/registrar" }
|
||||||
|
|
||||||
|
parity-util-mem = { version = "0.1", features = ["jemalloc-global"] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
rustc_version = "0.2"
|
rustc_version = "0.2"
|
||||||
@@ -83,17 +87,17 @@ fake-fetch = { path = "util/fake-fetch" }
|
|||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
winapi = { version = "0.3.4", features = ["winsock2", "winuser", "shellapi"] }
|
winapi = { version = "0.3.4", features = ["winsock2", "winuser", "shellapi"] }
|
||||||
|
|
||||||
[target.'cfg(not(windows))'.dependencies]
|
|
||||||
daemonize = { git = "https://github.com/paritytech/daemonize" }
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
default = ["accounts"]
|
||||||
|
accounts = ["ethcore-accounts", "parity-rpc/accounts"]
|
||||||
miner-debug = ["ethcore/miner-debug"]
|
miner-debug = ["ethcore/miner-debug"]
|
||||||
json-tests = ["ethcore/json-tests"]
|
json-tests = ["ethcore/json-tests"]
|
||||||
|
ci-skip-tests = ["ethcore/ci-skip-tests"]
|
||||||
test-heavy = ["ethcore/test-heavy"]
|
test-heavy = ["ethcore/test-heavy"]
|
||||||
evm-debug = ["ethcore/evm-debug"]
|
evm-debug = ["ethcore/evm-debug"]
|
||||||
evm-debug-tests = ["ethcore/evm-debug-tests"]
|
evm-debug-tests = ["ethcore/evm-debug-tests"]
|
||||||
slow-blocks = ["ethcore/slow-blocks"]
|
slow-blocks = ["ethcore/slow-blocks"]
|
||||||
secretstore = ["ethcore-secretstore"]
|
secretstore = ["ethcore-secretstore", "ethcore-secretstore/accounts"]
|
||||||
final = ["parity-version/final"]
|
final = ["parity-version/final"]
|
||||||
deadlock_detection = ["parking_lot/deadlock_detection"]
|
deadlock_detection = ["parking_lot/deadlock_detection"]
|
||||||
# to create a memory profile (requires nightly rust), use e.g.
|
# to create a memory profile (requires nightly rust), use e.g.
|
||||||
@@ -115,28 +119,25 @@ path = "parity/lib.rs"
|
|||||||
path = "parity/main.rs"
|
path = "parity/main.rs"
|
||||||
name = "parity"
|
name = "parity"
|
||||||
|
|
||||||
[profile.dev]
|
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
debug = false
|
debug = false
|
||||||
|
lto = true
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
# This should only list projects that are not
|
||||||
|
# in the dependency tree in any other way
|
||||||
|
# (i.e. pretty much only standalone CLI tools)
|
||||||
members = [
|
members = [
|
||||||
|
"accounts/ethkey/cli",
|
||||||
|
"accounts/ethstore/cli",
|
||||||
"chainspec",
|
"chainspec",
|
||||||
"ethcore/wasm/run",
|
"ethcore/wasm/run",
|
||||||
"ethcore/types",
|
|
||||||
"ethkey/cli",
|
|
||||||
"ethstore/cli",
|
|
||||||
"evmbin",
|
"evmbin",
|
||||||
"miner",
|
|
||||||
"parity-clib",
|
"parity-clib",
|
||||||
"whisper",
|
|
||||||
"whisper/cli",
|
"whisper/cli",
|
||||||
"util/triehash-ethereum",
|
"util/triehash-ethereum",
|
||||||
"util/keccak-hasher",
|
"util/keccak-hasher",
|
||||||
"util/patricia-trie-ethereum",
|
"util/patricia-trie-ethereum",
|
||||||
"util/fastmap",
|
"util/fastmap",
|
||||||
|
"util/time-utils",
|
||||||
]
|
]
|
||||||
|
|
||||||
[patch.crates-io]
|
|
||||||
ring = { git = "https://github.com/paritytech/ring" }
|
|
||||||
|
|||||||
306
README.md
306
README.md
@@ -1,14 +1,31 @@
|
|||||||

|

|
||||||
|
|
||||||
## The fastest and most advanced Ethereum client.
|
<h2 align="center">The Fastest and most Advanced Ethereum Client.</h2>
|
||||||
|
|
||||||
<p align="center"><strong><a href="https://github.com/paritytech/parity-ethereum/releases/latest">» Download the latest release «</a></strong></p>
|
<p align="center"><strong><a href="https://github.com/paritytech/parity-ethereum/releases/latest">» Download the latest release «</a></strong></p>
|
||||||
|
|
||||||
<p align="center"><a href="https://gitlab.parity.io/parity/parity/commits/master" target="_blank"><img src="https://gitlab.parity.io/parity/parity/badges/master/build.svg" /></a>
|
<p align="center"><a href="https://gitlab.parity.io/parity/parity-ethereum/commits/master" target="_blank"><img src="https://gitlab.parity.io/parity/parity-ethereum/badges/master/build.svg" /></a>
|
||||||
<a href="https://codecov.io/gh/paritytech/parity-ethereum" target="_blank"><img src="https://codecov.io/gh/paritytech/parity-ethereum/branch/master/graph/badge.svg" /></a>
|
|
||||||
<a href="https://build.snapcraft.io/user/paritytech/parity" target="_blank"><img src="https://build.snapcraft.io/badge/paritytech/parity.svg" /></a>
|
|
||||||
<a href="https://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank"><img src="https://img.shields.io/badge/license-GPL%20v3-green.svg" /></a></p>
|
<a href="https://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank"><img src="https://img.shields.io/badge/license-GPL%20v3-green.svg" /></a></p>
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
|
1. [Description](#chapter-001)
|
||||||
|
2. [Technical Overview](#chapter-002)
|
||||||
|
3. [Building](#chapter-003)<br>
|
||||||
|
3.1 [Building Dependencies](#chapter-0031)<br>
|
||||||
|
3.2 [Building from Source Code](#chapter-0032)<br>
|
||||||
|
3.3 [Simple One-Line Installer for Mac and Linux](#chapter-0033)<br>
|
||||||
|
3.4 [Starting Parity Ethereum](#chapter-0034)
|
||||||
|
4. [Testing](#chapter-004)
|
||||||
|
5. [Documentation](#chapter-005)
|
||||||
|
6. [Toolchain](#chapter-006)
|
||||||
|
7. [Community](#chapter-007)
|
||||||
|
8. [Contributing](#chapter-008)
|
||||||
|
9. [License](#chapter-009)
|
||||||
|
|
||||||
|
|
||||||
|
## 1. Description <a id="chapter-001"></a>
|
||||||
|
|
||||||
**Built for mission-critical use**: Miners, service providers, and exchanges need fast synchronisation and maximum uptime. Parity Ethereum provides the core infrastructure essential for speedy and reliable services.
|
**Built for mission-critical use**: Miners, service providers, and exchanges need fast synchronisation and maximum uptime. Parity Ethereum provides the core infrastructure essential for speedy and reliable services.
|
||||||
|
|
||||||
- Clean, modular codebase for easy customisation
|
- Clean, modular codebase for easy customisation
|
||||||
@@ -17,7 +34,7 @@
|
|||||||
- Synchronise in hours, not days with Warp Sync
|
- Synchronise in hours, not days with Warp Sync
|
||||||
- Modular for light integration into your service or product
|
- Modular for light integration into your service or product
|
||||||
|
|
||||||
## Technical Overview
|
## 2. Technical Overview <a id="chapter-002"></a>
|
||||||
|
|
||||||
Parity Ethereum's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity Ethereum using the sophisticated and cutting-edge **Rust programming language**. Parity Ethereum is licensed under the GPLv3 and can be used for all your Ethereum needs.
|
Parity Ethereum's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity Ethereum using the sophisticated and cutting-edge **Rust programming language**. Parity Ethereum is licensed under the GPLv3 and can be used for all your Ethereum needs.
|
||||||
|
|
||||||
@@ -25,11 +42,13 @@ By default, Parity Ethereum runs a JSON-RPC HTTP server on port `:8545` and a We
|
|||||||
|
|
||||||
If you run into problems while using Parity Ethereum, check out the [wiki for documentation](https://wiki.parity.io/), feel free to [file an issue in this repository](https://github.com/paritytech/parity-ethereum/issues/new), or hop on our [Gitter](https://gitter.im/paritytech/parity) or [Riot](https://riot.im/app/#/group/+parity:matrix.parity.io) chat room to ask a question. We are glad to help! **For security-critical issues**, please refer to the security policy outlined in [SECURITY.md](SECURITY.md).
|
If you run into problems while using Parity Ethereum, check out the [wiki for documentation](https://wiki.parity.io/), feel free to [file an issue in this repository](https://github.com/paritytech/parity-ethereum/issues/new), or hop on our [Gitter](https://gitter.im/paritytech/parity) or [Riot](https://riot.im/app/#/group/+parity:matrix.parity.io) chat room to ask a question. We are glad to help! **For security-critical issues**, please refer to the security policy outlined in [SECURITY.md](SECURITY.md).
|
||||||
|
|
||||||
Parity Ethereum's current beta-release is 2.0. You can download it at [the releases page](https://github.com/paritytech/parity-ethereum/releases) or follow the instructions below to build from source. Please, mind the [CHANGELOG.md](CHANGELOG.md) for a list of all changes between different versions.
|
Parity Ethereum's current beta-release is 2.1. You can download it at [the releases page](https://github.com/paritytech/parity-ethereum/releases) or follow the instructions below to build from source. Please, mind the [CHANGELOG.md](CHANGELOG.md) for a list of all changes between different versions.
|
||||||
|
|
||||||
## Build Dependencies
|
## 3. Building <a id="chapter-003"></a>
|
||||||
|
|
||||||
Parity Ethereum requires **Rust version 1.28.x** to build.
|
### 3.1 Build Dependencies <a id="chapter-0031"></a>
|
||||||
|
|
||||||
|
Parity Ethereum requires **latest stable Rust version** 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:
|
We recommend installing Rust through [rustup](https://www.rustup.rs/). If you don't already have `rustup`, you can install it like this:
|
||||||
|
|
||||||
@@ -38,7 +57,7 @@ We recommend installing Rust through [rustup](https://www.rustup.rs/). If you do
|
|||||||
$ curl https://sh.rustup.rs -sSf | sh
|
$ curl https://sh.rustup.rs -sSf | sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Parity Ethereum also requires `gcc`, `g++`, `libudev-dev`, `pkg-config`, `file`, `make`, and `cmake` packages to be installed.
|
Parity Ethereum also requires `gcc`, `g++`, `pkg-config`, `file`, `make`, and `cmake` packages to be installed.
|
||||||
|
|
||||||
- OSX:
|
- OSX:
|
||||||
```bash
|
```bash
|
||||||
@@ -47,7 +66,7 @@ We recommend installing Rust through [rustup](https://www.rustup.rs/). If you do
|
|||||||
|
|
||||||
`clang` is required. It comes with Xcode command line tools or can be installed with homebrew.
|
`clang` is required. It comes with Xcode command line tools or can be installed with homebrew.
|
||||||
|
|
||||||
- Windows
|
- Windows:
|
||||||
Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the `rustup` installer from
|
Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the `rustup` installer from
|
||||||
https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe, start "VS2015 x64 Native Tools Command Prompt", and use the following command to install and set up the `msvc` toolchain:
|
https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe, start "VS2015 x64 Native Tools Command Prompt", and use the following command to install and set up the `msvc` toolchain:
|
||||||
```bash
|
```bash
|
||||||
@@ -60,27 +79,7 @@ Once you have `rustup` installed, then you need to install:
|
|||||||
|
|
||||||
Make sure that these binaries are in your `PATH`. After that, you should be able to build Parity Ethereum from source.
|
Make sure that these binaries are in your `PATH`. After that, you should be able to build Parity Ethereum from source.
|
||||||
|
|
||||||
## Install from the Snapcraft Store
|
### 3.2 Build from Source Code <a id="chapter-0032"></a>
|
||||||
|
|
||||||
In any of the [supported Linux distros](https://snapcraft.io/docs/core/install):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo snap install parity
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, if you want to contribute testing the upcoming release:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo snap install parity --beta
|
|
||||||
```
|
|
||||||
|
|
||||||
Moreover, to test the latest code from the master branch:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo snap install parity --edge
|
|
||||||
```
|
|
||||||
|
|
||||||
## Build from Source Code
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# download Parity Ethereum code
|
# download Parity Ethereum code
|
||||||
@@ -117,7 +116,7 @@ or
|
|||||||
$ git checkout beta
|
$ git checkout beta
|
||||||
```
|
```
|
||||||
|
|
||||||
## Simple One-Line Installer for Mac and Linux
|
### 3.3 Simple One-Line Installer for Mac and Linux <a id="chapter-0033"></a>
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash <(curl https://get.parity.io -L)
|
bash <(curl https://get.parity.io -L)
|
||||||
@@ -129,9 +128,9 @@ The one-line installer always defaults to the latest beta release. To install a
|
|||||||
bash <(curl https://get.parity.io -L) -r stable
|
bash <(curl https://get.parity.io -L) -r stable
|
||||||
```
|
```
|
||||||
|
|
||||||
## Start Parity Ethereum
|
### 3.4 Starting Parity Ethereum <a id="chapter-0034"></a>
|
||||||
|
|
||||||
### Manually
|
#### Manually
|
||||||
|
|
||||||
To start Parity Ethereum manually, just run
|
To start Parity Ethereum manually, just run
|
||||||
|
|
||||||
@@ -141,25 +140,234 @@ $ ./target/release/parity
|
|||||||
|
|
||||||
so Parity Ethereum begins syncing the Ethereum blockchain.
|
so Parity Ethereum begins syncing the Ethereum blockchain.
|
||||||
|
|
||||||
### Using `systemd` service file
|
#### Using `systemd` service file
|
||||||
|
|
||||||
To start Parity Ethereum as a regular user using `systemd` init:
|
To start Parity Ethereum as a regular user using `systemd` init:
|
||||||
|
|
||||||
1. Copy `./scripts/parity.service` to your
|
1. Copy `./scripts/parity.service` to your
|
||||||
`systemd` user directory (usually `~/.config/systemd/user`).
|
`systemd` user directory (usually `~/.config/systemd/user`).
|
||||||
2. To configure Parity Ethereum, write a `/etc/parity/config.toml` config file, see [Configuring Parity Ethereum](https://paritytech.github.io/wiki/Configuring-Parity) for details.
|
2. Copy release to bin folder, write `sudo install ./target/release/parity /usr/bin/parity`
|
||||||
|
3. To configure Parity Ethereum, write a `/etc/parity/config.toml` config file, see [Configuring Parity Ethereum](https://paritytech.github.io/wiki/Configuring-Parity) for details.
|
||||||
|
|
||||||
## Parity Ethereum toolchain
|
## 4. Testing <a id="chapter-004"></a>
|
||||||
|
|
||||||
|
You can run tests with the following commands:
|
||||||
|
|
||||||
|
* **All** packages
|
||||||
|
```
|
||||||
|
cargo test --all
|
||||||
|
```
|
||||||
|
|
||||||
|
* Specific package
|
||||||
|
```
|
||||||
|
cargo test --package <spec>
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace `<spec>` with one of the packages from the [package list](#package-list) (e.g. `cargo test --package evmbin`).
|
||||||
|
|
||||||
|
You can show your logs in the test output by passing `--nocapture` (i.e. `cargo test --package evmbin -- --nocapture`)
|
||||||
|
|
||||||
|
## 5. Documentation <a id="chapter-005"></a>
|
||||||
|
|
||||||
|
Official website: https://parity.io
|
||||||
|
|
||||||
|
Be sure to [check out our wiki](https://wiki.parity.io) for more information.
|
||||||
|
|
||||||
|
### Viewing documentation for Parity Ethereum packages
|
||||||
|
|
||||||
|
You can generate documentation for Parity Ethereum Rust packages that automatically opens in your web browser using [rustdoc with Cargo](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html#using-rustdoc-with-cargo) (of the The Rustdoc Book), by running the the following commands:
|
||||||
|
|
||||||
|
* **All** packages
|
||||||
|
```
|
||||||
|
cargo doc --document-private-items --open
|
||||||
|
```
|
||||||
|
|
||||||
|
* Specific package
|
||||||
|
```
|
||||||
|
cargo doc --package <spec> -- --document-private-items --open
|
||||||
|
```
|
||||||
|
|
||||||
|
Use`--document-private-items` to also view private documentation and `--no-deps` to exclude building documentation for dependencies.
|
||||||
|
|
||||||
|
Replacing `<spec>` with one of the following from the details section below (i.e. `cargo doc --package parity-ethereum --open`):
|
||||||
|
|
||||||
|
<a id="package-list"></a>
|
||||||
|
**Package List**
|
||||||
|
<details><p>
|
||||||
|
|
||||||
|
* Parity Ethereum (EthCore) Client Application
|
||||||
|
```bash
|
||||||
|
parity-ethereum
|
||||||
|
```
|
||||||
|
* Parity Ethereum Account Management, Key Management Tool, and Keys Generator
|
||||||
|
```bash
|
||||||
|
ethcore-accounts, ethkey-cli, ethstore, ethstore-cli
|
||||||
|
```
|
||||||
|
* Parity Chain Specification
|
||||||
|
```bash
|
||||||
|
chainspec
|
||||||
|
```
|
||||||
|
* Parity CLI Signer Tool & RPC Client
|
||||||
|
```bash
|
||||||
|
cli-signer parity-rpc-client
|
||||||
|
```
|
||||||
|
* Parity Ethereum Ethash & ProgPoW Implementations
|
||||||
|
```bash
|
||||||
|
ethash
|
||||||
|
```
|
||||||
|
* Parity (EthCore) Library
|
||||||
|
```bash
|
||||||
|
ethcore
|
||||||
|
```
|
||||||
|
* Parity Ethereum Blockchain Database, Test Generator, Configuration,
|
||||||
|
Caching, Importing Blocks, and Block Information
|
||||||
|
```bash
|
||||||
|
ethcore-blockchain
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Contract Calls and Blockchain Service & Registry Information
|
||||||
|
```bash
|
||||||
|
ethcore-call-contract
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Database Access & Utilities, Database Cache Manager
|
||||||
|
```bash
|
||||||
|
ethcore-db
|
||||||
|
```
|
||||||
|
* Parity Ethereum Virtual Machine (EVM) Rust Implementation
|
||||||
|
```bash
|
||||||
|
evm
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Light Client Implementation
|
||||||
|
```bash
|
||||||
|
ethcore-light
|
||||||
|
```
|
||||||
|
* Parity Smart Contract based Node Filter, Manage Permissions of Network Connections
|
||||||
|
```bash
|
||||||
|
node-filter
|
||||||
|
```
|
||||||
|
* Parity Private Transactions
|
||||||
|
```bash
|
||||||
|
ethcore-private-tx
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Client & Network Service Creation & Registration with the I/O Subsystem
|
||||||
|
```bash
|
||||||
|
ethcore-service
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Blockchain Synchronization
|
||||||
|
```bash
|
||||||
|
ethcore-sync
|
||||||
|
```
|
||||||
|
* Parity Ethereum Common Types
|
||||||
|
```bash
|
||||||
|
common-types
|
||||||
|
```
|
||||||
|
* Parity Ethereum Virtual Machines (VM) Support Library
|
||||||
|
```bash
|
||||||
|
vm
|
||||||
|
```
|
||||||
|
* Parity Ethereum WASM Interpreter
|
||||||
|
```bash
|
||||||
|
wasm
|
||||||
|
```
|
||||||
|
* Parity Ethereum WASM Test Runner
|
||||||
|
```bash
|
||||||
|
pwasm-run-test
|
||||||
|
```
|
||||||
|
* Parity EVM Implementation
|
||||||
|
```bash
|
||||||
|
evmbin
|
||||||
|
```
|
||||||
|
* Parity Ethereum IPFS-compatible API
|
||||||
|
```bash
|
||||||
|
parity-ipfs-api
|
||||||
|
```
|
||||||
|
* Parity Ethereum JSON Deserialization
|
||||||
|
```bash
|
||||||
|
ethjson
|
||||||
|
```
|
||||||
|
* Parity Ethereum State Machine Generalization for Consensus Engines
|
||||||
|
```bash
|
||||||
|
parity-machine
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Miner Interface
|
||||||
|
```bash
|
||||||
|
ethcore-miner parity-local-store price-info ethcore-stratum using_queue
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Logger Implementation
|
||||||
|
```bash
|
||||||
|
ethcore-logger
|
||||||
|
```
|
||||||
|
* C bindings library for the Parity Ethereum client
|
||||||
|
```bash
|
||||||
|
parity-clib
|
||||||
|
```
|
||||||
|
* Parity Ethereum JSON-RPC Servers
|
||||||
|
```bash
|
||||||
|
parity-rpc
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Secret Store
|
||||||
|
```bash
|
||||||
|
ethcore-secretstore
|
||||||
|
```
|
||||||
|
* Parity Updater Service
|
||||||
|
```bash
|
||||||
|
parity-updater parity-hash-fetch
|
||||||
|
```
|
||||||
|
* Parity Core Libraries (Parity Util)
|
||||||
|
```bash
|
||||||
|
ethcore-bloom-journal blooms-db dir eip-712 fake-fetch fastmap fetch ethcore-io
|
||||||
|
journaldb keccak-hasher len-caching-lock macros memory-cache memzero
|
||||||
|
migration-rocksdb ethcore-network ethcore-network-devp2p panic_hook
|
||||||
|
patricia-trie-ethereum registrar rlp_compress rlp_derive parity-runtime stats
|
||||||
|
time-utils triehash-ethereum unexpected parity-version
|
||||||
|
```
|
||||||
|
* Parity Whisper Protocol Implementation
|
||||||
|
```bash
|
||||||
|
parity-whisper whisper-cli
|
||||||
|
```
|
||||||
|
|
||||||
|
</p></details>
|
||||||
|
|
||||||
|
### Contributing to documentation for Parity Ethereum packages
|
||||||
|
|
||||||
|
[Document source code](https://doc.rust-lang.org/1.9.0/book/documentation.html) for Parity Ethereum packages by annotating the source code with documentation comments.
|
||||||
|
|
||||||
|
Example (generic documentation comment):
|
||||||
|
```markdown
|
||||||
|
/// Summary
|
||||||
|
///
|
||||||
|
/// Description
|
||||||
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
|
/// # Errors
|
||||||
|
///
|
||||||
|
/// # Safety
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
/// Summary of Example 1
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// // insert example 1 code here for use with documentation as tests
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
|
```
|
||||||
|
|
||||||
|
## 6. Toolchain <a id="chapter-006"></a>
|
||||||
|
|
||||||
In addition to the Parity Ethereum client, there are additional tools in this repository available:
|
In addition to the Parity Ethereum client, there are additional tools in this repository available:
|
||||||
|
|
||||||
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
|
- [evmbin](./evmbin) - Parity Ethereum EVM Implementation.
|
||||||
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
|
- [ethstore](./accounts/ethstore) - Parity Ethereum Key Management.
|
||||||
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/ethstore/) - Parity Ethereum key management.
|
- [ethkey](./accounts/ethkey) - Parity Ethereum Keys Generator.
|
||||||
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/ethkey/) - Parity Ethereum keys generator.
|
- [whisper](./whisper) - Parity Ethereum Whisper-v2 PoC Implementation.
|
||||||
- [whisper](https://github.com/paritytech/parity-ethereum/blob/master/whisper/) - Implementation of Whisper-v2 PoC.
|
|
||||||
|
|
||||||
## Join the chat!
|
The following tool is available in a separate repository:
|
||||||
|
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum Encoding of Function Calls. [Docs here](https://crates.io/crates/ethabi)
|
||||||
|
|
||||||
|
## 7. Community <a id="chapter-007"></a>
|
||||||
|
|
||||||
|
### Join the chat!
|
||||||
|
|
||||||
Questions? Get in touch with us on Gitter:
|
Questions? Get in touch with us on Gitter:
|
||||||
[](https://gitter.im/paritytech/parity)
|
[](https://gitter.im/paritytech/parity)
|
||||||
@@ -170,8 +378,14 @@ Questions? Get in touch with us on Gitter:
|
|||||||
Alternatively, join our community on Matrix:
|
Alternatively, join our community on Matrix:
|
||||||
[](https://riot.im/app/#/group/+parity:matrix.parity.io)
|
[](https://riot.im/app/#/group/+parity:matrix.parity.io)
|
||||||
|
|
||||||
## Documentation
|
## 8. Contributing <a id="chapter-008"></a>
|
||||||
|
|
||||||
Official website: https://parity.io
|
An introduction has been provided in the ["So You Want to be a Core Developer" presentation slides by Hernando Castano](http://tiny.cc/contrib-to-parity-eth). Additional guidelines are provided in [CONTRIBUTING](./.github/CONTRIBUTING.md).
|
||||||
|
|
||||||
Be sure to [check out our wiki](https://wiki.parity.io) for more information.
|
### Contributor Code of Conduct
|
||||||
|
|
||||||
|
[CODE_OF_CONDUCT](./.github/CODE_OF_CONDUCT.md)
|
||||||
|
|
||||||
|
## 9. License <a id="chapter-009"></a>
|
||||||
|
|
||||||
|
[LICENSE](./LICENSE)
|
||||||
|
|||||||
21
accounts/Cargo.toml
Normal file
21
accounts/Cargo.toml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
[package]
|
||||||
|
description = "Parity Ethereum Account Management"
|
||||||
|
homepage = "http://parity.io"
|
||||||
|
license = "GPL-3.0"
|
||||||
|
name = "ethcore-accounts"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ethkey = { path = "ethkey" }
|
||||||
|
ethstore = { path = "ethstore" }
|
||||||
|
log = "0.4"
|
||||||
|
parking_lot = "0.7"
|
||||||
|
serde = "1.0"
|
||||||
|
serde_derive = "1.0"
|
||||||
|
serde_json = "1.0"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
ethereum-types = "0.6.0"
|
||||||
|
tempdir = "0.3"
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
[package]
|
[package]
|
||||||
|
description = "Parity Ethereum Keys Generator"
|
||||||
name = "ethkey"
|
name = "ethkey"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
byteorder = "1.0"
|
|
||||||
edit-distance = "2.0"
|
edit-distance = "2.0"
|
||||||
parity-crypto = "0.1"
|
parity-crypto = "0.4.0"
|
||||||
eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" }
|
eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" }
|
||||||
ethereum-types = "0.4"
|
ethereum-types = "0.6.0"
|
||||||
lazy_static = "1.0"
|
lazy_static = "1.0"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
mem = { path = "../util/mem" }
|
parity-wordlist = "1.3"
|
||||||
parity-wordlist = "1.2"
|
|
||||||
quick-error = "1.2.2"
|
quick-error = "1.2.2"
|
||||||
rand = "0.4"
|
rand = "0.6"
|
||||||
rustc-hex = "1.0"
|
rustc-hex = "1.0"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
tiny-keccak = "1.4"
|
tiny-keccak = "1.4"
|
||||||
|
zeroize = "0.9.1"
|
||||||
@@ -5,8 +5,8 @@ Parity Ethereum keys generator.
|
|||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
```
|
```
|
||||||
Parity Ethereum keys generator.
|
Parity Ethereum Keys Generator.
|
||||||
Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
ethkey info <secret-or-phrase> [options]
|
ethkey info <secret-or-phrase> [options]
|
||||||
@@ -216,6 +216,6 @@ _This project is a part of the Parity Ethereum toolchain._
|
|||||||
|
|
||||||
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
|
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
|
||||||
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
|
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
|
||||||
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/ethstore/) - Parity Ethereum key management.
|
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethstore) - Parity Ethereum key management.
|
||||||
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/ethkey/) - Parity Ethereum keys generator.
|
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethkey) - Parity Ethereum keys generator.
|
||||||
- [whisper](https://github.com/paritytech/parity-ethereum/blob/master/whisper/) - Implementation of Whisper-v2 PoC.
|
- [whisper](https://github.com/paritytech/parity-ethereum/blob/master/whisper/) - Implementation of Whisper-v2 PoC.
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
[package]
|
[package]
|
||||||
|
description = "Parity Ethereum Keys Generator CLI"
|
||||||
name = "ethkey-cli"
|
name = "ethkey-cli"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
docopt = "0.8"
|
docopt = "1.0"
|
||||||
env_logger = "0.5"
|
env_logger = "0.5"
|
||||||
ethkey = { path = "../" }
|
ethkey = { path = "../" }
|
||||||
panic_hook = { path = "../../util/panic_hook" }
|
panic_hook = { path = "../../../util/panic-hook" }
|
||||||
parity-wordlist="1.2"
|
parity-wordlist="1.2"
|
||||||
rustc-hex = "1.0"
|
rustc-hex = "1.0"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
extern crate docopt;
|
extern crate docopt;
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
@@ -35,7 +35,7 @@ use rustc_hex::{FromHex, FromHexError};
|
|||||||
|
|
||||||
const USAGE: &'static str = r#"
|
const USAGE: &'static str = r#"
|
||||||
Parity Ethereum keys generator.
|
Parity Ethereum keys generator.
|
||||||
Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
ethkey info <secret-or-phrase> [options]
|
ethkey info <secret-or-phrase> [options]
|
||||||
@@ -168,7 +168,7 @@ fn main() {
|
|||||||
Ok(ok) => println!("{}", ok),
|
Ok(ok) => println!("{}", ok),
|
||||||
Err(Error::Docopt(ref e)) => e.exit(),
|
Err(Error::Docopt(ref e)) => e.exit(),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
println!("{}", err);
|
eprintln!("{}", err);
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use keccak::Keccak256;
|
use keccak::Keccak256;
|
||||||
use super::{KeyPair, Generator, Secret};
|
use super::{KeyPair, Generator, Secret};
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use super::{Generator, KeyPair, Error, Brain};
|
use super::{Generator, KeyPair, Error, Brain};
|
||||||
use parity_wordlist as wordlist;
|
use parity_wordlist as wordlist;
|
||||||
@@ -47,7 +47,7 @@ impl Generator for BrainPrefix {
|
|||||||
for _ in 0..self.iterations {
|
for _ in 0..self.iterations {
|
||||||
let phrase = wordlist::random_phrase(self.no_of_words);
|
let phrase = wordlist::random_phrase(self.no_of_words);
|
||||||
let keypair = Brain::new(phrase.clone()).generate().unwrap();
|
let keypair = Brain::new(phrase.clone()).generate().unwrap();
|
||||||
if keypair.address().starts_with(&self.prefix) {
|
if keypair.address().as_ref().starts_with(&self.prefix) {
|
||||||
self.last_phrase = phrase;
|
self.last_phrase = phrase;
|
||||||
return Ok(keypair)
|
return Ok(keypair)
|
||||||
}
|
}
|
||||||
@@ -65,6 +65,6 @@ mod tests {
|
|||||||
fn prefix_generator() {
|
fn prefix_generator() {
|
||||||
let prefix = vec![0x00u8];
|
let prefix = vec![0x00u8];
|
||||||
let keypair = BrainPrefix::new(prefix.clone(), usize::max_value(), 12).generate().unwrap();
|
let keypair = BrainPrefix::new(prefix.clone(), usize::max_value(), 12).generate().unwrap();
|
||||||
assert!(keypair.address().starts_with(&prefix));
|
assert!(keypair.address().as_bytes().starts_with(&prefix));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use secp256k1;
|
use secp256k1;
|
||||||
use std::io;
|
use std::io;
|
||||||
@@ -57,7 +57,7 @@ pub mod ecdh {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let publ = key::PublicKey::from_slice(context, &pdata)?;
|
let publ = key::PublicKey::from_slice(context, &pdata)?;
|
||||||
let sec = key::SecretKey::from_slice(context, &secret)?;
|
let sec = key::SecretKey::from_slice(context, secret.as_bytes())?;
|
||||||
let shared = ecdh::SharedSecret::new_raw(context, &publ, &sec);
|
let shared = ecdh::SharedSecret::new_raw(context, &publ, &sec);
|
||||||
|
|
||||||
Secret::from_unsafe_slice(&shared[0..32])
|
Secret::from_unsafe_slice(&shared[0..32])
|
||||||
@@ -89,12 +89,12 @@ pub mod ecies {
|
|||||||
msg[0] = 0x04u8;
|
msg[0] = 0x04u8;
|
||||||
{
|
{
|
||||||
let msgd = &mut msg[1..];
|
let msgd = &mut msg[1..];
|
||||||
msgd[0..64].copy_from_slice(r.public());
|
msgd[0..64].copy_from_slice(r.public().as_bytes());
|
||||||
let iv = H128::random();
|
let iv = H128::random();
|
||||||
msgd[64..80].copy_from_slice(&iv);
|
msgd[64..80].copy_from_slice(iv.as_bytes());
|
||||||
{
|
{
|
||||||
let cipher = &mut msgd[(64 + 16)..(64 + 16 + plain.len())];
|
let cipher = &mut msgd[(64 + 16)..(64 + 16 + plain.len())];
|
||||||
aes::encrypt_128_ctr(ekey, &iv, plain, cipher)?;
|
aes::encrypt_128_ctr(ekey, iv.as_bytes(), plain, cipher)?;
|
||||||
}
|
}
|
||||||
let mut hmac = hmac::Signer::with(&mkey);
|
let mut hmac = hmac::Signer::with(&mkey);
|
||||||
{
|
{
|
||||||
@@ -156,7 +156,7 @@ pub mod ecies {
|
|||||||
let mut hasher = digest::Hasher::sha256();
|
let mut hasher = digest::Hasher::sha256();
|
||||||
let ctrs = [(ctr >> 24) as u8, (ctr >> 16) as u8, (ctr >> 8) as u8, ctr as u8];
|
let ctrs = [(ctr >> 24) as u8, (ctr >> 16) as u8, (ctr >> 8) as u8, ctr as u8];
|
||||||
hasher.update(&ctrs);
|
hasher.update(&ctrs);
|
||||||
hasher.update(secret);
|
hasher.update(secret.as_bytes());
|
||||||
hasher.update(s1);
|
hasher.update(s1);
|
||||||
let d = hasher.finish();
|
let d = hasher.finish();
|
||||||
&mut dest[written..(written + 32)].copy_from_slice(&d);
|
&mut dest[written..(written + 32)].copy_from_slice(&d);
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{fmt, error};
|
use std::{fmt, error};
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Extended keys
|
//! Extended keys
|
||||||
|
|
||||||
@@ -35,9 +35,8 @@ impl Label for u32 {
|
|||||||
fn len() -> usize { 4 }
|
fn len() -> usize { 4 }
|
||||||
|
|
||||||
fn store(&self, target: &mut [u8]) {
|
fn store(&self, target: &mut [u8]) {
|
||||||
use byteorder::{BigEndian, ByteOrder};
|
let bytes = self.to_be_bytes();
|
||||||
|
target[0..4].copy_from_slice(&bytes);
|
||||||
BigEndian::write_u32(&mut target[0..4], *self);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +63,7 @@ impl Label for H256 {
|
|||||||
fn len() -> usize { 32 }
|
fn len() -> usize { 32 }
|
||||||
|
|
||||||
fn store(&self, target: &mut [u8]) {
|
fn store(&self, target: &mut [u8]) {
|
||||||
self.copy_to(&mut target[0..32]);
|
(&mut target[0..32]).copy_from_slice(self.as_bytes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +179,7 @@ impl ExtendedKeyPair {
|
|||||||
pub fn with_seed(seed: &[u8]) -> Result<ExtendedKeyPair, DerivationError> {
|
pub fn with_seed(seed: &[u8]) -> Result<ExtendedKeyPair, DerivationError> {
|
||||||
let (master_key, chain_code) = derivation::seed_pair(seed);
|
let (master_key, chain_code) = derivation::seed_pair(seed);
|
||||||
Ok(ExtendedKeyPair::with_secret(
|
Ok(ExtendedKeyPair::with_secret(
|
||||||
Secret::from_unsafe_slice(&*master_key).map_err(|_| DerivationError::InvalidSeed)?,
|
Secret::from_unsafe_slice(master_key.as_bytes()).map_err(|_| DerivationError::InvalidSeed)?,
|
||||||
chain_code,
|
chain_code,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
@@ -208,12 +207,13 @@ impl ExtendedKeyPair {
|
|||||||
// https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
|
// https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
|
||||||
mod derivation {
|
mod derivation {
|
||||||
use parity_crypto::hmac;
|
use parity_crypto::hmac;
|
||||||
use ethereum_types::{U256, U512, H512, H256};
|
use ethereum_types::{BigEndianHash, U256, U512, H512, H256};
|
||||||
use secp256k1::key::{SecretKey, PublicKey};
|
use secp256k1::key::{SecretKey, PublicKey};
|
||||||
use SECP256K1;
|
use SECP256K1;
|
||||||
use keccak;
|
use keccak;
|
||||||
use math::curve_order;
|
use math::curve_order;
|
||||||
use super::{Label, Derivation};
|
use super::{Label, Derivation};
|
||||||
|
use std::convert::TryInto;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
@@ -237,18 +237,18 @@ mod derivation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn hmac_pair(data: &[u8], private_key: H256, chain_code: H256) -> (H256, H256) {
|
fn hmac_pair(data: &[u8], private_key: H256, chain_code: H256) -> (H256, H256) {
|
||||||
let private: U256 = private_key.into();
|
let private: U256 = private_key.into_uint();
|
||||||
|
|
||||||
// produces 512-bit derived hmac (I)
|
// produces 512-bit derived hmac (I)
|
||||||
let skey = hmac::SigKey::sha512(&*chain_code);
|
let skey = hmac::SigKey::sha512(chain_code.as_bytes());
|
||||||
let i_512 = hmac::sign(&skey, &data[..]);
|
let i_512 = hmac::sign(&skey, &data[..]);
|
||||||
|
|
||||||
// left most 256 bits are later added to original private key
|
// left most 256 bits are later added to original private key
|
||||||
let hmac_key: U256 = H256::from_slice(&i_512[0..32]).into();
|
let hmac_key: U256 = H256::from_slice(&i_512[0..32]).into_uint();
|
||||||
// right most 256 bits are new chain code for later derivations
|
// right most 256 bits are new chain code for later derivations
|
||||||
let next_chain_code = H256::from(&i_512[32..64]);
|
let next_chain_code = H256::from_slice(&i_512[32..64]);
|
||||||
|
|
||||||
let child_key = private_add(hmac_key, private).into();
|
let child_key = BigEndianHash::from_uint(&private_add(hmac_key, private));
|
||||||
(child_key, next_chain_code)
|
(child_key, next_chain_code)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,7 +257,7 @@ mod derivation {
|
|||||||
fn private_soft<T>(private_key: H256, chain_code: H256, index: T) -> (H256, H256) where T: Label {
|
fn private_soft<T>(private_key: H256, chain_code: H256, index: T) -> (H256, H256) where T: Label {
|
||||||
let mut data = vec![0u8; 33 + T::len()];
|
let mut data = vec![0u8; 33 + T::len()];
|
||||||
|
|
||||||
let sec_private = SecretKey::from_slice(&SECP256K1, &*private_key)
|
let sec_private = SecretKey::from_slice(&SECP256K1, private_key.as_bytes())
|
||||||
.expect("Caller should provide valid private key");
|
.expect("Caller should provide valid private key");
|
||||||
let sec_public = PublicKey::from_secret_key(&SECP256K1, &sec_private)
|
let sec_public = PublicKey::from_secret_key(&SECP256K1, &sec_private)
|
||||||
.expect("Caller should provide valid private key");
|
.expect("Caller should provide valid private key");
|
||||||
@@ -276,7 +276,7 @@ mod derivation {
|
|||||||
// corresponding public keys of the original and derived private keys
|
// corresponding public keys of the original and derived private keys
|
||||||
fn private_hard<T>(private_key: H256, chain_code: H256, index: T) -> (H256, H256) where T: Label {
|
fn private_hard<T>(private_key: H256, chain_code: H256, index: T) -> (H256, H256) where T: Label {
|
||||||
let mut data: Vec<u8> = vec![0u8; 33 + T::len()];
|
let mut data: Vec<u8> = vec![0u8; 33 + T::len()];
|
||||||
let private: U256 = private_key.into();
|
let private: U256 = private_key.into_uint();
|
||||||
|
|
||||||
// 0x00 (padding) -- private_key -- index
|
// 0x00 (padding) -- private_key -- index
|
||||||
// 0 -- 1..33 -- 33..end
|
// 0 -- 1..33 -- 33..end
|
||||||
@@ -293,9 +293,8 @@ mod derivation {
|
|||||||
|
|
||||||
// todo: surely can be optimized
|
// todo: surely can be optimized
|
||||||
fn modulo(u1: U512, u2: U256) -> U256 {
|
fn modulo(u1: U512, u2: U256) -> U256 {
|
||||||
let dv = u1 / U512::from(u2);
|
let m = u1 % U512::from(u2);
|
||||||
let md = u1 - (dv * U512::from(u2));
|
m.try_into().expect("U512 modulo U256 should fit into U256; qed")
|
||||||
md.into()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn public<T>(public_key: H512, chain_code: H256, derivation: Derivation<T>) -> Result<(H512, H256), Error> where T: Label {
|
pub fn public<T>(public_key: H512, chain_code: H256, derivation: Derivation<T>) -> Result<(H512, H256), Error> where T: Label {
|
||||||
@@ -306,7 +305,7 @@ mod derivation {
|
|||||||
|
|
||||||
let mut public_sec_raw = [0u8; 65];
|
let mut public_sec_raw = [0u8; 65];
|
||||||
public_sec_raw[0] = 4;
|
public_sec_raw[0] = 4;
|
||||||
public_sec_raw[1..65].copy_from_slice(&*public_key);
|
public_sec_raw[1..65].copy_from_slice(public_key.as_bytes());
|
||||||
let public_sec = PublicKey::from_slice(&SECP256K1, &public_sec_raw).map_err(|_| Error::InvalidPoint)?;
|
let public_sec = PublicKey::from_slice(&SECP256K1, &public_sec_raw).map_err(|_| Error::InvalidPoint)?;
|
||||||
let public_serialized = public_sec.serialize_vec(&SECP256K1, true);
|
let public_serialized = public_sec.serialize_vec(&SECP256K1, true);
|
||||||
|
|
||||||
@@ -317,15 +316,15 @@ mod derivation {
|
|||||||
index.store(&mut data[33..(33 + T::len())]);
|
index.store(&mut data[33..(33 + T::len())]);
|
||||||
|
|
||||||
// HMAC512SHA produces [derived private(256); new chain code(256)]
|
// HMAC512SHA produces [derived private(256); new chain code(256)]
|
||||||
let skey = hmac::SigKey::sha512(&*chain_code);
|
let skey = hmac::SigKey::sha512(chain_code.as_bytes());
|
||||||
let i_512 = hmac::sign(&skey, &data[..]);
|
let i_512 = hmac::sign(&skey, &data[..]);
|
||||||
|
|
||||||
let new_private = H256::from(&i_512[0..32]);
|
let new_private = H256::from_slice(&i_512[0..32]);
|
||||||
let new_chain_code = H256::from(&i_512[32..64]);
|
let new_chain_code = H256::from_slice(&i_512[32..64]);
|
||||||
|
|
||||||
// Generated private key can (extremely rarely) be out of secp256k1 key field
|
// Generated private key can (extremely rarely) be out of secp256k1 key field
|
||||||
if curve_order() <= new_private.clone().into() { return Err(Error::MissingIndex); }
|
if curve_order() <= new_private.into_uint() { return Err(Error::MissingIndex); }
|
||||||
let new_private_sec = SecretKey::from_slice(&SECP256K1, &*new_private)
|
let new_private_sec = SecretKey::from_slice(&SECP256K1, new_private.as_bytes())
|
||||||
.expect("Private key belongs to the field [0..CURVE_ORDER) (checked above); So initializing can never fail; qed");
|
.expect("Private key belongs to the field [0..CURVE_ORDER) (checked above); So initializing can never fail; qed");
|
||||||
let mut new_public = PublicKey::from_secret_key(&SECP256K1, &new_private_sec)
|
let mut new_public = PublicKey::from_secret_key(&SECP256K1, &new_private_sec)
|
||||||
.expect("Valid private key produces valid public key");
|
.expect("Valid private key produces valid public key");
|
||||||
@@ -337,7 +336,7 @@ mod derivation {
|
|||||||
let serialized = new_public.serialize_vec(&SECP256K1, false);
|
let serialized = new_public.serialize_vec(&SECP256K1, false);
|
||||||
|
|
||||||
Ok((
|
Ok((
|
||||||
H512::from(&serialized[1..65]),
|
H512::from_slice(&serialized[1..65]),
|
||||||
new_chain_code,
|
new_chain_code,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
@@ -348,18 +347,18 @@ mod derivation {
|
|||||||
|
|
||||||
pub fn chain_code(secret: H256) -> H256 {
|
pub fn chain_code(secret: H256) -> H256 {
|
||||||
// 10,000 rounds of sha3
|
// 10,000 rounds of sha3
|
||||||
let mut running_sha3 = sha3(&*secret);
|
let mut running_sha3 = sha3(secret.as_bytes());
|
||||||
for _ in 0..99999 { running_sha3 = sha3(&*running_sha3); }
|
for _ in 0..99999 { running_sha3 = sha3(running_sha3.as_bytes()); }
|
||||||
running_sha3
|
running_sha3
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn point(secret: H256) -> Result<H512, Error> {
|
pub fn point(secret: H256) -> Result<H512, Error> {
|
||||||
let sec = SecretKey::from_slice(&SECP256K1, &*secret)
|
let sec = SecretKey::from_slice(&SECP256K1, secret.as_bytes())
|
||||||
.map_err(|_| Error::InvalidPoint)?;
|
.map_err(|_| Error::InvalidPoint)?;
|
||||||
let public_sec = PublicKey::from_secret_key(&SECP256K1, &sec)
|
let public_sec = PublicKey::from_secret_key(&SECP256K1, &sec)
|
||||||
.map_err(|_| Error::InvalidPoint)?;
|
.map_err(|_| Error::InvalidPoint)?;
|
||||||
let serialized = public_sec.serialize_vec(&SECP256K1, false);
|
let serialized = public_sec.serialize_vec(&SECP256K1, false);
|
||||||
Ok(H512::from(&serialized[1..65]))
|
Ok(H512::from_slice(&serialized[1..65]))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn seed_pair(seed: &[u8]) -> (H256, H256) {
|
pub fn seed_pair(seed: &[u8]) -> (H256, H256) {
|
||||||
@@ -378,12 +377,13 @@ mod tests {
|
|||||||
use super::{ExtendedSecret, ExtendedPublic, ExtendedKeyPair};
|
use super::{ExtendedSecret, ExtendedPublic, ExtendedKeyPair};
|
||||||
use secret::Secret;
|
use secret::Secret;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use ethereum_types::{H128, H256};
|
use ethereum_types::{H128, H256, H512};
|
||||||
use super::{derivation, Derivation};
|
use super::{derivation, Derivation};
|
||||||
|
|
||||||
fn master_chain_basic() -> (H256, H256) {
|
fn master_chain_basic() -> (H256, H256) {
|
||||||
let seed = H128::from_str("000102030405060708090a0b0c0d0e0f")
|
let seed = H128::from_str("000102030405060708090a0b0c0d0e0f")
|
||||||
.expect("Seed should be valid H128")
|
.expect("Seed should be valid H128")
|
||||||
|
.as_bytes()
|
||||||
.to_vec();
|
.to_vec();
|
||||||
|
|
||||||
derivation::seed_pair(&*seed)
|
derivation::seed_pair(&*seed)
|
||||||
@@ -399,27 +399,39 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn smoky() {
|
fn smoky() {
|
||||||
let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap();
|
let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap();
|
||||||
let extended_secret = ExtendedSecret::with_code(secret.clone(), 0u64.into());
|
let extended_secret = ExtendedSecret::with_code(secret.clone(), H256::zero());
|
||||||
|
|
||||||
// hardened
|
// hardened
|
||||||
assert_eq!(&**extended_secret.as_raw(), &*secret);
|
assert_eq!(&**extended_secret.as_raw(), &*secret);
|
||||||
assert_eq!(&**extended_secret.derive(2147483648.into()).as_raw(), &"0927453daed47839608e414a3738dfad10aed17c459bbd9ab53f89b026c834b6".into());
|
assert_eq!(
|
||||||
assert_eq!(&**extended_secret.derive(2147483649.into()).as_raw(), &"44238b6a29c6dcbe9b401364141ba11e2198c289a5fed243a1c11af35c19dc0f".into());
|
**extended_secret.derive(2147483648.into()).as_raw(),
|
||||||
|
H256::from_str("0927453daed47839608e414a3738dfad10aed17c459bbd9ab53f89b026c834b6").unwrap(),
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
**extended_secret.derive(2147483649.into()).as_raw(),
|
||||||
|
H256::from_str("44238b6a29c6dcbe9b401364141ba11e2198c289a5fed243a1c11af35c19dc0f").unwrap(),
|
||||||
|
);
|
||||||
|
|
||||||
// normal
|
// normal
|
||||||
assert_eq!(&**extended_secret.derive(0.into()).as_raw(), &"bf6a74e3f7b36fc4c96a1e12f31abc817f9f5904f5a8fc27713163d1f0b713f6".into());
|
assert_eq!(**extended_secret.derive(0.into()).as_raw(), H256::from_str("bf6a74e3f7b36fc4c96a1e12f31abc817f9f5904f5a8fc27713163d1f0b713f6").unwrap());
|
||||||
assert_eq!(&**extended_secret.derive(1.into()).as_raw(), &"bd4fca9eb1f9c201e9448c1eecd66e302d68d4d313ce895b8c134f512205c1bc".into());
|
assert_eq!(**extended_secret.derive(1.into()).as_raw(), H256::from_str("bd4fca9eb1f9c201e9448c1eecd66e302d68d4d313ce895b8c134f512205c1bc").unwrap());
|
||||||
assert_eq!(&**extended_secret.derive(2.into()).as_raw(), &"86932b542d6cab4d9c65490c7ef502d89ecc0e2a5f4852157649e3251e2a3268".into());
|
assert_eq!(**extended_secret.derive(2.into()).as_raw(), H256::from_str("86932b542d6cab4d9c65490c7ef502d89ecc0e2a5f4852157649e3251e2a3268").unwrap());
|
||||||
|
|
||||||
let extended_public = ExtendedPublic::from_secret(&extended_secret).expect("Extended public should be created");
|
let extended_public = ExtendedPublic::from_secret(&extended_secret).expect("Extended public should be created");
|
||||||
let derived_public = extended_public.derive(0.into()).expect("First derivation of public should succeed");
|
let derived_public = extended_public.derive(0.into()).expect("First derivation of public should succeed");
|
||||||
assert_eq!(&*derived_public.public(), &"f7b3244c96688f92372bfd4def26dc4151529747bab9f188a4ad34e141d47bd66522ff048bc6f19a0a4429b04318b1a8796c000265b4fa200dae5f6dda92dd94".into());
|
assert_eq!(
|
||||||
|
*derived_public.public(),
|
||||||
|
H512::from_str("f7b3244c96688f92372bfd4def26dc4151529747bab9f188a4ad34e141d47bd66522ff048bc6f19a0a4429b04318b1a8796c000265b4fa200dae5f6dda92dd94").unwrap(),
|
||||||
|
);
|
||||||
|
|
||||||
let keypair = ExtendedKeyPair::with_secret(
|
let keypair = ExtendedKeyPair::with_secret(
|
||||||
Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap(),
|
Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap(),
|
||||||
064.into(),
|
H256::from_low_u64_be(64),
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
**keypair.derive(2147483648u32.into()).expect("Derivation of keypair should succeed").secret().as_raw(),
|
||||||
|
H256::from_str("edef54414c03196557cf73774bc97a645c9a1df2164ed34f0c2a78d1375a930c").unwrap(),
|
||||||
);
|
);
|
||||||
assert_eq!(&**keypair.derive(2147483648u32.into()).expect("Derivation of keypair should succeed").secret().as_raw(), &"edef54414c03196557cf73774bc97a645c9a1df2164ed34f0c2a78d1375a930c".into());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -427,7 +439,7 @@ mod tests {
|
|||||||
let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap();
|
let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap();
|
||||||
let derivation_secret = H256::from_str("51eaf04f9dbbc1417dc97e789edd0c37ecda88bac490434e367ea81b71b7b015").unwrap();
|
let derivation_secret = H256::from_str("51eaf04f9dbbc1417dc97e789edd0c37ecda88bac490434e367ea81b71b7b015").unwrap();
|
||||||
|
|
||||||
let extended_secret = ExtendedSecret::with_code(secret.clone(), 0u64.into());
|
let extended_secret = ExtendedSecret::with_code(secret.clone(), H256::zero());
|
||||||
let extended_public = ExtendedPublic::from_secret(&extended_secret).expect("Extended public should be created");
|
let extended_public = ExtendedPublic::from_secret(&extended_secret).expect("Extended public should be created");
|
||||||
|
|
||||||
let derived_secret0 = extended_secret.derive(Derivation::Soft(derivation_secret));
|
let derived_secret0 = extended_secret.derive(Derivation::Soft(derivation_secret));
|
||||||
@@ -442,15 +454,18 @@ mod tests {
|
|||||||
fn h256_hard() {
|
fn h256_hard() {
|
||||||
let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap();
|
let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap();
|
||||||
let derivation_secret = H256::from_str("51eaf04f9dbbc1417dc97e789edd0c37ecda88bac490434e367ea81b71b7b015").unwrap();
|
let derivation_secret = H256::from_str("51eaf04f9dbbc1417dc97e789edd0c37ecda88bac490434e367ea81b71b7b015").unwrap();
|
||||||
let extended_secret = ExtendedSecret::with_code(secret.clone(), 1u64.into());
|
let extended_secret = ExtendedSecret::with_code(secret.clone(), H256::from_low_u64_be(1));
|
||||||
|
|
||||||
assert_eq!(&**extended_secret.derive(Derivation::Hard(derivation_secret)).as_raw(), &"2bc2d696fb744d77ff813b4a1ef0ad64e1e5188b622c54ba917acc5ebc7c5486".into());
|
assert_eq!(
|
||||||
|
**extended_secret.derive(Derivation::Hard(derivation_secret)).as_raw(),
|
||||||
|
H256::from_str("2bc2d696fb744d77ff813b4a1ef0ad64e1e5188b622c54ba917acc5ebc7c5486").unwrap(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn match_() {
|
fn match_() {
|
||||||
let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap();
|
let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap();
|
||||||
let extended_secret = ExtendedSecret::with_code(secret.clone(), 1.into());
|
let extended_secret = ExtendedSecret::with_code(secret.clone(), H256::from_low_u64_be(1));
|
||||||
let extended_public = ExtendedPublic::from_secret(&extended_secret).expect("Extended public should be created");
|
let extended_public = ExtendedPublic::from_secret(&extended_secret).expect("Extended public should be created");
|
||||||
|
|
||||||
let derived_secret0 = extended_secret.derive(0.into());
|
let derived_secret0 = extended_secret.derive(0.into());
|
||||||
@@ -465,6 +480,7 @@ mod tests {
|
|||||||
fn test_seeds() {
|
fn test_seeds() {
|
||||||
let seed = H128::from_str("000102030405060708090a0b0c0d0e0f")
|
let seed = H128::from_str("000102030405060708090a0b0c0d0e0f")
|
||||||
.expect("Seed should be valid H128")
|
.expect("Seed should be valid H128")
|
||||||
|
.as_bytes()
|
||||||
.to_vec();
|
.to_vec();
|
||||||
|
|
||||||
// private key from bitcoin test vector
|
// private key from bitcoin test vector
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use tiny_keccak::Keccak;
|
use tiny_keccak::Keccak;
|
||||||
|
|
||||||
@@ -1,29 +1,28 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use secp256k1::key;
|
use secp256k1::key;
|
||||||
use rustc_hex::ToHex;
|
|
||||||
use keccak::Keccak256;
|
|
||||||
use super::{Secret, Public, Address, SECP256K1, Error};
|
use super::{Secret, Public, Address, SECP256K1, Error};
|
||||||
|
use parity_crypto::Keccak256 as _;
|
||||||
|
|
||||||
pub fn public_to_address(public: &Public) -> Address {
|
pub fn public_to_address(public: &Public) -> Address {
|
||||||
let hash = public.keccak256();
|
let hash = public.keccak256();
|
||||||
let mut result = Address::default();
|
let mut result = Address::zero();
|
||||||
result.copy_from_slice(&hash[12..]);
|
result.as_bytes_mut().copy_from_slice(&hash[12..]);
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,9 +35,9 @@ pub struct KeyPair {
|
|||||||
|
|
||||||
impl fmt::Display for KeyPair {
|
impl fmt::Display for KeyPair {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||||
writeln!(f, "secret: {}", self.secret.to_hex())?;
|
writeln!(f, "secret: {:x}", self.secret)?;
|
||||||
writeln!(f, "public: {}", self.public.to_hex())?;
|
writeln!(f, "public: {:x}", self.public)?;
|
||||||
write!(f, "address: {}", self.address().to_hex())
|
write!(f, "address: {:x}", self.address())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +50,7 @@ impl KeyPair {
|
|||||||
let serialized = pub_key.serialize_vec(context, false);
|
let serialized = pub_key.serialize_vec(context, false);
|
||||||
|
|
||||||
let mut public = Public::default();
|
let mut public = Public::default();
|
||||||
public.copy_from_slice(&serialized[1..65]);
|
public.as_bytes_mut().copy_from_slice(&serialized[1..65]);
|
||||||
|
|
||||||
let keypair = KeyPair {
|
let keypair = KeyPair {
|
||||||
secret: secret,
|
secret: secret,
|
||||||
@@ -70,7 +69,7 @@ impl KeyPair {
|
|||||||
let serialized = publ.serialize_vec(context, false);
|
let serialized = publ.serialize_vec(context, false);
|
||||||
let secret = Secret::from(sec);
|
let secret = Secret::from(sec);
|
||||||
let mut public = Public::default();
|
let mut public = Public::default();
|
||||||
public.copy_from_slice(&serialized[1..65]);
|
public.as_bytes_mut().copy_from_slice(&serialized[1..65]);
|
||||||
|
|
||||||
KeyPair {
|
KeyPair {
|
||||||
secret: secret,
|
secret: secret,
|
||||||
@@ -1,26 +1,24 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// #![warn(missing_docs)]
|
// #![warn(missing_docs)]
|
||||||
|
|
||||||
extern crate byteorder;
|
|
||||||
extern crate edit_distance;
|
extern crate edit_distance;
|
||||||
extern crate parity_crypto;
|
extern crate parity_crypto;
|
||||||
extern crate ethereum_types;
|
extern crate ethereum_types;
|
||||||
extern crate mem;
|
|
||||||
extern crate parity_wordlist;
|
extern crate parity_wordlist;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate quick_error;
|
extern crate quick_error;
|
||||||
@@ -29,6 +27,7 @@ extern crate rustc_hex;
|
|||||||
extern crate secp256k1;
|
extern crate secp256k1;
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
extern crate tiny_keccak;
|
extern crate tiny_keccak;
|
||||||
|
extern crate zeroize;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use super::{SECP256K1, Public, Secret, Error};
|
use super::{SECP256K1, Public, Secret, Error};
|
||||||
use secp256k1::key;
|
use secp256k1::key;
|
||||||
use secp256k1::constants::{GENERATOR_X, GENERATOR_Y, CURVE_ORDER};
|
use secp256k1::constants::{GENERATOR_X, GENERATOR_Y, CURVE_ORDER};
|
||||||
use ethereum_types::{U256, H256};
|
use ethereum_types::{BigEndianHash as _, U256, H256};
|
||||||
|
|
||||||
/// Whether the public key is valid.
|
/// Whether the public key is valid.
|
||||||
pub fn public_is_valid(public: &Public) -> bool {
|
pub fn public_is_valid(public: &Public) -> bool {
|
||||||
@@ -78,7 +78,7 @@ pub fn generation_point() -> Public {
|
|||||||
|
|
||||||
/// Return secp256k1 elliptic curve order
|
/// Return secp256k1 elliptic curve order
|
||||||
pub fn curve_order() -> U256 {
|
pub fn curve_order() -> U256 {
|
||||||
H256::from_slice(&CURVE_ORDER).into()
|
H256::from_slice(&CURVE_ORDER).into_uint()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn to_secp256k1_public(public: &Public) -> Result<key::PublicKey, Error> {
|
fn to_secp256k1_public(public: &Public) -> Result<key::PublicKey, Error> {
|
||||||
@@ -93,7 +93,7 @@ fn to_secp256k1_public(public: &Public) -> Result<key::PublicKey, Error> {
|
|||||||
|
|
||||||
fn set_public(public: &mut Public, key_public: &key::PublicKey) {
|
fn set_public(public: &mut Public, key_public: &key::PublicKey) {
|
||||||
let key_public_serialized = key_public.serialize_vec(&SECP256K1, false);
|
let key_public_serialized = key_public.serialize_vec(&SECP256K1, false);
|
||||||
public.copy_from_slice(&key_public_serialized[1..65]);
|
public.as_bytes_mut().copy_from_slice(&key_public_serialized[1..65]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{fmt, ptr};
|
use std::{fmt, ptr};
|
||||||
|
|
||||||
@@ -57,4 +57,3 @@ impl<'a> From<&'a str> for Password {
|
|||||||
Password::from(String::from(s))
|
Password::from(String::from(s))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use super::{Random, Generator, KeyPair, Error};
|
use super::{Random, Generator, KeyPair, Error};
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ impl Generator for Prefix {
|
|||||||
fn generate(&mut self) -> Result<KeyPair, Error> {
|
fn generate(&mut self) -> Result<KeyPair, Error> {
|
||||||
for _ in 0..self.iterations {
|
for _ in 0..self.iterations {
|
||||||
let keypair = Random.generate()?;
|
let keypair = Random.generate()?;
|
||||||
if keypair.address().starts_with(&self.prefix) {
|
if keypair.address().as_ref().starts_with(&self.prefix) {
|
||||||
return Ok(keypair)
|
return Ok(keypair)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,6 +54,6 @@ mod tests {
|
|||||||
fn prefix_generator() {
|
fn prefix_generator() {
|
||||||
let prefix = vec![0xffu8];
|
let prefix = vec![0xffu8];
|
||||||
let keypair = Prefix::new(prefix.clone(), usize::max_value()).generate().unwrap();
|
let keypair = Prefix::new(prefix.clone(), usize::max_value()).generate().unwrap();
|
||||||
assert!(keypair.address().starts_with(&prefix));
|
assert!(keypair.address().as_bytes().starts_with(&prefix));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use rand::os::OsRng;
|
use rand::rngs::OsRng;
|
||||||
use super::{Generator, KeyPair, SECP256K1};
|
use super::{Generator, KeyPair, SECP256K1};
|
||||||
|
|
||||||
/// Randomly generates new keypair, instantiating the RNG each time.
|
/// Randomly generates new keypair, instantiating the RNG each time.
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
@@ -21,17 +21,23 @@ use rustc_hex::ToHex;
|
|||||||
use secp256k1::constants::{SECRET_KEY_SIZE as SECP256K1_SECRET_KEY_SIZE};
|
use secp256k1::constants::{SECRET_KEY_SIZE as SECP256K1_SECRET_KEY_SIZE};
|
||||||
use secp256k1::key;
|
use secp256k1::key;
|
||||||
use ethereum_types::H256;
|
use ethereum_types::H256;
|
||||||
use mem::Memzero;
|
use zeroize::Zeroize;
|
||||||
use {Error, SECP256K1};
|
use {Error, SECP256K1};
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq)]
|
#[derive(Clone, PartialEq, Eq)]
|
||||||
pub struct Secret {
|
pub struct Secret {
|
||||||
inner: Memzero<H256>,
|
inner: H256,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Drop for Secret {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
self.inner.0.zeroize()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ToHex for Secret {
|
impl ToHex for Secret {
|
||||||
fn to_hex(&self) -> String {
|
fn to_hex(&self) -> String {
|
||||||
format!("{:x}", *self.inner)
|
format!("{:x}", self.inner)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,14 +65,14 @@ impl Secret {
|
|||||||
if key.len() != 32 {
|
if key.len() != 32 {
|
||||||
return None
|
return None
|
||||||
}
|
}
|
||||||
let mut h = H256::default();
|
let mut h = H256::zero();
|
||||||
h.copy_from_slice(&key[0..32]);
|
h.as_bytes_mut().copy_from_slice(&key[0..32]);
|
||||||
Some(Secret { inner: Memzero::from(h) })
|
Some(Secret { inner: h })
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates zero key, which is invalid for crypto operations, but valid for math operation.
|
/// Creates zero key, which is invalid for crypto operations, but valid for math operation.
|
||||||
pub fn zero() -> Self {
|
pub fn zero() -> Self {
|
||||||
Secret { inner: Memzero::from(H256::default()) }
|
Secret { inner: H256::zero() }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Imports and validates the key.
|
/// Imports and validates the key.
|
||||||
@@ -214,7 +220,7 @@ impl FromStr for Secret {
|
|||||||
|
|
||||||
impl From<[u8; 32]> for Secret {
|
impl From<[u8; 32]> for Secret {
|
||||||
fn from(k: [u8; 32]) -> Self {
|
fn from(k: [u8; 32]) -> Self {
|
||||||
Secret { inner: Memzero::from(H256(k)) }
|
Secret { inner: H256(k) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::ops::{Deref, DerefMut};
|
use std::ops::{Deref, DerefMut};
|
||||||
use std::cmp::PartialEq;
|
use std::cmp::PartialEq;
|
||||||
@@ -68,24 +68,44 @@ impl Signature {
|
|||||||
/// Create a signature object from the sig.
|
/// Create a signature object from the sig.
|
||||||
pub fn from_rsv(r: &H256, s: &H256, v: u8) -> Self {
|
pub fn from_rsv(r: &H256, s: &H256, v: u8) -> Self {
|
||||||
let mut sig = [0u8; 65];
|
let mut sig = [0u8; 65];
|
||||||
sig[0..32].copy_from_slice(&r);
|
sig[0..32].copy_from_slice(r.as_ref());
|
||||||
sig[32..64].copy_from_slice(&s);
|
sig[32..64].copy_from_slice(s.as_ref());
|
||||||
sig[64] = v;
|
sig[64] = v;
|
||||||
Signature(sig)
|
Signature(sig)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check if this is a "low" signature.
|
/// Check if this is a "low" signature.
|
||||||
pub fn is_low_s(&self) -> bool {
|
pub fn is_low_s(&self) -> bool {
|
||||||
H256::from_slice(self.s()) <= "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0".into()
|
// "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0"
|
||||||
|
const MASK: H256 = H256([
|
||||||
|
0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0x5D, 0x57, 0x6E, 0x73, 0x57, 0xA4, 0x50, 0x1D,
|
||||||
|
0xDF, 0xE9, 0x2F, 0x46, 0x68, 0x1B, 0x20, 0xA0,
|
||||||
|
]);
|
||||||
|
H256::from_slice(self.s()) <= MASK
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check if each component of the signature is in range.
|
/// Check if each component of the signature is in range.
|
||||||
pub fn is_valid(&self) -> bool {
|
pub fn is_valid(&self) -> bool {
|
||||||
|
// "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"
|
||||||
|
const MASK: H256 = H256([
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
|
||||||
|
0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,
|
||||||
|
0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x41,
|
||||||
|
]);
|
||||||
|
const ONE: H256 = H256([
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||||
|
]);
|
||||||
|
let r = H256::from_slice(self.r());
|
||||||
|
let s = H256::from_slice(self.s());
|
||||||
self.v() <= 1 &&
|
self.v() <= 1 &&
|
||||||
H256::from_slice(self.r()) < "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141".into() &&
|
r < MASK && r >= ONE &&
|
||||||
H256::from_slice(self.r()) >= 1.into() &&
|
s < MASK && s >= ONE
|
||||||
H256::from_slice(self.s()) < "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141".into() &&
|
|
||||||
H256::from_slice(self.s()) >= 1.into()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +210,7 @@ impl DerefMut for Signature {
|
|||||||
|
|
||||||
pub fn sign(secret: &Secret, message: &Message) -> Result<Signature, Error> {
|
pub fn sign(secret: &Secret, message: &Message) -> Result<Signature, Error> {
|
||||||
let context = &SECP256K1;
|
let context = &SECP256K1;
|
||||||
let sec = SecretKey::from_slice(context, &secret)?;
|
let sec = SecretKey::from_slice(context, secret.as_ref())?;
|
||||||
let s = context.sign_recoverable(&SecpMessage::from_slice(&message[..])?, &sec)?;
|
let s = context.sign_recoverable(&SecpMessage::from_slice(&message[..])?, &sec)?;
|
||||||
let (rec_id, data) = s.serialize_compact(context);
|
let (rec_id, data) = s.serialize_compact(context);
|
||||||
let mut data_arr = [0; 65];
|
let mut data_arr = [0; 65];
|
||||||
@@ -208,7 +228,7 @@ pub fn verify_public(public: &Public, signature: &Signature, message: &Message)
|
|||||||
|
|
||||||
let pdata: [u8; 65] = {
|
let pdata: [u8; 65] = {
|
||||||
let mut temp = [4u8; 65];
|
let mut temp = [4u8; 65];
|
||||||
temp[1..65].copy_from_slice(&**public);
|
temp[1..65].copy_from_slice(public.as_bytes());
|
||||||
temp
|
temp
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -233,7 +253,7 @@ pub fn recover(signature: &Signature, message: &Message) -> Result<Public, Error
|
|||||||
let serialized = pubkey.serialize_vec(context, false);
|
let serialized = pubkey.serialize_vec(context, false);
|
||||||
|
|
||||||
let mut public = Public::default();
|
let mut public = Public::default();
|
||||||
public.copy_from_slice(&serialized[1..65]);
|
public.as_bytes_mut().copy_from_slice(&serialized[1..65]);
|
||||||
Ok(public)
|
Ok(public)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
[package]
|
[package]
|
||||||
|
description = "Parity Ethereum Key Management"
|
||||||
name = "ethstore"
|
name = "ethstore"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
rand = "0.4"
|
rand = "0.6"
|
||||||
ethkey = { path = "../ethkey" }
|
ethkey = { path = "../ethkey" }
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
@@ -15,11 +16,11 @@ rustc-hex = "1.0"
|
|||||||
tiny-keccak = "1.4"
|
tiny-keccak = "1.4"
|
||||||
time = "0.1.34"
|
time = "0.1.34"
|
||||||
itertools = "0.5"
|
itertools = "0.5"
|
||||||
parking_lot = "0.6"
|
parking_lot = "0.7"
|
||||||
parity-crypto = "0.1"
|
parity-crypto = "0.4.0"
|
||||||
ethereum-types = "0.4"
|
ethereum-types = "0.6.0"
|
||||||
dir = { path = "../util/dir" }
|
dir = { path = "../../util/dir" }
|
||||||
smallvec = "0.4"
|
smallvec = "0.6"
|
||||||
parity-wordlist = "1.0"
|
parity-wordlist = "1.0"
|
||||||
tempdir = "0.3"
|
tempdir = "0.3"
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@ Parity Ethereum key management.
|
|||||||
|
|
||||||
```
|
```
|
||||||
Parity Ethereum key management tool.
|
Parity Ethereum key management tool.
|
||||||
Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
ethstore insert <secret> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore insert <secret> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
@@ -335,6 +335,6 @@ _This project is a part of the Parity Ethereum toolchain._
|
|||||||
|
|
||||||
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
|
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
|
||||||
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
|
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
|
||||||
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/ethstore/) - Parity Ethereum key management.
|
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethstore) - Parity Ethereum key management.
|
||||||
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/ethkey/) - Parity Ethereum keys generator.
|
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethkey) - Parity Ethereum keys generator.
|
||||||
- [whisper](https://github.com/paritytech/parity-ethereum/blob/master/whisper/) - Implementation of Whisper-v2 PoC.
|
- [whisper](https://github.com/paritytech/parity-ethereum/blob/master/whisper/) - Implementation of Whisper-v2 PoC.
|
||||||
@@ -1,18 +1,20 @@
|
|||||||
[package]
|
[package]
|
||||||
|
description = "Parity Ethereum Key Management CLI"
|
||||||
name = "ethstore-cli"
|
name = "ethstore-cli"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
docopt = "0.8"
|
docopt = "1.0"
|
||||||
|
env_logger = "0.5"
|
||||||
num_cpus = "1.6"
|
num_cpus = "1.6"
|
||||||
rustc-hex = "1.0"
|
rustc-hex = "1.0"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
parking_lot = "0.6"
|
parking_lot = "0.7"
|
||||||
ethstore = { path = "../" }
|
ethstore = { path = "../" }
|
||||||
dir = { path = '../../util/dir' }
|
dir = { path = '../../../util/dir' }
|
||||||
panic_hook = { path = "../../util/panic_hook" }
|
panic_hook = { path = "../../../util/panic-hook" }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "ethstore"
|
name = "ethstore"
|
||||||
@@ -20,4 +22,4 @@ path = "src/main.rs"
|
|||||||
doc = false
|
doc = false
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempdir = "0.3.5"
|
tempdir = "0.3"
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{cmp, thread};
|
use std::{cmp, thread};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
extern crate dir;
|
extern crate dir;
|
||||||
extern crate docopt;
|
extern crate docopt;
|
||||||
@@ -23,6 +23,8 @@ extern crate parking_lot;
|
|||||||
extern crate rustc_hex;
|
extern crate rustc_hex;
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
|
|
||||||
|
extern crate env_logger;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|
||||||
@@ -39,13 +41,13 @@ mod crack;
|
|||||||
|
|
||||||
pub const USAGE: &'static str = r#"
|
pub const USAGE: &'static str = r#"
|
||||||
Parity Ethereum key management tool.
|
Parity Ethereum key management tool.
|
||||||
Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
ethstore insert <secret> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore insert <secret> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
ethstore change-pwd <address> <old-pwd> <new-pwd> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore change-pwd <address> <old-pwd> <new-pwd> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
ethstore list [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore list [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
ethstore import [--src DIR] [--dir DIR]
|
ethstore import [<password>] [--src DIR] [--dir DIR]
|
||||||
ethstore import-wallet <path> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore import-wallet <path> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
ethstore find-wallet-pass <path> <password>
|
ethstore find-wallet-pass <path> <password>
|
||||||
ethstore remove <address> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore remove <address> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
@@ -146,30 +148,34 @@ impl fmt::Display for Error {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
panic_hook::set_abort();
|
panic_hook::set_abort();
|
||||||
|
if env::var("RUST_LOG").is_err() {
|
||||||
|
env::set_var("RUST_LOG", "warn")
|
||||||
|
}
|
||||||
|
env_logger::try_init().expect("Logger initialized only once.");
|
||||||
|
|
||||||
match execute(env::args()) {
|
match execute(env::args()) {
|
||||||
Ok(result) => println!("{}", result),
|
Ok(result) => println!("{}", result),
|
||||||
Err(Error::Docopt(ref e)) => e.exit(),
|
Err(Error::Docopt(ref e)) => e.exit(),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
println!("{}", err);
|
eprintln!("{}", err);
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn key_dir(location: &str) -> Result<Box<KeyDirectory>, Error> {
|
fn key_dir(location: &str, password: Option<Password>) -> Result<Box<KeyDirectory>, Error> {
|
||||||
let dir: Box<KeyDirectory> = match location {
|
let dir: RootDiskDirectory = match location {
|
||||||
"geth" => Box::new(RootDiskDirectory::create(dir::geth(false))?),
|
"geth" => RootDiskDirectory::create(dir::geth(false))?,
|
||||||
"geth-test" => Box::new(RootDiskDirectory::create(dir::geth(true))?),
|
"geth-test" => RootDiskDirectory::create(dir::geth(true))?,
|
||||||
path if path.starts_with("parity") => {
|
path if path.starts_with("parity") => {
|
||||||
let chain = path.split('-').nth(1).unwrap_or("ethereum");
|
let chain = path.split('-').nth(1).unwrap_or("ethereum");
|
||||||
let path = dir::parity(chain);
|
let path = dir::parity(chain);
|
||||||
Box::new(RootDiskDirectory::create(path)?)
|
RootDiskDirectory::create(path)?
|
||||||
},
|
},
|
||||||
path => Box::new(RootDiskDirectory::create(path)?),
|
path => RootDiskDirectory::create(path)?,
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(dir)
|
Ok(Box::new(dir.with_password(password)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn open_args_vault(store: &EthStore, args: &Args) -> Result<SecretVaultRef, Error> {
|
fn open_args_vault(store: &EthStore, args: &Args) -> Result<SecretVaultRef, Error> {
|
||||||
@@ -202,9 +208,9 @@ fn format_vaults(vaults: &[String]) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn load_password(path: &str) -> Result<Password, Error> {
|
fn load_password(path: &str) -> Result<Password, Error> {
|
||||||
let mut file = fs::File::open(path).map_err(|e| ethstore::Error::Custom(format!("Error opening password file {}: {}", path, e)))?;
|
let mut file = fs::File::open(path).map_err(|e| ethstore::Error::Custom(format!("Error opening password file '{}': {}", path, e)))?;
|
||||||
let mut password = String::new();
|
let mut password = String::new();
|
||||||
file.read_to_string(&mut password).map_err(|e| ethstore::Error::Custom(format!("Error reading password file {}: {}", path, e)))?;
|
file.read_to_string(&mut password).map_err(|e| ethstore::Error::Custom(format!("Error reading password file '{}': {}", path, e)))?;
|
||||||
// drop EOF
|
// drop EOF
|
||||||
let _ = password.pop();
|
let _ = password.pop();
|
||||||
Ok(password.into())
|
Ok(password.into())
|
||||||
@@ -214,7 +220,7 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
|
|||||||
let args: Args = Docopt::new(USAGE)
|
let args: Args = Docopt::new(USAGE)
|
||||||
.and_then(|d| d.argv(command).deserialize())?;
|
.and_then(|d| d.argv(command).deserialize())?;
|
||||||
|
|
||||||
let store = EthStore::open(key_dir(&args.flag_dir)?)?;
|
let store = EthStore::open(key_dir(&args.flag_dir, None)?)?;
|
||||||
|
|
||||||
return if args.cmd_insert {
|
return if args.cmd_insert {
|
||||||
let secret = args.arg_secret.parse().map_err(|_| ethstore::Error::InvalidSecret)?;
|
let secret = args.arg_secret.parse().map_err(|_| ethstore::Error::InvalidSecret)?;
|
||||||
@@ -239,8 +245,13 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
|
|||||||
.collect();
|
.collect();
|
||||||
Ok(format_accounts(&accounts))
|
Ok(format_accounts(&accounts))
|
||||||
} else if args.cmd_import {
|
} else if args.cmd_import {
|
||||||
let src = key_dir(&args.flag_src)?;
|
let password = match args.arg_password.as_ref() {
|
||||||
let dst = key_dir(&args.flag_dir)?;
|
"" => None,
|
||||||
|
_ => Some(load_password(&args.arg_password)?)
|
||||||
|
};
|
||||||
|
let src = key_dir(&args.flag_src, password)?;
|
||||||
|
let dst = key_dir(&args.flag_dir, None)?;
|
||||||
|
|
||||||
let accounts = import_accounts(&*src, &*dst)?;
|
let accounts = import_accounts(&*src, &*dst)?;
|
||||||
Ok(format_accounts(&accounts))
|
Ok(format_accounts(&accounts))
|
||||||
} else if args.cmd_import_wallet {
|
} else if args.cmd_import_wallet {
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
extern crate tempdir;
|
extern crate tempdir;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use json;
|
use json;
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::str;
|
use std::str;
|
||||||
use ethkey::{Password, Secret};
|
use ethkey::{Password, Secret};
|
||||||
@@ -74,7 +74,7 @@ impl From<Crypto> for String {
|
|||||||
impl Crypto {
|
impl Crypto {
|
||||||
/// Encrypt account secret
|
/// Encrypt account secret
|
||||||
pub fn with_secret(secret: &Secret, password: &Password, iterations: u32) -> Result<Self, crypto::Error> {
|
pub fn with_secret(secret: &Secret, password: &Password, iterations: u32) -> Result<Self, crypto::Error> {
|
||||||
Crypto::with_plain(&*secret, password, iterations)
|
Crypto::with_plain(secret.as_ref(), password, iterations)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Encrypt custom plain data
|
/// Encrypt custom plain data
|
||||||
@@ -84,7 +84,8 @@ impl Crypto {
|
|||||||
|
|
||||||
// two parts of derived key
|
// two parts of derived key
|
||||||
// DK = [ DK[0..15] DK[16..31] ] = [derived_left_bits, derived_right_bits]
|
// DK = [ DK[0..15] DK[16..31] ] = [derived_left_bits, derived_right_bits]
|
||||||
let (derived_left_bits, derived_right_bits) = crypto::derive_key_iterations(password.as_bytes(), &salt, iterations);
|
let (derived_left_bits, derived_right_bits) =
|
||||||
|
crypto::derive_key_iterations(password.as_bytes(), &salt, iterations);
|
||||||
|
|
||||||
// preallocated (on-stack in case of `Secret`) buffer to hold cipher
|
// preallocated (on-stack in case of `Secret`) buffer to hold cipher
|
||||||
// length = length(plain) as we are using CTR-approach
|
// length = length(plain) as we are using CTR-approach
|
||||||
@@ -104,7 +105,7 @@ impl Crypto {
|
|||||||
ciphertext: ciphertext.into_vec(),
|
ciphertext: ciphertext.into_vec(),
|
||||||
kdf: Kdf::Pbkdf2(Pbkdf2 {
|
kdf: Kdf::Pbkdf2(Pbkdf2 {
|
||||||
dklen: crypto::KEY_LENGTH as u32,
|
dklen: crypto::KEY_LENGTH as u32,
|
||||||
salt: salt,
|
salt: salt.to_vec(),
|
||||||
c: iterations,
|
c: iterations,
|
||||||
prf: Prf::HmacSha256,
|
prf: Prf::HmacSha256,
|
||||||
}),
|
}),
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use json;
|
use json;
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ pub struct Pbkdf2 {
|
|||||||
pub c: u32,
|
pub c: u32,
|
||||||
pub dklen: u32,
|
pub dklen: u32,
|
||||||
pub prf: Prf,
|
pub prf: Prf,
|
||||||
pub salt: [u8; 32],
|
pub salt: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
@@ -35,7 +35,7 @@ pub struct Scrypt {
|
|||||||
pub p: u32,
|
pub p: u32,
|
||||||
pub n: u32,
|
pub n: u32,
|
||||||
pub r: u32,
|
pub r: u32,
|
||||||
pub salt: [u8; 32],
|
pub salt: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
mod cipher;
|
mod cipher;
|
||||||
mod crypto;
|
mod crypto;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use ethkey::{self, KeyPair, sign, Address, Password, Signature, Message, Public, Secret};
|
use ethkey::{self, KeyPair, sign, Address, Password, Signature, Message, Public, Secret};
|
||||||
use ethkey::crypto::ecdh::agree;
|
use ethkey::crypto::ecdh::agree;
|
||||||
@@ -45,7 +45,7 @@ impl Into<json::KeyFile> for SafeAccount {
|
|||||||
json::KeyFile {
|
json::KeyFile {
|
||||||
id: From::from(self.id),
|
id: From::from(self.id),
|
||||||
version: self.version.into(),
|
version: self.version.into(),
|
||||||
address: self.address.into(),
|
address: Some(self.address.into()),
|
||||||
crypto: self.crypto.into(),
|
crypto: self.crypto.into(),
|
||||||
name: Some(self.name.into()),
|
name: Some(self.name.into()),
|
||||||
meta: Some(self.meta.into()),
|
meta: Some(self.meta.into()),
|
||||||
@@ -77,16 +77,43 @@ impl SafeAccount {
|
|||||||
/// Create a new `SafeAccount` from the given `json`; if it was read from a
|
/// Create a new `SafeAccount` from the given `json`; if it was read from a
|
||||||
/// file, the `filename` should be `Some` name. If it is as yet anonymous, then it
|
/// file, the `filename` should be `Some` name. If it is as yet anonymous, then it
|
||||||
/// can be left `None`.
|
/// can be left `None`.
|
||||||
pub fn from_file(json: json::KeyFile, filename: Option<String>) -> Self {
|
/// In case `password` is provided, we will attempt to read the secret from the keyfile
|
||||||
SafeAccount {
|
/// and derive the address from it instead of reading it directly.
|
||||||
|
/// Providing password is required for `json::KeyFile`s with no address.
|
||||||
|
pub fn from_file(json: json::KeyFile, filename: Option<String>, password: &Option<Password>) -> Result<Self, Error> {
|
||||||
|
let crypto = Crypto::from(json.crypto);
|
||||||
|
let address = match (password, &json.address) {
|
||||||
|
(None, Some(json_address)) => json_address.into(),
|
||||||
|
(None, None) => Err(Error::Custom(
|
||||||
|
"This keystore does not contain address. You need to provide password to import it".into()))?,
|
||||||
|
(Some(password), json_address) => {
|
||||||
|
let derived_address = KeyPair::from_secret(
|
||||||
|
crypto.secret(&password).map_err(|_| Error::InvalidPassword)?
|
||||||
|
)?.address();
|
||||||
|
|
||||||
|
match json_address {
|
||||||
|
Some(json_address) => {
|
||||||
|
let json_address = json_address.into();
|
||||||
|
if derived_address != json_address {
|
||||||
|
warn!("Detected address mismatch when opening an account. Derived: {:?}, in json got: {:?}",
|
||||||
|
derived_address, json_address);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_ => {},
|
||||||
|
}
|
||||||
|
derived_address
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Ok(SafeAccount {
|
||||||
id: json.id.into(),
|
id: json.id.into(),
|
||||||
version: json.version.into(),
|
version: json.version.into(),
|
||||||
address: json.address.into(),
|
address,
|
||||||
crypto: json.crypto.into(),
|
crypto,
|
||||||
filename: filename,
|
filename,
|
||||||
name: json.name.unwrap_or(String::new()),
|
name: json.name.unwrap_or(String::new()),
|
||||||
meta: json.meta.unwrap_or("{}".to_owned()),
|
meta: json.meta.unwrap_or("{}".to_owned()),
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new `SafeAccount` from the given vault `json`; if it was read from a
|
/// Create a new `SafeAccount` from the given vault `json`; if it was read from a
|
||||||
@@ -97,14 +124,14 @@ impl SafeAccount {
|
|||||||
let meta_plain = meta_crypto.decrypt(password)?;
|
let meta_plain = meta_crypto.decrypt(password)?;
|
||||||
let meta_plain = json::VaultKeyMeta::load(&meta_plain).map_err(|e| Error::Custom(format!("{:?}", e)))?;
|
let meta_plain = json::VaultKeyMeta::load(&meta_plain).map_err(|e| Error::Custom(format!("{:?}", e)))?;
|
||||||
|
|
||||||
Ok(SafeAccount::from_file(json::KeyFile {
|
SafeAccount::from_file(json::KeyFile {
|
||||||
id: json.id,
|
id: json.id,
|
||||||
version: json.version,
|
version: json.version,
|
||||||
crypto: json.crypto,
|
crypto: json.crypto,
|
||||||
address: meta_plain.address,
|
address: Some(meta_plain.address),
|
||||||
name: meta_plain.name,
|
name: meta_plain.name,
|
||||||
meta: meta_plain.meta,
|
meta: meta_plain.meta,
|
||||||
}, filename))
|
}, filename, &None)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new `VaultKeyFile` from the given `self`
|
/// Create a new `VaultKeyFile` from the given `self`
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use json;
|
use json;
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{fs, io};
|
use std::{fs, io};
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
@@ -23,6 +23,7 @@ use {json, SafeAccount, Error};
|
|||||||
use json::Uuid;
|
use json::Uuid;
|
||||||
use super::{KeyDirectory, VaultKeyDirectory, VaultKeyDirectoryProvider, VaultKey};
|
use super::{KeyDirectory, VaultKeyDirectory, VaultKeyDirectoryProvider, VaultKey};
|
||||||
use super::vault::{VAULT_FILE_NAME, VaultDiskDirectory};
|
use super::vault::{VAULT_FILE_NAME, VaultDiskDirectory};
|
||||||
|
use ethkey::Password;
|
||||||
|
|
||||||
const IGNORED_FILES: &'static [&'static str] = &[
|
const IGNORED_FILES: &'static [&'static str] = &[
|
||||||
"thumbs.db",
|
"thumbs.db",
|
||||||
@@ -60,7 +61,6 @@ pub fn find_unique_filename_using_random_suffix(parent_path: &Path, original_fil
|
|||||||
/// Create a new file and restrict permissions to owner only. It errors if the file already exists.
|
/// Create a new file and restrict permissions to owner only. It errors if the file already exists.
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub fn create_new_file_with_permissions_to_owner(file_path: &Path) -> io::Result<fs::File> {
|
pub fn create_new_file_with_permissions_to_owner(file_path: &Path) -> io::Result<fs::File> {
|
||||||
use libc;
|
|
||||||
use std::os::unix::fs::OpenOptionsExt;
|
use std::os::unix::fs::OpenOptionsExt;
|
||||||
|
|
||||||
fs::OpenOptions::new()
|
fs::OpenOptions::new()
|
||||||
@@ -82,7 +82,6 @@ pub fn create_new_file_with_permissions_to_owner(file_path: &Path) -> io::Result
|
|||||||
/// Create a new file and restrict permissions to owner only. It replaces the existing file if it already exists.
|
/// Create a new file and restrict permissions to owner only. It replaces the existing file if it already exists.
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub fn replace_file_with_permissions_to_owner(file_path: &Path) -> io::Result<fs::File> {
|
pub fn replace_file_with_permissions_to_owner(file_path: &Path) -> io::Result<fs::File> {
|
||||||
use libc;
|
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
|
|
||||||
let file = fs::File::create(file_path)?;
|
let file = fs::File::create(file_path)?;
|
||||||
@@ -106,6 +105,7 @@ pub type RootDiskDirectory = DiskDirectory<DiskKeyFileManager>;
|
|||||||
pub trait KeyFileManager: Send + Sync {
|
pub trait KeyFileManager: Send + Sync {
|
||||||
/// Read `SafeAccount` from given key file stream
|
/// Read `SafeAccount` from given key file stream
|
||||||
fn read<T>(&self, filename: Option<String>, reader: T) -> Result<SafeAccount, Error> where T: io::Read;
|
fn read<T>(&self, filename: Option<String>, reader: T) -> Result<SafeAccount, Error> where T: io::Read;
|
||||||
|
|
||||||
/// Write `SafeAccount` to given key file stream
|
/// Write `SafeAccount` to given key file stream
|
||||||
fn write<T>(&self, account: SafeAccount, writer: &mut T) -> Result<(), Error> where T: io::Write;
|
fn write<T>(&self, account: SafeAccount, writer: &mut T) -> Result<(), Error> where T: io::Write;
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,10 @@ pub struct DiskDirectory<T> where T: KeyFileManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Keys file manager for root keys directory
|
/// Keys file manager for root keys directory
|
||||||
pub struct DiskKeyFileManager;
|
#[derive(Default)]
|
||||||
|
pub struct DiskKeyFileManager {
|
||||||
|
password: Option<Password>,
|
||||||
|
}
|
||||||
|
|
||||||
impl RootDiskDirectory {
|
impl RootDiskDirectory {
|
||||||
pub fn create<P>(path: P) -> Result<Self, Error> where P: AsRef<Path> {
|
pub fn create<P>(path: P) -> Result<Self, Error> where P: AsRef<Path> {
|
||||||
@@ -125,8 +128,13 @@ impl RootDiskDirectory {
|
|||||||
Ok(Self::at(path))
|
Ok(Self::at(path))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// allows to read keyfiles with given password (needed for keyfiles w/o address)
|
||||||
|
pub fn with_password(&self, password: Option<Password>) -> Self {
|
||||||
|
DiskDirectory::new(&self.path, DiskKeyFileManager { password })
|
||||||
|
}
|
||||||
|
|
||||||
pub fn at<P>(path: P) -> Self where P: AsRef<Path> {
|
pub fn at<P>(path: P) -> Self where P: AsRef<Path> {
|
||||||
DiskDirectory::new(path, DiskKeyFileManager)
|
DiskDirectory::new(path, DiskKeyFileManager::default())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,7 +327,7 @@ impl<T> VaultKeyDirectoryProvider for DiskDirectory<T> where T: KeyFileManager {
|
|||||||
impl KeyFileManager for DiskKeyFileManager {
|
impl KeyFileManager for DiskKeyFileManager {
|
||||||
fn read<T>(&self, filename: Option<String>, reader: T) -> Result<SafeAccount, Error> where T: io::Read {
|
fn read<T>(&self, filename: Option<String>, reader: T) -> Result<SafeAccount, Error> where T: io::Read {
|
||||||
let key_file = json::KeyFile::load(reader).map_err(|e| Error::Custom(format!("{:?}", e)))?;
|
let key_file = json::KeyFile::load(reader).map_err(|e| Error::Custom(format!("{:?}", e)))?;
|
||||||
Ok(SafeAccount::from_file(key_file, filename))
|
SafeAccount::from_file(key_file, filename, &self.password)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write<T>(&self, mut account: SafeAccount, writer: &mut T) -> Result<(), Error> where T: io::Write {
|
fn write<T>(&self, mut account: SafeAccount, writer: &mut T) -> Result<(), Error> where T: io::Write {
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
@@ -68,7 +68,7 @@ impl KeyDirectory for MemoryDirectory {
|
|||||||
fn unique_repr(&self) -> Result<u64, Error> {
|
fn unique_repr(&self) -> Result<u64, Error> {
|
||||||
let mut val = 0u64;
|
let mut val = 0u64;
|
||||||
let accounts = self.accounts.read();
|
let accounts = self.accounts.read();
|
||||||
for acc in accounts.keys() { val = val ^ acc.low_u64() }
|
for acc in accounts.keys() { val = val ^ acc.to_low_u64_be() }
|
||||||
Ok(val)
|
Ok(val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Accounts Directory
|
//! Accounts Directory
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{fs, io};
|
use std::{fs, io};
|
||||||
use std::path::{PathBuf, Path};
|
use std::path::{PathBuf, Path};
|
||||||
@@ -310,8 +310,10 @@ mod test {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn make_vault_dir_path_succeeds() {
|
fn make_vault_dir_path_succeeds() {
|
||||||
assert_eq!(make_vault_dir_path("/home/user/parity", "vault", true).unwrap().to_str().unwrap(), "/home/user/parity/vault");
|
use std::path::Path;
|
||||||
assert_eq!(make_vault_dir_path("/home/user/parity", "*bad-name*", false).unwrap().to_str().unwrap(), "/home/user/parity/*bad-name*");
|
|
||||||
|
assert_eq!(&make_vault_dir_path("/home/user/parity", "vault", true).unwrap(), &Path::new("/home/user/parity/vault"));
|
||||||
|
assert_eq!(&make_vault_dir_path("/home/user/parity", "*bad-name*", false).unwrap(), &Path::new("/home/user/parity/*bad-name*"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::io::Error as IoError;
|
use std::io::Error as IoError;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! ethkey reexport to make documentation look pretty.
|
//! ethkey reexport to make documentation look pretty.
|
||||||
pub use _ethkey::*;
|
pub use _ethkey::*;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::collections::{BTreeMap, HashMap};
|
use std::collections::{BTreeMap, HashMap};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
@@ -168,7 +168,7 @@ impl SecretStore for EthStore {
|
|||||||
|
|
||||||
fn import_wallet(&self, vault: SecretVaultRef, json: &[u8], password: &Password, gen_id: bool) -> Result<StoreAccountRef, Error> {
|
fn import_wallet(&self, vault: SecretVaultRef, json: &[u8], password: &Password, gen_id: bool) -> Result<StoreAccountRef, Error> {
|
||||||
let json_keyfile = json::KeyFile::load(json).map_err(|_| Error::InvalidKeyFile("Invalid JSON format".to_owned()))?;
|
let json_keyfile = json::KeyFile::load(json).map_err(|_| Error::InvalidKeyFile("Invalid JSON format".to_owned()))?;
|
||||||
let mut safe_account = SafeAccount::from_file(json_keyfile, None);
|
let mut safe_account = SafeAccount::from_file(json_keyfile, None, &None)?;
|
||||||
|
|
||||||
if gen_id {
|
if gen_id {
|
||||||
safe_account.id = Random::random();
|
safe_account.id = Random::random();
|
||||||
@@ -1084,7 +1084,7 @@ mod tests {
|
|||||||
SecretVaultRef::Root,
|
SecretVaultRef::Root,
|
||||||
&address,
|
&address,
|
||||||
&"test".into(),
|
&"test".into(),
|
||||||
Derivation::HardHash(H256::from(0)),
|
Derivation::HardHash(H256::zero()),
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
// there should be 2 accounts in the store
|
// there should be 2 accounts in the store
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
@@ -25,7 +25,7 @@ use Error;
|
|||||||
|
|
||||||
/// Import an account from a file.
|
/// Import an account from a file.
|
||||||
pub fn import_account(path: &Path, dst: &KeyDirectory) -> Result<Address, Error> {
|
pub fn import_account(path: &Path, dst: &KeyDirectory) -> Result<Address, Error> {
|
||||||
let key_manager = DiskKeyFileManager;
|
let key_manager = DiskKeyFileManager::default();
|
||||||
let existing_accounts = dst.load()?.into_iter().map(|a| a.address).collect::<HashSet<_>>();
|
let existing_accounts = dst.load()?.into_iter().map(|a| a.address).collect::<HashSet<_>>();
|
||||||
let filename = path.file_name().and_then(|n| n.to_str()).map(|f| f.to_owned());
|
let filename = path.file_name().and_then(|n| n.to_str()).map(|f| f.to_owned());
|
||||||
let account = fs::File::open(&path)
|
let account = fs::File::open(&path)
|
||||||
@@ -42,7 +42,9 @@ pub fn import_account(path: &Path, dst: &KeyDirectory) -> Result<Address, Error>
|
|||||||
/// Import all accounts from one directory to the other.
|
/// Import all accounts from one directory to the other.
|
||||||
pub fn import_accounts(src: &KeyDirectory, dst: &KeyDirectory) -> Result<Vec<Address>, Error> {
|
pub fn import_accounts(src: &KeyDirectory, dst: &KeyDirectory) -> Result<Vec<Address>, Error> {
|
||||||
let accounts = src.load()?;
|
let accounts = src.load()?;
|
||||||
let existing_accounts = dst.load()?.into_iter().map(|a| a.address).collect::<HashSet<_>>();
|
let existing_accounts = dst.load()?.into_iter()
|
||||||
|
.map(|a| a.address)
|
||||||
|
.collect::<HashSet<_>>();
|
||||||
|
|
||||||
accounts.into_iter()
|
accounts.into_iter()
|
||||||
.filter(|a| !existing_accounts.contains(&a.address))
|
.filter(|a| !existing_accounts.contains(&a.address))
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{ops, str};
|
use std::{ops, str};
|
||||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{fmt, str};
|
use std::{fmt, str};
|
||||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||||
@@ -41,7 +41,7 @@ impl str::FromStr for Crypto {
|
|||||||
|
|
||||||
impl From<Crypto> for String {
|
impl From<Crypto> for String {
|
||||||
fn from(c: Crypto) -> Self {
|
fn from(c: Crypto) -> Self {
|
||||||
serde_json::to_string(&c).expect("serialization cannot fail, cause all crypto keys are strings")
|
serde_json::to_string(&c).expect("Serialization cannot fail, because all crypto keys are strings")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,6 +52,7 @@ enum CryptoField {
|
|||||||
Kdf,
|
Kdf,
|
||||||
KdfParams,
|
KdfParams,
|
||||||
Mac,
|
Mac,
|
||||||
|
Version,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Deserialize<'a> for CryptoField {
|
impl<'a> Deserialize<'a> for CryptoField {
|
||||||
@@ -81,6 +82,7 @@ impl<'a> Visitor<'a> for CryptoFieldVisitor {
|
|||||||
"kdf" => Ok(CryptoField::Kdf),
|
"kdf" => Ok(CryptoField::Kdf),
|
||||||
"kdfparams" => Ok(CryptoField::KdfParams),
|
"kdfparams" => Ok(CryptoField::KdfParams),
|
||||||
"mac" => Ok(CryptoField::Mac),
|
"mac" => Ok(CryptoField::Mac),
|
||||||
|
"version" => Ok(CryptoField::Version),
|
||||||
_ => Err(Error::custom(format!("Unknown field: '{}'", value))),
|
_ => Err(Error::custom(format!("Unknown field: '{}'", value))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -122,6 +124,8 @@ impl<'a> Visitor<'a> for CryptoVisitor {
|
|||||||
Some(CryptoField::Kdf) => { kdf = Some(visitor.next_value()?); }
|
Some(CryptoField::Kdf) => { kdf = Some(visitor.next_value()?); }
|
||||||
Some(CryptoField::KdfParams) => { kdfparams = Some(visitor.next_value()?); }
|
Some(CryptoField::KdfParams) => { kdfparams = Some(visitor.next_value()?); }
|
||||||
Some(CryptoField::Mac) => { mac = Some(visitor.next_value()?); }
|
Some(CryptoField::Mac) => { mac = Some(visitor.next_value()?); }
|
||||||
|
// skip not required version field (it appears in pyethereum generated keystores)
|
||||||
|
Some(CryptoField::Version) => { visitor.next_value().unwrap_or(()) }
|
||||||
None => { break; }
|
None => { break; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{ops, fmt, str};
|
use std::{ops, fmt, str};
|
||||||
use rustc_hex::{FromHex, ToHex};
|
use rustc_hex::{FromHex, ToHex};
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Universaly unique identifier.
|
//! Universaly unique identifier.
|
||||||
use std::{fmt, str};
|
use std::{fmt, str};
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
||||||
use serde::de::{Visitor, Error as SerdeError};
|
use serde::de::{Visitor, Error as SerdeError};
|
||||||
use super::{Error, H256};
|
use super::{Error, Bytes};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum KdfSer {
|
pub enum KdfSer {
|
||||||
@@ -111,7 +111,7 @@ pub struct Pbkdf2 {
|
|||||||
pub c: u32,
|
pub c: u32,
|
||||||
pub dklen: u32,
|
pub dklen: u32,
|
||||||
pub prf: Prf,
|
pub prf: Prf,
|
||||||
pub salt: H256,
|
pub salt: Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||||
@@ -120,7 +120,7 @@ pub struct Scrypt {
|
|||||||
pub p: u32,
|
pub p: u32,
|
||||||
pub n: u32,
|
pub n: u32,
|
||||||
pub r: u32,
|
pub r: u32,
|
||||||
pub salt: H256,
|
pub salt: Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
@@ -46,7 +46,7 @@ pub struct KeyFile {
|
|||||||
pub id: Uuid,
|
pub id: Uuid,
|
||||||
pub version: Version,
|
pub version: Version,
|
||||||
pub crypto: Crypto,
|
pub crypto: Crypto,
|
||||||
pub address: H160,
|
pub address: Option<H160>,
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
pub meta: Option<String>,
|
pub meta: Option<String>,
|
||||||
}
|
}
|
||||||
@@ -158,11 +158,6 @@ impl<'a> Visitor<'a> for KeyFileVisitor {
|
|||||||
None => return Err(V::Error::missing_field("crypto")),
|
None => return Err(V::Error::missing_field("crypto")),
|
||||||
};
|
};
|
||||||
|
|
||||||
let address = match address {
|
|
||||||
Some(address) => address,
|
|
||||||
None => return Err(V::Error::missing_field("address")),
|
|
||||||
};
|
|
||||||
|
|
||||||
let result = KeyFile {
|
let result = KeyFile {
|
||||||
id: id,
|
id: id,
|
||||||
version: version,
|
version: version,
|
||||||
@@ -222,7 +217,7 @@ mod tests {
|
|||||||
let expected = KeyFile {
|
let expected = KeyFile {
|
||||||
id: Uuid::from_str("8777d9f6-7860-4b9b-88b7-0b57ee6b3a73").unwrap(),
|
id: Uuid::from_str("8777d9f6-7860-4b9b-88b7-0b57ee6b3a73").unwrap(),
|
||||||
version: Version::V3,
|
version: Version::V3,
|
||||||
address: "6edddfc6349aff20bc6467ccf276c5b52487f7a8".into(),
|
address: Some("6edddfc6349aff20bc6467ccf276c5b52487f7a8".into()),
|
||||||
crypto: Crypto {
|
crypto: Crypto {
|
||||||
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
||||||
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
||||||
@@ -273,7 +268,7 @@ mod tests {
|
|||||||
let expected = KeyFile {
|
let expected = KeyFile {
|
||||||
id: "8777d9f6-7860-4b9b-88b7-0b57ee6b3a73".into(),
|
id: "8777d9f6-7860-4b9b-88b7-0b57ee6b3a73".into(),
|
||||||
version: Version::V3,
|
version: Version::V3,
|
||||||
address: "6edddfc6349aff20bc6467ccf276c5b52487f7a8".into(),
|
address: Some("6edddfc6349aff20bc6467ccf276c5b52487f7a8".into()),
|
||||||
crypto: Crypto {
|
crypto: Crypto {
|
||||||
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
||||||
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
||||||
@@ -301,7 +296,7 @@ mod tests {
|
|||||||
let file = KeyFile {
|
let file = KeyFile {
|
||||||
id: "8777d9f6-7860-4b9b-88b7-0b57ee6b3a73".into(),
|
id: "8777d9f6-7860-4b9b-88b7-0b57ee6b3a73".into(),
|
||||||
version: Version::V3,
|
version: Version::V3,
|
||||||
address: "6edddfc6349aff20bc6467ccf276c5b52487f7a8".into(),
|
address: Some("6edddfc6349aff20bc6467ccf276c5b52487f7a8".into()),
|
||||||
crypto: Crypto {
|
crypto: Crypto {
|
||||||
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
||||||
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Contract interface specification.
|
//! Contract interface specification.
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use serde_json;
|
use serde_json;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
use serde_json;
|
use serde_json;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Ethereum key-management.
|
//! Ethereum key-management.
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use rand::{Rng, OsRng};
|
use rand::{Rng, RngCore, rngs::OsRng, distributions::Alphanumeric};
|
||||||
|
|
||||||
pub trait Random {
|
pub trait Random {
|
||||||
fn random() -> Self where Self: Sized;
|
fn random() -> Self where Self: Sized;
|
||||||
@@ -41,5 +41,5 @@ impl Random for [u8; 32] {
|
|||||||
/// Generate a random string of given length.
|
/// Generate a random string of given length.
|
||||||
pub fn random_string(length: usize) -> String {
|
pub fn random_string(length: usize) -> String {
|
||||||
let mut rng = OsRng::new().expect("Not able to operate without random source.");
|
let mut rng = OsRng::new().expect("Not able to operate without random source.");
|
||||||
rng.gen_ascii_chars().take(length).collect()
|
rng.sample_iter(&Alphanumeric).take(length).collect()
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
@@ -1,21 +1,22 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
extern crate ethstore;
|
extern crate ethstore;
|
||||||
|
extern crate ethereum_types;
|
||||||
|
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
@@ -23,6 +24,8 @@ use ethstore::{EthStore, SimpleSecretStore, SecretVaultRef, StoreAccountRef};
|
|||||||
use ethstore::ethkey::{Random, Generator, Secret, KeyPair, verify_address};
|
use ethstore::ethkey::{Random, Generator, Secret, KeyPair, verify_address};
|
||||||
use ethstore::accounts_dir::RootDiskDirectory;
|
use ethstore::accounts_dir::RootDiskDirectory;
|
||||||
use util::TransientDir;
|
use util::TransientDir;
|
||||||
|
use ethereum_types::Address;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn secret_store_create() {
|
fn secret_store_create() {
|
||||||
@@ -114,9 +117,9 @@ fn secret_store_laod_geth_files() {
|
|||||||
let dir = RootDiskDirectory::at(test_path());
|
let dir = RootDiskDirectory::at(test_path());
|
||||||
let store = EthStore::open(Box::new(dir)).unwrap();
|
let store = EthStore::open(Box::new(dir)).unwrap();
|
||||||
assert_eq!(store.accounts().unwrap(), vec![
|
assert_eq!(store.accounts().unwrap(), vec![
|
||||||
StoreAccountRef::root("3f49624084b67849c7b4e805c5988c21a430f9d9".into()),
|
StoreAccountRef::root(Address::from_str("3f49624084b67849c7b4e805c5988c21a430f9d9").unwrap()),
|
||||||
StoreAccountRef::root("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf".into()),
|
StoreAccountRef::root(Address::from_str("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf").unwrap()),
|
||||||
StoreAccountRef::root("63121b431a52f8043c16fcf0d1df9cb7b5f66649".into()),
|
StoreAccountRef::root(Address::from_str("63121b431a52f8043c16fcf0d1df9cb7b5f66649").unwrap()),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,8 +128,8 @@ fn secret_store_load_pat_files() {
|
|||||||
let dir = RootDiskDirectory::at(pat_path());
|
let dir = RootDiskDirectory::at(pat_path());
|
||||||
let store = EthStore::open(Box::new(dir)).unwrap();
|
let store = EthStore::open(Box::new(dir)).unwrap();
|
||||||
assert_eq!(store.accounts().unwrap(), vec![
|
assert_eq!(store.accounts().unwrap(), vec![
|
||||||
StoreAccountRef::root("3f49624084b67849c7b4e805c5988c21a430f9d9".into()),
|
StoreAccountRef::root(Address::from_str("3f49624084b67849c7b4e805c5988c21a430f9d9").unwrap()),
|
||||||
StoreAccountRef::root("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf".into()),
|
StoreAccountRef::root(Address::from_str("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf").unwrap()),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,8 +143,8 @@ fn test_decrypting_files_with_short_ciphertext() {
|
|||||||
let store = EthStore::open(Box::new(dir)).unwrap();
|
let store = EthStore::open(Box::new(dir)).unwrap();
|
||||||
let accounts = store.accounts().unwrap();
|
let accounts = store.accounts().unwrap();
|
||||||
assert_eq!(accounts, vec![
|
assert_eq!(accounts, vec![
|
||||||
StoreAccountRef::root("31e9d1e6d844bd3a536800ef8d8be6a9975db509".into()),
|
StoreAccountRef::root(Address::from_str("31e9d1e6d844bd3a536800ef8d8be6a9975db509").unwrap()),
|
||||||
StoreAccountRef::root("d1e64e5480bfaf733ba7d48712decb8227797a4e".into()),
|
StoreAccountRef::root(Address::from_str("d1e64e5480bfaf733ba7d48712decb8227797a4e").unwrap()),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let message = Default::default();
|
let message = Default::default();
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
mod transient_dir;
|
mod transient_dir;
|
||||||
|
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::{env, fs};
|
use std::{env, fs};
|
||||||
use rand::{Rng, OsRng};
|
use rand::{RngCore, rngs::OsRng};
|
||||||
use ethstore::accounts_dir::{KeyDirectory, RootDiskDirectory};
|
use ethstore::accounts_dir::{KeyDirectory, RootDiskDirectory};
|
||||||
use ethstore::{Error, SafeAccount};
|
use ethstore::{Error, SafeAccount};
|
||||||
|
|
||||||
73
accounts/src/account_data.rs
Normal file
73
accounts/src/account_data.rs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
|
// Parity Ethereum 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 Ethereum 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 Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
//! Account Metadata
|
||||||
|
|
||||||
|
use std::{
|
||||||
|
collections::HashMap,
|
||||||
|
time::Instant,
|
||||||
|
};
|
||||||
|
|
||||||
|
use ethkey::{Address, Password};
|
||||||
|
use serde_derive::{Serialize, Deserialize};
|
||||||
|
use serde_json;
|
||||||
|
|
||||||
|
/// Type of unlock.
|
||||||
|
#[derive(Clone, PartialEq)]
|
||||||
|
pub enum Unlock {
|
||||||
|
/// If account is unlocked temporarily, it should be locked after first usage.
|
||||||
|
OneTime,
|
||||||
|
/// Account unlocked permanently can always sign message.
|
||||||
|
/// Use with caution.
|
||||||
|
Perm,
|
||||||
|
/// Account unlocked with a timeout
|
||||||
|
Timed(Instant),
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Data associated with account.
|
||||||
|
#[derive(Clone)]
|
||||||
|
pub struct AccountData {
|
||||||
|
pub unlock: Unlock,
|
||||||
|
pub password: Password,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Collected account metadata
|
||||||
|
#[derive(Default, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct AccountMeta {
|
||||||
|
/// The name of the account.
|
||||||
|
pub name: String,
|
||||||
|
/// The rest of the metadata of the account.
|
||||||
|
pub meta: String,
|
||||||
|
/// The 128-bit Uuid of the account, if it has one (brain-wallets don't).
|
||||||
|
pub uuid: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AccountMeta {
|
||||||
|
/// Read a hash map of Address -> AccountMeta
|
||||||
|
pub fn read<R>(reader: R) -> Result<HashMap<Address, Self>, serde_json::Error> where
|
||||||
|
R: ::std::io::Read,
|
||||||
|
{
|
||||||
|
serde_json::from_reader(reader)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Write a hash map of Address -> AccountMeta
|
||||||
|
pub fn write<W>(m: &HashMap<Address, Self>, writer: &mut W) -> Result<(), serde_json::Error> where
|
||||||
|
W: ::std::io::Write,
|
||||||
|
{
|
||||||
|
serde_json::to_writer(writer, m)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -14,32 +14,33 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Stop guard mod
|
use std::fmt;
|
||||||
|
|
||||||
use std::sync::Arc;
|
use ethstore::{Error as SSError};
|
||||||
use std::sync::atomic::*;
|
|
||||||
|
|
||||||
/// Stop guard that will set a stop flag on drop
|
/// Signing error
|
||||||
pub struct StopGuard {
|
#[derive(Debug)]
|
||||||
flag: Arc<AtomicBool>,
|
pub enum SignError {
|
||||||
|
/// Account is not unlocked
|
||||||
|
NotUnlocked,
|
||||||
|
/// Account does not exist.
|
||||||
|
NotFound,
|
||||||
|
/// Low-level error from store
|
||||||
|
SStore(SSError),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StopGuard {
|
impl fmt::Display for SignError {
|
||||||
/// Create a stop guard
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||||
pub fn new() -> StopGuard {
|
match *self {
|
||||||
StopGuard {
|
SignError::NotUnlocked => write!(f, "Account is locked"),
|
||||||
flag: Arc::new(AtomicBool::new(false))
|
SignError::NotFound => write!(f, "Account does not exist"),
|
||||||
|
SignError::SStore(ref e) => write!(f, "{}", e),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Share stop guard between the threads
|
|
||||||
pub fn share(&self) -> Arc<AtomicBool> {
|
|
||||||
self.flag.clone()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for StopGuard {
|
impl From<SSError> for SignError {
|
||||||
fn drop(&mut self) {
|
fn from(e: SSError) -> Self {
|
||||||
self.flag.store(true, Ordering::Relaxed)
|
SignError::SStore(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,107 +1,59 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
//! Account management.
|
//! Account management.
|
||||||
|
|
||||||
|
mod account_data;
|
||||||
|
mod error;
|
||||||
mod stores;
|
mod stores;
|
||||||
|
|
||||||
|
use self::account_data::{Unlock, AccountData};
|
||||||
use self::stores::AddressBook;
|
use self::stores::AddressBook;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fmt;
|
|
||||||
use std::time::{Instant, Duration};
|
use std::time::{Instant, Duration};
|
||||||
|
|
||||||
|
use ethkey::{Address, Message, Public, Secret, Password, Random, Generator};
|
||||||
use ethstore::accounts_dir::MemoryDirectory;
|
use ethstore::accounts_dir::MemoryDirectory;
|
||||||
use ethstore::ethkey::{Address, Message, Public, Secret, Password, Random, Generator};
|
|
||||||
use ethjson::misc::AccountMeta;
|
|
||||||
use ethstore::{
|
use ethstore::{
|
||||||
SimpleSecretStore, SecretStore, Error as SSError, EthStore, EthMultiStore,
|
SimpleSecretStore, SecretStore, EthStore, EthMultiStore,
|
||||||
random_string, SecretVaultRef, StoreAccountRef, OpaqueSecret,
|
random_string, SecretVaultRef, StoreAccountRef, OpaqueSecret,
|
||||||
};
|
};
|
||||||
|
use log::warn;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
|
|
||||||
pub use ethstore::ethkey::Signature;
|
pub use ethkey::Signature;
|
||||||
pub use ethstore::{Derivation, IndexDerivation, KeyFile};
|
pub use ethstore::{Derivation, IndexDerivation, KeyFile, Error};
|
||||||
pub use hardware_wallet::{Error as HardwareError, HardwareWalletManager, KeyPath, TransactionInfo};
|
|
||||||
pub use super::transaction::{Action, Transaction};
|
|
||||||
|
|
||||||
/// Type of unlock.
|
pub use self::account_data::AccountMeta;
|
||||||
#[derive(Clone, PartialEq)]
|
pub use self::error::SignError;
|
||||||
enum Unlock {
|
|
||||||
/// If account is unlocked temporarily, it should be locked after first usage.
|
|
||||||
OneTime,
|
|
||||||
/// Account unlocked permanently can always sign message.
|
|
||||||
/// Use with caution.
|
|
||||||
Perm,
|
|
||||||
/// Account unlocked with a timeout
|
|
||||||
Timed(Instant),
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Data associated with account.
|
|
||||||
#[derive(Clone)]
|
|
||||||
struct AccountData {
|
|
||||||
unlock: Unlock,
|
|
||||||
password: Password,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Signing error
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub enum SignError {
|
|
||||||
/// Account is not unlocked
|
|
||||||
NotUnlocked,
|
|
||||||
/// Account does not exist.
|
|
||||||
NotFound,
|
|
||||||
/// Low-level hardware device error.
|
|
||||||
Hardware(HardwareError),
|
|
||||||
/// Low-level error from store
|
|
||||||
SStore(SSError),
|
|
||||||
}
|
|
||||||
|
|
||||||
impl fmt::Display for SignError {
|
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
|
||||||
match *self {
|
|
||||||
SignError::NotUnlocked => write!(f, "Account is locked"),
|
|
||||||
SignError::NotFound => write!(f, "Account does not exist"),
|
|
||||||
SignError::Hardware(ref e) => write!(f, "{}", e),
|
|
||||||
SignError::SStore(ref e) => write!(f, "{}", e),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<HardwareError> for SignError {
|
|
||||||
fn from(e: HardwareError) -> Self {
|
|
||||||
SignError::Hardware(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<SSError> for SignError {
|
|
||||||
fn from(e: SSError) -> Self {
|
|
||||||
SignError::SStore(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// `AccountProvider` errors.
|
|
||||||
pub type Error = SSError;
|
|
||||||
|
|
||||||
fn transient_sstore() -> EthMultiStore {
|
|
||||||
EthMultiStore::open(Box::new(MemoryDirectory::default())).expect("MemoryDirectory load always succeeds; qed")
|
|
||||||
}
|
|
||||||
|
|
||||||
type AccountToken = Password;
|
type AccountToken = Password;
|
||||||
|
|
||||||
|
/// Account management settings.
|
||||||
|
#[derive(Debug, Default)]
|
||||||
|
pub struct AccountProviderSettings {
|
||||||
|
/// Store raw account secret when unlocking the account permanently.
|
||||||
|
pub unlock_keep_secret: bool,
|
||||||
|
/// Disallowed accounts.
|
||||||
|
pub blacklisted_accounts: Vec<Address>,
|
||||||
|
}
|
||||||
|
|
||||||
/// Account management.
|
/// Account management.
|
||||||
/// Responsible for unlocking accounts.
|
/// Responsible for unlocking accounts.
|
||||||
pub struct AccountProvider {
|
pub struct AccountProvider {
|
||||||
@@ -115,8 +67,6 @@ pub struct AccountProvider {
|
|||||||
sstore: Box<SecretStore>,
|
sstore: Box<SecretStore>,
|
||||||
/// Accounts unlocked with rolling tokens
|
/// Accounts unlocked with rolling tokens
|
||||||
transient_sstore: EthMultiStore,
|
transient_sstore: EthMultiStore,
|
||||||
/// Accounts in hardware wallets.
|
|
||||||
hardware_store: Option<HardwareWalletManager>,
|
|
||||||
/// When unlocking account permanently we additionally keep a raw secret in memory
|
/// When unlocking account permanently we additionally keep a raw secret in memory
|
||||||
/// to increase the performance of transaction signing.
|
/// to increase the performance of transaction signing.
|
||||||
unlock_keep_secret: bool,
|
unlock_keep_secret: bool,
|
||||||
@@ -124,44 +74,13 @@ pub struct AccountProvider {
|
|||||||
blacklisted_accounts: Vec<Address>,
|
blacklisted_accounts: Vec<Address>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Account management settings.
|
fn transient_sstore() -> EthMultiStore {
|
||||||
pub struct AccountProviderSettings {
|
EthMultiStore::open(Box::new(MemoryDirectory::default())).expect("MemoryDirectory load always succeeds; qed")
|
||||||
/// Enable hardware wallet support.
|
|
||||||
pub enable_hardware_wallets: bool,
|
|
||||||
/// Use the classic chain key on the hardware wallet.
|
|
||||||
pub hardware_wallet_classic_key: bool,
|
|
||||||
/// Store raw account secret when unlocking the account permanently.
|
|
||||||
pub unlock_keep_secret: bool,
|
|
||||||
/// Disallowed accounts.
|
|
||||||
pub blacklisted_accounts: Vec<Address>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for AccountProviderSettings {
|
|
||||||
fn default() -> Self {
|
|
||||||
AccountProviderSettings {
|
|
||||||
enable_hardware_wallets: false,
|
|
||||||
hardware_wallet_classic_key: false,
|
|
||||||
unlock_keep_secret: false,
|
|
||||||
blacklisted_accounts: vec![],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AccountProvider {
|
impl AccountProvider {
|
||||||
/// Creates new account provider.
|
/// Creates new account provider.
|
||||||
pub fn new(sstore: Box<SecretStore>, settings: AccountProviderSettings) -> Self {
|
pub fn new(sstore: Box<SecretStore>, settings: AccountProviderSettings) -> Self {
|
||||||
let mut hardware_store = None;
|
|
||||||
|
|
||||||
if settings.enable_hardware_wallets {
|
|
||||||
match HardwareWalletManager::new() {
|
|
||||||
Ok(manager) => {
|
|
||||||
manager.set_key_path(if settings.hardware_wallet_classic_key { KeyPath::EthereumClassic } else { KeyPath::Ethereum });
|
|
||||||
hardware_store = Some(manager)
|
|
||||||
},
|
|
||||||
Err(e) => debug!("Error initializing hardware wallets: {}", e),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Ok(accounts) = sstore.accounts() {
|
if let Ok(accounts) = sstore.accounts() {
|
||||||
for account in accounts.into_iter().filter(|a| settings.blacklisted_accounts.contains(&a.address)) {
|
for account in accounts.into_iter().filter(|a| settings.blacklisted_accounts.contains(&a.address)) {
|
||||||
warn!("Local Account {} has a blacklisted (known to be weak) address and will be ignored",
|
warn!("Local Account {} has a blacklisted (known to be weak) address and will be ignored",
|
||||||
@@ -179,9 +98,8 @@ impl AccountProvider {
|
|||||||
unlocked_secrets: RwLock::new(HashMap::new()),
|
unlocked_secrets: RwLock::new(HashMap::new()),
|
||||||
unlocked: RwLock::new(HashMap::new()),
|
unlocked: RwLock::new(HashMap::new()),
|
||||||
address_book: RwLock::new(address_book),
|
address_book: RwLock::new(address_book),
|
||||||
sstore: sstore,
|
sstore,
|
||||||
transient_sstore: transient_sstore(),
|
transient_sstore: transient_sstore(),
|
||||||
hardware_store: hardware_store,
|
|
||||||
unlock_keep_secret: settings.unlock_keep_secret,
|
unlock_keep_secret: settings.unlock_keep_secret,
|
||||||
blacklisted_accounts: settings.blacklisted_accounts,
|
blacklisted_accounts: settings.blacklisted_accounts,
|
||||||
}
|
}
|
||||||
@@ -195,7 +113,6 @@ impl AccountProvider {
|
|||||||
address_book: RwLock::new(AddressBook::transient()),
|
address_book: RwLock::new(AddressBook::transient()),
|
||||||
sstore: Box::new(EthStore::open(Box::new(MemoryDirectory::default())).expect("MemoryDirectory load always succeeds; qed")),
|
sstore: Box::new(EthStore::open(Box::new(MemoryDirectory::default())).expect("MemoryDirectory load always succeeds; qed")),
|
||||||
transient_sstore: transient_sstore(),
|
transient_sstore: transient_sstore(),
|
||||||
hardware_store: None,
|
|
||||||
unlock_keep_secret: false,
|
unlock_keep_secret: false,
|
||||||
blacklisted_accounts: vec![],
|
blacklisted_accounts: vec![],
|
||||||
}
|
}
|
||||||
@@ -221,7 +138,7 @@ impl AccountProvider {
|
|||||||
let account = self.sstore.insert_account(SecretVaultRef::Root, secret, password)?;
|
let account = self.sstore.insert_account(SecretVaultRef::Root, secret, password)?;
|
||||||
if self.blacklisted_accounts.contains(&account.address) {
|
if self.blacklisted_accounts.contains(&account.address) {
|
||||||
self.sstore.remove_account(&account, password)?;
|
self.sstore.remove_account(&account, password)?;
|
||||||
return Err(SSError::InvalidAccount.into());
|
return Err(Error::InvalidAccount.into());
|
||||||
}
|
}
|
||||||
Ok(account.address)
|
Ok(account.address)
|
||||||
}
|
}
|
||||||
@@ -251,7 +168,7 @@ impl AccountProvider {
|
|||||||
let account = self.sstore.import_wallet(SecretVaultRef::Root, json, password, gen_id)?;
|
let account = self.sstore.import_wallet(SecretVaultRef::Root, json, password, gen_id)?;
|
||||||
if self.blacklisted_accounts.contains(&account.address) {
|
if self.blacklisted_accounts.contains(&account.address) {
|
||||||
self.sstore.remove_account(&account, password)?;
|
self.sstore.remove_account(&account, password)?;
|
||||||
return Err(SSError::InvalidAccount.into());
|
return Err(Error::InvalidAccount.into());
|
||||||
}
|
}
|
||||||
Ok(Address::from(account.address).into())
|
Ok(Address::from(account.address).into())
|
||||||
}
|
}
|
||||||
@@ -277,34 +194,6 @@ impl AccountProvider {
|
|||||||
Ok(self.accounts()?.first().cloned().unwrap_or_default())
|
Ok(self.accounts()?.first().cloned().unwrap_or_default())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns addresses of hardware accounts.
|
|
||||||
pub fn hardware_accounts(&self) -> Result<Vec<Address>, Error> {
|
|
||||||
if let Some(accounts) = self.hardware_store.as_ref().map(|h| h.list_wallets()) {
|
|
||||||
if !accounts.is_empty() {
|
|
||||||
return Ok(accounts.into_iter().map(|a| a.address).collect());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(SSError::Custom("No hardware wallet accounts were found".into()))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get a list of paths to locked hardware wallets
|
|
||||||
pub fn locked_hardware_accounts(&self) -> Result<Vec<String>, SignError> {
|
|
||||||
match self.hardware_store.as_ref().map(|h| h.list_locked_wallets()) {
|
|
||||||
None => Err(SignError::NotFound),
|
|
||||||
Some(Err(e)) => Err(SignError::Hardware(e)),
|
|
||||||
Some(Ok(s)) => Ok(s),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Provide a pin to a locked hardware wallet on USB path to unlock it
|
|
||||||
pub fn hardware_pin_matrix_ack(&self, path: &str, pin: &str) -> Result<bool, SignError> {
|
|
||||||
match self.hardware_store.as_ref().map(|h| h.pin_matrix_ack(path, pin)) {
|
|
||||||
None => Err(SignError::NotFound),
|
|
||||||
Some(Err(e)) => Err(SignError::Hardware(e)),
|
|
||||||
Some(Ok(s)) => Ok(s),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns each address along with metadata.
|
/// Returns each address along with metadata.
|
||||||
pub fn addresses_info(&self) -> HashMap<Address, AccountMeta> {
|
pub fn addresses_info(&self) -> HashMap<Address, AccountMeta> {
|
||||||
self.address_book.read().get()
|
self.address_book.read().get()
|
||||||
@@ -335,36 +224,14 @@ impl AccountProvider {
|
|||||||
Ok(r)
|
Ok(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns each hardware account along with name and meta.
|
|
||||||
pub fn hardware_accounts_info(&self) -> Result<HashMap<Address, AccountMeta>, Error> {
|
|
||||||
let r = self.hardware_accounts()?
|
|
||||||
.into_iter()
|
|
||||||
.map(|address| (address.clone(), self.account_meta(address).ok().unwrap_or_default()))
|
|
||||||
.collect();
|
|
||||||
Ok(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns each hardware account along with name and meta.
|
|
||||||
pub fn is_hardware_address(&self, address: &Address) -> bool {
|
|
||||||
self.hardware_store.as_ref().and_then(|s| s.wallet_info(address)).is_some()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns each account along with name and meta.
|
/// Returns each account along with name and meta.
|
||||||
pub fn account_meta(&self, address: Address) -> Result<AccountMeta, Error> {
|
pub fn account_meta(&self, address: Address) -> Result<AccountMeta, Error> {
|
||||||
if let Some(info) = self.hardware_store.as_ref().and_then(|s| s.wallet_info(&address)) {
|
let account = self.sstore.account_ref(&address)?;
|
||||||
Ok(AccountMeta {
|
Ok(AccountMeta {
|
||||||
name: info.name,
|
name: self.sstore.name(&account)?,
|
||||||
meta: info.manufacturer,
|
meta: self.sstore.meta(&account)?,
|
||||||
uuid: None,
|
uuid: self.sstore.uuid(&account).ok().map(Into::into), // allowed to not have a Uuid
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
let account = self.sstore.account_ref(&address)?;
|
|
||||||
Ok(AccountMeta {
|
|
||||||
name: self.sstore.name(&account)?,
|
|
||||||
meta: self.sstore.meta(&account)?,
|
|
||||||
uuid: self.sstore.uuid(&account).ok().map(Into::into), // allowed to not have a Uuid
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns account public key.
|
/// Returns account public key.
|
||||||
@@ -428,10 +295,7 @@ impl AccountProvider {
|
|||||||
let _ = self.sstore.sign(&account, &password, &Default::default())?;
|
let _ = self.sstore.sign(&account, &password, &Default::default())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = AccountData {
|
let data = AccountData { unlock, password };
|
||||||
unlock: unlock,
|
|
||||||
password: password,
|
|
||||||
};
|
|
||||||
|
|
||||||
unlocked.insert(account, data);
|
unlocked.insert(account, data);
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -633,43 +497,13 @@ impl AccountProvider {
|
|||||||
self.sstore.set_vault_meta(name, meta)
|
self.sstore.set_vault_meta(name, meta)
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sign message with hardware wallet.
|
|
||||||
pub fn sign_message_with_hardware(&self, address: &Address, message: &[u8]) -> Result<Signature, SignError> {
|
|
||||||
match self.hardware_store.as_ref().map(|s| s.sign_message(address, message)) {
|
|
||||||
None | Some(Err(HardwareError::KeyNotFound)) => Err(SignError::NotFound),
|
|
||||||
Some(Err(e)) => Err(From::from(e)),
|
|
||||||
Some(Ok(s)) => Ok(s),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Sign transaction with hardware wallet.
|
|
||||||
pub fn sign_transaction_with_hardware(&self, address: &Address, transaction: &Transaction, chain_id: Option<u64>, rlp_encoded_transaction: &[u8]) -> Result<Signature, SignError> {
|
|
||||||
let t_info = TransactionInfo {
|
|
||||||
nonce: transaction.nonce,
|
|
||||||
gas_price: transaction.gas_price,
|
|
||||||
gas_limit: transaction.gas,
|
|
||||||
to: match transaction.action {
|
|
||||||
Action::Create => None,
|
|
||||||
Action::Call(ref to) => Some(to.clone()),
|
|
||||||
},
|
|
||||||
value: transaction.value,
|
|
||||||
data: transaction.data.to_vec(),
|
|
||||||
chain_id: chain_id,
|
|
||||||
};
|
|
||||||
match self.hardware_store.as_ref().map(|s| s.sign_transaction(&address, &t_info, rlp_encoded_transaction)) {
|
|
||||||
None | Some(Err(HardwareError::KeyNotFound)) => Err(SignError::NotFound),
|
|
||||||
Some(Err(e)) => Err(From::from(e)),
|
|
||||||
Some(Ok(s)) => Ok(s),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{AccountProvider, Unlock};
|
use super::{AccountProvider, Unlock};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use ethstore::ethkey::{Generator, Random, Address};
|
use ethkey::{Generator, Random, Address};
|
||||||
use ethstore::{StoreAccountRef, Derivation};
|
use ethstore::{StoreAccountRef, Derivation};
|
||||||
use ethereum_types::H256;
|
use ethereum_types::H256;
|
||||||
|
|
||||||
@@ -694,7 +528,7 @@ mod tests {
|
|||||||
let derived_addr = ap.derive_account(
|
let derived_addr = ap.derive_account(
|
||||||
&kp.address(),
|
&kp.address(),
|
||||||
None,
|
None,
|
||||||
Derivation::SoftHash(H256::from(999)),
|
Derivation::SoftHash(H256::from_low_u64_be(999)),
|
||||||
false,
|
false,
|
||||||
).expect("Derivation should not fail");
|
).expect("Derivation should not fail");
|
||||||
|
|
||||||
@@ -712,7 +546,7 @@ mod tests {
|
|||||||
let derived_addr = ap.derive_account(
|
let derived_addr = ap.derive_account(
|
||||||
&kp.address(),
|
&kp.address(),
|
||||||
None,
|
None,
|
||||||
Derivation::SoftHash(H256::from(999)),
|
Derivation::SoftHash(H256::from_low_u64_be(999)),
|
||||||
true,
|
true,
|
||||||
).expect("Derivation should not fail");
|
).expect("Derivation should not fail");
|
||||||
|
|
||||||
@@ -733,7 +567,7 @@ mod tests {
|
|||||||
let derived_addr = ap.derive_account(
|
let derived_addr = ap.derive_account(
|
||||||
&kp.address(),
|
&kp.address(),
|
||||||
None,
|
None,
|
||||||
Derivation::SoftHash(H256::from(1999)),
|
Derivation::SoftHash(H256::from_low_u64_be(1999)),
|
||||||
true,
|
true,
|
||||||
).expect("Derivation should not fail");
|
).expect("Derivation should not fail");
|
||||||
ap.unlock_account_permanently(derived_addr, "base".into())
|
ap.unlock_account_permanently(derived_addr, "base".into())
|
||||||
@@ -745,7 +579,7 @@ mod tests {
|
|||||||
let signed_msg2 = ap.sign_derived(
|
let signed_msg2 = ap.sign_derived(
|
||||||
&kp.address(),
|
&kp.address(),
|
||||||
None,
|
None,
|
||||||
Derivation::SoftHash(H256::from(1999)),
|
Derivation::SoftHash(H256::from_low_u64_be(1999)),
|
||||||
msg,
|
msg,
|
||||||
).expect("Derived signing with existing unlocked account should not fail");
|
).expect("Derived signing with existing unlocked account should not fail");
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Address Book Store
|
//! Address Book Store
|
||||||
|
|
||||||
@@ -20,8 +20,10 @@ use std::{fs, fmt, hash, ops};
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use ethstore::ethkey::Address;
|
use ethkey::Address;
|
||||||
use ethjson::misc::AccountMeta;
|
use log::{trace, warn};
|
||||||
|
|
||||||
|
use crate::AccountMeta;
|
||||||
|
|
||||||
/// Disk-backed map from Address to String. Uses JSON.
|
/// Disk-backed map from Address to String. Uses JSON.
|
||||||
pub struct AddressBook {
|
pub struct AddressBook {
|
||||||
@@ -151,19 +153,21 @@ impl<K: hash::Hash + Eq, V> DiskMap<K, V> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::AddressBook;
|
use super::{AddressBook, Address};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use ethjson::misc::AccountMeta;
|
|
||||||
use tempdir::TempDir;
|
use tempdir::TempDir;
|
||||||
|
use crate::account_data::AccountMeta;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_save_and_reload_address_book() {
|
fn should_save_and_reload_address_book() {
|
||||||
let tempdir = TempDir::new("").unwrap();
|
let tempdir = TempDir::new("").unwrap();
|
||||||
let mut b = AddressBook::new(tempdir.path());
|
let mut b = AddressBook::new(tempdir.path());
|
||||||
b.set_name(1.into(), "One".to_owned());
|
b.set_name(Address::from_low_u64_be(1), "One".to_owned());
|
||||||
b.set_meta(1.into(), "{1:1}".to_owned());
|
b.set_meta(Address::from_low_u64_be(1), "{1:1}".to_owned());
|
||||||
let b = AddressBook::new(tempdir.path());
|
let b = AddressBook::new(tempdir.path());
|
||||||
assert_eq!(b.get(), hash_map![1.into() => AccountMeta{name: "One".to_owned(), meta: "{1:1}".to_owned(), uuid: None}]);
|
assert_eq!(b.get(), vec![
|
||||||
|
(Address::from_low_u64_be(1), AccountMeta {name: "One".to_owned(), meta: "{1:1}".to_owned(), uuid: None})
|
||||||
|
].into_iter().collect::<HashMap<_, _>>());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -171,15 +175,15 @@ mod tests {
|
|||||||
let tempdir = TempDir::new("").unwrap();
|
let tempdir = TempDir::new("").unwrap();
|
||||||
let mut b = AddressBook::new(tempdir.path());
|
let mut b = AddressBook::new(tempdir.path());
|
||||||
|
|
||||||
b.set_name(1.into(), "One".to_owned());
|
b.set_name(Address::from_low_u64_be(1), "One".to_owned());
|
||||||
b.set_name(2.into(), "Two".to_owned());
|
b.set_name(Address::from_low_u64_be(2), "Two".to_owned());
|
||||||
b.set_name(3.into(), "Three".to_owned());
|
b.set_name(Address::from_low_u64_be(3), "Three".to_owned());
|
||||||
b.remove(2.into());
|
b.remove(Address::from_low_u64_be(2).into());
|
||||||
|
|
||||||
let b = AddressBook::new(tempdir.path());
|
let b = AddressBook::new(tempdir.path());
|
||||||
assert_eq!(b.get(), hash_map![
|
assert_eq!(b.get(), vec![
|
||||||
1.into() => AccountMeta{name: "One".to_owned(), meta: "{}".to_owned(), uuid: None},
|
(Address::from_low_u64_be(1), AccountMeta{name: "One".to_owned(), meta: "{}".to_owned(), uuid: None}),
|
||||||
3.into() => AccountMeta{name: "Three".to_owned(), meta: "{}".to_owned(), uuid: None}
|
(Address::from_low_u64_be(3), AccountMeta{name: "Three".to_owned(), meta: "{}".to_owned(), uuid: None}),
|
||||||
]);
|
].into_iter().collect::<HashMap<_, _>>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
|
description = "Parity Ethereum Chain Specification"
|
||||||
name = "chainspec"
|
name = "chainspec"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Marek Kotewicz <marek@parity.io>"]
|
authors = ["Marek Kotewicz <marek@parity.io>"]
|
||||||
@@ -6,4 +7,3 @@ authors = ["Marek Kotewicz <marek@parity.io>"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
ethjson = { path = "../json" }
|
ethjson = { path = "../json" }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde_ignored = "0.0.4"
|
|
||||||
|
|||||||
@@ -1,24 +1,22 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
extern crate serde_ignored;
|
|
||||||
extern crate ethjson;
|
extern crate ethjson;
|
||||||
|
|
||||||
use std::collections::BTreeSet;
|
|
||||||
use std::{fs, env, process};
|
use std::{fs, env, process};
|
||||||
use ethjson::spec::Spec;
|
use ethjson::spec::Spec;
|
||||||
|
|
||||||
@@ -41,24 +39,11 @@ fn main() {
|
|||||||
Err(_) => quit(&format!("{} could not be opened", path)),
|
Err(_) => quit(&format!("{} could not be opened", path)),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut unused = BTreeSet::new();
|
let spec: Result<Spec, _> = serde_json::from_reader(file);
|
||||||
let mut deserializer = serde_json::Deserializer::from_reader(file);
|
|
||||||
|
|
||||||
let spec: Result<Spec, _> = serde_ignored::deserialize(&mut deserializer, |field| {
|
|
||||||
unused.insert(field.to_string());
|
|
||||||
});
|
|
||||||
|
|
||||||
if let Err(err) = spec {
|
if let Err(err) = spec {
|
||||||
quit(&format!("{} {}", path, err.to_string()));
|
quit(&format!("{} {}", path, err.to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if !unused.is_empty() {
|
|
||||||
let err = unused.into_iter()
|
|
||||||
.map(|field| format!("{} unexpected field `{}`", path, field))
|
|
||||||
.collect::<Vec<_>>()
|
|
||||||
.join("\n");
|
|
||||||
quit(&err);
|
|
||||||
}
|
|
||||||
|
|
||||||
println!("{} is valid", path);
|
println!("{} is valid", path);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
[package]
|
[package]
|
||||||
authors = ["Parity <admin@parity.io>"]
|
description = "Parity Ethereum CLI Signer Tool"
|
||||||
description = "Parity Cli Tool"
|
|
||||||
homepage = "http://parity.io"
|
homepage = "http://parity.io"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
name = "rpc-cli"
|
name = "cli-signer"
|
||||||
version = "1.4.0"
|
version = "1.4.0"
|
||||||
|
authors = ["Parity <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
ethereum-types = "0.6.0"
|
||||||
futures = "0.1"
|
futures = "0.1"
|
||||||
rpassword = "1.0"
|
rpassword = "1.0"
|
||||||
parity-rpc = { path = "../rpc" }
|
parity-rpc = { path = "../rpc" }
|
||||||
parity-rpc-client = { path = "../rpc_client" }
|
parity-rpc-client = { path = "rpc-client" }
|
||||||
21
cli-signer/rpc-client/Cargo.toml
Normal file
21
cli-signer/rpc-client/Cargo.toml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
[package]
|
||||||
|
description = "Parity Ethereum RPC Client"
|
||||||
|
homepage = "http://parity.io"
|
||||||
|
license = "GPL-3.0"
|
||||||
|
name = "parity-rpc-client"
|
||||||
|
version = "1.4.0"
|
||||||
|
authors = ["Parity <admin@parity.io>"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ethereum-types = "0.6.0"
|
||||||
|
futures = "0.1"
|
||||||
|
log = "0.4"
|
||||||
|
serde = "1.0"
|
||||||
|
serde_json = "1.0"
|
||||||
|
url = "1.2.0"
|
||||||
|
matches = "0.1"
|
||||||
|
parking_lot = "0.7"
|
||||||
|
jsonrpc-core = "12.0.0"
|
||||||
|
jsonrpc-ws-server = "12.0.0"
|
||||||
|
parity-rpc = { path = "../../rpc" }
|
||||||
|
keccak-hash = "0.2.0"
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt::{Debug, Formatter, Error as FmtError};
|
use std::fmt::{Debug, Formatter, Error as FmtError};
|
||||||
use std::io::{BufReader, BufRead};
|
use std::io::{BufReader, BufRead};
|
||||||
@@ -274,7 +274,7 @@ impl Rpc {
|
|||||||
let request = MethodCall {
|
let request = MethodCall {
|
||||||
jsonrpc: Some(Version::V2),
|
jsonrpc: Some(Version::V2),
|
||||||
method: method.to_owned(),
|
method: method.to_owned(),
|
||||||
params: Some(Params::Array(params)),
|
params: Params::Array(params),
|
||||||
id: Id::Num(id as u64),
|
id: Id::Num(id as u64),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1,22 +1,23 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pub mod client;
|
pub mod client;
|
||||||
pub mod signer_client;
|
pub mod signer_client;
|
||||||
|
|
||||||
|
extern crate ethereum_types;
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
extern crate jsonrpc_core;
|
extern crate jsonrpc_core;
|
||||||
extern crate jsonrpc_ws_server as ws;
|
extern crate jsonrpc_ws_server as ws;
|
||||||
@@ -1,21 +1,22 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use client::{Rpc, RpcError};
|
use client::{Rpc, RpcError};
|
||||||
use rpc::signer::{ConfirmationRequest, TransactionModification, U256, TransactionCondition};
|
use ethereum_types::U256;
|
||||||
|
use rpc::signer::{ConfirmationRequest, TransactionModification, TransactionCondition};
|
||||||
use serde;
|
use serde;
|
||||||
use serde_json::{Value as JsonValue, to_value};
|
use serde_json::{Value as JsonValue, to_value};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
@@ -1,26 +1,28 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
extern crate ethereum_types;
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
extern crate rpassword;
|
extern crate rpassword;
|
||||||
|
|
||||||
extern crate parity_rpc as rpc;
|
extern crate parity_rpc as rpc;
|
||||||
extern crate parity_rpc_client as client;
|
extern crate parity_rpc_client as client;
|
||||||
|
|
||||||
use rpc::signer::{U256, ConfirmationRequest};
|
use ethereum_types::U256;
|
||||||
|
use rpc::signer::ConfirmationRequest;
|
||||||
use client::signer_client::SignerRpc;
|
use client::signer_client::SignerRpc;
|
||||||
use std::io::{Write, BufRead, BufReader, stdout, stdin};
|
use std::io::{Write, BufRead, BufReader, stdout, stdin};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
[package]
|
|
||||||
description = "Ethcore development/test/build tools"
|
|
||||||
homepage = "http://parity.io"
|
|
||||||
license = "GPL-3.0"
|
|
||||||
name = "ethcore-devtools"
|
|
||||||
version = "1.12.0"
|
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
FROM ubuntu:xenial
|
|
||||||
LABEL maintainer="Parity Technologies <devops@parity.io>"
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -yq sudo curl file build-essential wget git g++ cmake pkg-config bison flex \
|
|
||||||
unzip lib32stdc++6 lib32z1 python autotools-dev automake autoconf libtool \
|
|
||||||
gperf xsltproc docbook-xsl
|
|
||||||
|
|
||||||
# Rust & Cargo
|
|
||||||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|
||||||
ENV PATH /root/.cargo/bin:$PATH
|
|
||||||
RUN rustup toolchain install stable
|
|
||||||
RUN rustup target add --toolchain stable arm-linux-androideabi
|
|
||||||
RUN rustup target add --toolchain stable armv7-linux-androideabi
|
|
||||||
|
|
||||||
# Android NDK and toolchain
|
|
||||||
RUN cd /usr/local && \
|
|
||||||
wget -q https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip && \
|
|
||||||
unzip -q android-ndk-r16b-linux-x86_64.zip && \
|
|
||||||
rm android-ndk-r16b-linux-x86_64.zip
|
|
||||||
ENV NDK_HOME /usr/local/android-ndk-r16b
|
|
||||||
RUN /usr/local/android-ndk-r16b/build/tools/make-standalone-toolchain.sh \
|
|
||||||
--arch=arm --install-dir=/opt/ndk-standalone --stl=libc++ --platform=android-26
|
|
||||||
ENV PATH $PATH:/opt/ndk-standalone/bin
|
|
||||||
|
|
||||||
# Compiling libudev for Android
|
|
||||||
# This is the most hacky part of the process, as we need to apply a patch and pass specific
|
|
||||||
# options that the compiler environment doesn't define.
|
|
||||||
RUN cd /root && \
|
|
||||||
git clone https://github.com/gentoo/eudev.git
|
|
||||||
ADD libudev.patch /root
|
|
||||||
RUN cd /root/eudev && \
|
|
||||||
git checkout 83d918449f22720d84a341a05e24b6d109e6d3ae && \
|
|
||||||
./autogen.sh && \
|
|
||||||
./configure --disable-introspection --disable-programs --disable-hwdb \
|
|
||||||
--host=arm-linux-androideabi --prefix=/opt/ndk-standalone/sysroot/usr/ \
|
|
||||||
--enable-shared=false CC=arm-linux-androideabi-clang \
|
|
||||||
CFLAGS="-D LINE_MAX=2048 -D RLIMIT_NLIMITS=15 -D IPTOS_LOWCOST=2 -std=gnu99" \
|
|
||||||
CXX=arm-linux-androideabi-clang++ && \
|
|
||||||
git apply - < /root/libudev.patch && \
|
|
||||||
make && \
|
|
||||||
make install
|
|
||||||
RUN rm -rf /root/eudev
|
|
||||||
RUN rm /root/libudev.patch
|
|
||||||
|
|
||||||
# Rust-related configuration
|
|
||||||
ADD cargo-config.toml /root/.cargo/config
|
|
||||||
ENV ARM_LINUX_ANDROIDEABI_OPENSSL_DIR /opt/ndk-standalone/sysroot/usr
|
|
||||||
ENV ARMV7_LINUX_ANDROIDEABI_OPENSSL_DIR /opt/ndk-standalone/sysroot/usr
|
|
||||||
ENV CC_arm_linux_androideabi arm-linux-androideabi-clang
|
|
||||||
ENV CC_armv7_linux_androideabi arm-linux-androideabi-clang
|
|
||||||
ENV CXX_arm_linux_androideabi arm-linux-androideabi-clang++
|
|
||||||
ENV CXX_armv7_linux_androideabi arm-linux-androideabi-clang++
|
|
||||||
ENV AR_arm_linux_androideabi arm-linux-androideabi-ar
|
|
||||||
ENV AR_armv7_linux_androideabi arm-linux-androideabi-ar
|
|
||||||
ENV CFLAGS_arm_linux_androideabi -std=gnu11 -fPIC -D OS_ANDROID
|
|
||||||
ENV CFLAGS_armv7_linux_androideabi -std=gnu11 -fPIC -D OS_ANDROID
|
|
||||||
ENV CXXFLAGS_arm_linux_androideabi -std=gnu++11 -fPIC -fexceptions -frtti -static-libstdc++ -D OS_ANDROID
|
|
||||||
ENV CXXFLAGS_armv7_linux_androideabi -std=gnu++11 -fPIC -fexceptions -frtti -static-libstdc++ -D OS_ANDROID
|
|
||||||
ENV CXXSTDLIB_arm_linux_androideabi ""
|
|
||||||
ENV CXXSTDLIB_armv7_linux_androideabi ""
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
[target.armv7-linux-androideabi]
|
|
||||||
linker = "arm-linux-androideabi-clang"
|
|
||||||
ar = "arm-linux-androideabi-ar"
|
|
||||||
rustflags = ["-C", "link-arg=-lc++_static", "-C", "link-arg=-lc++abi", "-C", "link-arg=-landroid_support"]
|
|
||||||
|
|
||||||
[target.arm-linux-androideabi]
|
|
||||||
linker = "arm-linux-androideabi-clang"
|
|
||||||
ar = "arm-linux-androideabi-ar"
|
|
||||||
rustflags = ["-C", "link-arg=-lc++_static", "-C", "link-arg=-lc++abi", "-C", "link-arg=-landroid_support"]
|
|
||||||
@@ -1,216 +0,0 @@
|
|||||||
diff --git a/src/collect/collect.c b/src/collect/collect.c
|
|
||||||
index 2cf1f00..b24f26b 100644
|
|
||||||
--- a/src/collect/collect.c
|
|
||||||
+++ b/src/collect/collect.c
|
|
||||||
@@ -84,7 +84,7 @@ static void usage(void)
|
|
||||||
" invoked for each ID in <idlist>) collect returns 0, the\n"
|
|
||||||
" number of missing IDs otherwise.\n"
|
|
||||||
" On error a negative number is returned.\n\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
diff --git a/src/scsi_id/scsi_id.c b/src/scsi_id/scsi_id.c
|
|
||||||
index 8b76d87..7bf3948 100644
|
|
||||||
--- a/src/scsi_id/scsi_id.c
|
|
||||||
+++ b/src/scsi_id/scsi_id.c
|
|
||||||
@@ -321,7 +321,7 @@ static void help(void) {
|
|
||||||
" -u --replace-whitespace Replace all whitespace by underscores\n"
|
|
||||||
" -v --verbose Verbose logging\n"
|
|
||||||
" -x --export Print values as environment keys\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/shared/hashmap.h b/src/shared/hashmap.h
|
|
||||||
index a03ee58..a7c2005 100644
|
|
||||||
--- a/src/shared/hashmap.h
|
|
||||||
+++ b/src/shared/hashmap.h
|
|
||||||
@@ -98,10 +98,7 @@ extern const struct hash_ops uint64_hash_ops;
|
|
||||||
#if SIZEOF_DEV_T != 8
|
|
||||||
unsigned long devt_hash_func(const void *p, const uint8_t hash_key[HASH_KEY_SIZE]) _pure_;
|
|
||||||
int devt_compare_func(const void *a, const void *b) _pure_;
|
|
||||||
-extern const struct hash_ops devt_hash_ops = {
|
|
||||||
- .hash = devt_hash_func,
|
|
||||||
- .compare = devt_compare_func
|
|
||||||
-};
|
|
||||||
+extern const struct hash_ops devt_hash_ops;
|
|
||||||
#else
|
|
||||||
#define devt_hash_func uint64_hash_func
|
|
||||||
#define devt_compare_func uint64_compare_func
|
|
||||||
diff --git a/src/shared/log.c b/src/shared/log.c
|
|
||||||
index 4a40996..1496984 100644
|
|
||||||
--- a/src/shared/log.c
|
|
||||||
+++ b/src/shared/log.c
|
|
||||||
@@ -335,7 +335,7 @@ static int write_to_syslog(
|
|
||||||
|
|
||||||
IOVEC_SET_STRING(iovec[0], header_priority);
|
|
||||||
IOVEC_SET_STRING(iovec[1], header_time);
|
|
||||||
- IOVEC_SET_STRING(iovec[2], program_invocation_short_name);
|
|
||||||
+ IOVEC_SET_STRING(iovec[2], "parity");
|
|
||||||
IOVEC_SET_STRING(iovec[3], header_pid);
|
|
||||||
IOVEC_SET_STRING(iovec[4], buffer);
|
|
||||||
|
|
||||||
@@ -383,7 +383,7 @@ static int write_to_kmsg(
|
|
||||||
char_array_0(header_pid);
|
|
||||||
|
|
||||||
IOVEC_SET_STRING(iovec[0], header_priority);
|
|
||||||
- IOVEC_SET_STRING(iovec[1], program_invocation_short_name);
|
|
||||||
+ IOVEC_SET_STRING(iovec[1], "parity");
|
|
||||||
IOVEC_SET_STRING(iovec[2], header_pid);
|
|
||||||
IOVEC_SET_STRING(iovec[3], buffer);
|
|
||||||
IOVEC_SET_STRING(iovec[4], "\n");
|
|
||||||
diff --git a/src/udev/udevadm-control.c b/src/udev/udevadm-control.c
|
|
||||||
index 6af7163..3271e56 100644
|
|
||||||
--- a/src/udev/udevadm-control.c
|
|
||||||
+++ b/src/udev/udevadm-control.c
|
|
||||||
@@ -41,7 +41,7 @@ static void print_help(void) {
|
|
||||||
" -p --property=KEY=VALUE Set a global property for all events\n"
|
|
||||||
" -m --children-max=N Maximum number of children\n"
|
|
||||||
" --timeout=SECONDS Maximum time to block for a reply\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
}
|
|
||||||
|
|
||||||
static int adm_control(struct udev *udev, int argc, char *argv[]) {
|
|
||||||
diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c
|
|
||||||
index 0aec976..a31ac02 100644
|
|
||||||
--- a/src/udev/udevadm-info.c
|
|
||||||
+++ b/src/udev/udevadm-info.c
|
|
||||||
@@ -279,7 +279,7 @@ static void help(void) {
|
|
||||||
" -P --export-prefix Export the key name with a prefix\n"
|
|
||||||
" -e --export-db Export the content of the udev database\n"
|
|
||||||
" -c --cleanup-db Clean up the udev database\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
}
|
|
||||||
|
|
||||||
static int uinfo(struct udev *udev, int argc, char *argv[]) {
|
|
||||||
diff --git a/src/udev/udevadm-monitor.c b/src/udev/udevadm-monitor.c
|
|
||||||
index 15ded09..b58dd08 100644
|
|
||||||
--- a/src/udev/udevadm-monitor.c
|
|
||||||
+++ b/src/udev/udevadm-monitor.c
|
|
||||||
@@ -73,7 +73,7 @@ static void help(void) {
|
|
||||||
" -u --udev Print udev events\n"
|
|
||||||
" -s --subsystem-match=SUBSYSTEM[/DEVTYPE] Filter events by subsystem\n"
|
|
||||||
" -t --tag-match=TAG Filter events by tag\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
}
|
|
||||||
|
|
||||||
static int adm_monitor(struct udev *udev, int argc, char *argv[]) {
|
|
||||||
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c
|
|
||||||
index 33597bc..b36a504 100644
|
|
||||||
--- a/src/udev/udevadm-settle.c
|
|
||||||
+++ b/src/udev/udevadm-settle.c
|
|
||||||
@@ -43,7 +43,7 @@ static void help(void) {
|
|
||||||
" --version Show package version\n"
|
|
||||||
" -t --timeout=SECONDS Maximum time to wait for events\n"
|
|
||||||
" -E --exit-if-exists=FILE Stop waiting if file exists\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
}
|
|
||||||
|
|
||||||
static int adm_settle(struct udev *udev, int argc, char *argv[]) {
|
|
||||||
diff --git a/src/udev/udevadm-test-builtin.c b/src/udev/udevadm-test-builtin.c
|
|
||||||
index baaeca9..50ed812 100644
|
|
||||||
--- a/src/udev/udevadm-test-builtin.c
|
|
||||||
+++ b/src/udev/udevadm-test-builtin.c
|
|
||||||
@@ -39,7 +39,7 @@ static void help(struct udev *udev) {
|
|
||||||
" -h --help Print this message\n"
|
|
||||||
" --version Print version of the program\n\n"
|
|
||||||
"Commands:\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
|
|
||||||
udev_builtin_list(udev);
|
|
||||||
}
|
|
||||||
diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c
|
|
||||||
index 47fd924..a855412 100644
|
|
||||||
--- a/src/udev/udevadm-test.c
|
|
||||||
+++ b/src/udev/udevadm-test.c
|
|
||||||
@@ -39,7 +39,7 @@ static void help(void) {
|
|
||||||
" --version Show package version\n"
|
|
||||||
" -a --action=ACTION Set action string\n"
|
|
||||||
" -N --resolve-names=early|late|never When to resolve names\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
}
|
|
||||||
|
|
||||||
static int adm_test(struct udev *udev, int argc, char *argv[]) {
|
|
||||||
diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c
|
|
||||||
index 4dc756a..67787d3 100644
|
|
||||||
--- a/src/udev/udevadm-trigger.c
|
|
||||||
+++ b/src/udev/udevadm-trigger.c
|
|
||||||
@@ -92,7 +92,7 @@ static void help(void) {
|
|
||||||
" -y --sysname-match=NAME Trigger devices with this /sys path\n"
|
|
||||||
" --name-match=NAME Trigger devices with this /dev name\n"
|
|
||||||
" -b --parent-match=NAME Trigger devices with that parent device\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
}
|
|
||||||
|
|
||||||
static int adm_trigger(struct udev *udev, int argc, char *argv[]) {
|
|
||||||
diff --git a/src/udev/udevadm.c b/src/udev/udevadm.c
|
|
||||||
index 3e57cf6..b03dfaa 100644
|
|
||||||
--- a/src/udev/udevadm.c
|
|
||||||
+++ b/src/udev/udevadm.c
|
|
||||||
@@ -62,7 +62,7 @@ static int adm_help(struct udev *udev, int argc, char *argv[]) {
|
|
||||||
printf("%s [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]\n\n"
|
|
||||||
"Send control commands or test the device manager.\n\n"
|
|
||||||
"Commands:\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
|
|
||||||
for (i = 0; i < ELEMENTSOF(udevadm_cmds); i++)
|
|
||||||
if (udevadm_cmds[i]->help != NULL)
|
|
||||||
@@ -128,7 +128,7 @@ int main(int argc, char *argv[]) {
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
- fprintf(stderr, "%s: missing or unknown command\n", program_invocation_short_name);
|
|
||||||
+ fprintf(stderr, "%s: missing or unknown command\n", "parity");
|
|
||||||
rc = 2;
|
|
||||||
out:
|
|
||||||
mac_selinux_finish();
|
|
||||||
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
|
|
||||||
index cf826c6..4eec0af 100644
|
|
||||||
--- a/src/udev/udevd.c
|
|
||||||
+++ b/src/udev/udevd.c
|
|
||||||
@@ -1041,7 +1041,7 @@ static void help(void) {
|
|
||||||
" -t --event-timeout=SECONDS Seconds to wait before terminating an event\n"
|
|
||||||
" -N --resolve-names=early|late|never\n"
|
|
||||||
" When to resolve users and groups\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
}
|
|
||||||
|
|
||||||
static int parse_argv(int argc, char *argv[]) {
|
|
||||||
diff --git a/src/v4l_id/v4l_id.c b/src/v4l_id/v4l_id.c
|
|
||||||
index 1dce0d5..f65badf 100644
|
|
||||||
--- a/src/v4l_id/v4l_id.c
|
|
||||||
+++ b/src/v4l_id/v4l_id.c
|
|
||||||
@@ -49,7 +49,7 @@ int main(int argc, char *argv[]) {
|
|
||||||
printf("%s [-h,--help] <device file>\n\n"
|
|
||||||
"Video4Linux device identification.\n\n"
|
|
||||||
" -h Print this message\n"
|
|
||||||
- , program_invocation_short_name);
|
|
||||||
+ , "parity");
|
|
||||||
return 0;
|
|
||||||
case '?':
|
|
||||||
return -EINVAL;
|
|
||||||
diff --git a/src/shared/path-util.c b/src/shared/path-util.c
|
|
||||||
index 0744563..7151356 100644
|
|
||||||
--- a/src/shared/path-util.c
|
|
||||||
+++ b/src/shared/path-util.c
|
|
||||||
@@ -109,7 +109,7 @@ char *path_make_absolute_cwd(const char *p) {
|
|
||||||
if (path_is_absolute(p))
|
|
||||||
return strdup(p);
|
|
||||||
|
|
||||||
- cwd = get_current_dir_name();
|
|
||||||
+ cwd = getcwd(malloc(128), 128);
|
|
||||||
if (!cwd)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
FROM ubuntu:xenial
|
|
||||||
MAINTAINER Parity Technologies <devops@parity.io>
|
|
||||||
#set ENVIROMENT
|
|
||||||
ARG TARGET
|
|
||||||
ENV TARGET ${TARGET}
|
|
||||||
|
|
||||||
# install tools and dependencies
|
|
||||||
RUN apt update && apt install -y --no-install-recommends openssl libudev-dev file
|
|
||||||
|
|
||||||
# show backtraces
|
|
||||||
ENV RUST_BACKTRACE 1
|
|
||||||
|
|
||||||
#cleanup Docker image
|
|
||||||
RUN apt autoremove -y
|
|
||||||
RUN apt clean -y
|
|
||||||
RUN rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
#add TARGET to docker image
|
|
||||||
COPY artifacts/x86_64-unknown-linux-gnu/$TARGET /usr/bin/$TARGET
|
|
||||||
|
|
||||||
# Build a shell script because the ENTRYPOINT command doesn't like using ENV
|
|
||||||
RUN echo "#!/bin/bash \n ${TARGET} \$@" > ./entrypoint.sh
|
|
||||||
RUN chmod +x ./entrypoint.sh
|
|
||||||
|
|
||||||
# setup ENTRYPOINT
|
|
||||||
EXPOSE 5001 8080 8082 8083 8545 8546 8180 30303/tcp 30303/udp
|
|
||||||
ENTRYPOINT ["./entrypoint.sh"]
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
FROM ubuntu:14.04
|
|
||||||
WORKDIR /build
|
|
||||||
|
|
||||||
# install tools and dependencies
|
|
||||||
RUN apt-get -y update && \
|
|
||||||
apt-get install -y --force-yes --no-install-recommends \
|
|
||||||
curl git make g++ gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
|
|
||||||
libc6-arm64-cross libc6-dev-arm64-cross wget file ca-certificates \
|
|
||||||
binutils-aarch64-linux-gnu cmake3 libudev-dev \
|
|
||||||
&& \
|
|
||||||
apt-get clean
|
|
||||||
|
|
||||||
# install rustup
|
|
||||||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|
||||||
|
|
||||||
# rustup directory
|
|
||||||
ENV PATH /root/.cargo/bin:$PATH
|
|
||||||
|
|
||||||
ENV RUST_TARGETS="aarch64-unknown-linux-gnu"
|
|
||||||
|
|
||||||
# multirust add arm--linux-gnuabhf toolchain
|
|
||||||
RUN rustup target add aarch64-unknown-linux-gnu
|
|
||||||
|
|
||||||
# show backtraces
|
|
||||||
ENV RUST_BACKTRACE 1
|
|
||||||
|
|
||||||
# show tools
|
|
||||||
RUN rustc -vV && cargo -V
|
|
||||||
|
|
||||||
# build parity
|
|
||||||
ADD . /build/parity
|
|
||||||
RUN cd parity && \
|
|
||||||
mkdir -p .cargo && \
|
|
||||||
echo '[target.aarch64-unknown-linux-gnu]\n\
|
|
||||||
linker = "aarch64-linux-gnu-gcc"\n'\
|
|
||||||
>>.cargo/config && \
|
|
||||||
cat .cargo/config && \
|
|
||||||
cargo build --target aarch64-unknown-linux-gnu --release --verbose && \
|
|
||||||
ls /build/parity/target/aarch64-unknown-linux-gnu/release/parity && \
|
|
||||||
/usr/bin/aarch64-linux-gnu-strip /build/parity/target/aarch64-unknown-linux-gnu/release/parity
|
|
||||||
|
|
||||||
RUN file /build/parity/target/aarch64-unknown-linux-gnu/release/parity
|
|
||||||
|
|
||||||
EXPOSE 8080 8545 8180
|
|
||||||
ENTRYPOINT ["/build/parity/target/aarch64-unknown-linux-gnu/release/parity"]
|
|
||||||
@@ -1,4 +1,84 @@
|
|||||||
## Parity [v1.11.8](https://github.com/paritytech/parity-ethereum/releases/tag/v1.11.8) (2018-07-27)
|
Note: Parity 1.11 reached End-of-Life on 2018-09-19 (EOL).
|
||||||
|
|
||||||
|
## Parity-Ethereum [v1.11.11](https://github.com/paritytech/parity-ethereum/releases/tag/v1.11.11) (2018-09-11)
|
||||||
|
|
||||||
|
Parity-Ethereum 1.11.11-stable is a bug-fix release to improve performance and stability.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Stable backports 1.11.11 ([#9443](https://github.com/paritytech/parity-ethereum/pull/9443))
|
||||||
|
- Parity-version: bump stable to 1.11.11
|
||||||
|
- Update tobalaba.json ([#9419](https://github.com/paritytech/parity-ethereum/pull/9419))
|
||||||
|
- Update hardcoded sync ([#9421](https://github.com/paritytech/parity-ethereum/pull/9421))
|
||||||
|
- Update foundation hardcoded header to block 6219777
|
||||||
|
- Update ropsten hardcoded header to block 3917825
|
||||||
|
- Update kovan hardcoded header to block 8511489
|
||||||
|
- Parity: print correct keys path on startup ([#9501](https://github.com/paritytech/parity-ethereum/pull/9501))
|
||||||
|
- Only check warp syncing for eth_getWorks ([#9484](https://github.com/paritytech/parity-ethereum/pull/9484))
|
||||||
|
- Only check warp syncing for eth_getWorks
|
||||||
|
- Use SyncStatus::is_snapshot_syncing
|
||||||
|
|
||||||
|
## Parity-Ethereum [v1.11.10](https://github.com/paritytech/parity-ethereum/releases/tag/v1.11.10) (2018-08-31)
|
||||||
|
|
||||||
|
Parity-Ethereum 1.11.10-stable is a bug-fix release to improve performance and stability.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Stable backports for 1.11.10 ([#9228](https://github.com/paritytech/parity-ethereum/pull/9228))
|
||||||
|
- Parity-version: bump stable to 1.11.9
|
||||||
|
- Fix compilation error on nightly rust ([#8707](https://github.com/paritytech/parity-ethereum/pull/8707))
|
||||||
|
- On nightly rust passing `public_url` works but that breaks on stable. This works for both.
|
||||||
|
- Parity-version: bump stable to 1.11.10
|
||||||
|
- Check if synced when using eth_getWork ([#9193](https://github.com/paritytech/parity-ethereum/issues/9193)) ([#9210](https://github.com/paritytech/parity-ethereum/pull/9210))
|
||||||
|
- Check if synced when using eth_getWork ([#9193](https://github.com/paritytech/parity-ethereum/issues/9193))
|
||||||
|
- Don't use fn syncing
|
||||||
|
- Fix identation
|
||||||
|
- Fix typo
|
||||||
|
- Don't check for warping
|
||||||
|
- Rpc: avoid calling queue_info twice on eth_getWork
|
||||||
|
- Fix potential as_usize overflow when casting from U256 in miner ([#9221](https://github.com/paritytech/parity-ethereum/pull/9221))
|
||||||
|
- Allow old blocks from peers with lower difficulty ([#9226](https://github.com/paritytech/parity-ethereum/pull/9226))
|
||||||
|
- Previously we only allow downloading of old blocks if the peer difficulty was greater than our syncing difficulty. This change allows downloading of blocks from peers where the difficulty is greater then the last downloaded old block.
|
||||||
|
- Update Dockerfile ([#9242](https://github.com/paritytech/parity-ethereum/pull/9242))
|
||||||
|
- Update Dockerfile
|
||||||
|
- Fix Docker build
|
||||||
|
- Fix dockerfile paths: parity -> parity-ethereum ([#9248](https://github.com/paritytech/parity-ethereum/pull/9248))
|
||||||
|
- Update tobalaba.json ([#9313](https://github.com/paritytech/parity-ethereum/pull/9313))
|
||||||
|
- Light client `Provide default nonce in transactions when it´s missing` ([#9370](https://github.com/paritytech/parity-ethereum/pull/9370))
|
||||||
|
- Provide `default_nonce` in tx`s when it´s missing
|
||||||
|
- When `nonce` is missing in a `EthTransaction` will cause it to fall in these cases provide `default_nonce` value instead!
|
||||||
|
- Changed http:// to https:// on Yasm link ([#9369](https://github.com/paritytech/parity-ethereum/pull/9369))
|
||||||
|
- Changed http:// to https:// on Yasm link in README.md
|
||||||
|
- Provide `default_nonce` in tx`s when it´s missing
|
||||||
|
- When `nonce` is missing in a `EthTransaction` will cause it to fall in these cases provide `default_nonce` value instead!
|
||||||
|
- Address grumbles
|
||||||
|
- Ethcore: kovan: delay activation of strict score validation ([#9406](https://github.com/paritytech/parity-ethereum/pull/9406))
|
||||||
|
- Use impl Future in the light client RPC helpers ([#8628](https://github.com/paritytech/parity-ethereum/pull/8628))
|
||||||
|
- Better support for eth_getLogs in light mode ([#9186](https://github.com/paritytech/parity-ethereum/pull/9186))
|
||||||
|
- Light client on-demand request for headers range.
|
||||||
|
- Cache headers in HeaderWithAncestors response.
|
||||||
|
- Also fulfills request locally if all headers are in cache.
|
||||||
|
- Lightfetch::logs fetches missing headers on demand.
|
||||||
|
- Lightfetch::logs limit the number of headers requested at a time.
|
||||||
|
- Lightfetch::logs refactor header fetching logic.
|
||||||
|
- Enforce limit on header range length in light client logs request.
|
||||||
|
- Fix light request tests after struct change.
|
||||||
|
- Respond to review comments.
|
||||||
|
- Propagate transactions for next 4 blocks. ([#9265](https://github.com/paritytech/parity-ethereum/pull/9265))
|
||||||
|
- This PR also removes the limit of max 64 transactions per packet, currently we only attempt to prevent the packet size to go over 8MB. This will only be the case for super-large transactions or high-block-gas-limit chains.
|
||||||
|
- Patching this is important only for chains that have blocks that can fit more than 4k transactions (over 86M block gas limit)
|
||||||
|
- For mainnet, we should actually see a tiny bit faster propagation since instead of computing 4k pending set, we only need `4 * 8M / 21k = 1523` transactions.
|
||||||
|
- Ethcore: fix pow difficulty validation ([#9328](https://github.com/paritytech/parity-ethereum/pull/9328))
|
||||||
|
- Ethcore: fix pow difficulty validation
|
||||||
|
- Ethcore: validate difficulty is not zero
|
||||||
|
- Ethcore: add issue link to regression test
|
||||||
|
- Ethcore: fix tests
|
||||||
|
- Ethcore: move difficulty_to_boundary to ethash crate
|
||||||
|
- Ethcore: reuse difficulty_to_boundary and boundary_to_difficulty
|
||||||
|
- Ethcore: fix grumbles in difficulty_to_boundary_aux
|
||||||
|
- Add snapcraft cmake build dependency ([#9243](https://github.com/paritytech/parity-ethereum/pull/9243))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v1.11.8](https://github.com/paritytech/parity-ethereum/releases/tag/v1.11.8) (2018-07-27)
|
||||||
|
|
||||||
Parity 1.11.8-stable is a bug-fix release to improve performance and stability.
|
Parity 1.11.8-stable is a bug-fix release to improve performance and stability.
|
||||||
|
|
||||||
@@ -42,7 +122,7 @@ The full list of included changes:
|
|||||||
- Ethcore: update to parity-wasm 0.31
|
- Ethcore: update to parity-wasm 0.31
|
||||||
- Rpc: fix broken merge
|
- Rpc: fix broken merge
|
||||||
|
|
||||||
## Parity [v1.11.7](https://github.com/paritytech/parity-ethereum/releases/tag/v1.11.7) "Prosperity" (2018-07-17)
|
## Parity-Ethereum [v1.11.7](https://github.com/paritytech/parity-ethereum/releases/tag/v1.11.7) "Prosperity" (2018-07-17)
|
||||||
|
|
||||||
Parity 1.11.7 "Prosperity" is a bug-fix release to improve performance and stability that marks the 1.11 release track as `stable`. Among other fixes, this release significantly addresses peering and synchronization issues. If you experienced such issues before, upgrading is highly recommended. If you rely on old versions of Parity, check out the `old-stable-1.10` branch, cherry-pick fixes, and compile your binaries independently. There will be no official support for any versions prior to 1.11.7, however (EOL).
|
Parity 1.11.7 "Prosperity" is a bug-fix release to improve performance and stability that marks the 1.11 release track as `stable`. Among other fixes, this release significantly addresses peering and synchronization issues. If you experienced such issues before, upgrading is highly recommended. If you rely on old versions of Parity, check out the `old-stable-1.10` branch, cherry-pick fixes, and compile your binaries independently. There will be no official support for any versions prior to 1.11.7, however (EOL).
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user