Skip to content

fix(farming-pool): return typed error before initialization#40

Merged
prodbycorne merged 2 commits into
SmartDropLabs:mainfrom
ProtonsAndElectrons:codex/farming-pool-not-initialized
Jun 27, 2026
Merged

fix(farming-pool): return typed error before initialization#40
prodbycorne merged 2 commits into
SmartDropLabs:mainfrom
ProtonsAndElectrons:codex/farming-pool-not-initialized

Conversation

@ProtonsAndElectrons

Copy link
Copy Markdown
Contributor

Summary

  • Add PoolError::NotInitialized and an initialization guard for farming-pool entrypoints.
  • Replace get_admin and get_stake_token storage unwrap() calls with fallible helpers.
  • Return typed contract errors from public farming-pool methods and add regression coverage for uninitialized stake and pause calls.

Fixes #34

Validation

  • cargo fmt --check -p farming-pool
  • cargo test -p farming-pool (52 passed)

I also tried the broader cargo test / cargo test -p factory on Windows, but both were blocked while linking farming_pool.dll with x86_64-w64-mingw32-gcc: export ordinal too large: 75493.

@prodbycorne prodbycorne merged commit f4595d2 into SmartDropLabs:main Jun 27, 2026
1 check failed
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.

farming-pool: get_admin panics on unwrap if contract is not initialized

2 participants