Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Substrate 2.0 #218

Merged
merged 20 commits into from
Feb 10, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/develop' into try
# Conflicts:
#	frame/staking/src/mock.rs
#	srml/staking/src/tests.rs
aurexav committed Jan 9, 2020
commit 80d11a35dc0dc944561c96c46c1e89be32a87642
19 changes: 19 additions & 0 deletions .maintain/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# The script help you set up your develop envirnment

# Setup git hooks
cp .hooks/* .git/hooks

# Install nightly Rust
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly -y

# Install wasm toolchain
rustup target add wasm32-unknown-unknown

# Install rustfmt for coding style checking
rustup component add rustfmt --toolchain nightly

# TODO: help other developers with different platform
sudo apt-get -y update
sudo apt-get install -y cmake pkg-config libssl-dev
7 changes: 5 additions & 2 deletions .maintain/ci/script.sh
Original file line number Diff line number Diff line change
@@ -16,10 +16,13 @@ cargo --version
rustc --version

case $TARGET in
"native")
"rustfmt")
sudo apt-get -y update
sudo apt-get install -y cmake pkg-config libssl-dev
cargo fmt --all
;;

"native")
# Unit test
cargo test --release --all --locked "$@"
;;
@@ -28,4 +31,4 @@ case $TARGET in
# Build test
cargo build --locked "$@"
;;
esac
esac
37 changes: 37 additions & 0 deletions .maintain/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh

export PATH=$PATH:$HOME/.cargo/bin

rustfmt --version &>/dev/null
if [ $? != 0 ]; then
printf "[pre_commit] [ERROR] \"rustfmt\" not available. \n"
printf "[pre_commit] [ERROR] rustfmt can be installed via - \n"
printf "[pre_commit] $ rustup component add rustfmt \n"
exit 1
fi


problem_files=()

# first collect all the files that need reformatting
for file in $(git diff --name-only --cached); do
if [ ${file: -3} == ".rs" ]; then
rustfmt --check $file
if [ $? != 0 ]; then
problem_files+=($file)
fi
fi
done

if [ ${#problem_files[@]} != 0 ]; then
printf "[pre_commit] [ERROR] Plaese format the files via -\n"
printf "[pre_commit] $ cargo fmt --all \n"
printf "[pre_commit] [ERROR] If you want to keep your format with special reason, \n"
printf "[pre_commit] [ERROR] you can use this macro. \n"
printf "[pre_commit] #[rustfmt::skip] \n"
exit 1
fi

printf "[pre_commit] [SUCCESS] rustfmt ok \n"

exit 0
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ env:
global:
- RUST_BACKTRACE=1
matrix:
- RUST_TOOLCHAIN=nightly TARGET=rustfmt
- RUST_TOOLCHAIN=nightly TARGET=wasm
- RUST_TOOLCHAIN=nightly TARGET=native

@@ -26,4 +27,4 @@ script:

after_script:
# Check how much free disk space left after the build
- df -h
- df -h
16 changes: 14 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -237,7 +237,7 @@ please kindly check following things before making an issue.

=== Quick start (professional):
* https://telemetry.polkadot.io/#list/Darwinia%20IceFrog%20Testnet[Telemetry]
* https://testnet-wallet.darwinia.network[Darwinia Web Wallet]
* https://icefrog-wallet.darwinia.network[Darwinia Web Wallet]
* Bootnodes:
** `/ip4/45.249.244.33/tcp/20222/p2p/QmPCSb9yCRAXnqvG6AnX27X6gutvVDq4NBPDNJtnBmNk43`
** `/ip4/121.199.60.87/tcp/20222/p2p/QmaRDRZZpmY9FwjSwW8JhfkyaHc6XRHsLWnp6cLtyb3FCF`
@@ -335,10 +335,22 @@ darwinia-balances, darwinia-eth-backing, darwinia-eth-relay,
darwinia-kton, darwinia-staking, darwinia-support
* Node
[source, shell]
node-cli, node-executor, node-primitives, node-rpc, node-rpc-client, node-runtime
node-cli, node-runtime

== Contributing

=== Environment

If you are using Ubuntu,
you may use the `.maintain/bootstrap.sh` to set up your develop environment.
In this script, the nightly `Rust`, `cargo`, `rustfmt` will be installed,
the git hooks will be set, and ready to code.
We will appreciate your contribution.

If you are using different environment, you may copy the git hooks mannually.
```
$ cp .maintain/hooks/* .git/hooks
```
=== Contributing Guidelines

link:CONTRIBUTING.adoc[CONTRIBUTING.adoc]
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.