From 227192424ff13b41be81411461e4ffd81a80182b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Chuda=C5=9B?= Date: Tue, 16 Jan 2024 10:55:23 +0100 Subject: [PATCH] Disable auto-generation of wallet contract by default --- runtime/near-wallet-contract/Cargo.toml | 1 + runtime/near-wallet-contract/README.md | 1 + runtime/near-wallet-contract/build.rs | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/near-wallet-contract/Cargo.toml b/runtime/near-wallet-contract/Cargo.toml index c8978386a67..c966818173d 100644 --- a/runtime/near-wallet-contract/Cargo.toml +++ b/runtime/near-wallet-contract/Cargo.toml @@ -22,6 +22,7 @@ near-primitives-core.workspace = true anyhow.workspace = true [features] +build_wallet_contract = [] nightly_protocol = [ "near-vm-runner/nightly_protocol", ] diff --git a/runtime/near-wallet-contract/README.md b/runtime/near-wallet-contract/README.md index 51ca7112bc9..7540180cd1e 100644 --- a/runtime/near-wallet-contract/README.md +++ b/runtime/near-wallet-contract/README.md @@ -5,6 +5,7 @@ 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`. 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 diff --git a/runtime/near-wallet-contract/build.rs b/runtime/near-wallet-contract/build.rs index 33e440081c3..9788f4a9bf5 100644 --- a/runtime/near-wallet-contract/build.rs +++ b/runtime/near-wallet-contract/build.rs @@ -6,7 +6,9 @@ use std::path::{Path, PathBuf}; use std::process::Command; fn main() -> Result<()> { - if cfg!(not(feature = "nightly")) { + // 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(()); } build_contract("./wallet-contract", &[], "wallet_contract")