Skip to content

Commit

Permalink
leveraged airdrop params in claim query
Browse files Browse the repository at this point in the history
  • Loading branch information
sampocs committed Apr 21, 2023
1 parent 0351d75 commit 118df0d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions x/claim/keeper/claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,23 +508,19 @@ func (k Keeper) GetClaimStatus(ctx sdk.Context, addr sdk.AccAddress) ([]types.Cl
}

func CurrentAirdropRound(start time.Time) int {
// Define constants for 90 days and 30 days
const initialRoundDuration = 90 * 24 * time.Hour
const subsequentRoundDuration = 30 * 24 * time.Hour

// Calculate the time passed since the start
timePassed := time.Since(start)

// Check if the initial round is still ongoing
if timePassed < initialRoundDuration {
if timePassed < types.DefaultVestingInitialPeriod {
return 1
}

// Calculate the time passed after the initial round
timePassedAfterInitialRound := timePassed - initialRoundDuration
timePassedAfterInitialRound := timePassed - types.DefaultVestingInitialPeriod

// Calculate the number of subsequent rounds passed
subsequentRoundsPassed := timePassedAfterInitialRound / subsequentRoundDuration
subsequentRoundsPassed := timePassedAfterInitialRound / types.DefaultEpochDuration

// Add 1 for the initial round and 1 for the current round
return 1 + 1 + int(subsequentRoundsPassed)
Expand Down

0 comments on commit 118df0d

Please sign in to comment.