Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gagdiez committed Apr 2, 2024
1 parent 9b14ae5 commit e764428
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions contract-rs/tests/test_basics.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
use near_sdk::NearToken;
use serde_json::json;

const FIVE_NEAR: NearToken = NearToken::from_near(5);

#[tokio::test]
async fn test_contract_is_operational() -> Result<(), Box<dyn std::error::Error>> {
let sandbox = near_workspaces::sandbox().await?;
let contract_wasm = near_workspaces::compile_project("./").await?;

let contract = sandbox.dev_deploy(&contract_wasm).await?;
let root = sandbox.root_account()?;

let user_account = root.create_subaccount("user").transact().await?.unwrap();
let contract_account = root.create_subaccount("contract").initial_balance(FIVE_NEAR).transact().await?.unwrap();

let user_account = sandbox.dev_create_account().await?;
let contract = contract_account.deploy(&contract_wasm).await?.unwrap();

let outcome = user_account
.call(contract.id(), "set_greeting")
Expand Down

0 comments on commit e764428

Please sign in to comment.