use crate::common::{self, logs, Result};
use gear_program::api::Api;
const SURI: &str = "tumble tenant update heavy sad draw present tray atom chunk animal exhaust";
const ADDRESS: &str = "5EJAhWN49JDfn58DpkERvCrtJ5X3sHue93a1hH4nB9KngGSs";
#[tokio::test]
async fn test_command_transfer_works() -> Result<()> {
common::login_as_alice().expect("login failed");
let mut node = common::Node::dev()?;
node.wait(logs::gear_node::IMPORTING_BLOCKS)?;
let api = Api::new(Some(&node.ws())).await?.signer(SURI, None)?;
let before = api.get_balance(ADDRESS).await?;
let value = 1000000000_u128;
let _ = common::gear(&["-e", &node.ws(), "transfer", ADDRESS, &value.to_string()])?;
let after = api.get_balance(ADDRESS).await?;
assert_eq!(after.saturating_sub(before), value);
Ok(())
}