mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 14:25:41 +00:00
Networking and in-memory client (#38)
* Networking crate draft * Started work on syncing algo * Fixed query range * BlockCollection tests * In-mem client backend * Fixed tests * Renamed Transaction * Removed stray println * Docs
This commit is contained in:
committed by
Robert Habermeier
parent
8e554129ec
commit
44499550d9
@@ -18,14 +18,15 @@ use super::*;
|
||||
use polkadot_executor as executor;
|
||||
|
||||
use self::error::{Error, ErrorKind};
|
||||
use test_helpers::Blockchain;
|
||||
use client;
|
||||
|
||||
#[test]
|
||||
fn should_return_storage() {
|
||||
let client = Client::new(Blockchain::default(), executor::executor());
|
||||
let client = client::new_in_mem(executor::executor()).unwrap();
|
||||
let genesis_hash = "11265ce45dd2baaaf071f6df8c5a44f0ed1d85a50e71451ff2d4345e57d12e3a".into();
|
||||
|
||||
assert_matches!(
|
||||
StateApi::storage(&client, StorageKey(vec![10]), 0.into()),
|
||||
StateApi::storage(&client, StorageKey(vec![10]), genesis_hash),
|
||||
Ok(ref x) if x.0.is_empty()
|
||||
)
|
||||
}
|
||||
@@ -34,10 +35,11 @@ fn should_return_storage() {
|
||||
#[ignore] // TODO: [ToDr] reenable once we can properly mock the wasm executor env
|
||||
fn should_call_contract() {
|
||||
// TODO [ToDr] Fix test after we are able to mock state.
|
||||
let client = Client::new(Blockchain::default(), executor::executor());
|
||||
let client = client::new_in_mem(executor::executor()).unwrap();
|
||||
let genesis_hash = "11265ce45dd2baaaf071f6df8c5a44f0ed1d85a50e71451ff2d4345e57d12e3a".into();
|
||||
|
||||
assert_matches!(
|
||||
StateApi::call(&client, "balanceOf".into(), CallData(vec![1,2,3]), 0.into()),
|
||||
StateApi::call(&client, "balanceOf".into(), CallData(vec![1,2,3]), genesis_hash),
|
||||
Err(Error(ErrorKind::Client(client::error::ErrorKind::Execution(_)), _))
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user