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

[WIP] Initial merge with a parachain codebase #9

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git
**/target/
**/*.txt
**/*.md
/docker/
!/target/release/polkadot-collator

# dotfiles in the repo root
/.*
30 changes: 22 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
root = true

# default
[*]
charset=utf-8
indent_style=space
indent_size=4
indent_style=tab
indent_size=tab
tab_width=4
end_of_line=lf
charset=utf-8
trim_trailing_whitespace=true
max_line_length=100
insert_final_newline=true

[*.{toml,rs}]
indent_style=tab
indent_size=4
[*.yml]
indent_style=space
indent_size=2
tab_width=8
end_of_line=lf

[*.sh]
indent_style=space
indent_size=4
tab_width=8
end_of_line=lf

[*.json]
indent_style=space
indent_size=2
tab_width=8
end_of_line=lf

47 changes: 47 additions & 0 deletions .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test Code

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
test-code:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

# Steps taken from https://github.com/actions/cache/blob/master/examples.md#rust---cargo
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy
target: wasm32-unknown-unknown
override: true
default: true

# Enable this for clippy linting.
# - name: Check and Lint Code
# run: cargo +nightly clippy -- -D warnings

- name: Check Code
run: cargo check

- name: Test Code
run: cargo test
17 changes: 11 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Generated by Cargo
# will have compiled files and executables
# Cargo compiled files and executables
**/target/

# These are backup files generated by rustfmt
**/*.rs.bk

.DS_Store
# Local chain databases (defalut location)
**/chains/

# The cache for chain data in container
.local

# The cache for docker container dependency
.cargo
/.cargo/config

# The cache for chain data in container
.local
.DS_Store
.idea
.vscode
23 changes: 23 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Basic
hard_tabs = true
max_width = 100
use_small_heuristics = "Max"

# Imports
imports_granularity = "Crate"
reorder_imports = true

# Consistency
newline_style = "Unix"

# Misc
binop_separator = "Back"
chain_width = 80
match_arm_blocks = false
match_arm_leading_pipes = "Preserve"
match_block_trailing_comma = true
reorder_impl_items = false
spaces_around_ranges = false
trailing_comma = "Vertical"
trailing_semicolon = false
use_field_init_shorthand = true
Loading