Skip to content

Commit

Permalink
Remove unused constants
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonD3 committed Jan 29, 2021
1 parent 1b58903 commit b5f9d5c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
10 changes: 1 addition & 9 deletions infrastructure/explorer/src/Cacher.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import LRU from 'lru-cache';
import {
BLOCK_STORAGE_SLOT,
BLOCK_TRANSACTIONS_STORAGE_SLOT,
MAX_CACHED_BLOCKS,
MAX_CACHED_BLOCKS_TRANSACTIONS,
MAX_CACHED_TRANSACTIONS,
CACHE_VERSION_SLOT,
CACHE_VERSION
} from './constants';
import { MAX_CACHED_BLOCKS, MAX_CACHED_BLOCKS_TRANSACTIONS, MAX_CACHED_TRANSACTIONS } from './constants';
import { getTxFee, getFromAddressOfTx, getTxToAddress, getTxAmount, getTxToken } from './blockUtils';

class Cacher {
Expand Down
3 changes: 2 additions & 1 deletion infrastructure/explorer/src/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import config from './env-config';
import * as constants from './constants';
import { formatToken, isBlockVerified } from './utils';
import { BlockExplorerClient } from './BlockExplorerClient';
import timeConstants from './timeConstants';

import { Provider } from 'zksync';

Expand Down Expand Up @@ -56,6 +55,8 @@ export class Client {
syncProvider: window.syncProvider
};

// Clear the localStorage since it could have been saved before
// But now localStorage is not used
localStorage.clear();
const client = new Client(props);
const cacher = new Cacher(client);
Expand Down
10 changes: 0 additions & 10 deletions infrastructure/explorer/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ import { getBlockchainExplorerTx, getBlockchainExplorerAddress } from './utils';
export const PAGE_SIZE = 20;
export const TX_BATCH_SIZE = 50;

export const BLOCK_STORAGE_SLOT = 'BLOCK_STORAGE';
export const BLOCK_TRANSACTIONS_STORAGE_SLOT = 'BLOCK_TX_STORAGE';
export const CACHE_VERSION_SLOT = 'CACHE_VERSION';
// In the future our cache utilities / api responses might change
// When it happens, we must also change the CACHE_VERSION.
//
// If the CACHE_VERSION on a client's computer is incorrect,
// it wiil be reset.
export const CACHE_VERSION = '2';

export const blockchainExplorerTx = getBlockchainExplorerTx(store.network);

export const blockchainExplorerAddress = getBlockchainExplorerAddress(store.network);
Expand Down
3 changes: 1 addition & 2 deletions infrastructure/explorer/src/timeConstants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export default {
accountUpdate: 10000,
transactionUpdate: 5000,
cacheSaving: 5000
transactionUpdate: 5000
};

0 comments on commit b5f9d5c

Please sign in to comment.