diff --git a/workspaces/tests/cross_contract.rs b/workspaces/tests/cross_contract.rs index 7dc4bef9..7b35686e 100644 --- a/workspaces/tests/cross_contract.rs +++ b/workspaces/tests/cross_contract.rs @@ -33,15 +33,21 @@ async fn test_cross_contract_create_contract() -> anyhow::Result<()> { .into_result()?; let status_amt = NearToken::from_near(35); - // Expect the creation of a top level account to fail. - let status_id: AccountId = "status-top-level-account-long-name".parse().unwrap(); - let outcome = cross_contract_create_contract(&status_id, &status_amt, &contract).await?; - let failures = outcome.failures(); - assert!( - failures.len() == 1, - "Expected one receipt failure for creating a top level account, but got {} failures", - failures.len() - ); + #[cfg(feature = "experimental")] + if let Ok(conf) = worker.genesis_config().await { + if conf.protocol_version >= 64 { + // Expect the creation of a top level account to fail. + let status_id: AccountId = "status-top-level-account-long-name".parse().unwrap(); + let outcome = + cross_contract_create_contract(&status_id, &status_amt, &contract).await?; + let failures = outcome.failures(); + assert!( + failures.len() == 1, + "Expected one receipt failure for creating a top level account, but got {} failures", + failures.len() + ); + } + } // Expect the creation of a subaccount like "status.{contract_id}" to pass. let status_id: AccountId = format!("status.{}", contract.id()).parse().unwrap(); diff --git a/workspaces/tests/gas_meter.rs b/workspaces/tests/gas_meter.rs index 1aae098c..f5b558e7 100644 --- a/workspaces/tests/gas_meter.rs +++ b/workspaces/tests/gas_meter.rs @@ -510,6 +510,6 @@ async fn test_dropped_gas_meter() -> anyhow::Result<()> { Ok(()) } -fn as_near(gas: Gas) -> NearToken { +const fn as_near(gas: Gas) -> NearToken { NearToken::from_yoctonear(gas.as_gas() as u128) }