Skip to content

Commit

Permalink
chore: Replace Currency->fungible: update pallet_capacity with fungible
Browse files Browse the repository at this point in the history
for time-release pallet

Initial code changes
Split from PR #1779
  • Loading branch information
Matthew Orris committed Dec 20, 2023
1 parent 9691055 commit 33a70c6
Show file tree
Hide file tree
Showing 67 changed files with 8,860 additions and 6,284 deletions.
2 changes: 1 addition & 1 deletion .cargo-deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ allow-git = []

[sources.allow-org]
# 1 or more github.com organizations to allow git sources for
github = ["paritytech", "w3f"]
github = ["paritytech", "w3f", "multiformats"]
# 1 or more gitlab.com organizations to allow git sources for
# gitlab = [""]
# 1 or more bitbucket.org organizations to allow git sources for
Expand Down
57 changes: 48 additions & 9 deletions .github/workflows/common/codecov/action.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,59 @@
name: Run Generation of Code Coverage
description: Runs cargo llvm-cov
description: Runs cargo grcov
inputs:
code-cov-token:
description: "codecov token"
required: true
runs:
using: "composite"
steps:
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install grcov
shell: bash
run: cargo +nightly-2023-07-13 install grcov
- name: Build
shell: bash # Limited to 10 threads max
run: cargo +nightly-2023-07-13 build -j 10 --features frequency-lint-check
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
RUSTDOCFLAGS: "-Cpanic=abort"
- name: Test
shell: bash # Limited to 10 threads max
run: cargo +nightly-2023-07-13 test -j 10 --features frequency-lint-check
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
RUSTDOCFLAGS: "-Cpanic=abort"
# There are a lot of things ignored here to make it all work
# See the grcov docs for more information
# excl rpc traits, and error enums
# Only one of excl start and stop are allowed.
- name: Generate code coverage
shell: bash
run: |
cargo llvm-cov -v --no-fail-fast --workspace --lcov --output-path lcov.info \
--ignore-filename-regex "^.*\/(node\/|runtime\/|mock\.rs|weights(\.rs)?|benchmarking\.rs|runtime-api/src/lib\.rs).*$" \
--exclude "frequency,frequency-cli,frequency-runtime,frequency-service" \
--features frequency-lint-check
grcov . -s . --binary-path ./target/debug/ -t lcov \
--ignore-not-existing \
--excl-start '(pub enum Error<T> \{|#\[rpc\()' \
--excl-stop '\s*}$' \
--ignore "target/*" \
--ignore "node/*" \
--ignore "runtime/*" \
--ignore "**/*weights.rs" \
--ignore "**/benchmark*.rs" \
--ignore "**/*tests.rs" \
--ignore "**/tests/*.rs" \
--ignore "**/*mock.rs" \
--ignore "**/*runtime-api/src/lib.rs" \
--ignore "*github.com*" \
--ignore "*libcore*" \
--ignore "*rustc*" \
--ignore "*liballoc*" \
--ignore "*cargo*" \
-o ./target/debug/lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4.0.0-beta.3
with:
files: lcov.info
token: ${{inputs.code-cov-token}}
files: ./target/debug/lcov.info
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
6 changes: 3 additions & 3 deletions .github/workflows/merge-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ jobs:

calc-code-coverage:
name: Merge - Calculate Code Coverage
# This job currently fails on EKS runners and must be run on standalone until
# https://www.pivotaltracker.com/story/show/185045668 is resolved.
runs-on: [self-hosted, Linux, X64, build, v1]
runs-on: [self-hosted, Linux, X64, build, v2]
container: ghcr.io/libertydsnp/frequency/ci-base-image:1.0.0
steps:
- name: Check Out Repo
uses: actions/checkout@v4
- name: Generate and Upload Code Coverage
id: codecov
uses: ./.github/workflows/common/codecov
with:
code-cov-token: ${{ secrets.CODECOV_TOKEN }}

publish-ci-base-image:
needs: changes
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ jobs:
with:
ref: ${{env.RELEASE_BRANCH_NAME}}
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v4
- name: Build Docs
run: |
rustup target add wasm32-unknown-unknown --toolchain nightly-2023-07-13
Expand All @@ -371,7 +371,7 @@ jobs:
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Docs
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: ./target/doc

Expand Down Expand Up @@ -1005,7 +1005,7 @@ jobs:
- name: Deploy to GitHub Pages
if: env.TEST_RUN != 'true'
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4

release-js-api-augment:
needs: wait-for-all-builds
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/verify-pr-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,16 @@ jobs:
needs: changes
if: needs.changes.outputs.rust == 'true'
name: Calculate Code Coverage
# This job currently fails on EKS runners and must be run on standalone until
# https://www.pivotaltracker.com/story/show/185045668 is resolved.
runs-on: [self-hosted, Linux, X64, build, v1]
runs-on: [self-hosted, Linux, X64, build, v2]
container: ghcr.io/libertydsnp/frequency/ci-base-image:1.0.0
steps:
- name: Check Out Repo
uses: actions/checkout@v4
- name: Generate and Upload Code Coverage
id: codecov
uses: ./.github/workflows/common/codecov
with:
code-cov-token: ${{ secrets.CODECOV_TOKEN }}

# Workaround to handle skipped required check inside matrix
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
// Set the features to use for cargo commands
"rust-analyzer.cargo.features": [
"frequency-no-relay"
],
"lldb.launch.preRunCommands": [
"script lldb.debugger.HandleCommand('settings set target.source-map /rustc/{} \"{}/lib/rustlib/src/rust\"'.format(os.popen('rustc --version --verbose').read().split('commit-hash: ')[1].split('\\n')[0].strip(), os.popen('rustc --print sysroot').readline().strip()))"
]
}
Loading

0 comments on commit 33a70c6

Please sign in to comment.