Fix compile errors (#17)

* Fix compile errors

* Fix tests, close #13 BTW
This commit is contained in:
Yuanchao Sun
2019-09-13 03:31:05 +08:00
committed by Andrew Jones
parent 25c3e81811
commit 650c6d3bb0
3 changed files with 8 additions and 10 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ runtime_primitives = { git = "https://github.com/paritytech/substrate/", package
serde = { version = "1.0", features = ["derive"] }
sr-version = { git = "https://github.com/paritytech/substrate/", package = "sr-version" }
srml-system = { git = "https://github.com/paritytech/substrate/", package = "srml-system" }
substrate-rpc = { git = "https://github.com/paritytech/substrate/", package = "substrate-rpc" }
substrate-rpc-api = { git = "https://github.com/paritytech/substrate/", package = "substrate-rpc-api" }
substrate-primitives = { git = "https://github.com/paritytech/substrate/", package = "substrate-primitives" }
transaction_pool = { git = "https://github.com/paritytech/substrate/", package = "substrate-transaction-pool" }
url = "1.7"
+5 -7
View File
@@ -84,8 +84,7 @@ pub struct ExtrinsicSuccess<T: System> {
}
fn connect<T: System>(url: &Url) -> impl Future<Item = Rpc<T>, Error = Error> {
ws::connect(url.as_str())
.expect("Url is a valid url; qed")
ws::connect(url)
.map_err(Into::into)
}
@@ -404,7 +403,6 @@ mod tests {
use runtime_support::StorageMap;
use substrate_keyring::AccountKeyring;
use substrate_primitives::{
blake2_256,
storage::StorageKey,
Pair,
};
@@ -555,8 +553,8 @@ mod tests {
assert_eq!(call.encode().to_vec(), call2.0);
let free_balance =
<srml_balances::FreeBalance<node_runtime::Runtime>>::key_for(&dest);
let free_balance_key = StorageKey(blake2_256(&free_balance).to_vec());
<srml_balances::FreeBalance<node_runtime::Runtime>>::hashed_key_for(&dest);
let free_balance_key = StorageKey(free_balance);
let free_balance_key2 = balances
.storage("FreeBalance")
.unwrap()
@@ -566,8 +564,8 @@ mod tests {
assert_eq!(free_balance_key, free_balance_key2);
let account_nonce =
<srml_system::AccountNonce<node_runtime::Runtime>>::key_for(&dest);
let account_nonce_key = StorageKey(blake2_256(&account_nonce).to_vec());
<srml_system::AccountNonce<node_runtime::Runtime>>::hashed_key_for(&dest);
let account_nonce_key = StorageKey(account_nonce);
let account_nonce_key2 = client
.metadata()
.module("System")
+2 -2
View File
@@ -42,7 +42,7 @@ use runtime_primitives::{
use sr_version::RuntimeVersion;
use std::convert::TryInto;
use substrate_primitives::storage::StorageKey;
use substrate_rpc::{
use substrate_rpc_api::{
author::AuthorClient,
chain::{
number::NumberOrHex,
@@ -163,7 +163,7 @@ impl<T: System> Rpc<T> {
event
});
self.chain
.subscribe_new_head()
.subscribe_new_heads()
.map(|stream| stream.map(closure))
.map_err(Into::into)
}