diff --git a/Makefile b/Makefile index 8e9b34172..66d272670 100644 --- a/Makefile +++ b/Makefile @@ -68,13 +68,22 @@ target/wasm32-unknown-unknown/debug/aurora_engine.wasm: Cargo.toml Cargo.lock $( test: test-mainnet mainnet-test-build: FEATURES=mainnet,integration-test,meta-call -mainnet-test-build: mainnet-release.wasm +mainnet-test-build: mainnet-test.wasm betanet-test-build: FEATURES=betanet,integration-test,meta-call -betanet-test-build: betanet-release.wasm +betanet-test-build: betanet-test.wasm testnet-test-build: FEATURES=testnet,integration-test,meta-call -testnet-test-build: testnet-release.wasm +testnet-test-build: testnet-test.wasm + +mainnet-test.wasm: target/wasm32-unknown-unknown/release/aurora_engine.wasm + cp $< $@ + +testnet-test.wasm: target/wasm32-unknown-unknown/release/aurora_engine.wasm + cp $< $@ + +betanet-test.wasm: target/wasm32-unknown-unknown/release/aurora_engine.wasm + cp $< $@ test-mainnet: mainnet-test-build $(CARGO) test --features mainnet-test diff --git a/src/lib.rs b/src/lib.rs index f6cdba375..8b50f334d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -189,7 +189,14 @@ mod contract { /// MUTATIVE METHODS /// + #[cfg(feature = "integration-test")] + #[no_mangle] + pub extern "C" fn deploy_code() { + sdk::panic_utf8(b"ERR_DEPLOYED_TEST_VERSION"); + } + /// Deploy code into the EVM. + #[cfg(not(feature = "integration-test"))] #[no_mangle] pub extern "C" fn deploy_code() { let input = sdk::read_input(); diff --git a/src/test_utils/mod.rs b/src/test_utils/mod.rs index c8e8fc2aa..d70112403 100644 --- a/src/test_utils/mod.rs +++ b/src/test_utils/mod.rs @@ -29,7 +29,7 @@ use crate::types::AccountId; not(any(feature = "testnet", feature = "betanet")) ))] lazy_static_include::lazy_static_include_bytes! { - EVM_WASM_BYTES => "mainnet-release.wasm" + EVM_WASM_BYTES => "mainnet-test.wasm" } #[cfg(all( @@ -37,7 +37,7 @@ lazy_static_include::lazy_static_include_bytes! { not(any(feature = "mainnet", feature = "betanet")) ))] lazy_static_include::lazy_static_include_bytes! { - EVM_WASM_BYTES => "testnet-release.wasm" + EVM_WASM_BYTES => "testnet-test.wasm" } #[cfg(all( @@ -45,7 +45,7 @@ lazy_static_include::lazy_static_include_bytes! { not(any(feature = "mainnet", feature = "testnet")) ))] lazy_static_include::lazy_static_include_bytes! { - EVM_WASM_BYTES => "betanet-release.wasm" + EVM_WASM_BYTES => "betanet-test.wasm" } // TODO(Copied from #84): Make sure that there is only one Signer after both PR are merged.