From f878610d39536e03cbbf098d5d82bb548b1cfea9 Mon Sep 17 00:00:00 2001 From: tom Date: Thu, 18 Apr 2024 13:48:46 +0200 Subject: [PATCH] rename optimism routes --- lib/api/resources.ts | 35 ++++++++++++------------- ui/pages/OptimisticL2Deposits.pw.tsx | 4 +-- ui/pages/OptimisticL2Deposits.tsx | 6 ++--- ui/pages/OptimisticL2OutputRoots.pw.tsx | 4 +-- ui/pages/OptimisticL2OutputRoots.tsx | 6 ++--- ui/pages/OptimisticL2TxnBatches.pw.tsx | 4 +-- ui/pages/OptimisticL2TxnBatches.tsx | 6 ++--- ui/pages/OptimisticL2Withdrawals.pw.tsx | 4 +-- ui/pages/OptimisticL2Withdrawals.tsx | 6 ++--- 9 files changed, 37 insertions(+), 38 deletions(-) diff --git a/lib/api/resources.ts b/lib/api/resources.ts index f0775b801e..35c102ff1c 100644 --- a/lib/api/resources.ts +++ b/lib/api/resources.ts @@ -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', }, @@ -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' | @@ -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 !!! diff --git a/ui/pages/OptimisticL2Deposits.pw.tsx b/ui/pages/OptimisticL2Deposits.pw.tsx index b1737edd05..daed59df99 100644 --- a/ui/pages/OptimisticL2Deposits.pw.tsx +++ b/ui/pages/OptimisticL2Deposits.pw.tsx @@ -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 diff --git a/ui/pages/OptimisticL2Deposits.tsx b/ui/pages/OptimisticL2Deposits.tsx index c23a842eee..0b2335af74 100644 --- a/ui/pages/OptimisticL2Deposits.tsx +++ b/ui/pages/OptimisticL2Deposits.tsx @@ -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, { @@ -30,7 +30,7 @@ const OptimisticL2Deposits = () => { }, }); - const countersQuery = useApiQuery('l2_deposits_count', { + const countersQuery = useApiQuery('optimistic_l2_deposits_count', { queryOptions: { placeholderData: 1927029, }, diff --git a/ui/pages/OptimisticL2OutputRoots.pw.tsx b/ui/pages/OptimisticL2OutputRoots.pw.tsx index 8c19f64377..fefffc20e6 100644 --- a/ui/pages/OptimisticL2OutputRoots.pw.tsx +++ b/ui/pages/OptimisticL2OutputRoots.pw.tsx @@ -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 diff --git a/ui/pages/OptimisticL2OutputRoots.tsx b/ui/pages/OptimisticL2OutputRoots.tsx index dac63f79cf..ef72bc84f9 100644 --- a/ui/pages/OptimisticL2OutputRoots.tsx +++ b/ui/pages/OptimisticL2OutputRoots.tsx @@ -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, { @@ -28,7 +28,7 @@ const OptimisticL2OutputRoots = () => { }, }); - const countersQuery = useApiQuery('l2_output_roots_count', { + const countersQuery = useApiQuery('optimistic_l2_output_roots_count', { queryOptions: { placeholderData: 50617, }, diff --git a/ui/pages/OptimisticL2TxnBatches.pw.tsx b/ui/pages/OptimisticL2TxnBatches.pw.tsx index fb6c40a307..b781c6db85 100644 --- a/ui/pages/OptimisticL2TxnBatches.pw.tsx +++ b/ui/pages/OptimisticL2TxnBatches.pw.tsx @@ -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 diff --git a/ui/pages/OptimisticL2TxnBatches.tsx b/ui/pages/OptimisticL2TxnBatches.tsx index 6d8decf462..9578642300 100644 --- a/ui/pages/OptimisticL2TxnBatches.tsx +++ b/ui/pages/OptimisticL2TxnBatches.tsx @@ -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, { @@ -29,7 +29,7 @@ const OptimisticL2TxnBatches = () => { }, }); - const countersQuery = useApiQuery('l2_txn_batches_count', { + const countersQuery = useApiQuery('optimistic_l2_txn_batches_count', { queryOptions: { placeholderData: 5231746, }, diff --git a/ui/pages/OptimisticL2Withdrawals.pw.tsx b/ui/pages/OptimisticL2Withdrawals.pw.tsx index 70742da848..b30611cc93 100644 --- a/ui/pages/OptimisticL2Withdrawals.pw.tsx +++ b/ui/pages/OptimisticL2Withdrawals.pw.tsx @@ -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 diff --git a/ui/pages/OptimisticL2Withdrawals.tsx b/ui/pages/OptimisticL2Withdrawals.tsx index 6e941ff3de..d249970e58 100644 --- a/ui/pages/OptimisticL2Withdrawals.tsx +++ b/ui/pages/OptimisticL2Withdrawals.tsx @@ -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, { @@ -29,7 +29,7 @@ const OptimisticL2Withdrawals = () => { }, }); - const countersQuery = useApiQuery('l2_withdrawals_count', { + const countersQuery = useApiQuery('optimistic_l2_withdrawals_count', { queryOptions: { placeholderData: 23700, },