mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 02:51:08 +00:00
Fix compile errors (#17)
* Fix compile errors * Fix tests, close #13 BTW
This commit is contained in:
committed by
Andrew Jones
parent
25c3e81811
commit
650c6d3bb0
+1
-1
@@ -25,7 +25,7 @@ runtime_primitives = { git = "https://github.com/paritytech/substrate/", package
|
|||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
sr-version = { git = "https://github.com/paritytech/substrate/", package = "sr-version" }
|
sr-version = { git = "https://github.com/paritytech/substrate/", package = "sr-version" }
|
||||||
srml-system = { git = "https://github.com/paritytech/substrate/", package = "srml-system" }
|
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" }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate/", package = "substrate-primitives" }
|
||||||
transaction_pool = { git = "https://github.com/paritytech/substrate/", package = "substrate-transaction-pool" }
|
transaction_pool = { git = "https://github.com/paritytech/substrate/", package = "substrate-transaction-pool" }
|
||||||
url = "1.7"
|
url = "1.7"
|
||||||
|
|||||||
+5
-7
@@ -84,8 +84,7 @@ pub struct ExtrinsicSuccess<T: System> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn connect<T: System>(url: &Url) -> impl Future<Item = Rpc<T>, Error = Error> {
|
fn connect<T: System>(url: &Url) -> impl Future<Item = Rpc<T>, Error = Error> {
|
||||||
ws::connect(url.as_str())
|
ws::connect(url)
|
||||||
.expect("Url is a valid url; qed")
|
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,7 +403,6 @@ mod tests {
|
|||||||
use runtime_support::StorageMap;
|
use runtime_support::StorageMap;
|
||||||
use substrate_keyring::AccountKeyring;
|
use substrate_keyring::AccountKeyring;
|
||||||
use substrate_primitives::{
|
use substrate_primitives::{
|
||||||
blake2_256,
|
|
||||||
storage::StorageKey,
|
storage::StorageKey,
|
||||||
Pair,
|
Pair,
|
||||||
};
|
};
|
||||||
@@ -555,8 +553,8 @@ mod tests {
|
|||||||
assert_eq!(call.encode().to_vec(), call2.0);
|
assert_eq!(call.encode().to_vec(), call2.0);
|
||||||
|
|
||||||
let free_balance =
|
let free_balance =
|
||||||
<srml_balances::FreeBalance<node_runtime::Runtime>>::key_for(&dest);
|
<srml_balances::FreeBalance<node_runtime::Runtime>>::hashed_key_for(&dest);
|
||||||
let free_balance_key = StorageKey(blake2_256(&free_balance).to_vec());
|
let free_balance_key = StorageKey(free_balance);
|
||||||
let free_balance_key2 = balances
|
let free_balance_key2 = balances
|
||||||
.storage("FreeBalance")
|
.storage("FreeBalance")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
@@ -566,8 +564,8 @@ mod tests {
|
|||||||
assert_eq!(free_balance_key, free_balance_key2);
|
assert_eq!(free_balance_key, free_balance_key2);
|
||||||
|
|
||||||
let account_nonce =
|
let account_nonce =
|
||||||
<srml_system::AccountNonce<node_runtime::Runtime>>::key_for(&dest);
|
<srml_system::AccountNonce<node_runtime::Runtime>>::hashed_key_for(&dest);
|
||||||
let account_nonce_key = StorageKey(blake2_256(&account_nonce).to_vec());
|
let account_nonce_key = StorageKey(account_nonce);
|
||||||
let account_nonce_key2 = client
|
let account_nonce_key2 = client
|
||||||
.metadata()
|
.metadata()
|
||||||
.module("System")
|
.module("System")
|
||||||
|
|||||||
+2
-2
@@ -42,7 +42,7 @@ use runtime_primitives::{
|
|||||||
use sr_version::RuntimeVersion;
|
use sr_version::RuntimeVersion;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use substrate_primitives::storage::StorageKey;
|
use substrate_primitives::storage::StorageKey;
|
||||||
use substrate_rpc::{
|
use substrate_rpc_api::{
|
||||||
author::AuthorClient,
|
author::AuthorClient,
|
||||||
chain::{
|
chain::{
|
||||||
number::NumberOrHex,
|
number::NumberOrHex,
|
||||||
@@ -163,7 +163,7 @@ impl<T: System> Rpc<T> {
|
|||||||
event
|
event
|
||||||
});
|
});
|
||||||
self.chain
|
self.chain
|
||||||
.subscribe_new_head()
|
.subscribe_new_heads()
|
||||||
.map(|stream| stream.map(closure))
|
.map(|stream| stream.map(closure))
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user