Skip to content

HAMT-72: Refactor Community Vault - PurchaseTracker Relationship#22

Merged
hudsonhrh merged 14 commits intomainfrom
HAMT-59-72-community-vault-refactor-tests
Mar 12, 2025
Merged

HAMT-72: Refactor Community Vault - PurchaseTracker Relationship#22
hudsonhrh merged 14 commits intomainfrom
HAMT-59-72-community-vault-refactor-tests

Conversation

@jrkosinski
Copy link
Collaborator

@jrkosinski jrkosinski commented Mar 12, 2025

Changes

NOTE: Merge LoadPipe/hamza-escrow#14 first

Refactoring:

  1. CommunityVault is responsible for distributing rewards, and keeping track of how much was distributed to each address.
  2. CommunityRewardsCalculator is used by CommunityVault, and is responsible for calculating how much to distribute to each recipient
  3. PurchaseTracker is used by PaymentEscrow to record activity, and is used by CommunityRewardsCalculator to determine (according to some strategy, which is CommunityRewardsCalculator's responsibility) how much each recipient should get.
  4. CommunityVault holds a reference to CommunityRewardsCalculator
  5. CommunityVault holds a reference to PurchaseTracker
  6. PurchaseTracker no longer holds a reference to CommunityVault
  7. Change out CommunityVault's CRC to change the strategy by which rewards are calculated.
  8. Modified Deployment script to deploy a CommunityRewardsCalculator

Tests:

  1. Removed some tests from PurchaseTracker, and moved those tests to CommunityVault
  2. Added tests in CommunityVault
  3. Revised tests in CommunityVault to match new structure

@hudsonhrh hudsonhrh merged commit 09d1e49 into main Mar 12, 2025
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