rewrite me

This commit is contained in:
Niklas
2022-01-20 15:07:14 +01:00
parent 65fb71a8d3
commit c988c4a16a
3 changed files with 16 additions and 8 deletions
+11 -5
View File
@@ -37,6 +37,11 @@ use test_runtime::node_runtime::{
#[async_std::test]
pub async fn test_embedded_client() {
tracing_subscriber::FmtSubscriber::builder()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init()
.expect("setting default subscriber failed");
let tmp = TempDir::new("subxt-").expect("failed to create tempdir");
let config = SubxtClientConfig {
impl_name: "full-client",
@@ -72,6 +77,7 @@ pub async fn test_embedded_client() {
.build::<DefaultConfig>()
.await
.unwrap();
let api: node_runtime::RuntimeApi<DefaultConfig> =
ext_client.clone().to_runtime_api();
@@ -86,19 +92,19 @@ pub async fn test_embedded_client() {
let bob_address = AccountKeyring::Bob.to_account_id().into();
// verify that we can call dispatchable functions
let success = api
let events = api
.tx()
.balances()
.transfer(bob_address, 100_000_000_000_000_000)
.transfer(bob_address, 100_000)
.sign_and_submit_then_watch(&alice)
.await
.unwrap()
.wait_for_finalized_success()
.await
.unwrap()
.has_event::<system::events::ExtrinsicSuccess>()
.unwrap();
panic!("{:?}", events);
// verify that we receive events
assert!(success);
//assert!(success);
}