-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IND-481] Remove market cache. #818
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ import { | |
OraclePriceTable, | ||
assetRefresher, | ||
dbHelpers, | ||
marketRefresher, | ||
perpetualMarketRefresher, | ||
testConstants, | ||
testMocks, | ||
|
@@ -35,7 +34,6 @@ describe('block-cache', () => { | |
clearCandlesMap(); | ||
perpetualMarketRefresher.clear(); | ||
assetRefresher.clear(); | ||
marketRefresher.clear(); | ||
}); | ||
|
||
afterAll(async () => { | ||
|
@@ -80,7 +78,6 @@ describe('block-cache', () => { | |
expect(getCandlesMap()).not.toEqual({}); | ||
expect(perpetualMarketRefresher.getPerpetualMarketsMap()).not.toEqual({}); | ||
expect(assetRefresher.getAssetsMap()).not.toEqual({}); | ||
expect(marketRefresher.getMarketsMap()).not.toEqual({}); | ||
} | ||
}); | ||
}); | ||
|
@@ -92,7 +89,6 @@ describe('block-cache', () => { | |
expect(getCandlesMap()).toEqual({}); | ||
expect(perpetualMarketRefresher.getPerpetualMarketsMap()).toEqual({}); | ||
expect(assetRefresher.getAssetsMap()).toEqual({}); | ||
Comment on lines
90
to
91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test setup still contains calls to |
||
expect(marketRefresher.getMarketsMap()).toEqual({}); | ||
|
||
await initializeAllCaches(); | ||
|
||
|
@@ -101,7 +97,6 @@ describe('block-cache', () => { | |
expect(getCandlesMap()).not.toEqual({}); | ||
expect(perpetualMarketRefresher.getPerpetualMarketsMap()).not.toEqual({}); | ||
expect(assetRefresher.getAssetsMap()).not.toEqual({}); | ||
Comment on lines
98
to
99
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test assertions still check the state of |
||
expect(marketRefresher.getMarketsMap()).not.toEqual({}); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,7 @@ | ||||||
import { logger, ParseMessageError } from '@dydxprotocol-indexer/base'; | ||||||
import { PerpetualMarketCreateEventV1, IndexerTendermintBlock, IndexerTendermintEvent } from '@dydxprotocol-indexer/v4-protos'; | ||||||
import { | ||||||
dbHelpers, marketRefresher, testMocks, perpetualMarketRefresher, | ||||||
dbHelpers, testMocks, perpetualMarketRefresher, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The import of - dbHelpers, testMocks, perpetualMarketRefresher,
+ dbHelpers, testMocks, Committable suggestion
Suggested change
|
||||||
} from '@dydxprotocol-indexer/postgres'; | ||||||
import { DydxIndexerSubtypes } from '../../src/lib/types'; | ||||||
import { | ||||||
Comment on lines
1
to
7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The call to - await perpetualMarketRefresher.clear();
The call to - await perpetualMarketRefresher.updatePerpetualMarkets(); |
||||||
|
@@ -18,7 +18,6 @@ import Long from 'long'; | |||||
describe('perpetual-market-validator', () => { | ||||||
beforeEach(async () => { | ||||||
await testMocks.seedData(); | ||||||
await marketRefresher.updateMarkets(); | ||||||
jest.spyOn(logger, 'error'); | ||||||
}); | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,7 +5,6 @@ import { | |||||
IsolationLevel, | ||||||
Transaction, | ||||||
assetRefresher, | ||||||
marketRefresher, | ||||||
perpetualMarketRefresher, | ||||||
} from '@dydxprotocol-indexer/postgres'; | ||||||
import Big from 'big.js'; | ||||||
|
@@ -111,7 +110,6 @@ export async function initializeAllCaches(): Promise<void> { | |||||
startCandleCache(txId), | ||||||
perpetualMarketRefresher.updatePerpetualMarkets({ txId }), | ||||||
assetRefresher.updateAssets({ txId }), | ||||||
marketRefresher.updateMarkets({ txId }), | ||||||
]); | ||||||
|
||||||
await Transaction.rollback(txId); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The transaction in - await Transaction.rollback(txId);
+ await Transaction.commit(txId); Committable suggestion
Suggested change
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,7 +2,6 @@ import { | |||||
IsolationLevel, | ||||||
Transaction, | ||||||
assetRefresher, | ||||||
marketRefresher, | ||||||
perpetualMarketRefresher, | ||||||
} from '@dydxprotocol-indexer/postgres'; | ||||||
|
||||||
|
@@ -13,7 +12,6 @@ export async function refreshDataCaches(): Promise<void> { | |||||
await Promise.all([ | ||||||
perpetualMarketRefresher.updatePerpetualMarkets({ txId, readReplica: true }), | ||||||
assetRefresher.updateAssets({ txId, readReplica: true }), | ||||||
marketRefresher.updateMarkets({ txId, readReplica: true }), | ||||||
]); | ||||||
|
||||||
await Transaction.rollback(txId); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The - await Transaction.rollback(txId);
+ await Transaction.commit(txId); Committable suggestion
Suggested change
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The summary indicates that references to
marketRefresher
have been removed, but the test assertions still check the state ofperpetualMarketRefresher.getPerpetualMarketsMap()
andassetRefresher.getAssetsMap()
. These assertions should be removed ifmarketRefresher
and its methods are no longer used.