Skip to content

Commit

Permalink
Initialize firstMarkedUpdatableTimestamps (#272)
Browse files Browse the repository at this point in the history
* Initialize `firstMarkedUpdatableTimestamps`

* Remove not utilized constant

* Fix test
  • Loading branch information
bdrhn9 authored Apr 25, 2024
1 parent fe08a89 commit d6faf65
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export const RPC_PROVIDER_TIMEOUT_MS = 120_000;

export const HUNDRED_PERCENT = 10n ** 8n;

export const AIRSEEKER_PROTOCOL_ID = '5'; // From: https://github.com/api3dao/airnode/blob/ef16c54f33d455a1794e7886242567fc47ee14ef/packages/airnode-protocol/src/index.ts#L46
Expand Down
3 changes: 2 additions & 1 deletion src/update-feeds-loops/update-feeds-loops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { getUpdatableFeeds } from './get-updatable-feeds';
import { getDerivedSponsorWallet, submitTransactions } from './submit-transactions';
import {
clearFirstMarkedUpdatableTimestamp,
initializeFirstMarkedUpdatableTimestamp,
isAlreadyUpdatable,
setFirstMarkedUpdatableTimestamp,
} from './updatability-timestamp';
Expand Down Expand Up @@ -52,7 +53,7 @@ export const startUpdateFeedsLoops = async () => {

for (const providerName of Object.keys(providers)) {
initializeGasState(chainId, providerName);

initializeFirstMarkedUpdatableTimestamp(chainId, providerName);
logger.debug(`Starting update feeds loop.`, { chainName: alias, providerName });
// Run the update feed loop manually for the first time, because setInterval first waits for the given period of
// time before calling the callback function.
Expand Down
1 change: 1 addition & 0 deletions test/e2e/update-feeds.feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ it('reads blockchain data', async () => {

initializeState(config);
initializeGasState(chainId, providerName);
initializeFirstMarkedUpdatableTimestamp(chainId, providerName);

await runUpdateFeeds(providerName, chain, chainId);

Expand Down

0 comments on commit d6faf65

Please sign in to comment.