Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproduce concurrent failures #1279

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/fungible-token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }

13 changes: 7 additions & 6 deletions examples/fungible-token/tests/workspaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ fn build_contract(path: &str, contract_name: &str) -> Vec<u8> {
}

#[fixture]
#[once]
// #[once]
fn fungible_contract_wasm() -> Vec<u8> {
build_contract("./ft/Cargo.toml", "fungible-token")
}


#[fixture]
#[once]
// #[once]
fn defi_contract_wasm() -> Vec<u8> {
build_contract("./test-contract-defi/Cargo.toml", "defi")
}
Expand All @@ -59,12 +59,12 @@ fn initial_balance() -> U128 {
#[fixture]
async fn initialized_contracts(
initial_balance: U128,
fungible_contract_wasm: &Vec<u8>,
defi_contract_wasm: &Vec<u8>,
fungible_contract_wasm: Vec<u8>,
defi_contract_wasm: Vec<u8>,
) -> 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")
Expand All @@ -74,14 +74,15 @@ 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")
.args_json((ft_contract.id(),))
.max_gas()
.transact()
.await?;
dbg!(&res);
assert!(res.is_success());

let alice = ft_contract
Expand Down
Loading