Commit d386482b authored by Ricardo Rius's avatar Ricardo Rius Committed by Hero Bird

[core] Fix memory vec (#176)

* Fix memory vec error

* Update build scripts

* Add rustfmt skip

* Delete empty line
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>
parent 9c05d4c1
......@@ -14,6 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with ink!. If not, see <http://www.gnu.org/licenses/>.
// We need this to fix a rustfmt issue. https://github.com/rust-lang/rustfmt/issues/3750
#[rustfmt::skip]
use crate::{
env::{
self,
......@@ -21,9 +23,9 @@ use crate::{
Env,
EnvTypes,
},
memory::vec::{
self,
Vec,
memory::{
vec,
vec::Vec,
},
};
use core::marker::PhantomData;
......
......@@ -7,7 +7,8 @@ PROJNAME=erc20
# cargo clean
# rm Cargo.lock
CARGO_INCREMENTAL=0 cargo +nightly build --no-default-features --release --target=wasm32-unknown-unknown --verbose
CARGO_INCREMENTAL=0 &&
cargo +nightly build --no-default-features --release --target=wasm32-unknown-unknown --verbose
wasm2wat -o target/$PROJNAME.wat target/wasm32-unknown-unknown/release/$PROJNAME.wasm
cat target/$PROJNAME.wat | sed "s/(import \"env\" \"memory\" (memory (;0;) 2))/(import \"env\" \"memory\" (memory (;0;) 2 16))/" > target/$PROJNAME-fixed.wat
wat2wasm -o target/$PROJNAME.wasm target/$PROJNAME-fixed.wat
......
......@@ -5,7 +5,8 @@ PROJNAME=events
# cargo clean
# rm Cargo.lock
CARGO_INCREMENTAL=0 cargo +nightly build --no-default-features --release --target=wasm32-unknown-unknown --verbose
CARGO_INCREMENTAL=0 &&
cargo +nightly build --no-default-features --release --target=wasm32-unknown-unknown --verbose
wasm2wat -o target/$PROJNAME.wat target/wasm32-unknown-unknown/release/$PROJNAME.wasm
cat target/$PROJNAME.wat | sed "s/(import \"env\" \"memory\" (memory (;0;) 2))/(import \"env\" \"memory\" (memory (;0;) 2 16))/" > target/$PROJNAME-fixed.wat
wat2wasm -o target/$PROJNAME.wasm target/$PROJNAME-fixed.wat
......
......@@ -3,11 +3,11 @@
set -e
PROJNAME=flipper
# cargo clean
# rm Cargo.lock
CARGO_INCREMENTAL=0 cargo +nightly build --no-default-features --release --target=wasm32-unknown-unknown --verbose
CARGO_INCREMENTAL=0 &&
cargo +nightly build --no-default-features --release --target=wasm32-unknown-unknown --verbose
wasm2wat -o target/$PROJNAME.wat target/wasm32-unknown-unknown/release/$PROJNAME.wasm
cat target/$PROJNAME.wat | sed "s/(import \"env\" \"memory\" (memory (;0;) 2))/(import \"env\" \"memory\" (memory (;0;) 2 16))/" > target/$PROJNAME-fixed.wat
wat2wasm -o target/$PROJNAME.wasm target/$PROJNAME-fixed.wat
......
#!/bin/bash
set -e
PROJNAME=incrementer
# cargo clean
# rm Cargo.lock
CARGO_INCREMENTAL=0 &&
cargo +nightly build --release --target=wasm32-unknown-unknown --verbose &&
wasm2wat -o target/$PROJNAME.wat target/wasm32-unknown-unknown/release/$PROJNAME.wasm &&
cat target/$PROJNAME.wat | sed "s/(import \"env\" \"memory\" (memory (;0;) 2))/(import \"env\" \"memory\" (memory (;0;) 2 16))/" > target/$PROJNAME-fixed.wat &&
wat2wasm -o target/$PROJNAME.wasm target/$PROJNAME-fixed.wat &&
wasm-prune --exports call,deploy target/$PROJNAME.wasm target/$PROJNAME-pruned.wasm
\ No newline at end of file
cargo +nightly build --no-default-features --release --target=wasm32-unknown-unknown --verbose
wasm2wat -o target/$PROJNAME.wat target/wasm32-unknown-unknown/release/$PROJNAME.wasm
cat target/$PROJNAME.wat | sed "s/(import \"env\" \"memory\" (memory (;0;) 2))/(import \"env\" \"memory\" (memory (;0;) 2 16))/" > target/$PROJNAME-fixed.wat
wat2wasm -o target/$PROJNAME.wasm target/$PROJNAME-fixed.wat
wasm-prune --exports call,deploy target/$PROJNAME.wasm target/$PROJNAME-pruned.wasm
#!/bin/bash
PROJNAME=shared_vec
# cargo clean
# rm Cargo.lock
CARGO_INCREMENTAL=0 &&
cargo +nightly build --release --target=wasm32-unknown-unknown --verbose &&
wasm2wat -o target/$PROJNAME.wat target/wasm32-unknown-unknown/release/$PROJNAME.wasm &&
cat target/$PROJNAME.wat | sed "s/(import \"env\" \"memory\" (memory (;0;) 2))/(import \"env\" \"memory\" (memory (;0;) 2 16))/" > target/$PROJNAME-fixed.wat &&
wat2wasm -o target/$PROJNAME.wasm target/$PROJNAME-fixed.wat &&
wasm-prune --exports call,deploy target/$PROJNAME.wasm target/$PROJNAME-pruned.wasm
\ No newline at end of file
cargo +nightly build --no-default-features --release --target=wasm32-unknown-unknown --verbose
wasm2wat -o target/$PROJNAME.wat target/wasm32-unknown-unknown/release/$PROJNAME.wasm
cat target/$PROJNAME.wat | sed "s/(import \"env\" \"memory\" (memory (;0;) 2))/(import \"env\" \"memory\" (memory (;0;) 2 16))/" > target/$PROJNAME-fixed.wat
wat2wasm -o target/$PROJNAME.wasm target/$PROJNAME-fixed.wat
wasm-prune --exports call,deploy target/$PROJNAME.wasm target/$PROJNAME-pruned.wasm
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment