Skip to content
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
18 changes: 18 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
max_width = 100
binop_separator = "Front"
blank_lines_upper_bound = 1
brace_style = "SameLineWhere"
control_brace_style = "AlwaysSameLine"
comment_width = 100
format_code_in_doc_comments = true
ignore = ['target']
imports_indent = "Block"
indent_style = "Block"
merge_imports = true
merge_derives = true
newline_style = "Auto"
space_after_colon = true
space_before_colon = false
trailing_comma = "Vertical"
wrap_comments = true
hard_tabs = false
49 changes: 45 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,51 @@
[profile.release]
panic = 'unwind'

[workspace]
members = [
'node',
'pallets/account-linker',
'pallets/offchain-worker',
'pallets/offchain-worker',
'runtime',
]

[profile.dev]
opt-level = 0
debug = true
debug-assertions = true
overflow-checks = true
lto = false
panic = 'unwind'
incremental = true
codegen-units = 256
rpath = false

[profile.test]
opt-level = 0
debug = 2
debug-assertions = true
overflow-checks = true
lto = false
panic = 'unwind' # This setting is always ignored.
incremental = true
codegen-units = 256
rpath = false

[profile.bench]
opt-level = 3
debug = false
debug-assertions = false
overflow-checks = false
lto = false
panic = 'unwind' # This setting is always ignored.
incremental = false
codegen-units = 16
rpath = false

[profile.release]
opt-level = 3
debug = false
debug-assertions = false
overflow-checks = false
lto = false
panic = 'unwind'
incremental = false
codegen-units = 16
rpath = false
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
all:
@echo "Make All"

build:
cargo build
node:
cargo build --package $(call pkgid, litentry-node)
runtime:
cargo build --package $(call pkgid, litentry-runtime)
offchain-worker:
cargo build --package $(call pkgid, pallet-offchain-worker)
account-linker:
cargo build --package $(call pkgid, pallet-account-linker)

test-node:
cargo test --package $(call pkgid, litentry-node)
test-runtime:
cargo test --package $(call pkgid, litentry-runtime)
test-account-linker:
cargo test --package $(call pkgid, pallet-account-linker)
test-offchain-worker:
cargo test --package $(call pkgid, pallet-offchain-worker)

test:
cargo test

fmt:
cargo fmt
define pkgid
$(shell cargo pkgid $1)
endef
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,16 @@ Litentry node built with Substrate.


## License
Apache-2.0
Apache-2.0


## Set up
```
rustup default nightly-2020-10-06
```

```
cargo build
```
## Useful links
[rustfmt configurations](https://github.com/rust-lang/rustfmt/blob/master/Configurations.md)
5 changes: 5 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ substrate-frame-rpc-system = '2.0.0'
[features]
default = []
runtime-benchmarks = ['litentry-runtime/runtime-benchmarks']

[dev-dependencies.cargo-husky]
version = "1"
default-features = false # Disable features which are enabled by default
features = ["precommit-hook", "run-cargo-fmt"]
4 changes: 2 additions & 2 deletions node/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};

fn main() {
generate_cargo_keys();
generate_cargo_keys();

rerun_if_git_head_changed();
rerun_if_git_head_changed();
}
Loading