Skip to content

Commit

Permalink
fixed cross-contract create account test
Browse files Browse the repository at this point in the history
  • Loading branch information
frol committed Jun 25, 2024
1 parent 7a11a2e commit cadb911
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions workspaces/tests/cross_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ async fn test_cross_contract_create_contract() -> anyhow::Result<()> {
let contract = worker.dev_deploy(FACTORY_CONTRACT).await?;
let status_amt = NearToken::from_near(35);

// Expect to fail for trying to create a new contract account with too short of a
// Expect to fail for trying to create a new contract account with a
// top level account name, such as purely just "status"
let status_id: AccountId = ("status".to_string() + "." + contract.id().as_str())
.parse()
.unwrap();
let status_id: AccountId = "status".parse().unwrap();
let outcome = cross_contract_create_contract(&status_id, &status_amt, &contract).await?;
let failures = outcome.failures();
assert!(
failures.is_empty(),
failures.len() == 1,
"Expected one receipt failure for creating too short of a TLA, but got {} failures",
failures.len()
);
Expand All @@ -51,9 +49,7 @@ async fn test_cross_contract_calls() -> anyhow::Result<()> {
let contract = worker.dev_deploy(FACTORY_CONTRACT).await?;
let status_amt = NearToken::from_near(35);

let status_id: AccountId = ("status".to_string() + "." + contract.id().as_str())
.parse()
.unwrap();
let status_id: AccountId = format!("status.{}", contract.id()).parse().unwrap();
cross_contract_create_contract(&status_id, &status_amt, &contract)
.await?
.into_result()?;
Expand Down

0 comments on commit cadb911

Please sign in to comment.