Skip to content

Commit

Permalink
rename optimism routes
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Apr 18, 2024
1 parent 1dee24a commit f878610
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 38 deletions.
35 changes: 17 additions & 18 deletions lib/api/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,40 +595,39 @@ export const RESOURCES = {
},

// optimistic L2
// TODO @tom2drum rename these resources to be consistent with other L2s
l2_deposits: {
optimistic_l2_deposits: {
path: '/api/v2/optimism/deposits',
filterFields: [],
},

l2_deposits_count: {
optimistic_l2_deposits_count: {
path: '/api/v2/optimism/deposits/count',
},

l2_withdrawals: {
optimistic_l2_withdrawals: {
path: '/api/v2/optimism/withdrawals',
filterFields: [],
},

l2_withdrawals_count: {
optimistic_l2_withdrawals_count: {
path: '/api/v2/optimism/withdrawals/count',
},

l2_output_roots: {
optimistic_l2_output_roots: {
path: '/api/v2/optimism/output-roots',
filterFields: [],
},

l2_output_roots_count: {
optimistic_l2_output_roots_count: {
path: '/api/v2/optimism/output-roots/count',
},

l2_txn_batches: {
optimistic_l2_txn_batches: {
path: '/api/v2/optimism/txn-batches',
filterFields: [],
},

l2_txn_batches_count: {
optimistic_l2_txn_batches_count: {
path: '/api/v2/optimism/txn-batches/count',
},

Expand Down Expand Up @@ -828,7 +827,7 @@ export type PaginatedResources = 'blocks' | 'block_txs' |
'token_transfers' | 'token_holders' | 'token_inventory' | 'tokens' | 'tokens_bridged' |
'token_instance_transfers' | 'token_instance_holders' |
'verified_contracts' |
'l2_output_roots' | 'l2_withdrawals' | 'l2_txn_batches' | 'l2_deposits' |
'optimistic_l2_output_roots' | 'optimistic_l2_withdrawals' | 'optimistic_l2_txn_batches' | 'optimistic_l2_deposits' |
'shibarium_deposits' | 'shibarium_withdrawals' |
'zkevm_l2_deposits' | 'zkevm_l2_withdrawals' | 'zkevm_l2_txn_batches' | 'zkevm_l2_txn_batch_txs' |
'zksync_l2_txn_batches' | 'zksync_l2_txn_batch_txs' |
Expand Down Expand Up @@ -928,14 +927,14 @@ Q extends 'visualize_sol2uml' ? VisualizedContract :
Q extends 'contract_verification_config' ? SmartContractVerificationConfig :
Q extends 'withdrawals' ? WithdrawalsResponse :
Q extends 'withdrawals_counters' ? WithdrawalsCounters :
Q extends 'l2_output_roots' ? OptimisticL2OutputRootsResponse :
Q extends 'l2_withdrawals' ? OptimisticL2WithdrawalsResponse :
Q extends 'l2_deposits' ? OptimisticL2DepositsResponse :
Q extends 'l2_txn_batches' ? OptimisticL2TxnBatchesResponse :
Q extends 'l2_output_roots_count' ? number :
Q extends 'l2_withdrawals_count' ? number :
Q extends 'l2_deposits_count' ? number :
Q extends 'l2_txn_batches_count' ? number :
Q extends 'optimistic_l2_output_roots' ? OptimisticL2OutputRootsResponse :
Q extends 'optimistic_l2_withdrawals' ? OptimisticL2WithdrawalsResponse :
Q extends 'optimistic_l2_deposits' ? OptimisticL2DepositsResponse :
Q extends 'optimistic_l2_txn_batches' ? OptimisticL2TxnBatchesResponse :
Q extends 'optimistic_l2_output_roots_count' ? number :
Q extends 'optimistic_l2_withdrawals_count' ? number :
Q extends 'optimistic_l2_deposits_count' ? number :
Q extends 'optimistic_l2_txn_batches_count' ? number :
Q extends 'config_backend_version' ? BackendVersionConfig :
never;
// !!! IMPORTANT !!!
Expand Down
4 changes: 2 additions & 2 deletions ui/pages/OptimisticL2Deposits.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import * as configs from 'playwright/utils/configs';

import OptimisticL2Deposits from './OptimisticL2Deposits';

const DEPOSITS_API_URL = buildApiUrl('l2_deposits');
const DEPOSITS_COUNT_API_URL = buildApiUrl('l2_deposits_count');
const DEPOSITS_API_URL = buildApiUrl('optimistic_l2_deposits');
const DEPOSITS_COUNT_API_URL = buildApiUrl('optimistic_l2_deposits_count');

const test = base.extend({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
6 changes: 3 additions & 3 deletions ui/pages/OptimisticL2Deposits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import StickyPaginationWithText from 'ui/shared/StickyPaginationWithText';

const OptimisticL2Deposits = () => {
const { data, isError, isPlaceholderData, pagination } = useQueryWithPages({
resourceName: 'l2_deposits',
resourceName: 'optimistic_l2_deposits',
options: {
placeholderData: generateListStub<'l2_deposits'>(
placeholderData: generateListStub<'optimistic_l2_deposits'>(
L2_DEPOSIT_ITEM,
50,
{
Expand All @@ -30,7 +30,7 @@ const OptimisticL2Deposits = () => {
},
});

const countersQuery = useApiQuery('l2_deposits_count', {
const countersQuery = useApiQuery('optimistic_l2_deposits_count', {
queryOptions: {
placeholderData: 1927029,
},
Expand Down
4 changes: 2 additions & 2 deletions ui/pages/OptimisticL2OutputRoots.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const test = base.extend({
context: contextWithEnvs(configs.featureEnvs.optimisticRollup) as any,
});

const OUTPUT_ROOTS_API_URL = buildApiUrl('l2_output_roots');
const OUTPUT_ROOTS_COUNT_API_URL = buildApiUrl('l2_output_roots_count');
const OUTPUT_ROOTS_API_URL = buildApiUrl('optimistic_l2_output_roots');
const OUTPUT_ROOTS_COUNT_API_URL = buildApiUrl('optimistic_l2_output_roots_count');

test('base view +@mobile', async({ mount, page }) => {
// test on mobile is flaky
Expand Down
6 changes: 3 additions & 3 deletions ui/pages/OptimisticL2OutputRoots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import StickyPaginationWithText from 'ui/shared/StickyPaginationWithText';

const OptimisticL2OutputRoots = () => {
const { data, isError, isPlaceholderData, pagination } = useQueryWithPages({
resourceName: 'l2_output_roots',
resourceName: 'optimistic_l2_output_roots',
options: {
placeholderData: generateListStub<'l2_output_roots'>(
placeholderData: generateListStub<'optimistic_l2_output_roots'>(
L2_OUTPUT_ROOTS_ITEM,
50,
{
Expand All @@ -28,7 +28,7 @@ const OptimisticL2OutputRoots = () => {
},
});

const countersQuery = useApiQuery('l2_output_roots_count', {
const countersQuery = useApiQuery('optimistic_l2_output_roots_count', {
queryOptions: {
placeholderData: 50617,
},
Expand Down
4 changes: 2 additions & 2 deletions ui/pages/OptimisticL2TxnBatches.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const test = base.extend({
context: contextWithEnvs(configs.featureEnvs.optimisticRollup) as any,
});

const TXN_BATCHES_API_URL = buildApiUrl('l2_txn_batches');
const TXN_BATCHES_COUNT_API_URL = buildApiUrl('l2_txn_batches_count');
const TXN_BATCHES_API_URL = buildApiUrl('optimistic_l2_txn_batches');
const TXN_BATCHES_COUNT_API_URL = buildApiUrl('optimistic_l2_txn_batches_count');

test('base view +@mobile', async({ mount, page }) => {
// test on mobile is flaky
Expand Down
6 changes: 3 additions & 3 deletions ui/pages/OptimisticL2TxnBatches.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import OptimisticL2TxnBatchesTable from 'ui/txnBatches/optimisticL2/OptimisticL2

const OptimisticL2TxnBatches = () => {
const { data, isError, isPlaceholderData, pagination } = useQueryWithPages({
resourceName: 'l2_txn_batches',
resourceName: 'optimistic_l2_txn_batches',
options: {
placeholderData: generateListStub<'l2_txn_batches'>(
placeholderData: generateListStub<'optimistic_l2_txn_batches'>(
L2_TXN_BATCHES_ITEM,
50,
{
Expand All @@ -29,7 +29,7 @@ const OptimisticL2TxnBatches = () => {
},
});

const countersQuery = useApiQuery('l2_txn_batches_count', {
const countersQuery = useApiQuery('optimistic_l2_txn_batches_count', {
queryOptions: {
placeholderData: 5231746,
},
Expand Down
4 changes: 2 additions & 2 deletions ui/pages/OptimisticL2Withdrawals.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const test = base.extend({
context: contextWithEnvs(configs.featureEnvs.optimisticRollup) as any,
});

const WITHDRAWALS_API_URL = buildApiUrl('l2_withdrawals');
const WITHDRAWALS_COUNT_API_URL = buildApiUrl('l2_withdrawals_count');
const WITHDRAWALS_API_URL = buildApiUrl('optimistic_l2_withdrawals');
const WITHDRAWALS_COUNT_API_URL = buildApiUrl('optimistic_l2_withdrawals_count');

test('base view +@mobile', async({ mount, page }) => {
// test on mobile is flaky
Expand Down
6 changes: 3 additions & 3 deletions ui/pages/OptimisticL2Withdrawals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import OptimisticL2WithdrawalsTable from 'ui/withdrawals/optimisticL2/Optimistic

const OptimisticL2Withdrawals = () => {
const { data, isError, isPlaceholderData, pagination } = useQueryWithPages({
resourceName: 'l2_withdrawals',
resourceName: 'optimistic_l2_withdrawals',
options: {
placeholderData: generateListStub<'l2_withdrawals'>(
placeholderData: generateListStub<'optimistic_l2_withdrawals'>(
L2_WITHDRAWAL_ITEM,
50,
{
Expand All @@ -29,7 +29,7 @@ const OptimisticL2Withdrawals = () => {
},
});

const countersQuery = useApiQuery('l2_withdrawals_count', {
const countersQuery = useApiQuery('optimistic_l2_withdrawals_count', {
queryOptions: {
placeholderData: 23700,
},
Expand Down

0 comments on commit f878610

Please sign in to comment.