Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a2a5dd4
[SDK] Introduce a replacement Rust SDK for the entirety of the existi…
gregnazario Jan 7, 2026
e333ce5
more additions to rust SDK v2
gregnazario Jan 26, 2026
247a8d5
[sdkv2] Add feature flags to gate features and reduce overhead
gregnazario Jan 26, 2026
3acd662
format files
gregnazario Jan 26, 2026
dea9609
address comments
gregnazario Jan 26, 2026
35e5f39
address comments
gregnazario Jan 26, 2026
325f7c2
fix formatting
gregnazario Jan 27, 2026
5415c61
update some fixes for CI and PR comments
gregnazario Jan 27, 2026
3d3f278
more cleanup
gregnazario Jan 27, 2026
3d6c1cc
more fixes
gregnazario Jan 27, 2026
f758899
Address PR review comments and fix CI
gregnazario Jan 28, 2026
2f06a37
Fix clippy lint: remove unnecessary to_string() in println
gregnazario Jan 28, 2026
c9f2a1f
add more examples
gregnazario Jan 28, 2026
e98f5db
remove ANS for now
gregnazario Jan 28, 2026
35b0e49
add migration guide
gregnazario Jan 29, 2026
a46b8c2
cleanup security issues
gregnazario Jan 29, 2026
5358424
fix some lints
gregnazario Jan 29, 2026
319024d
enable some pedantic lints
gregnazario Jan 30, 2026
0ad9a40
re-enable a bunch of pedantic lints
gregnazario Jan 30, 2026
5fb627b
add pedantic lint
gregnazario Jan 30, 2026
8592f79
add pedantic lint, must use for self
gregnazario Jan 30, 2026
85f56b8
add another pedantic lint
gregnazario Jan 30, 2026
436d69b
add more pedantic lints
gregnazario Jan 30, 2026
5a291c7
more pedantic lints
gregnazario Jan 30, 2026
1eee71c
lint more pedantic
gregnazario Jan 30, 2026
7c501fb
add error messaging, and single key support
gregnazario Jan 30, 2026
13a90e5
Fix single key handling, AIP80 formatting, signed integer type, and
gregnazario Jan 30, 2026
44c9cb0
add significantly more testing
gregnazario Jan 31, 2026
5c804a3
add security fixes
gregnazario Jan 31, 2026
3b259b0
fix some PR comments
gregnazario Jan 31, 2026
4e0d8f2
fix clippy warnings, and CI issues
gregnazario Jan 31, 2026
a87215d
fix lints
gregnazario Jan 31, 2026
3694281
Address PR comments
gregnazario Jan 31, 2026
bb28450
update GitHub Actions to latest versions
gregnazario Feb 1, 2026
3e77edd
fix invalid Rust syntax in deploy_module example
gregnazario Feb 1, 2026
1c81003
fix format string lint
gregnazario Feb 1, 2026
3e81012
address PR comments
gregnazario Feb 4, 2026
0a23635
rename crates to more publishable crate names
gregnazario Feb 4, 2026
c7311c4
fix remaining renames
gregnazario Feb 4, 2026
629cefe
finalize renames
gregnazario Feb 4, 2026
d46dd7d
Fix invalid string
gregnazario Feb 5, 2026
1076ff8
Add security audit CI and fix bytes vulnerability
gregnazario Feb 5, 2026
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
26 changes: 26 additions & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Clippy configuration

# Cognitive complexity threshold
cognitive-complexity-threshold = 30

# Maximum number of lines for a function
too-many-lines-threshold = 200

# Maximum number of arguments for a function
too-many-arguments-threshold = 8

# Maximum number of struct fields
max-struct-bools = 3

# Allowed names for variables (won't trigger `disallowed_names`)
allowed-idents-below-min-chars = ["i", "j", "k", "n", "x", "y", "z", "id", "to", "db"]

# Type complexity threshold
type-complexity-threshold = 350

# Maximum enum variant size ratio for large_enum_variant
enum-variant-size-threshold = 200

