Skip to content

Commit

Permalink
Add empty wasm file.
Browse files Browse the repository at this point in the history
  • Loading branch information
staffik committed Dec 15, 2023
1 parent efdfa9b commit 53f7a8a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion runtime/near-wallet-contract/res/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.wasm
*.wasm
Empty file.
10 changes: 7 additions & 3 deletions runtime/near-wallet-contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ pub fn wallet_contract() -> Arc<ContractCode> {

/// Include the WASM file content directly in the binary at compile time.
fn read_contract() -> ContractCode {
let code: &[u8] =
if cfg!(feature = "nightly") { include_bytes!("../res/wallet_contract.wasm") } else { &[] };
#[cfg(feature = "nightly")]
let code = include_bytes!("../res/wallet_contract.wasm");

#[cfg(not(feature = "nightly"))]
let code = &[];

ContractCode::new(code.to_vec(), None)
}

Expand All @@ -35,7 +39,7 @@ mod tests {
use std::str::FromStr;

const WALLET_CONTRACT_HASH: &'static str = "4UkQ8nasN1u5aBuRna2wEHHAbQmWS2Kdq88TRz1phxAc";
const MAGIC_BYTES_HASH: &'static str = "46ABZEDwsEGnyJqNzJ1EftKzqH3ZtZj5Loj78Wr1vopm";
const MAGIC_BYTES_HASH: &'static str = "31PSU4diHE4cpWju91fb2zTqn5JSDRZ6xNGM2ub8Lgdg";

#[test]
fn check_wallet_contract() {
Expand Down

0 comments on commit 53f7a8a

Please sign in to comment.