Skip to content

Commit a37e3f2

Browse files
committed
Import Substrate
Signed-off-by: alvicsam <[email protected]>
2 parents 944c64d + 4a4b1af commit a37e3f2

File tree

2,683 files changed

+654669
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,683 files changed

+654669
-0
lines changed

substrate/.cargo/config.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# An auto defined `clippy` feature was introduced,
3+
# but it was found to clash with user defined features,
4+
# so was renamed to `cargo-clippy`.
5+
#
6+
# If you want standard clippy run:
7+
# RUSTFLAGS= cargo clippy
8+
[target.'cfg(feature = "cargo-clippy")']
9+
rustflags = [
10+
"-Aclippy::all",
11+
"-Dclippy::correctness",
12+
"-Aclippy::if-same-then-else",
13+
"-Aclippy::clone-double-ref",
14+
"-Dclippy::complexity",
15+
"-Aclippy::zero-prefixed-literal", # 00_1000_000
16+
"-Aclippy::type_complexity", # raison d'etre
17+
"-Aclippy::nonminimal-bool", # maybe
18+
"-Aclippy::borrowed-box", # Reasonable to fix this one
19+
"-Aclippy::too-many-arguments", # (Turning this on would lead to)
20+
"-Aclippy::unnecessary_cast", # Types may change
21+
"-Aclippy::identity-op", # One case where we do 0 +
22+
"-Aclippy::useless_conversion", # Types may change
23+
"-Aclippy::unit_arg", # styalistic.
24+
"-Aclippy::option-map-unit-fn", # styalistic
25+
"-Aclippy::bind_instead_of_map", # styalistic
26+
"-Aclippy::erasing_op", # E.g. 0 * DOLLARS
27+
"-Aclippy::eq_op", # In tests we test equality.
28+
"-Aclippy::while_immutable_condition", # false positives
29+
"-Aclippy::needless_option_as_deref", # false positives
30+
"-Aclippy::derivable_impls", # false positives
31+
"-Aclippy::stable_sort_primitive", # prefer stable sort
32+
"-Aclippy::extra-unused-type-parameters", # stylistic
33+
]

substrate/.config/nextest.toml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# This is the default config used by nextest. It is embedded in the binary at
2+
# build time. It may be used as a template for .config/nextest.toml.
3+
4+
[store]
5+
# The directory under the workspace root at which nextest-related files are
6+
# written. Profile-specific storage is currently written to dir/<profile-name>.
7+
dir = "target/nextest"
8+
9+
# This section defines the default nextest profile. Custom profiles are layered
10+
# on top of the default profile.
11+
[profile.default]
12+
# "retries" defines the number of times a test should be retried. If set to a
13+
# non-zero value, tests that succeed on a subsequent attempt will be marked as
14+
# non-flaky. Can be overridden through the `--retries` option.
15+
# Examples
16+
# * retries = 3
17+
# * retries = { backoff = "fixed", count = 2, delay = "1s" }
18+
# * retries = { backoff = "exponential", count = 10, delay = "1s", jitter = true, max-delay = "10s" }
19+
retries = 5
20+
21+
# The number of threads to run tests with. Supported values are either an integer or
22+
# the string "num-cpus". Can be overridden through the `--test-threads` option.
23+
test-threads = "num-cpus"
24+
25+
# The number of threads required for each test. This is generally used in overrides to
26+
# mark certain tests as heavier than others. However, it can also be set as a global parameter.
27+
threads-required = 1
28+
29+
# Show these test statuses in the output.
30+
#
31+
# The possible values this can take are:
32+
# * none: no output
33+
# * fail: show failed (including exec-failed) tests
34+
# * retry: show flaky and retried tests
35+
# * slow: show slow tests
36+
# * pass: show passed tests
37+
# * skip: show skipped tests (most useful for CI)
38+
# * all: all of the above
39+
#
40+
# Each value includes all the values above it; for example, "slow" includes
41+
# failed and retried tests.
42+
#
43+
# Can be overridden through the `--status-level` flag.
44+
status-level = "pass"
45+
46+
# Similar to status-level, show these test statuses at the end of the run.
47+
final-status-level = "flaky"
48+
49+
# "failure-output" defines when standard output and standard error for failing tests are produced.
50+
# Accepted values are
51+
# * "immediate": output failures as soon as they happen
52+
# * "final": output failures at the end of the test run
53+
# * "immediate-final": output failures as soon as they happen and at the end of
54+
# the test run; combination of "immediate" and "final"
55+
# * "never": don't output failures at all
56+
#
57+
# For large test suites and CI it is generally useful to use "immediate-final".
58+
#
59+
# Can be overridden through the `--failure-output` option.
60+
failure-output = "immediate"
61+
62+
# "success-output" controls production of standard output and standard error on success. This should
63+
# generally be set to "never".
64+
success-output = "never"
65+
66+
# Cancel the test run on the first failure. For CI runs, consider setting this
67+
# to false.
68+
fail-fast = true
69+
70+
# Treat a test that takes longer than the configured 'period' as slow, and print a message.
71+
# See <https://nexte.st/book/slow-tests> for more information.
72+
#
73+
# Optional: specify the parameter 'terminate-after' with a non-zero integer,
74+
# which will cause slow tests to be terminated after the specified number of
75+
# periods have passed.
76+
# Example: slow-timeout = { period = "60s", terminate-after = 2 }
77+
slow-timeout = { period = "60s" }
78+
79+
# Treat a test as leaky if after the process is shut down, standard output and standard error
80+
# aren't closed within this duration.
81+
#
82+
# This usually happens in case of a test that creates a child process and lets it inherit those
83+
# handles, but doesn't clean the child process up (especially when it fails).
84+
#
85+
# See <https://nexte.st/book/leaky-tests> for more information.
86+
leak-timeout = "100ms"
87+
88+
[profile.default.junit]
89+
# Output a JUnit report into the given file inside 'store.dir/<profile-name>'.
90+
# If unspecified, JUnit is not written out.
91+
92+
path = "junit.xml"
93+
94+
# The name of the top-level "report" element in JUnit report. If aggregating
95+
# reports across different test runs, it may be useful to provide separate names
96+
# for each report.
97+
report-name = "substrate"
98+
99+
# Whether standard output and standard error for passing tests should be stored in the JUnit report.
100+
# Output is stored in the <system-out> and <system-err> elements of the <testcase> element.
101+
store-success-output = false
102+
103+
# Whether standard output and standard error for failing tests should be stored in the JUnit report.
104+
# Output is stored in the <system-out> and <system-err> elements of the <testcase> element.
105+
#
106+
# Note that if a description can be extracted from the output, it is always stored in the
107+
# <description> element.
108+
store-failure-output = true
109+
110+
# This profile is activated if MIRI_SYSROOT is set.
111+
[profile.default-miri]
112+
# Miri tests take up a lot of memory, so only run 1 test at a time by default.
113+
test-threads = 1
114+
115+
# Mutual exclusion of tests with `cargo build` invocation as a lock to avoid multiple
116+
# simultaneous invocations clobbering each other.
117+
[test-groups]
118+
serial-integration = { max-threads = 1 }
119+
120+
# Running UI tests sequentially
121+
# More info can be found here: https://github.com/paritytech/ci_cd/issues/754
122+
[[profile.default.overrides]]
123+
filter = 'test(/(^ui$|_ui|ui_)/)'
124+
test-group = 'serial-integration'

substrate/.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
doc
2+
**target*
3+
.idea/
4+
Dockerfile
5+
.dockerignore
6+
.local
7+
.env*

substrate/.editorconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
root = true
2+
[*]
3+
indent_style=tab
4+
indent_size=tab
5+
tab_width=4
6+
end_of_line=lf
7+
charset=utf-8
8+
trim_trailing_whitespace=true
9+
max_line_length=100
10+
insert_final_newline=true
11+
12+
[*.md]
13+
max_line_length=80
14+
indent_style=space
15+
indent_size=2
16+
17+
[*.yml]
18+
indent_style=space
19+
indent_size=2
20+
tab_width=8
21+
end_of_line=lf
22+
23+
[*.sh]
24+
indent_style=space
25+
indent_size=2
26+
tab_width=8
27+
end_of_line=lf

substrate/.git-blame-ignore-revs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# You can easily exclude big automated code changes by running
2+
#
3+
# git config blame.ignoreRevsFile .git-blame-ignore-revs
4+
#
5+
# in your local repository. It will work also in IDE integrations.
6+
#
7+
# On versions of Git 2.20 and later comments (#), empty lines, and any leading and
8+
# trailing whitespace is ignored. Everything but a SHA-1 per line will error out on
9+
# older versions.
10+
#
11+
# You should add new commit hashes to this file when you create or find such big
12+
# automated refactorings while reading code history. If you only know the short hash,
13+
# use `git rev-parse 1d5abf01` to expand it to the full SHA1 hash needed in this file.
14+
15+
1d5abf01abafdb6c15bcd0172f5de09fd87c5fbf # Run cargo fmt on the whole code base (#9394)

