Skip to content

test(event): governance actions#600

Merged
wolf31o2 merged 1 commit intomainfrom
test/governance
Feb 1, 2026
Merged

test(event): governance actions#600
wolf31o2 merged 1 commit intomainfrom
test/governance

Conversation

@wolf31o2
Copy link
Copy Markdown
Member

@wolf31o2 wolf31o2 commented Feb 1, 2026

Summary by cubic

Add unit tests for governance action extraction to ensure correct parsing of treasury withdrawals, committee updates, new constitution anchors/script hash, Conway parameter changes (policy hash, execution units, rational values, governance params), and previous action IDs. Also add a test for rational-to-float conversion.

Written for commit b767b9a. Summary will update on new commits.

Summary by CodeRabbit

  • Tests
    • Expanded test coverage for governance data extraction with comprehensive test suites for treasury withdrawals, committee updates, constitution changes, and parameter modifications.
    • Added validation tests for policy and script hash handling, data transformations, and aggregation logic across multiple governance action scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
@wolf31o2 wolf31o2 requested a review from a team as a code owner February 1, 2026 14:59
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 1, 2026

📝 Walkthrough

Walkthrough

This pull request adds a comprehensive test suite to event/governance_test.go covering governance data extraction across multiple action types. The new tests validate the extractGovActionData function with TreasuryWithdrawal, UpdateCommittee, NewConstitution, and ParameterChange actions. Tests include scenarios for policy hashes, script/data hashes, PrevActionId handling, and Conway parameter changes covering fields like MinFeeA/B, MaxTxSize, and rational value conversions. The rationalToFloat helper function is also tested with edge cases. Total lines added: 327.

Possibly related PRs

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test(event): governance actions' accurately describes the main change, which is adding a comprehensive test suite for governance data extraction across multiple action types.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/governance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@wolf31o2 wolf31o2 merged commit a724052 into main Feb 1, 2026
11 checks passed
@wolf31o2 wolf31o2 deleted the test/governance branch February 1, 2026 22:21
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