Skip to content

Commit

Permalink
refactor: kill duplicate function
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermendes committed Nov 13, 2024
1 parent 80eef1c commit c26e803
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/utils/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { type AuroraNetworkConfig } from '../types/network.js';
import { logger } from '../logger.js';
import { isDefined } from './is-defined.js';
import { StreamSchedule } from '../types/stream.js';
import { getScheduleStartAndEndTimes } from './schedule.js';

export const getDeposit = async (
account: string,
Expand Down Expand Up @@ -194,24 +195,6 @@ export const getStreamsSchedule = async (
});
};

const getScheduleStartAndEndTimes = (schedule: StreamSchedule) => {
const startTime = schedule.scheduleTimes[0];
const endTime = schedule.scheduleTimes[schedule.scheduleTimes.length - 1];

if (!isDefined(startTime)) {
throw new Error('Invalid schedule: start time not found');
}

if (!isDefined(endTime)) {
throw new Error('Invalid schedule: end time not found');
}

return {
startTime: startTime.toNumber() * 1000,
endTime: endTime.toNumber() * 1000,
};
};

export const getStreamsProgress = (
streamsSchedule: StreamSchedule[],
): number[] => {
Expand Down

0 comments on commit c26e803

Please sign in to comment.