Skip to content

Commit 25e833c

Browse files
committed
upgrade rust
1 parent 87a7723 commit 25e833c

File tree

35 files changed

+70
-96
lines changed

35 files changed

+70
-96
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ alias:
107107
108108
- &job-default
109109
docker:
110-
- image: cita/cita-build:ubuntu-18.04-20191128
110+
- image: cita/cita-build:ubuntu-18.04-20200606
111111
working_directory: ~/cita-build
112112

113113
- &job-unit-test
@@ -522,4 +522,4 @@ workflows:
522522
# - "Crosschain Test"
523523
# - "Test Snapshot Taking And Restoring"
524524
# - "JSON-RPC Mock Test in Charge Mode"
525-
525+

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ stages:
1515
- Release
1616
- IntegrateTest
1717
before_install:
18-
- docker pull cita/cita-build:ubuntu-18.04-20191128
18+
- docker pull cita/cita-build:ubuntu-18.04-20200606
1919
jobs:
2020
include:
2121

cita-auth/src/dispatcher.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use std::cell::RefCell;
2525
use std::collections::HashSet;
2626
use std::convert::Into;
2727
use std::thread;
28-
use tx_pool;
2928

3029
pub struct Dispatcher {
3130
txs_pool: RefCell<tx_pool::Pool>,

cita-auth/src/handler.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ use lru::LruCache;
3535
use pubsub::channel::{Receiver, Sender};
3636
use rayon::iter::{IntoParallelIterator, ParallelIterator};
3737
use rayon::ThreadPoolBuilder;
38-
use serde_json;
3938
use std::collections::{HashMap, HashSet};
4039
use std::convert::Into;
4140
use std::str::FromStr;
@@ -552,7 +551,7 @@ impl MsgHandler {
552551
let check_quota = block_tx_hashes.get_check_quota();
553552
self.config_info.check_quota = check_quota;
554553
self.config_info.block_quota_limit = block_quota_limit;
555-
self.config_info.account_quota_limit = account_quota_limit.clone();
554+
self.config_info.account_quota_limit = account_quota_limit;
556555
self.config_info.admin_address = if block_tx_hashes.get_admin_address().is_empty() {
557556
None
558557
} else {

cita-chain/core/src/libchain/chain.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use crate::header::{BlockNumber, Header};
2020
use crate::libchain::status::Status;
2121
use crate::log_blooms::LogBloomGroup;
2222
use crate::receipt::{Receipt, RichReceipt};
23-
use cita_merklehash;
2423
use hashable::Hashable;
2524

2625
use libproto::blockchain::{
@@ -390,7 +389,7 @@ impl Chain {
390389

391390
let chain = Chain {
392391
blooms_config,
393-
current_header: RwLock::new(header.clone()),
392+
current_header: RwLock::new(header),
394393
current_height,
395394
max_store_height,
396395
block_map: RwLock::new(BTreeMap::new()),

cita-chain/src/forward.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ use libproto::{
3333
};
3434
use proof::BftProof;
3535
use pubsub::channel::Sender;
36-
use serde_json;
3736

3837
use crate::types::block::OpenBlock;
3938
use crate::types::block_number::BlockTag;

cita-chain/types/src/receipt.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ impl From<ProtoReceipt> for Receipt {
122122
.collect();
123123

124124
if receipt.error.is_some() {
125-
error = Some(ReceiptError::from_proto(
126-
receipt.clone().take_error().get_error(),
127-
));
125+
error = Some(ReceiptError::from_proto(receipt.get_error().get_error()));
128126
}
129127

130128
Receipt::new(

cita-executor/core/src/cita_executive.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> {
503503
let amend_type = value.low_u32();
504504
match amend_type {
505505
AMEND_ABI => {
506-
if self.transact_set_abi(&(data.to_owned().unwrap())) {
506+
if self.transact_set_abi(&(data.unwrap())) {
507507
Ok(None)
508508
} else {
509509
Err(VMError::Evm(EVMError::Internal(
@@ -512,7 +512,7 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> {
512512
}
513513
}
514514
AMEND_CODE => {
515-
if self.transact_set_code(&(data.to_owned().unwrap())) {
515+
if self.transact_set_code(&(data.unwrap())) {
516516
Ok(None)
517517
} else {
518518
Err(VMError::Evm(EVMError::Internal(
@@ -521,7 +521,7 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> {
521521
}
522522
}
523523
AMEND_KV_H256 => {
524-
if self.transact_set_kv_h256(&(data.to_owned().unwrap())) {
524+
if self.transact_set_kv_h256(&(data.unwrap())) {
525525
Ok(None)
526526
} else {
527527
Err(VMError::Evm(EVMError::Internal(
@@ -530,7 +530,7 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> {
530530
}
531531
}
532532
AMEND_GET_KV_H256 => {
533-
if let Some(v) = self.transact_get_kv_h256(&(data.to_owned().unwrap())) {
533+
if let Some(v) = self.transact_get_kv_h256(&(data.unwrap())) {
534534
Ok(Some(v))
535535
} else {
536536
Err(VMError::Evm(EVMError::Internal(
@@ -539,7 +539,7 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> {
539539
}
540540
}
541541
AMEND_ACCOUNT_BALANCE => {
542-
if self.transact_set_balance(&(data.to_owned().unwrap())) {
542+
if self.transact_set_balance(&(data.unwrap())) {
543543
Ok(None)
544544
} else {
545545
Err(VMError::Evm(EVMError::Internal(
@@ -607,7 +607,7 @@ pub fn create<B: DB + 'static>(
607607
let r = call(
608608
block_provider.clone(),
609609
state_provider.clone(),
610-
store.clone(),
610+
store,
611611
&reqchan,
612612
);
613613
match r {

cita-executor/core/src/cita_vm_helper.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,8 @@ pub fn call_pure<B: DB + 'static>(
3333
let evm_context = store.borrow().evm_context.clone();
3434
let evm_cfg = store.borrow().evm_cfg.clone();
3535
let evm_params = request.clone();
36-
let evm_data_provider = DataProvider::new(
37-
block_provider.clone(),
38-
state_provider.clone(),
39-
store.clone(),
40-
);
36+
let evm_data_provider =
37+
DataProvider::new(block_provider.clone(), state_provider.clone(), store);
4138
// Transfer value
4239
if !request.disable_transfer_value {
4340
state_provider.borrow_mut().transfer_balance(

cita-executor/core/src/contracts/native/crosschain_verify.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use crate::contracts::{
2020
use cita_types::{Address, H256, U256};
2121
use core::header::Header;
2222
use core::libchain::chain::TxProof;
23-
use ethabi;
2423

2524
use crate::storage::Map;
2625
use crate::types::context::Context;
@@ -180,7 +179,7 @@ impl CrossChainVerify {
180179

181180
let tokens = vec![
182181
ethabi::Token::Address(sender.into()),
183-
ethabi::Token::Bytes(tx_data.clone()),
182+
ethabi::Token::Bytes(tx_data),
184183
];
185184
let result = ethabi::encode(&tokens);
186185
trace!("encoded {:?}", result);

0 commit comments

Comments
 (0)