This commit is contained in:
Tomasz Drwięga 2016-11-17 13:48:25 +01:00
parent fc4b51fe68
commit 5c62e38a7c
6 changed files with 4 additions and 12 deletions

View File

@ -891,12 +891,9 @@ impl BlockChainClient for Client {
let mut mode = self.mode.lock();
*mode = new_mode.clone().into();
trace!(target: "mode", "Mode now {:?}", &*mode);
match *self.on_mode_change.lock() {
Some(ref mut f) => {
trace!(target: "mode", "Making callback...");
f(&*mode)
},
_ => {}
if let Some(ref mut f) = *self.on_mode_change.lock() {
trace!(target: "mode", "Making callback...");
f(&*mode)
}
}
match new_mode {

View File

@ -38,7 +38,6 @@ use miner::price_info::PriceInfo;
use miner::local_transactions::{Status as LocalTransactionStatus};
use header::BlockNumber;
/// Different possible definitions for pending transaction set.
#[derive(Debug, PartialEq)]
pub enum PendingSet {

View File

@ -2137,12 +2137,11 @@ mod test {
let mut txq = TransactionQueue::with_limits(PrioritizationStrategy::GasPriceOnly, 100, default_gas_val() * U256::from(2), !U256::zero());
let (tx1, tx2) = new_tx_pair_default(U256::from(1), U256::from(1));
let (tx3, tx4) = new_tx_pair_default(U256::from(1), U256::from(2));
let (tx5, tx6) = new_tx_pair_default(U256::from(1), U256::from(2));
let (tx5, _) = new_tx_pair_default(U256::from(1), U256::from(2));
txq.add(tx1.clone(), TransactionOrigin::Local, &default_account_details, &gas_estimator).unwrap();
txq.add(tx2.clone(), TransactionOrigin::Local, &default_account_details, &gas_estimator).unwrap();
// Not accepted because of limit
txq.add(tx5.clone(), TransactionOrigin::External, &default_account_details, &gas_estimator).unwrap_err();
txq.add(tx6.clone(), TransactionOrigin::External, &default_account_details, &gas_estimator).unwrap_err();
txq.add(tx3.clone(), TransactionOrigin::Local, &default_account_details, &gas_estimator).unwrap();
txq.add(tx4.clone(), TransactionOrigin::Local, &default_account_details, &gas_estimator).unwrap();
assert_eq!(txq.status().pending, 4);

View File

@ -49,5 +49,4 @@
"version": "1.0.0",
"secure": true
}
]

View File

@ -132,7 +132,6 @@ impl Serialize for LocalTransactionStatus {
}
}
impl From<LocalizedTransaction> for Transaction {
fn from(t: LocalizedTransaction) -> Transaction {
let signature = t.signature();

View File

@ -18,5 +18,4 @@ extern crate ethcore_ipc_codegen;
fn main() {
ethcore_ipc_codegen::derive_ipc_cond("src/api.rs", cfg!(feature="ipc")).unwrap();
ethcore_ipc_codegen::derive_ipc_cond("src/transactions_stats.rs", cfg!(feature="ipc")).unwrap();
}