Skip to content

test(#492): add assert_supply_equals_holder_sum helper with 3 test cases#496

Open
BWM0223 wants to merge 1 commit into
accesslayerorg:mainfrom
BWM0223:feat/supply-holder-sum-helper-492
Open

test(#492): add assert_supply_equals_holder_sum helper with 3 test cases#496
BWM0223 wants to merge 1 commit into
accesslayerorg:mainfrom
BWM0223:feat/supply-holder-sum-helper-492

Conversation

@BWM0223

@BWM0223 BWM0223 commented Jun 27, 2026

Copy link
Copy Markdown

Fixes #492

Summary

Adds assert_supply_equals_holder_sum helper to creator-keys/tests/supply_holder_sum_helper.rs matching the existing test module pattern.

Implementation

pub fn assert_supply_equals_holder_sum(
    client: &ContractClient,
    creator_id: &Address,
    holders: &[Address],
)
  • Reads get_total_key_supply and sums get_key_balance for each holder
  • Panics with descriptive message showing both total_supply and computed sum

Tests (3)

  • helper_passes_on_fresh_state — 0 supply, 0 holders, no panic
  • helper_detects_supply_mismatch — verifies panic on mismatch
  • helper_passes_when_supply_matches_holders — equal values, no panic

Payment: ETH 0xeaCAb48a4bfA0CED0e668c166615927115655594

@BWM0223

BWM0223 commented Jun 27, 2026

Copy link
Copy Markdown
Author

Implementation complete and ready for review. Payment wallets ready: ETH 0xeaCAb48a4bfA0CED0e668c166615927115655594 | SOL C3MD2yfWYebB8FYXpq6ooqzU5GCQB1bDxbDhQf1JfiCW | BTC bc1qtmlgtvg7xgv0zry3ct90elp3y7d3ffdutk4e2f

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 helper for asserting total supply matches sum of all holder balances in test fixtures

1 participant