With the sample code
let mut client = RpcClientBuilder::new()
.build("http://127.0.0.1:38085")
.unwrap();
let mut wallet = client.wallet();
println!("{:?}", wallet.open_wallet("test-wallet".to_string(), Some("test141414A".to_string())).await);
let foo = wallet.get_balance(0, None).await;
println!("{:?}", foo);
The following program crashes, with the error
Err(error sending request for url (http://127.0.0.1:38085/json_rpc): connection closed before message completed
Caused by:
connection closed before message completed)
However, adding a sleep between the open_wallet and get_balance requests makes it work as intended.
With the sample code
The following program crashes, with the error
However, adding a sleep between the open_wallet and get_balance requests makes it work as intended.