-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
68 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
require('util').inspect.defaultOptions.depth = 5; // Increase AVA's printing depth | ||
require("util").inspect.defaultOptions.depth = 5; // Increase AVA's printing depth | ||
|
||
module.exports = { | ||
timeout: '300000', | ||
files: ['**/*.ava.ts'], | ||
timeout: "300000", | ||
files: ["**/*.ava.ts"], | ||
failWithoutAssertions: false, | ||
extensions: [ | ||
'ts' | ||
], | ||
require: [ | ||
'ts-node/register', | ||
], | ||
}; | ||
extensions: ["ts"], | ||
require: ["ts-node/register"], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "rust-status-message-integration-tests" | ||
version = "1.0.0" | ||
publish = false | ||
edition = "2018" | ||
|
||
[dev-dependencies] | ||
anyhow = "1.0" | ||
borsh = "0.9" | ||
maplit = "1.0" | ||
near-units = "0.2.0" | ||
# arbitrary_precision enabled for u128 types that workspaces requires for Balance types | ||
serde_json = { version = "1.0", features = ["arbitrary_precision"] } | ||
tokio = { version = "1.18.1", features = ["full"] } | ||
tracing = "0.1" | ||
tracing-subscriber = { version = "0.3.11", features = ["env-filter"] } | ||
workspaces = "0.2.1" | ||
pkg-config = "0.3.1" | ||
|
||
[[example]] | ||
name = "set" | ||
path = "src/set.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use serde_json::json; | ||
use near_units::parse_near; | ||
use workspaces::prelude::*; | ||
|
||
const WASM_FILEPATH: &str = "../../res/status_message.wasm"; | ||
|
||
#[tokio::main] | ||
async fn main() -> anyhow::Result<()> { | ||
let worker = workspaces::sandbox().await?; | ||
let wasm = std::fs::read(WASM_FILEPATH)?; | ||
let contract = worker.dev_deploy(&wasm).await?; | ||
|
||
// create accounts | ||
let owner = worker.root_account(); | ||
let alice = owner | ||
.create_subaccount(&worker, "alice") | ||
.initial_balance(parse_near!("30 N")) | ||
.transact() | ||
.await? | ||
.into_result()?; | ||
|
||
// begin test | ||
alice | ||
.call(&worker, contract.id(), "set_status") | ||
.args_json(json!({ "message": "hello" }))? | ||
.transact() | ||
.await?; | ||
|
||
let alice_status: String = owner | ||
.call(&worker, contract.id(), "get_status") | ||
.args_json(json!({ "account_id": alice.id() }))? | ||
.transact() | ||
.await? | ||
.json()?; | ||
|
||
assert_eq!(alice_status, "hello"); | ||
println!("Passed ✅"); | ||
Ok(()) | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters