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
45 changes: 44 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,27 @@ jobs:
- name: msrv
run: cargo check --workspace --all-targets --all-features --locked

test:
wasm:
runs-on: ubuntu-latest
needs: msrv
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-wasip2
- uses: Swatinem/rust-cache@v2
- name: wasm aelf-client
run: cargo check -p aelf-client --target wasm32-wasip2 --no-default-features
- name: wasm aelf-contract
run: cargo check -p aelf-contract --target wasm32-wasip2 --no-default-features
- name: wasm aelf-sdk
run: cargo check -p aelf-sdk --target wasm32-wasip2 --no-default-features

test:
runs-on: ubuntu-latest
needs:
- msrv
- wasm
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -35,3 +53,28 @@ jobs:
run: cargo check --workspace --examples
- name: test
run: cargo test --workspace --all-targets

public-smoke:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: public readonly smoke
run: |
retry() {
local attempts=3
local delay=5
for attempt in $(seq 1 "$attempts"); do
if "$@"; then
return 0
fi
if [[ "$attempt" -lt "$attempts" ]]; then
sleep "$delay"
fi
done
return 1
}

retry cargo test -p aelf-sdk --test public_readonly_smoke -- --ignored --test-threads=1 --nocapture
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,17 @@ jobs:
return 1
}

if [[ "$DRY_RUN" != "true" && -z "${CARGO_REGISTRY_TOKEN:-}" ]]; then
echo "::error::CARGO_REGISTRY_TOKEN is required when dry_run=false."
exit 1
fi

if [[ "$DRY_RUN" == "true" && "${#requested_packages[@]}" -eq 0 ]]; then
echo "Running workspace dry-run for the full publish set."
cargo publish --workspace --dry-run --locked
exit 0
fi

if [[ "$DRY_RUN" != "true" && -z "${CARGO_REGISTRY_TOKEN:-}" ]]; then
echo "::error::CARGO_REGISTRY_TOKEN is required when dry_run=false."
exit 1
fi

for pkg in "${ordered_packages[@]}"; do
if ! package_selected "$pkg"; then
continue
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/transaction-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: transaction-smoke

on:
workflow_dispatch:

permissions:
contents: read

jobs:
funded-transaction-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: funded transaction smoke
env:
AELF_ENDPOINT: ${{ secrets.AELF_TRANSACTION_SMOKE_ENDPOINT }}
AELF_PRIVATE_KEY: ${{ secrets.AELF_TRANSACTION_SMOKE_PRIVATE_KEY }}
AELF_TO_ADDRESS: ${{ secrets.AELF_TRANSACTION_SMOKE_TO_ADDRESS }}
AELF_TOKEN_CONTRACT: ${{ secrets.AELF_TRANSACTION_SMOKE_TOKEN_CONTRACT }}
AELF_AMOUNT: ${{ secrets.AELF_TRANSACTION_SMOKE_AMOUNT }}
run: cargo test -p aelf-sdk --test funded_transaction_smoke funded_send_transaction_smoke -- --ignored --exact --nocapture
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ All notable changes to `aelf-sdk.rust` will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0-alpha.1] - 2026-03-11

### Added

- `native-http` Cargo feature on `aelf-client`, `aelf-contract`, and `aelf-sdk`, enabled by default for native consumers
- `AElfClient::with_provider(...)` and `Provider` re-exports on the facade crate for custom transports
- `wasm32-wasip2` CI compile gates for `aelf-client`, `aelf-contract`, and `aelf-sdk` with `--no-default-features`
- public readonly smoke coverage in a dedicated CI job plus a manual funded transaction smoke workflow

### Changed

- The workspace version moved to `0.1.0-alpha.1`
- Tokio now uses the wasm-compatible `rt` feature instead of `rt-multi-thread`
- `HttpProvider` and `AElfClient::new(...)` are now gated behind `native-http`, while the core SDK remains provider-first
- root `/examples` now forward to `crates/aelf-sdk/examples` so the SDK only maintains one example source of truth
- wallet keystore examples now redact private key and mnemonic output

### Fixed

- `aelf-client`, `aelf-contract`, and `aelf-sdk` now compile for `wasm32-wasip2` when consumed with `default-features = false`
- The facade crate now exposes the transport abstraction needed by native-wasm skill runtimes
- `send_transaction` no longer treats arbitrary non-empty text payloads as success
- typed contract wrappers now lazily reuse the first descriptor per handle, while direct `contract_at(...)` calls still fetch a fresh descriptor for each new handle

## [0.1.0-alpha.0] - 2026-03-10

### Added
Expand Down
12 changes: 10 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,21 @@ cargo +1.85.0 check --workspace --all-targets --all-features --locked
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo audit
cargo check --workspace --examples
cargo check -p aelf-client --target wasm32-wasip2 --no-default-features
cargo check -p aelf-contract --target wasm32-wasip2 --no-default-features
cargo check -p aelf-sdk --target wasm32-wasip2 --no-default-features
cargo test --workspace
```

Optional local-node validation:
Optional live-node validation:

```bash
cargo test -p aelf-sdk --test local_node -- --ignored
cargo test -p aelf-sdk --test public_readonly_smoke -- --ignored --test-threads=1
```

`cargo test --workspace` intentionally excludes the ignored live smoke suites so the default test pass remains deterministic and offline-friendly.

## Repository Layout

- `crates/aelf-sdk`: public facade crate
Expand All @@ -37,7 +43,8 @@ cargo test -p aelf-sdk --test local_node -- --ignored
- `crates/aelf-crypto`: wallet, signing, address utilities
- `crates/aelf-keystore`: JS-compatible keystore support
- `crates/aelf-proto`: generated protobuf bindings
- `examples/`: runnable examples wired into `aelf-sdk`
- `crates/aelf-sdk/examples`: canonical example sources
- `examples/`: thin forwarding wrappers for local convenience

## Pull Requests

Expand All @@ -46,6 +53,7 @@ cargo test -p aelf-sdk --test local_node -- --ignored
- Document public API additions with rustdoc.
- Update `README.md`, `README.zh.md`, or `CHANGELOG.md` when user-facing behavior changes.
- Keep the documented MSRV at Rust `1.85` and preserve the hard `cargo +1.85.0 check --workspace --all-targets --all-features --locked` CI gate.
- Preserve the `wasm32-wasip2` compile gates for `aelf-client`, `aelf-contract`, and `aelf-sdk` when changing transport or feature-flag behavior.

## Commit Style

Expand Down
44 changes: 10 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ edition = "2021"
license = "MIT"
repository = "https://github.com/AElfProject/aelf-web3.rust"
rust-version = "1.85"
version = "0.1.0-alpha.0"
version = "0.1.0-alpha.1"

[workspace.dependencies]
async-trait = "0.1.89"
Expand All @@ -30,7 +30,6 @@ coins-bip39 = "0.13.0"
ctr = "0.9.2"
hex = "0.4.3"
http = "1.3.1"
lru = "0.16.3"
pbjson = "0.9.0"
pbjson-build = "0.9.0"
pbjson-types = "0.9.0"
Expand All @@ -49,7 +48,7 @@ serde_json = "1.0.140"
sha2 = "0.10.9"
sha3 = "0.10.8"
thiserror = "2.0.18"
tokio = { version = "1.47.1", features = ["macros", "rt-multi-thread", "sync", "time"] }
tokio = { version = "1.47.1", features = ["macros", "rt", "sync", "time"] }
zeroize = "1.8.1"

[workspace.lints.rust]
Expand Down
Loading
Loading