Skip to content

Commit

Permalink
go
Browse files Browse the repository at this point in the history
  • Loading branch information
guibescos committed Oct 9, 2024
1 parent e38039b commit bbba8b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions governance/pyth_staking_sdk/src/pyth-staking-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ export class PythStakingClient {
),
);

const max = (a : bigint | undefined, b: bigint | undefined) => {
const bigintMax = (a : bigint | undefined, b: bigint | undefined) => {
if (a === undefined) {
return b;
}
Expand All @@ -713,8 +713,8 @@ export class PythStakingClient {
}

const lowestEpoch = publishers.reduce<bigint| undefined>((min, publisher, index) => {
const maximum = max(publisher.lowestEpoch, delegationRecords[index]?.lastEpoch);
return (min === undefined || (maximum !== undefined && maximum < min)) ? publisher.lowestEpoch : min, undefined as bigint| undefined
const maximum = bigintMax(publisher.lowestEpoch, delegationRecords[index]?.lastEpoch);
return (min === undefined || (maximum !== undefined && maximum < min)) ? maximum : min;
}, undefined);

const currentEpoch = await getCurrentEpoch(this.connection);
Expand Down

0 comments on commit bbba8b2

Please sign in to comment.