From 22faee2099df5d896903161bd4a87088be297f8d Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 9 Nov 2016 15:48:45 +0100 Subject: [PATCH 1/5] Update account recovery phrase hint --- js/src/modals/CreateAccount/AccountDetails/accountDetails.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/modals/CreateAccount/AccountDetails/accountDetails.js b/js/src/modals/CreateAccount/AccountDetails/accountDetails.js index 646c7c180..14c858c06 100644 --- a/js/src/modals/CreateAccount/AccountDetails/accountDetails.js +++ b/js/src/modals/CreateAccount/AccountDetails/accountDetails.js @@ -58,7 +58,7 @@ export default class AccountDetails extends Component { readOnly allowCopy hint='the account recovery phrase' - label='account recovery phrase (keep safe)' + label='owner recovery phrase (keep private and secure, it allows full and unlimited access to the account)' value={ phrase } /> ); } From 4712b882e5dd28a41b1b900b702c603c577d45a3 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 9 Nov 2016 18:02:24 +0100 Subject: [PATCH 2/5] New transaction tests (#3313) * Add new transaction tests. * Add new test. --- ethcore/res/ethereum/tests | 2 +- ethcore/src/json_tests/transaction.rs | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ethcore/res/ethereum/tests b/ethcore/res/ethereum/tests index 853333e7d..9028c4801 160000 --- a/ethcore/res/ethereum/tests +++ b/ethcore/res/ethereum/tests @@ -1 +1 @@ -Subproject commit 853333e7da312775fb8f32f2c2771b8578cd0d79 +Subproject commit 9028c4801fd39fbb71a9796979182549a24e81c8 diff --git a/ethcore/src/json_tests/transaction.rs b/ethcore/src/json_tests/transaction.rs index dd5a4ef14..438852124 100644 --- a/ethcore/src/json_tests/transaction.rs +++ b/ethcore/src/json_tests/transaction.rs @@ -26,8 +26,7 @@ fn do_json_test(json_data: &[u8]) -> Vec { let old_schedule = evm::Schedule::new_frontier(); let new_schedule = evm::Schedule::new_homestead(); for (name, test) in tests.into_iter() { - let mut fail = false; - let mut fail_unless = |cond: bool| if !cond && !fail { failed.push(name.clone()); println!("Transaction failed: {:?}", name); fail = true }; + let mut fail_unless = |cond: bool, title: &str| if !cond { failed.push(name.clone()); println!("Transaction failed: {:?}: {:?}", name, title); }; let number: Option = test.block_number.map(Into::into); let schedule = match number { @@ -35,7 +34,7 @@ fn do_json_test(json_data: &[u8]) -> Vec { Some(x) if x < 1_150_000 => &old_schedule, Some(_) => &new_schedule }; - let allow_network_id_of_one = number.map_or(false, |n| n > 2600000); + let allow_network_id_of_one = number.map_or(false, |n| n >= 3_500_000); let rlp: Vec = test.rlp.into(); let res = UntrustedRlp::new(&rlp) @@ -43,26 +42,26 @@ fn do_json_test(json_data: &[u8]) -> Vec { .map_err(From::from) .and_then(|t: SignedTransaction| t.validate(schedule, schedule.have_delegate_call, allow_network_id_of_one)); - fail_unless(test.transaction.is_none() == res.is_err()); + fail_unless(test.transaction.is_none() == res.is_err(), "Validity different"); if let (Some(tx), Some(sender)) = (test.transaction, test.sender) { let t = res.unwrap(); - fail_unless(t.sender().unwrap() == sender.into()); + fail_unless(t.sender().unwrap() == sender.into(), "sender mismatch"); let is_acceptable_network_id = match t.network_id() { None => true, Some(1) if allow_network_id_of_one => true, _ => false, }; - fail_unless(is_acceptable_network_id); + fail_unless(is_acceptable_network_id, "Network ID unacceptable"); let data: Vec = tx.data.into(); - fail_unless(t.data == data); - fail_unless(t.gas_price == tx.gas_price.into()); - fail_unless(t.nonce == tx.nonce.into()); - fail_unless(t.value == tx.value.into()); + fail_unless(t.data == data, "data mismatch"); + fail_unless(t.gas_price == tx.gas_price.into(), "gas_price mismatch"); + fail_unless(t.nonce == tx.nonce.into(), "nonce mismatch"); + fail_unless(t.value == tx.value.into(), "value mismatch"); let to: Option = tx.to.into(); let to: Option
= to.map(Into::into); match t.action { - Action::Call(dest) => fail_unless(Some(dest) == to), - Action::Create => fail_unless(None == to), + Action::Call(dest) => fail_unless(Some(dest) == to, "call/destination mismatch"), + Action::Create => fail_unless(None == to, "create mismatch"), } } } @@ -80,3 +79,7 @@ declare_test!{TransactionTests_Homestead_ttTransactionTest, "TransactionTests/Ho declare_test!{heavy => TransactionTests_Homestead_tt10mbDataField, "TransactionTests/Homestead/tt10mbDataField"} declare_test!{TransactionTests_Homestead_ttWrongRLPTransaction, "TransactionTests/Homestead/ttWrongRLPTransaction"} declare_test!{TransactionTests_RandomTests_tr201506052141PYTHON, "TransactionTests/RandomTests/tr201506052141PYTHON"} +declare_test!{TransactionTests_Homestead_ttTransactionTestEip155VitaliksTests, "TransactionTests/Homestead/ttTransactionTestEip155VitaliksTests"} +declare_test!{TransactionTests_EIP155_ttTransactionTest, "TransactionTests/EIP155/ttTransactionTest"} +declare_test!{TransactionTests_EIP155_ttTransactionTestEip155VitaliksTests, "TransactionTests/EIP155/ttTransactionTestEip155VitaliksTests"} +declare_test!{TransactionTests_EIP155_ttTransactionTestVRule, "TransactionTests/EIP155/ttTransactionTestVRule"} From 29aecc2cff401ae6af9d1e4a098159d54346c170 Mon Sep 17 00:00:00 2001 From: GitLab Build Bot Date: Wed, 9 Nov 2016 17:19:59 +0000 Subject: [PATCH 3/5] [ci skip] js-precompiled 20161109-171832 --- Cargo.lock | 2 +- ethcore/res/ethereum/tests | 2 +- js/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 925535d8a..c3dd51492 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1249,7 +1249,7 @@ dependencies = [ [[package]] name = "parity-ui-precompiled" version = "1.4.0" -source = "git+https://github.com/ethcore/js-precompiled.git#90bee2d692c71301ad7266d2d9667cba1a93e9f6" +source = "git+https://github.com/ethcore/js-precompiled.git#9054ef95a5d79cbd8fefe4869ec3b4de07e9a72d" dependencies = [ "parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/ethcore/res/ethereum/tests b/ethcore/res/ethereum/tests index 9028c4801..853333e7d 160000 --- a/ethcore/res/ethereum/tests +++ b/ethcore/res/ethereum/tests @@ -1 +1 @@ -Subproject commit 9028c4801fd39fbb71a9796979182549a24e81c8 +Subproject commit 853333e7da312775fb8f32f2c2771b8578cd0d79 diff --git a/js/package.json b/js/package.json index 0eae50582..df9e37811 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "parity.js", - "version": "0.2.23", + "version": "0.2.24", "main": "release/index.js", "jsnext:main": "src/index.js", "author": "Parity Team ", From 877cfe9b530e7a577b914a2de7c529d8d2cb5573 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 9 Nov 2016 18:26:10 +0100 Subject: [PATCH 4/5] Fix signer token updates (#3302) * Manual bump of package.json (recovery) * Debug * Simplify status connections --- js/src/redux/providers/status.js | 12 +++--------- js/src/secureApi.js | 4 ++-- js/src/views/Connection/connection.js | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/js/src/redux/providers/status.js b/js/src/redux/providers/status.js index 0e2bf6866..9f47517f5 100644 --- a/js/src/redux/providers/status.js +++ b/js/src/redux/providers/status.js @@ -85,11 +85,6 @@ export default class Status { setTimeout(this._pollStatus, timeout); }; - const wasConnected = this._store.getState().nodeStatus.isConnected; - if (isConnected !== wasConnected) { - this._fetchEnode(); - } - this._store.dispatch(statusCollection({ isConnected, isConnecting, needsToken, secureToken })); if (!isConnected) { @@ -111,8 +106,7 @@ export default class Status { this._api.parity.netPort(), this._api.parity.nodeName(), this._api.parity.rpcSettings(), - this._api.eth.syncing(), - this._pollTraceMode() + this._api.eth.syncing() ]) .then(([clientVersion, coinbase, defaultExtraData, extraData, gasFloorTarget, hashrate, minGasPrice, netChain, netPeers, netPort, nodeName, rpcSettings, syncing, traceMode]) => { const isTest = netChain === 'morden' || netChain === 'testnet'; @@ -134,12 +128,12 @@ export default class Status { isTest, traceMode })); - nextTimeout(); }) .catch((error) => { console.error('_pollStatus', error); - nextTimeout(); }); + + nextTimeout(); } _pollLogs = () => { diff --git a/js/src/secureApi.js b/js/src/secureApi.js index 62454e7ac..6bb9d38ea 100644 --- a/js/src/secureApi.js +++ b/js/src/secureApi.js @@ -23,7 +23,7 @@ export default class SecureApi extends Api { super(new Api.Transport.Ws(url, sysuiToken)); this._isConnecting = true; - this._connectState = 0; + this._connectState = sysuiToken === 'initial' ? 1 : 0; this._needsToken = false; this._dappsPort = 8080; this._signerPort = 8180; @@ -110,7 +110,7 @@ export default class SecureApi extends Api { console.log('SecureApi:connectSuccess', this._transport.token); } - updateToken (token, connectState) { + updateToken (token, connectState = 0) { this._connectState = connectState; this._transport.updateToken(token.replace(/[^a-zA-Z0-9]/g, '')); this._followConnection(); diff --git a/js/src/views/Connection/connection.js b/js/src/views/Connection/connection.js index 07fc8f18a..2929b38b8 100644 --- a/js/src/views/Connection/connection.js +++ b/js/src/views/Connection/connection.js @@ -128,7 +128,7 @@ class Connection extends Component { const { api } = this.context; const { token } = this.state; - api.updateToken(token); + api.updateToken(token, 0); this.setState({ token: '', validToken: false }); } } From 915766c7bfb72e420f6702fe1b2267399d48ede8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 9 Nov 2016 18:26:35 +0100 Subject: [PATCH 5/5] Fix spurious signer tests failures (#3312) * Increasing sleep time for signer tests * Attempt re-connections instead of delaying tests execution --- devtools/src/http_client.rs | 23 ++++++++++++++++++++++- signer/src/tests/mod.rs | 3 +-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/devtools/src/http_client.rs b/devtools/src/http_client.rs index acba2989e..2440a7cda 100644 --- a/devtools/src/http_client.rs +++ b/devtools/src/http_client.rs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +use std::thread; use std::time::Duration; use std::io::{Read, Write}; use std::str::{self, Lines}; @@ -42,8 +43,28 @@ pub fn read_block(lines: &mut Lines, all: bool) -> String { block } +fn connect(address: &SocketAddr) -> TcpStream { + let mut retries = 0; + let mut last_error = None; + while retries < 10 { + retries += 1; + + let res = TcpStream::connect(address); + match res { + Ok(stream) => { + return stream; + }, + Err(e) => { + last_error = Some(e); + thread::sleep(Duration::from_millis(retries * 10)); + } + } + } + panic!("Unable to connect to the server. Last error: {:?}", last_error); +} + pub fn request(address: &SocketAddr, request: &str) -> Response { - let mut req = TcpStream::connect(address).unwrap(); + let mut req = connect(address); req.set_read_timeout(Some(Duration::from_secs(1))).unwrap(); req.write_all(request.as_bytes()).unwrap(); diff --git a/signer/src/tests/mod.rs b/signer/src/tests/mod.rs index 9b85f1554..d442a7e0d 100644 --- a/signer/src/tests/mod.rs +++ b/signer/src/tests/mod.rs @@ -16,7 +16,7 @@ use std::ops::{Deref, DerefMut}; use std::thread; -use std::time::{self, Duration}; +use std::time; use std::sync::Arc; use devtools::{http_client, RandomTempPath}; use rpc::ConfirmationsQueue; @@ -50,7 +50,6 @@ pub fn serve() -> (Server, usize, GuardedAuthCodes) { let builder = ServerBuilder::new(queue, path.to_path_buf()); let port = 35000 + rand::random::() % 10000; let res = builder.start(format!("127.0.0.1:{}", port).parse().unwrap()).unwrap(); - thread::sleep(Duration::from_millis(25)); (res, port, GuardedAuthCodes { authcodes: AuthCodes::from_file(&path).unwrap(),