@@ -869,44 +869,17 @@ describe('IssuanceAllocator', () => {
869
869
// Accumulation should happen from lastIssuanceDistributionBlock to current block
870
870
const blockAfterAccumulation = await ethers . provider . getBlockNumber ( )
871
871
872
- // Debug: Check the actual values when accumulation occurs
873
872
const pendingAmount = await issuanceAllocator . pendingAccumulatedAllocatorIssuance ( )
874
873
const lastDistributionBlock = await issuanceAllocator . lastIssuanceDistributionBlock ( )
875
- // const lastAccumulationBlock = await issuanceAllocator.lastIssuanceAccumulationBlock()
876
874
const allocation = await issuanceAllocator . getTotalAllocation ( )
877
875
878
- // console.log('=== ACCUMULATION DEBUG ON BLOCK', blockAfterAccumulation, '===')
879
- // console.log('lastIssuanceDistributionBlock:', lastDistributionBlock.toString())
880
- // console.log('lastIssuanceAccumulationBlock:', lastAccumulationBlock.toString())
881
- // console.log('blockAfterAccumulation:', blockAfterAccumulation)
882
- // console.log('allocatorMintingPPM:', allocation.allocatorMintingPPM.toString())
883
- // console.log('actualPendingAmount:', formatEther(pendingAmount), 'ETH')
884
-
885
876
// Calculate what accumulation SHOULD be from lastDistributionBlock
886
877
const blocksFromDistribution = BigInt ( blockAfterAccumulation ) - BigInt ( lastDistributionBlock )
887
878
const expectedFromDistribution = calculateExpectedAccumulation (
888
879
parseEther ( '100' ) ,
889
880
blocksFromDistribution ,
890
881
allocation . allocatorMintingPPM ,
891
882
)
892
- // console.log('expectedFromDistribution (' + blocksFromDistribution + ' blocks):', formatEther(expectedFromDistribution), 'ETH')
893
-
894
- // // Calculate what accumulation would be from lastAccumulationBlock
895
- // const blocksFromAccumulation = BigInt(blockAfterAccumulation) - BigInt(lastAccumulationBlock)
896
- // const expectedFromAccumulation = calculateExpectedAccumulation(
897
- // parseEther('100'),
898
- // blocksFromAccumulation,
899
- // allocation.allocatorMintingPPM
900
- // )
901
- // console.log('expectedFromAccumulation (' + blocksFromAccumulation + ' blocks):', formatEther(expectedFromAccumulation), 'ETH')
902
-
903
- // // Calculate what accumulation would be from block 0
904
- // const expectedFromZero = calculateExpectedAccumulation(
905
- // parseEther('100'),
906
- // BigInt(blockAfterAccumulation),
907
- // allocation.allocatorMintingPPM
908
- // )
909
- // console.log('expectedFromZero (' + blockAfterAccumulation + ' blocks):', formatEther(expectedFromZero), 'ETH')
910
883
911
884
// This will fail, but we can see which calculation matches the actual result
912
885
expect ( pendingAmount ) . to . equal ( expectedFromDistribution )
@@ -1346,12 +1319,12 @@ describe('IssuanceAllocator', () => {
1346
1319
const pendingAmount = await issuanceAllocator . pendingAccumulatedAllocatorIssuance ( )
1347
1320
expect ( pendingAmount ) . to . be . gt ( 0 )
1348
1321
1349
- // Calculate expected accumulation manually :
1322
+ // Expected accumulation from multiple phases with rate and allocation changes :
1350
1323
// Phase 1: 2 blocks * 1000 * (1000000 - 500000) / 1000000 = 2000 * 0.5 = 1000
1351
1324
// Phase 3: 1 block * 2000 * (1000000 - 500000) / 1000000 = 2000 * 0.5 = 1000
1352
1325
// Phase 8: 1 block * 2000 * (1000000 - 410000) / 1000000 = 2000 * 0.59 = 1180
1353
1326
// Phase 10: 1 block * 3000 * (1000000 - 410000) / 1000000 = 3000 * 0.59 = 1770
1354
- // Note: Actual values may differ due to double accumulation behavior
1327
+ // Accumulation occurs at each self-minting allocation change during pause
1355
1328
1356
1329
// Get initial balances for new targets
1357
1330
const initialBalance3 = await ( graphToken as any ) . balanceOf ( await target3 . getAddress ( ) )
0 commit comments