substrate/.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Cargo.lock linguist-generated=true
2+
/.gitlab-ci.yml filter=ci-prettier
3+
/scripts/ci/gitlab/pipeline/*.yml filter=ci-prettier
4+
frame/**/src/weights.rs linguist-generated=true
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Bug Report
2+
description: Let us know about an issue you experienced with this software
3+
# labels: ["some existing label","another one"]
4+
body:
5+
- type: checkboxes
6+
attributes:
7+
label: Is there an existing issue?
8+
description: Please search to see if an issue already exists and leave a comment that you also experienced this issue or add your specifics that are related to an existing issue.
9+
options:
10+
- label: I have searched the existing issues
11+
required: true
12+
- type: checkboxes
13+
attributes:
14+
label: Experiencing problems? Have you tried our Stack Exchange first?
15+
description: Please search <https://substrate.stackexchange.com> to see if an post already exists, and ask if not. Please do not file support issues here.
16+
options:
17+
- label: This is not a support question.
18+
required: true
19+
- type: textarea
20+
id: bug
21+
attributes:
22+
label: Description of bug
23+
# description: What seems to be the problem?
24+
# placeholder: Describe the problem.
25+
validations:
26+
required: true
27+
- type: textarea
28+
id: steps
29+
attributes:
30+
label: Steps to reproduce
31+
description: Provide the steps that led to the discovery of the issue.
32+
# placeholder: Describe what you were doing so we can reproduce the problem.
33+
validations:
34+
required: false
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Support & Troubleshooting with the Substrate Stack Exchange Community
4+
url: https://substrate.stackexchange.com
5+
about: |
6+
For general problems with Substrate or related technologies, please search here first
7+
for solutions, by keyword and tags. If you discover no solution, please then ask and questions in our community! We highly encourage everyone also share their understanding by answering questions for others.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Feature Request
2+
description: Submit your requests and suggestions to improve!
3+
labels: ["J0-enhancement"]
4+
body:
5+
- type: checkboxes
6+
id: existing
7+
attributes:
8+
label: Is there an existing issue?
9+
description: Please search to see if an issue already exists and leave a comment that you also experienced this issue or add your specifics that are related to an existing issue.
10+
options:
11+
- label: I have searched the existing issues
12+
required: true
13+
- type: checkboxes
14+
id: stackexchange
15+
attributes:
16+
label: Experiencing problems? Have you tried our Stack Exchange first?
17+
description: Please search <https://substrate.stackexchange.com> to see if an post already exists, and ask if not. Please do not file support issues here.
18+
options:
19+
- label: This is not a support question.
20+
required: true
21+
- type: textarea
22+
id: motivation
23+
attributes:
24+
label: Motivation
25+
description: Please give precedence as to what lead you to file this issue.
26+
# placeholder: Describe ...
27+
validations:
28+
required: false
29+
- type: textarea
30+
id: request
31+
attributes:
32+
label: Request
33+
description: Please describe what is needed.
34+
# placeholder: Describe what you would like to see added or changed.
35+
validations:
36+
required: true
37+
- type: textarea
38+
id: solution
39+
attributes:
40+
label: Solution
41+
description: If possible, please describe what a solution could be.
42+
# placeholder: Describe what you would like to see added or changed.
43+
validations:
44+
required: false
45+
- type: dropdown
46+
id: help
47+
attributes:
48+
label: Are you willing to help with this request?
49+
multiple: true
50+
options:
51+
- Yes!
52+
- No.
53+
- Maybe (please elaborate above)
54+
validations:
55+
required: true

substrate/.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
directory: "/"
5+
labels: ["A2-insubstantial", "B0-silent", "C1-low", "E2-dependencies"]
6+
schedule:
7+
interval: "daily"
8+
- package-ecosystem: github-actions
9+
directory: '/'
10+
labels: ["A2-insubstantial", "B0-silent", "C1-low", "E2-dependencies"]
11+
schedule:
12+
interval: daily

0 commit comments

Comments
 (0)