Skip to content

Commit

Permalink
fix: fix test_cross_contract_calls failed
Browse files Browse the repository at this point in the history
  • Loading branch information
fospring committed Jun 9, 2024
1 parent 7646b15 commit 0768dd4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions workspaces/tests/cross_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ async fn test_cross_contract_create_contract() -> anyhow::Result<()> {

// Expect to succeed after calling into the contract with expected length for a
// top level account.
let status_id: AccountId = "status-top-level-account-long-name".parse().unwrap();
let status_id: AccountId = ("account-long-name.".to_string() + contract.id().as_str())
.parse()
.unwrap();
let outcome = cross_contract_create_contract(&status_id, &status_amt, &contract).await?;
let failures = outcome.failures();
assert!(
failures.is_empty(),
"Expected no failures for creating a TLA, but got {} failures",
"Expected no failures for creating a TLA, but got {} failures: {:?}, status_id: {}",
failures.len(),
failures,
status_id,
);

Ok(())
Expand All @@ -60,7 +64,9 @@ 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-top-level-account-long-name".parse().unwrap();
let status_id: AccountId = ("account-long-name.".to_string() + contract.id().as_str())
.parse()
.unwrap();
cross_contract_create_contract(&status_id, &status_amt, &contract)
.await?
.into_result()?;
Expand Down

0 comments on commit 0768dd4

Please sign in to comment.