Skip to content

Refactor: replace hardcoded literals with shared constants and add guardrails - #71

Merged
merlik787-droi merged 8 commits into
Kqirox:mainfrom
Agaki00:main
Jul 28, 2026
Merged

Refactor: replace hardcoded literals with shared constants and add guardrails#71
merlik787-droi merged 8 commits into
Kqirox:mainfrom
Agaki00:main

Conversation

@Agaki00

@Agaki00 Agaki00 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

…ardrails


name: Pull request
about: Submit changes for review
title: ''

Summary

Use shared constants in contract logic and add guardrails

  • Replace hardcoded literals with existing shared constants across reward-pool, course-registry, badge-nft, quest-engine, stake-vault, and governance
  • Enforce payout/spender/module/course limits using the intended constants
    add regression tests covering the new behavior
  • Verify the workspace test suite passes end to end

Test plan

Checklist

  • cargo fmt --check passes
  • cargo clippy -D warnings passes
  • cargo test passes

@Agaki00 Agaki00 changed the title Refactor: replace hardcoded literals with shared constants and add gua Refactor: replace hardcoded literals with shared constants and add guardrails Jul 25, 2026
Agaki00 and others added 6 commits July 26, 2026 05:53
Change crate-type from ["lib"] to ["cdylib", "lib"] on all six
deployable contracts so `stellar contract build` produces wasm
artifacts (previously it silently built nothing).

Gate stake-vault's #[contract]/#[contractimpl] behind the "contract"
feature (in a contract_impl module, matching badge-nft/reward-pool)
to avoid duplicate symbol linker errors when quest-engine links it
as a dependency. Re-export StakeVault/StakeVaultClient at the crate
root so tests and dependents keep working.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@merlik787-droi merlik787-droi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

A merge conflict resolution dropped SpenderRemoved from the
contract_impl use-list while keeping the remove_approved_spender
function that emits it, causing E0422 (struct not found in scope)
and failing CI. Re-add the import.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@merlik787-droi merlik787-droi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@merlik787-droi
merlik787-droi merged commit 7910176 into Kqirox:main Jul 28, 2026
1 check passed
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.

2 participants