Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PiVortex committed Sep 6, 2024
1 parent 6386ec0 commit e150407
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 59 deletions.
8 changes: 4 additions & 4 deletions contract-rs/01-basic-auction/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contract-rs"
description = "Auction"
name = "auction-contract"
description = "Auction Example Part 1"
version = "0.1.0"
edition = "2021"

Expand All @@ -9,10 +9,10 @@ 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.3" }
near-sdk = { version = "5.4.0" }

[dev-dependencies]
near-sdk = { version = "5.3", features = ["unit-testing"] }
near-sdk = { version = "5.4.0", features = ["unit-testing"] }
near-workspaces = { version = "0.11.0", features = ["unstable"] }
tokio = { version = "1.12.0", features = ["full"] }
serde_json = "1"
Expand Down
24 changes: 8 additions & 16 deletions contract-rs/02-owner-claims-money/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
[package]
name = "contract-rs"
description = "Hello Near Example"
name = "auction-contract"
description = "Auction Example Part 2"
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"
near-sdk = { version = "5.4.0" }

[dev-dependencies]
near-sdk = { version = "5.1.0", features = ["unit-testing"] }
near-workspaces = { version = "0.10.0", features = ["unstable"] }
near-sdk = { version = "5.4.0", 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/02-owner-claims-money/tests/test_basics.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
use chrono::Utc;
use contract_rs::Bid;
use near_sdk::{Gas, NearToken};
use serde_json::json;
use near_workspaces::types::{NearToken, AccountId, Gas};
use near_sdk::near;

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

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

Expand Down
24 changes: 8 additions & 16 deletions contract-rs/03-owner-claims-winner-gets-nft/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
[package]
name = "contract-rs"
description = "Hello Near Example"
name = "auction-contract"
description = "Auction Example Part 3"
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"
near-sdk = { version = "5.4.0" }

[dev-dependencies]
near-sdk = { version = "5.1.0", features = ["unit-testing"] }
near-workspaces = { version = "0.10.0", features = ["unstable"] }
near-sdk = { version = "5.4.0", 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/03-owner-claims-winner-gets-nft/tests/test_basics.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
use chrono::Utc;
use contract_rs::Bid;
use near_sdk::{Gas, NearToken};
use near_workspaces::result::ExecutionFinalResult;
use serde_json::json;
use near_workspaces::types::{NearToken, AccountId, Gas};
use near_sdk::near;

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

const TEN_NEAR: NearToken = NearToken::from_near(10);
const NFT_WASM_FILEPATH: &str = "./tests/non_fungible_token.wasm";
Expand Down
24 changes: 8 additions & 16 deletions contract-rs/04-ft-owner-claims-winner-gets-nft/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
[package]
name = "contract-rs"
description = "Hello Near Example"
name = "auction-contract"
description = "Auction Example Part 4"
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"
near-sdk = { version = "5.4.0" }

[dev-dependencies]
near-sdk = { version = "5.1.0", features = ["unit-testing"] }
near-workspaces = { version = "0.10.0", features = ["unstable"] }
near-sdk = { version = "5.4.0", 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
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
use chrono::Utc;
use contract_rs::Bid;
use near_sdk::{json_types::U128, NearToken};
use near_sdk::{AccountId, Gas};
use near_sdk::json_types::U128;
use near_workspaces::result::ExecutionFinalResult;
use near_workspaces::{Account, Contract};
use serde_json::json;
use near_workspaces::types::{NearToken, AccountId, Gas};
use near_sdk::near;

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

const TEN_NEAR: NearToken = NearToken::from_near(10);
const FT_WASM_FILEPATH: &str = "./tests/fungible_token.wasm";
Expand Down

0 comments on commit e150407

Please sign in to comment.