# Allow these macros to have more than 7 lines
excessive-nesting-threshold = 10

263 changes: 196 additions & 67 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,92 +2,221 @@ name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
fmt:
name: Format check
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Check formatting
run: cargo fmt --all -- --check

- name: Add rustfmt component
run: rustup component add rustfmt

- name: Check formatting
run: cargo fmt --all -- --check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Run Clippy (default features)
run: cargo clippy -p aptos-rust-sdk-v2 --all-targets -- -D warnings

- name: Run Clippy (all features)
run: cargo clippy -p aptos-rust-sdk-v2 --all-targets --all-features -- -D warnings

- name: Run Clippy (no default features)
run: cargo clippy -p aptos-rust-sdk-v2 --no-default-features -- -D warnings

test:
name: Test
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
rust: [stable]
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: clippy
- uses: actions/checkout@v4

- name: Install Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Build
run: cargo build -p aptos-rust-sdk-v2 --all-targets

- name: Run tests
run: cargo test -p aptos-rust-sdk-v2 --all-targets

- name: Run tests (all features)
run: cargo test -p aptos-rust-sdk-v2 --all-targets --all-features

- name: Install LLVM linker
run: sudo apt-get update && sudo apt-get install -y lld

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.rust }}-
${{ runner.os }}-cargo-

- name: Run tests (excluding examples)
run: |
# Test only the main crates, excluding examples
# Skip network-dependent tests by setting environment variable
# Skip doctests due to dependency version conflicts
SKIP_NETWORK_TESTS=1 cargo test --workspace --exclude examples --lib --bins

- name: Run clippy
run: cargo clippy --workspace --exclude examples -- -W warnings
test-features:
name: Test Feature Combinations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Test with only ed25519
run: cargo test -p aptos-rust-sdk-v2 --no-default-features --features ed25519

- name: Test with only secp256k1
run: cargo test -p aptos-rust-sdk-v2 --no-default-features --features secp256k1

- name: Test with secp256r1
run: cargo test -p aptos-rust-sdk-v2 --features secp256r1

- name: Test with bls
run: cargo test -p aptos-rust-sdk-v2 --features bls

- name: Test with faucet
run: cargo test -p aptos-rust-sdk-v2 --features faucet

- name: Test with indexer
run: cargo test -p aptos-rust-sdk-v2 --features indexer

- name: Test with full features
run: cargo test -p aptos-rust-sdk-v2 --features full

# Spec tests (behavioral tests from specifications)
# TODO: Re-enable once specification tests are stabilized
# spec-tests:
# name: Spec Tests
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
#
# - name: Install Rust
# uses: dtolnay/rust-toolchain@stable
#
# - name: Cache cargo
# uses: Swatinem/rust-cache@v2
#
# - name: Run spec tests
# run: cargo test --test specs
# working-directory: specifications/tests/rust

build:
name: Build
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc -p aptos-rust-sdk-v2 --no-deps --all-features

- name: Check examples documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc -p aptos-rust-sdk-v2 --all-features --document-private-items

- name: Install LLVM linker
run: sudo apt-get update && sudo apt-get install -y lld
# Deploy docs to GitHub Pages on main branch
deploy-docs:
name: Deploy Documentation
runs-on: ubuntu-latest
needs: [docs, test, lint]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Build documentation
env:
RUSTDOCFLAGS: --cfg docsrs
run: cargo doc -p aptos-rust-sdk-v2 --no-deps --all-features

- name: Add redirect to main crate
run: |
echo '<meta http-equiv="refresh" content="0; url=aptos_rust_sdk_v2/index.html">' > target/doc/index.html

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: target/doc

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

msrv:
name: Minimum Supported Rust Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust 1.85
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.85"

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Check MSRV
run: cargo check -p aptos-rust-sdk-v2

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
${{ runner.os }}-cargo-

- name: Build (excluding examples)
run: cargo build --workspace --exclude examples --release
security-audit:
name: Security Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install cargo-audit
run: cargo install cargo-audit

- name: Run security audit
run: cargo audit
Loading
Loading