Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Build parachains #207

Merged
merged 2 commits into from
Jun 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ cd demo/runtime/wasm && ./build.sh && cd ../../..
cd substrate/executor/wasm && ./build.sh && cd ../../..
cd substrate/test-runtime/wasm && ./build.sh && cd ../../..
cd polkadot/runtime/wasm && ./build.sh && cd ../../..
cd polkadot/parachain/test-chains && ./build.sh && cd ../../..
2 changes: 1 addition & 1 deletion polkadot/parachain/test-chains/basic_add/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ crate-type = ["cdylib"]

[dependencies]
polkadot-parachain = { path = "../../", default-features = false }
wee_alloc = "0.2.0"
wee_alloc = "0.4.0"
tiny-keccak = "1.4"
pwasm-libc = "0.2"

Expand Down
2 changes: 1 addition & 1 deletion polkadot/parachain/test-chains/basic_add/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! Basic parachain that adds a number as part of its state.

#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc, core_intrinsics, global_allocator, lang_items))]
#![cfg_attr(not(feature = "std"), feature(alloc, core_intrinsics, global_allocator, lang_items, panic_implementation))]

#[cfg(not(feature = "std"))]
extern crate alloc;
Expand Down
20 changes: 12 additions & 8 deletions polkadot/parachain/test-chains/basic_add/src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,23 @@

//! Defines WASM module logic.

use core::intrinsics;

use parachain::{self, ValidationResult};
use parachain::codec::Slicable;
use super::{HeadData, BlockData};

#[lang = "panic_fmt"]
#[panic_implementation]
#[no_mangle]
pub fn rust_begin_panic(_info: &::core::panic::PanicInfo) -> ! {
unsafe {
intrinsics::abort()
}
}

#[lang = "oom"]
#[no_mangle]
pub extern fn panic_fmt(
_args: ::core::fmt::Arguments,
_file: &'static str,
_line: u32,
_col: u32,
) -> ! {
use core::intrinsics;
pub fn oom() -> ! {
unsafe {
intrinsics::abort();
}
Expand Down
13 changes: 13 additions & 0 deletions polkadot/parachain/test-chains/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -e

rm -rf ./target
for i in */
do
i=${i%/}
cd $i

RUSTFLAGS="-C link-arg=--import-memory" cargo +nightly build --target=wasm32-unknown-unknown --release --no-default-features
wasm-gc target/wasm32-unknown-unknown/release/$i.wasm ../../tests/res/$i.wasm
cd ..
done
14 changes: 0 additions & 14 deletions polkadot/parachain/test-chains/build_test_chains.sh

This file was deleted.

Binary file modified polkadot/parachain/tests/res/basic_add.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion publish-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

REPO="github.com/paritytech/polkadot-wasm-bin.git"
REPO_AUTH="${GH_TOKEN}:@${REPO}"
SRCS=( "polkadot/runtime/wasm" "substrate/executor/wasm" "demo/runtime/wasm" "substrate/test-runtime/wasm" )
SRCS=( "polkadot/runtime/wasm" "substrate/executor/wasm" "demo/runtime/wasm" "substrate/test-runtime/wasm" "polkadot/parachain/test-chains" )
DST=".wasm-binaries"
TARGET="wasm32-unknown-unknown"
UTCDATE=`date -u "+%Y%m%d.%H%M%S.0"`
Expand Down