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

This commit is contained in:
parazyd
2024-01-09 15:05:35 +01:00
parent 92557d2cec
commit 849da0a521
7 changed files with 7 additions and 3 deletions

View File

@@ -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`

View File

@@ -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
}

View File

@@ -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) \

View File

@@ -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) \

View File

@@ -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) \

View File

@@ -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();

View File

@@ -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) \