Skip to content

chore: refactor signature id and failed signatures #301

chore: refactor signature id and failed signatures

chore: refactor signature id and failed signatures #301

Workflow file for this run

name: Unit
on:
push:
branches:
- main
- develop
pull_request:
paths:
- ".github/workflows/unit.yml"
- "chain-signatures/**/*.rs"
- "chain-signatures/Cargo.*"
- "integration-tests/**/*.rs"
env:
RUSTFLAGS: -D warnings
jobs:
test:
runs-on: warp-ubuntu-latest-x64-4x
name: Check & Test
steps:
- uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- uses: WarpBuilds/cache@v1
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: "${{ runner.os }}-cargo-${{ hashFiles('mpc-recovery/Cargo.lock') }}"
restore-keys: ${{ runner.os }}-cargo-
- name: Compile Contract
run: cargo build -p mpc-contract --target wasm32-unknown-unknown --release
- name: Compile eth contract
run: cd chain-signatures/contract-eth && npm i && npx hardhat compile
- name: Eth contract unit tests
run: cd chain-signatures/contract-eth && npx hardhat test
- name: Compile
run: cargo check
- name: Test format
run: cargo fmt -- --check
- name: Test clippy
run: cargo clippy --tests -- -Dclippy::all
- name: Unit tests
run: cargo test --workspace --exclude integration-tests
audit:
name: Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Install Audit
run: cargo install cargo-audit
- name: Run Audit
# even if previous audit step fails, run this audit step to ensure all crates are audited
if: always()
# ALL audit exceptions must be justified here
# RUSTSEC-2024-0344 and RUSTSEC-2022-0093 are both to do with ed25519 signatures in near-sdk, we don't sign things with this library so it's safe
# RUSTSEC-2022-0054 wee-alloc is unmaintained, it's fine for now because we barely use an allocator and the contracts are short lived, but we should find a replacement/use the default allocator
# RUSTSEC-2021-0145 atty can do an unallocated read with a custom allocator in windows. We don't run this in windows and we don't use a custom allocator.
# RUSTSEC-2024-0399 according to the description, this is not affecting us since we are not using Acceptor
run: |
cargo audit --ignore RUSTSEC-2022-0093 --ignore RUSTSEC-2024-0344 --ignore RUSTSEC-2022-0054 --ignore RUSTSEC-2021-0145 --ignore RUSTSEC-2024-0399