Skip to content

Commit

Permalink
Changed donation source to CHAIN for those synced by ankr
Browse files Browse the repository at this point in the history
Fixed timestamp fetching issue by ankr
  • Loading branch information
aminlatifi committed Oct 29, 2024
1 parent 3f2a1ec commit 744a771
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/entities/donation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const DONATION_STATUS = {
export const DONATION_ORIGINS = {
IDRISS_TWITTER: 'Idriss',
DRAFT_DONATION_MATCHING: 'DraftDonationMatching',
ANKR: 'Ankr',
CHAIN: 'Chain',
SUPER_FLUID: 'SuperFluid',
};

Expand Down
4 changes: 3 additions & 1 deletion src/services/ankrService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ export const processAnkrTransfers = async ({
}): Promise<void> => {
const ankrState = await getAnkrState();

const fromTimestamp = ankrState?.timestamp || ANKR_FETCH_START_TIMESTAMP;
const fromTimestamp = ankrState?.timestamp
? ankrState?.timestamp + 1
: ANKR_FETCH_START_TIMESTAMP;

const { lastTimeStamp } = await fetchAnkrTransfers({
addresses,
Expand Down
2 changes: 1 addition & 1 deletion src/services/donationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ const ankrTransferHandler = async (transfer: TokenTransfer) => {
);

await Donation.update(Number(donationId), {
origin: DONATION_ORIGINS.ANKR,
origin: DONATION_ORIGINS.CHAIN,
});

logger.debug(
Expand Down

0 comments on commit 744a771

Please sign in to comment.