Skip to content

Feat/admin transfer ci dependabot pause tests#469

Merged
ogazboiz merged 5 commits into
LabsCrypt:mainfrom
emdevelopa:feat/admin-transfer-ci-dependabot-pause-tests
May 28, 2026
Merged

Feat/admin transfer ci dependabot pause tests#469
ogazboiz merged 5 commits into
LabsCrypt:mainfrom
emdevelopa:feat/admin-transfer-ci-dependabot-pause-tests

Conversation

@emdevelopa
Copy link
Copy Markdown
Contributor

Description

This PR addresses multiple contract, infrastructure, and testing issues to improve protocol safety and automate code quality checks.

Changes

Closes #459
Closes #460
Closes #461
Closes #462

emdevelopa and others added 5 commits May 28, 2026 22:36
…vent

Add transfer_admin(env, current_admin, new_admin) to lib.rs that:
- Requires the current admin's auth
- Verifies the caller matches the stored admin
- Updates ProtocolConfig.admin to the new address
- Emits AdminTransferredEvent with previous_admin and new_admin

Also adds paused/paused_at fields to Stream struct and
pause_stream/resume_stream entry points with corresponding
StreamPausedEvent/StreamResumedEvent events. Updates
calculate_claimable to freeze accrual at paused_at when stream is
paused, and withdraw to reject calls on paused streams.

Refs: LabsCrypt#459, LabsCrypt#462
…rios

- Successful admin transfer, non-admin rejected, not-initialized rejected
- New admin can call update_fee_config, old admin cannot
- AdminTransferredEvent emitted with correct payload
- Pause stops accrual (frozen at paused_at)
- Withdraw on paused stream returns StreamInactive
- Resume adjusts last_update_time to skip pause window
- Cancel paused stream settles at paused_at, not current time
- Cancel emits correct refunded_amount when paused
- Resume then cancel settles correctly across pause boundary
- StreamPausedEvent and StreamResumedEvent emitted with correct payloads

Refs: LabsCrypt#459, LabsCrypt#462
Add .github/workflows/ci.yml with:
- cargo fmt --all -- --check (formatting gate)
- cargo clippy --all-targets --target wasm32-unknown-unknown -- -D warnings
- WASM release build step
- cargo test --all for unit tests
- rustfmt and clippy components in toolchain setup
- Cargo cache for faster builds

Triggers on push/PR to main and develop when contracts/ files change.

Refs: LabsCrypt#460
Add .github/dependabot.yml with package-ecosystem entries for:
- npm (root, /frontend, /backend)
- cargo (/contracts)
- github-actions (/)

Configured with weekly schedule (Monday), sensible PR limits,
and grouped minor/patch updates to reduce PR noise.

Refs: LabsCrypt#461
@ogazboiz ogazboiz merged commit 4ef2258 into LabsCrypt:main May 28, 2026
4 of 6 checks passed
ogazboiz added a commit that referenced this pull request May 29, 2026
…mpiles again

PR #469's merge left duplicate struct fields, functions, event fields, and a
stray brace across the stream contract. Kept the Option<u64>/status-based
pause-resume design (the one the test suite asserts on), removed the duplicate
u64-sentinel implementation, and fixed StreamResumedEvent to match.

Also:
- fuzz test now skips zero-rate inputs (rejected by the zero-rate guard)
- cancel-paused test asserts the balanced 400/600 settlement accounting
- cleared clippy lints (redundant cfg(test), unwrap_or_default, same-type casts)
- fixed contracts CI clippy gate (was targeting wasm, which can't build tests)

Closes #499
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants