Skip to content

Commit 65f0947

Browse files
committed
chore: removing unused code
1 parent 82ec319 commit 65f0947

File tree

2 files changed

+2
-48
lines changed

2 files changed

+2
-48
lines changed

packages/issuance/test/tests/IssuanceAllocator.test.ts

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -869,44 +869,17 @@ describe('IssuanceAllocator', () => {
869869
// Accumulation should happen from lastIssuanceDistributionBlock to current block
870870
const blockAfterAccumulation = await ethers.provider.getBlockNumber()
871871

872-
// Debug: Check the actual values when accumulation occurs
873872
const pendingAmount = await issuanceAllocator.pendingAccumulatedAllocatorIssuance()
874873
const lastDistributionBlock = await issuanceAllocator.lastIssuanceDistributionBlock()
875-
// const lastAccumulationBlock = await issuanceAllocator.lastIssuanceAccumulationBlock()
876874
const allocation = await issuanceAllocator.getTotalAllocation()
877875

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-
885876
// Calculate what accumulation SHOULD be from lastDistributionBlock
886877
const blocksFromDistribution = BigInt(blockAfterAccumulation) - BigInt(lastDistributionBlock)
887878
const expectedFromDistribution = calculateExpectedAccumulation(
888879
parseEther('100'),
889880
blocksFromDistribution,
890881
allocation.allocatorMintingPPM,
891882
)
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')
910883

911884
// This will fail, but we can see which calculation matches the actual result
912885
expect(pendingAmount).to.equal(expectedFromDistribution)
@@ -1346,12 +1319,12 @@ describe('IssuanceAllocator', () => {
13461319
const pendingAmount = await issuanceAllocator.pendingAccumulatedAllocatorIssuance()
13471320
expect(pendingAmount).to.be.gt(0)
13481321

1349-
// Calculate expected accumulation manually:
1322+
// Expected accumulation from multiple phases with rate and allocation changes:
13501323
// Phase 1: 2 blocks * 1000 * (1000000 - 500000) / 1000000 = 2000 * 0.5 = 1000
13511324
// Phase 3: 1 block * 2000 * (1000000 - 500000) / 1000000 = 2000 * 0.5 = 1000
13521325
// Phase 8: 1 block * 2000 * (1000000 - 410000) / 1000000 = 2000 * 0.59 = 1180
13531326
// 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
13551328

13561329
// Get initial balances for new targets
13571330
const initialBalance3 = await (graphToken as any).balanceOf(await target3.getAddress())

packages/issuance/test/utils/issuanceCalculations.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -152,22 +152,3 @@ export function ppmToPercentage(ppm: bigint | number): number {
152152
export function parseEther(value: string): bigint {
153153
return ethers.parseEther(value)
154154
}
155-
156-
/**
157-
* Helper to format wei bigint to ETH string for debugging.
158-
*/
159-
export function formatEther(value: bigint): string {
160-
return ethers.formatEther(value)
161-
}
162-
163-
/**
164-
* Calculate expected block difference for accumulation tests.
165-
* This accounts for the actual blocks mined during test execution.
166-
*
167-
* @param startBlock - Starting block number
168-
* @param endBlock - Ending block number
169-
* @returns Number of blocks for accumulation calculation
170-
*/
171-
export function calculateBlockDifference(startBlock: number, endBlock: number): bigint {
172-
return BigInt(Math.max(0, endBlock - startBlock))
173-
}

0 commit comments

Comments
 (0)