Skip to content

Commit

Permalink
Do not commit auto-generated wasm files
Browse files Browse the repository at this point in the history
  • Loading branch information
staffik committed Dec 8, 2023
1 parent 1614346 commit b138347
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,7 @@ fn meta_tx_create_eth_implicit_account() {
meta_tx_create_implicit_account(eth_implicit_test_account());
}

// TODO(eth-implicit) Remove this test and replace it with tests that directly call the `Wallet Contract` when it is ready.
/// Creating an ETH-implicit account with meta-transaction, then attempting to use it with another meta-transaction.
///
/// Depending on `rlp_transaction` blob that is sent to the `Wallet Contract`
Expand Down
1 change: 1 addition & 0 deletions runtime/near-wallet-contract/res/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.wasm
Binary file not shown.
Binary file not shown.
15 changes: 6 additions & 9 deletions runtime/near-wallet-contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ use std::path::Path;
/// Temporary (placeholder) Wallet Contract. Read from file once, then cache in memory.
pub fn wallet_contract() -> &'static ContractCode {
static CONTRACT: OnceCell<ContractCode> = OnceCell::new();
CONTRACT.get_or_init(|| read_contract("wallet_contract.wasm"))
}

/// Temporary (placeholder) Wallet Contract that has access to all host functions from
/// the nightly protocol. Read from file once, then cache in memory.
pub fn nightly_wallet_contract() -> &'static ContractCode {
static CONTRACT: OnceCell<ContractCode> = OnceCell::new();
CONTRACT.get_or_init(|| read_contract("nightly_wallet_contract.wasm"))
let file_name = if cfg!(feature = "nightly") {
"nightly_wallet_contract.wasm"
} else {
"wallet_contract.wasm"
};
CONTRACT.get_or_init(|| read_contract(file_name))
}

/// Read given wasm file or panic if unable to.
Expand All @@ -31,5 +29,4 @@ fn read_contract(file_name: &str) -> ContractCode {
#[test]
fn smoke_test() {
assert!(!wallet_contract().code().is_empty());
assert!(!nightly_wallet_contract().code().is_empty());
}

0 comments on commit b138347

Please sign in to comment.