Skip to content

feat(policy-engine): add integration test chaining all three primitiv… - #339

Merged
Idaonoli merged 2 commits into
stellar-compliance-kit:mainfrom
Peace-001:feat/233-policy-engine-three-primitive-integration-test
Sep 3, 2026
Merged

Idaonoli merged 2 commits into
stellar-compliance-kit:mainfrom
Peace-001:feat/233-policy-engine-three-primitive-integration-test

Conversation

@Peace-001

Copy link
Copy Markdown
Contributor

…es (#233)

  • Add CheckKind::Allowlist variant (with AllowlistCheck struct) to policy-engine, alongside the existing Denylist and Jurisdiction variants
  • Fix CheckKind enum variants to use contracttype-compatible tuple struct form (#[contracttype] does not support named struct fields in enum variants)
  • Add AllowlistCheckInterface + AllowlistCheckClient for cross-contract calls to allowlist-token.is_allowed()
  • Add allowlist-token as a dev-dependency to policy-engine
  • Add policy-engine and rwa-token to workspace Cargo.toml members
  • Write contracts/policy-engine/src/integration_test.rs with 5 tests:
    • test_all_three_pass: all checks clear → evaluate returns true
    • test_fail_allowlist_check: from not allowlisted → false (AND semantics)
    • test_fail_denylist_check: from denylisted → false (AND semantics)
    • test_fail_jurisdiction_check: to in forbidden jurisdiction → false (AND)
    • test_or_semantics_any_check_passes: denylist fails but allowlist passes → true (OR)
  • Fix pre-existing compile errors in denylist-gate, jurisdiction-flag, and allowlist-token source files (broken by conflicting PR merges on main)
  • Update existing policy-engine/src/test.rs to use new CheckKind tuple syntax

All 9 tests pass (4 existing + 5 new integration tests).

Closes

Closes #

What changed and why

Checklist

…es (stellar-compliance-kit#233)

- Add CheckKind::Allowlist variant (with AllowlistCheck struct) to policy-engine,
  alongside the existing Denylist and Jurisdiction variants
- Fix CheckKind enum variants to use contracttype-compatible tuple struct form
  (#[contracttype] does not support named struct fields in enum variants)
- Add AllowlistCheckInterface + AllowlistCheckClient for cross-contract calls
  to allowlist-token.is_allowed()
- Add allowlist-token as a dev-dependency to policy-engine
- Add policy-engine and rwa-token to workspace Cargo.toml members
- Write contracts/policy-engine/src/integration_test.rs with 5 tests:
  - test_all_three_pass: all checks clear → evaluate returns true
  - test_fail_allowlist_check: from not allowlisted → false (AND semantics)
  - test_fail_denylist_check: from denylisted → false (AND semantics)
  - test_fail_jurisdiction_check: to in forbidden jurisdiction → false (AND)
  - test_or_semantics_any_check_passes: denylist fails but allowlist passes → true (OR)
- Fix pre-existing compile errors in denylist-gate, jurisdiction-flag, and
  allowlist-token source files (broken by conflicting PR merges on main)
- Update existing policy-engine/src/test.rs to use new CheckKind tuple syntax

All 9 tests pass (4 existing + 5 new integration tests).
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Peace-001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Peace-001 is attempting to deploy a commit to the idaonoli-2655's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Idaonoli
Idaonoli merged commit b5b1128 into stellar-compliance-kit:main Sep 3, 2026
1 of 13 checks 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.

Add an integration test: policy-engine chaining jurisdiction-flag, denylist-gate, and allowlist-token

2 participants