use crate::common::{self, Result, ALICE_SS58_ADDRESS as ADDRESS};
use gear_program::api::Api;
const REWARD_PER_BLOCK: u128 = 3000;
#[tokio::test]
async fn test_command_claim_works() -> Result<()> {
let node = common::create_messager().await?;
let api = Api::new(Some(&node.ws())).await?.try_signer(None)?;
let mailbox = api.mailbox(common::alice_account_id(), 10).await?;
assert_eq!(mailbox.len(), 1);
let id = hex::encode(mailbox[0].0.id.0);
let before = api.get_balance(ADDRESS).await?;
let _ = common::gear(&["-e", &node.ws(), "claim", &id])?;
let after = api.get_balance(ADDRESS).await?;
assert_eq!(
after.saturating_sub(before),
messager::SENT_VALUE + REWARD_PER_BLOCK
);
Ok(())
}