Skip to content

Commit

Permalink
fix: Disable generation of WASM file for Wallet Contract (#10530)
Browse files Browse the repository at this point in the history
Looks like #10436 is not enough,
because the WASM file is still generated if someone manually run tests
with `--all-features` flag, which triggers `build_wallet_contract` too.
To make sure it does not happen at all, I would disable the Wallect
Contract build completely. We currently do not use it anyway.
  • Loading branch information
staffik authored Jan 31, 2024
1 parent 0e1c647 commit 6486e6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion runtime/near-wallet-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ near-primitives-core.workspace = true
anyhow.workspace = true

[features]
build_wallet_contract = []
nightly_protocol = [
"near-primitives-core/nightly_protocol",
"near-vm-runner/nightly_protocol",
Expand Down
4 changes: 2 additions & 2 deletions runtime/near-wallet-contract/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ See https://github.com/near/NEPs/issues/518.

Must not use in production!

Currently, the contract can only be used in nightly build.
Temporarily, we also require `build_wallet_contract` feature flag for `cargo build`.
Currently, the contract build is disabled!

The `build.rs` generates WASM file and saves it to the `./res` directory.

If you want to use the contract from nearcore, add this crate as a dependency
Expand Down
8 changes: 3 additions & 5 deletions runtime/near-wallet-contract/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ use anyhow::{anyhow, Context, Ok, Result};
use std::path::{Path, PathBuf};
use std::process::Command;

#[allow(unreachable_code)]
fn main() -> Result<()> {
// TODO(eth-implicit) Remove the `build_wallet_contract` flag once we have a proper way
// to generate the Wallet Contract WASM file.
if cfg!(not(feature = "nightly")) || cfg!(not(feature = "build_wallet_contract")) {
return Ok(());
}
// TODO(eth-implicit) Remove this once we have a proper way to generate the Wallet Contract WASM file.
return Ok(());
build_contract("./wallet-contract", &[], "wallet_contract")
}

Expand Down

0 comments on commit 6486e6f

Please sign in to comment.