Procházet zdrojové kódy

contract: Strip built WASM binaries using wasm-strip from the wabt toolkit

parazyd před 2 roky
rodič
revize
849da0a521

+ 2 - 1
README.md

@@ -55,13 +55,14 @@ The following dependencies are also required:
 | alsa-lib       | libasound2-dev   |
 | openssl        | libssl-dev       |
 | sqlcipher      | libsqlcipher-dev |
+| wabt           | wabt             |
 
 Users of Debian-based systems (e.g. Ubuntu) can simply run the
 following to install the required dependencies:
 
 ```shell
 # apt-get update
-# apt-get install -y git make gcc pkg-config libasound2-dev libssl-dev libsqlcipher-dev
+# apt-get install -y git make gcc pkg-config libasound2-dev libssl-dev libsqlcipher-dev wabt
 ```
 
 Alternatively, users can try using the automated script under `contrib`

+ 1 - 1
contrib/dependency_setup.sh

@@ -22,7 +22,7 @@ setup_mac() {
 }
 
 setup_apt() {
-	apt_deps="git cmake make gcc g++ pkg-config libasound2-dev libclang-dev libssl-dev libsqlcipher-dev libsqlite3-dev"
+	apt_deps="git cmake make gcc g++ pkg-config libasound2-dev libclang-dev libssl-dev libsqlcipher-dev libsqlite3-dev wabt"
 	$1 install $apt_deps || return 1
 }
 

+ 1 - 0
src/contract/consensus/Makefile

@@ -42,6 +42,7 @@ $(WASM_BIN): $(WASM_SRC) $(PROOFS_BIN)
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(WASM_TARGET) \
 	--release --package $(PKGNAME)
 	cp -f ../../../target/$(WASM_TARGET)/release/$@ $@
+	wasm-strip $@
 
 test-stake-unstake: all
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) test --target=$(RUST_TARGET) \

+ 1 - 0
src/contract/dao/Makefile

@@ -42,6 +42,7 @@ $(WASM_BIN): $(WASM_SRC) $(PROOFS_BIN)
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(WASM_TARGET) \
 		--release --package $(PKGNAME)
 	cp -f ../../../target/$(WASM_TARGET)/release/$@ $@
+	wasm-strip $@
 
 test-integration: all
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) test --target=$(RUST_TARGET) \

+ 1 - 0
src/contract/deployooor/Makefile

@@ -42,6 +42,7 @@ $(WASM_BIN): $(WASM_SRC) $(PROOFS_BIN)
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(WASM_TARGET) \
 		--release --package $(PKGNAME)
 	cp -f ../../../target/$(WASM_TARGET)/release/$@ $@
+	wasm-strip $@
 
 test-integration: all
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) test --target=$(RUST_TARGET) \

+ 0 - 1
src/contract/deployooor/tests/integration.rs

@@ -21,7 +21,6 @@ use darkfi_contract_test_harness::{init_logger, Holder, TestHarness};
 use log::info;
 
 #[test]
-#[ignore]
 fn deploy_integration() -> Result<()> {
     smol::block_on(async {
         init_logger();

+ 1 - 0
src/contract/money/Makefile

@@ -42,6 +42,7 @@ $(WASM_BIN): $(WASM_SRC) $(PROOFS_BIN)
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(WASM_TARGET) \
 		--release --package $(PKGNAME)
 	cp -f ../../../target/$(WASM_TARGET)/release/$@ $@
+	wasm-strip $@
 
 test-integration: all
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) test --target=$(RUST_TARGET) \