Skip to content

Commit

Permalink
fix: tets
Browse files Browse the repository at this point in the history
  • Loading branch information
gagdiez committed Sep 5, 2024
1 parent 793d3a4 commit 062b6c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
24 changes: 7 additions & 17 deletions contract-rs/01-basic-auction/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
[package]
name = "contract-rs"
description = "Hello Near Example"
description = "Auction"
version = "0.1.0"
edition = "2021"
# TODO: Fill out the repository field to help NEAR ecosystem tools to discover your project.
# NEP-0330 is automatically implemented for all contracts built with https://github.com/near/cargo-near.
# Link to the repository will be available via `contract_source_metadata` view-function.
repository = "https://github.com/near-examples/auction-examples"

[lib]
crate-type = ["cdylib", "rlib"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
near-sdk = { version = "5.1.0", features = ["legacy"] }
chrono = "0.4.38"
tracing = "0.1"
tracing-subscriber = "0.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
near-sdk = { version = "5.3" }

[dev-dependencies]
near-sdk = { version = "5.1.0", features = ["unit-testing"] }
near-workspaces = { version = "0.10.0", features = ["unstable"] }
near-sdk = { version = "5.3", features = ["unit-testing"] }
near-workspaces = { version = "0.11.0", features = ["unstable"] }
tokio = { version = "1.12.0", features = ["full"] }
serde_json = "1.0.117"
serde_json = "1"
chrono = "0.4.38"

[profile.release]
codegen-units = 1
# Tell `rustc` to optimize for small code size.
opt-level = "z"
lto = true
debug = false
panic = "abort"
# Opt into extra safety checks on arithmetic operations https://stackoverflow.com/a/64136471/249801
overflow-checks = true
overflow-checks = true
11 changes: 9 additions & 2 deletions contract-rs/01-basic-auction/tests/test_basics.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
use chrono::Utc;
use contract_rs::Bid;
use near_sdk::NearToken;
use near_workspaces::types::{NearToken, AccountId};
use serde_json::json;
use near_sdk::near;

const TEN_NEAR: NearToken = NearToken::from_near(10);

#[near(serializers = [json])]
#[derive(Clone)]
pub struct Bid {
pub bidder: AccountId,
pub bid: NearToken,
}

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

0 comments on commit 062b6c9

Please sign in to comment.