From 027ce75a67a023432901c5eb2d70aa68a276c423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dj8yf0=CE=BCl?= Date: Mon, 16 Dec 2024 20:38:50 +0200 Subject: [PATCH 1/2] test: remove `once` on compile project fixture --- examples/fungible-token/tests/workspaces.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/fungible-token/tests/workspaces.rs b/examples/fungible-token/tests/workspaces.rs index c3731540f..64db53acf 100644 --- a/examples/fungible-token/tests/workspaces.rs +++ b/examples/fungible-token/tests/workspaces.rs @@ -39,14 +39,14 @@ fn build_contract(path: &str, contract_name: &str) -> Vec { } #[fixture] -#[once] +// #[once] fn fungible_contract_wasm() -> Vec { build_contract("./ft/Cargo.toml", "fungible-token") } #[fixture] -#[once] +// #[once] fn defi_contract_wasm() -> Vec { build_contract("./test-contract-defi/Cargo.toml", "defi") } @@ -59,12 +59,12 @@ fn initial_balance() -> U128 { #[fixture] async fn initialized_contracts( initial_balance: U128, - fungible_contract_wasm: &Vec, - defi_contract_wasm: &Vec, + fungible_contract_wasm: Vec, + defi_contract_wasm: Vec, ) -> anyhow::Result<(Contract, Account, Contract)> { let worker = near_workspaces::sandbox().await?; - let ft_contract = worker.dev_deploy(fungible_contract_wasm).await?; + let ft_contract = worker.dev_deploy(&fungible_contract_wasm).await?; let res = ft_contract .call("new_default_meta") @@ -74,7 +74,7 @@ async fn initialized_contracts( .await?; assert!(res.is_success()); - let defi_contract = worker.dev_deploy(defi_contract_wasm).await?; + let defi_contract = worker.dev_deploy(&defi_contract_wasm).await?; let res = defi_contract .call("new") @@ -82,6 +82,7 @@ async fn initialized_contracts( .max_gas() .transact() .await?; + dbg!(&res); assert!(res.is_success()); let alice = ft_contract From ffab607525f02999ea82ed542ea051f2281d0dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dj8yf0=CE=BCl?= Date: Mon, 16 Dec 2024 21:05:18 +0200 Subject: [PATCH 2/2] test: test patched version of `cargo-near-build` --- examples/fungible-token/Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/fungible-token/Cargo.toml b/examples/fungible-token/Cargo.toml index b62008b0f..7e62f42b7 100644 --- a/examples/fungible-token/Cargo.toml +++ b/examples/fungible-token/Cargo.toml @@ -23,3 +23,7 @@ overflow-checks = true [workspace] # remember to include a member for each contract members = ["ft", "test-contract-defi"] + +[patch.crates-io] +cargo-near-build = { git = 'https://github.com/dj8yfo/cargo-near.git', rev = '843aa974d7f30ad803af401bd7c0a819872ccbdf' } +