Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
chore: Update rust to 1.40-nightly. (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
yejiayu authored Nov 8, 2019
1 parent abceb26 commit 4c6b6a1
Show file tree
Hide file tree
Showing 27 changed files with 154 additions and 77 deletions.
112 changes: 102 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.com/nervosnetwork/muta.svg?branch=master)](https://travis-ci.com/nervosnetwork/muta)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Minimum rustc version](https://img.shields.io/badge/rustc-nightly-informational.svg)](https://github.com/cryptape/overlord/blob/master/rust-toolchain)
[![Minimum rustc version](https://img.shields.io/badge/rustc-nightly-informational.svg)](https://github.com/nervosnetwork/muta/blob/master/rust-toolchain)

Muta is a high-performance blockchain framework.

Expand Down Expand Up @@ -39,7 +39,6 @@ Go to [http://127.0.0.1:8000/graphiql](http://127.0.0.1:8000/graphiql) to commun

The develop chain is worked on **LOCAL** and **SINGLE NODE**.


## How to Contribute

The contribution workflow is described in [CONTRIBUTING.md](CONTRIBUTING.md), and security policy is described in [SECURITY.md](SECURITY.md).
2 changes: 1 addition & 1 deletion common/merkle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl Merkle {
.into_iter()
.map(|node| ProofNode {
is_right: node.is_right,
hash: node.hash.clone(),
hash: node.hash,
})
.collect()
})
Expand Down
2 changes: 1 addition & 1 deletion core/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ juniper_codegen = "0.13"
async-trait = "0.1"
hex = "0.3"
bytes = "0.4"
futures-preview = { version = "0.3.0-alpha.19" }
futures = "0.3"
4 changes: 2 additions & 2 deletions core/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ fn gen_input_tx_encryption(
let signature = privkey.sign_message(&hash_value);

let input_encryption = InputTransactionEncryption {
tx_hash: tx_hash.clone(),
pubkey: Bytes::from(pubkey.to_bytes()),
tx_hash,
pubkey: Bytes::from(pubkey.to_bytes()),
signature: Bytes::from(signature.to_bytes()),
};
Ok(input_encryption)
Expand Down
2 changes: 1 addition & 1 deletion core/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ bincode = "1.1"
bytes = "0.4"
creep = "0.1"
derive_more = "0.15"
futures-preview = "0.3.0-alpha.19"
futures = "0.3"
log = "0.4"
overlord = "0.1"
parking_lot = "0.9"
Expand Down
4 changes: 2 additions & 2 deletions core/consensus/src/fixed_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ mod test {
logs_bloom: Default::default(),
order_root: nonce.clone(),
confirm_root: Vec::new(),
state_root: nonce.clone(),
state_root: nonce,
receipt_root: Vec::new(),
cycles_used: 999_999,
proposer: UserAddress::from_hex(addr_str).unwrap(),
Expand Down Expand Up @@ -212,7 +212,7 @@ mod test {
cycle: random::<u64>(),
};
let action = TransactionAction::Transfer {
receiver: address.clone(),
receiver: address,
carrying_asset: CarryingAsset {
asset_id: nonce.clone(),
amount: FromPrimitive::from_i32(42).unwrap(),
Expand Down
6 changes: 3 additions & 3 deletions core/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ impl<DB: TrieDB> Executor for TransactionExecutor<DB> {
Ok(ExecutorExecResp {
receipts,
all_cycles_used,
state_root,
logs_bloom: Bloom::default(),
state_root: state_root.clone(),
})
}

Expand Down Expand Up @@ -223,7 +223,7 @@ impl<DB: TrieDB> TransactionExecutor<DB> {

Ok(ReceiptResult::Transfer {
receiver: UserAddress::from_bytes(to.as_bytes())?,
asset_id: carrying_asset.asset_id.clone(),
asset_id: carrying_asset.asset_id,
before_amount,
after_amount,
})
Expand Down Expand Up @@ -298,7 +298,7 @@ impl<DB: 'static + TrieDB> ExecutorFactory<DB> for TransactionExecutorFactory {
if state_root == Hash::from_empty() {
MPTTrie::new(Arc::clone(&db))
} else {
MPTTrie::from(state_root.clone(), Arc::clone(&db))?
MPTTrie::from(state_root, Arc::clone(&db))?
}
};

Expand Down
2 changes: 1 addition & 1 deletion core/executor/src/native_contract/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<StateAdapter: ContractStateAdapter> BankContract<StateAdapter>

self.state_adapter
.borrow_mut()
.insert_cache::<FixedAssetSchema>(asset_id.clone(), asset.clone())?;
.insert_cache::<FixedAssetSchema>(asset_id, asset.clone())?;

let cycles_used = consume_cycles(
CyclesAction::BankRegister,
Expand Down
8 changes: 1 addition & 7 deletions core/executor/src/tests/account_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ fn test_account_contract() {
asset_id: asset.clone(),
amount: 1000u64.into(),
};
let ctx = mock_invoke_context(
user1.clone(),
Some(carrying_asset),
0,
1_000_000,
fee_asset.clone(),
);
let ctx = mock_invoke_context(user1.clone(), Some(carrying_asset), 0, 1_000_000, fee_asset);
account.transfer(Rc::clone(&ctx), &user2).unwrap();
let user1_balance = account.get_balance(&asset, &user1).unwrap();
assert_eq!(user1_balance, Balance::from(9000u64));
Expand Down
Loading

0 comments on commit 4c6b6a1

Please sign in to comment.