Skip to content

test: cover farming pool boost credit invariants - #56

Open
jamilahmadzai wants to merge 2 commits into
SmartDropLabs:mainfrom
jamilahmadzai:test/farming-pool-boost-coverage-22
Open

test: cover farming pool boost credit invariants#56
jamilahmadzai wants to merge 2 commits into
SmartDropLabs:mainfrom
jamilahmadzai:test/farming-pool-boost-coverage-22

Conversation

@jamilahmadzai

@jamilahmadzai jamilahmadzai commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Closes #22

Bounty: GrantFox OSS campaign for issue #22; no fixed public award has been confirmed.

Summary

  • Add exact boost arithmetic coverage for full allocation at 3x and 1x multipliers.
  • Assert boost and multiplier event payloads, admin authorization, and banked-credit preservation across explicit checkpoints.
  • Cover monotonic credit growth, boosted-versus-unboosted accrual, aggregate credits versus the dedicated stake/position views, and stake/unstake balance round trips.
  • Refresh against current main, including the active-stake requirement for boosts and the old/new multiplier event payload.

Validation (September 8 refresh)

  • cargo fmt --manifest-path soroban/Cargo.toml --all -- --check
  • cargo build --manifest-path soroban/Cargo.toml --target wasm32v1-none --release -p farming-pool
  • cargo test --manifest-path soroban/Cargo.toml -p farming-pool --lib — 164 passed
  • git diff --check

This is a test-only contribution; contract runtime behavior is unchanged. The banked-credit test explicitly checkpoints after a same-ledger multiplier update to adopt the new per-stake snapshot.

@jamilahmadzai
jamilahmadzai force-pushed the test/farming-pool-boost-coverage-22 branch from d7e507b to 44c29bc Compare August 28, 2026 19:28
@netlify

netlify Bot commented Aug 28, 2026

Copy link
Copy Markdown

Deploy Preview for sdcontracts ready!

Name Link
🔨 Latest commit 3cdd4ae
🔍 Latest deploy log https://app.netlify.com/projects/sdcontracts/deploys/6a9fcab5a0214d00088b5919
😎 Deploy Preview https://deploy-preview-56--sdcontracts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jamilahmadzai

Copy link
Copy Markdown
Contributor Author

Refreshed against current main and aligned the coverage with the active-stake requirement, old/new multiplier event payload, and combined versus per-position credit views. The banked-credit case explicitly adopts the new per-stake snapshot at a checkpoint. No contract runtime changes were added. All 164 farming-pool tests pass locally, and the current-head Test and build WASM workflow and deployment preview both pass. Ready for review.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant