Skip to content

Commit

Permalink
Merge pull request #2105 from oasisprotocol/mz/remove-scan-v1
Browse files Browse the repository at this point in the history
Remove Oasis Scan v1 API
  • Loading branch information
buberdds authored Jan 14, 2025
2 parents 89c4a1c + e1258d0 commit 9053e80
Show file tree
Hide file tree
Showing 53 changed files with 11 additions and 5,007 deletions.
1 change: 1 addition & 0 deletions .changelog/2105.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove Oasis Scan API v1
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ Procfile text

# Auto-generated files
src/vendors/explorer/*/** linguist-generated=true
src/vendors/oasisscan/*/** linguist-generated=true
src/vendors/oasisscan-v2/*/** linguist-generated=true
src/vendors/nexus/*/** linguist-generated=true
src/vendors/nexus/dump_validators.json linguist-generated=true
6 changes: 0 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
"src/vendors/explorer/.openapi-generator-ignore": true,
"src/vendors/explorer/runtime.ts": true,
"src/vendors/explorer/index.ts": true,
"src/vendors/oasisscan/apis": true,
"src/vendors/oasisscan/models": true,
"src/vendors/oasisscan/.openapi-generator": true,
"src/vendors/oasisscan/.openapi-generator-ignore": true,
"src/vendors/oasisscan/runtime.ts": true,
"src/vendors/oasisscan/index.ts": true,
"src/vendors/oasisscan-v2/apis": true,
"src/vendors/oasisscan-v2/models": true,
"src/vendors/oasisscan-v2/.openapi-generator": true,
Expand Down
1 change: 0 additions & 1 deletion src/app/components/ErrorFormatter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export function ErrorFormatter(props: Props) {

const backendToLabel = {
[BackendAPIs.OasisMonitor]: t('backends.oasismonitor', 'Oasis Monitor API'),
[BackendAPIs.OasisScan]: t('backends.oasisscan', 'Oasis Scan API'),
[BackendAPIs.OasisScanV2]: t('backends.oasisscanV2', 'Oasis Scan API v2'),
[BackendAPIs.Nexus]: t('backends.nexus', 'Nexus API'),
}
Expand Down
1 change: 0 additions & 1 deletion src/app/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const Footer = memo(() => {

const backendToLabel = {
[BackendAPIs.OasisMonitor]: t('footer.poweredBy.oasismonitor', 'Oasis Monitor API & Oasis gRPC'),
[BackendAPIs.OasisScan]: t('footer.poweredBy.oasisscan', 'Oasis Scan API & Oasis gRPC'),
[BackendAPIs.OasisScanV2]: t('footer.poweredBy.oasisscanV2', 'Oasis Scan API v2 & Oasis gRPC'),
[BackendAPIs.Nexus]: t('footer.poweredBy.nexus', 'Nexus API & Oasis gRPC'),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ exports[`<Transaction /> should handle unknown transaction types gracefully 1`]
<a
class="c24"
data-testid="explorer-link"
href="https://oasisscan.com/transactions/ff1234"
href="https://explorer.oasis.io/mainnet/consensus/tx/ff1234"
rel="noopener"
target="_blank"
>
Expand Down Expand Up @@ -1418,7 +1418,7 @@ exports[`<Transaction /> should match snapshot 1`] = `
<a
class="c24"
data-testid="explorer-link"
href="https://oasisscan.com/transactions/ff1234"
href="https://explorer.oasis.io/mainnet/consensus/tx/ff1234"
rel="noopener"
target="_blank"
>
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/Transaction/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('<Transaction />', () => {
const network = 'mainnet'

beforeEach(() => {
jest.mocked(backend).mockImplementation(() => BackendAPIs.OasisScan)
jest.mocked(backend).mockImplementation(() => BackendAPIs.Nexus)
store = configureAppStore()

when(useSelector as any)
Expand Down Expand Up @@ -145,7 +145,7 @@ describe('<Transaction />', () => {
renderComponent(store, ref, transaction, 'testnet')
expect(screen.getByTestId('explorer-link')).toHaveAttribute(
'href',
'https://testnet.oasisscan.com/transactions/ff1234',
'https://explorer.oasis.io/testnet/consensus/tx/ff1234',
)
})

Expand Down Expand Up @@ -187,7 +187,7 @@ describe('<Transaction />', () => {
expect(screen.queryByText('common.block')).not.toBeInTheDocument()
expect(screen.getByTestId('explorer-link')).toHaveAttribute(
'href',
`https://oasisscan.com/paratimes/transactions/ff1234?runtime=${runtimeId}`,
`https://explorer.oasis.io/mainnet/${runtimeId}/tx/ff1234`,
)
expect(screen.getByLabelText('Inherit')).toHaveStyleRule('stroke', '#FFCA58')
})
Expand Down
2 changes: 0 additions & 2 deletions src/app/pages/E2EPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { TextInput } from 'grommet/es6/components/TextInput'
import React, { useEffect } from 'react'
import { useNavigate } from 'react-router-dom'
import * as monitor from 'vendors/monitor'
import * as oasisscan from 'vendors/oasisscan'
import * as oasisscanV2 from 'vendors/oasisscan-v2'
import * as nexus from 'vendors/nexus'
import * as oasis from '@oasisprotocol/client'
Expand Down Expand Up @@ -47,7 +46,6 @@ function ExposeInternals() {
const store = useStore()
useEffect(() => {
window.monitor = monitor
window.oasisscan = oasisscan
window.oasisscanV2 = oasisscanV2
window.nexus = nexus
window.oasis = oasis
Expand Down
21 changes: 0 additions & 21 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const consensusDecimals = 9
// Moved outside backend.ts to avoid circular dependency
export enum BackendAPIs {
OasisMonitor = 'oasismonitor',
OasisScan = 'oasisscan',
OasisScanV2 = 'oasisscanV2',
Nexus = 'nexus',
}
Expand All @@ -24,7 +23,6 @@ type BackendProviders = {
ticker: string // from nic.stakingTokenSymbol()
min_delegation: number // from nic.stakingConsensusParameters().min_delegation
[BackendAPIs.OasisMonitor]: BackendApiUrls
[BackendAPIs.OasisScan]: BackendApiUrls
[BackendAPIs.OasisScanV2]: BackendApiUrls
[BackendAPIs.Nexus]: BackendApiUrls
}
Expand All @@ -42,12 +40,6 @@ export const config: BackendConfig = {
explorer: 'https://monitor.oasis.dev',
blockExplorer: 'https://oasismonitor.com/operation/{{txHash}}',
},
[BackendAPIs.OasisScan]: {
explorer: 'https://api.oasisscan.com/mainnet',
blockExplorer: 'https://oasisscan.com/transactions/{{txHash}}',
blockExplorerParatimes: 'https://oasisscan.com/paratimes/transactions/{{txHash}}?runtime={{runtimeId}}',
blockExplorerAccount: 'https://www.oasisscan.com/accounts/detail/{{address}}',
},
[BackendAPIs.OasisScanV2]: {
explorer: 'https://api.oasisscan.com/v2/mainnet',
blockExplorer: 'https://oasisscan.com/transactions/{{txHash}}',
Expand All @@ -69,12 +61,6 @@ export const config: BackendConfig = {
explorer: 'https://monitor.oasis.dev/api/testnet',
blockExplorer: 'https://testnet.oasismonitor.com/operation/{{txHash}}',
},
[BackendAPIs.OasisScan]: {
explorer: 'https://api.oasisscan.com/testnet',
blockExplorer: 'https://testnet.oasisscan.com/transactions/{{txHash}}',
blockExplorerParatimes: 'https://testnet.oasisscan.com/paratimes/tx/{{txHash}}',
blockExplorerAccount: 'https://testnet.oasisscan.com/accounts/detail/{{address}}',
},
[BackendAPIs.OasisScanV2]: {
explorer: 'https://api.oasisscan.com/v2/testnet',
blockExplorer: 'https://testnet.oasisscan.com/transactions/{{txHash}}',
Expand All @@ -97,13 +83,6 @@ export const config: BackendConfig = {
explorer: 'http://localhost:9001',
blockExplorer: 'http://localhost:9001/data/transactions?operation_id={{txHash}}',
},
[BackendAPIs.OasisScan]: {
explorer: 'http://localhost:9001',
blockExplorer: 'http://localhost:9001/data/transactions?operation_id={{txHash}}',
blockExplorerParatimes:
'http://localhost:9001/data/paratimes/transactions/{{txHash}}?runtime={{runtimeId}}',
blockExplorerAccount: 'http://localhost:9001/data/accounts/detail/{{address}}',
},
[BackendAPIs.OasisScanV2]: {
explorer: 'http://localhost:9001',
blockExplorer: 'http://localhost:9001/data/transactions?operation_id={{txHash}}',
Expand Down
2 changes: 0 additions & 2 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
"appTitle": "ROSE Wallet",
"backends": {
"oasismonitor": "Oasis Monitor API",
"oasisscan": "Oasis Scan API",
"oasisscanV2": "Oasis Scan API v2",
"nexus": "Nexus API"
},
Expand Down Expand Up @@ -201,7 +200,6 @@
"github": "ROSE Wallet is <GithubLink>open source</GithubLink> and powered by",
"poweredBy": {
"oasismonitor": "Oasis Monitor API & Oasis gRPC",
"oasisscan": "Oasis Scan API & Oasis gRPC",
"oasisscanV2": "Oasis Scan API v2 & Oasis gRPC",
"nexus": "Nexus API & Oasis gRPC"
},
Expand Down
2 changes: 1 addition & 1 deletion src/types/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type Backend = 'oasismonitor' | 'oasisscan' | 'oasisscanV2' | 'nexus'
type Backend = 'oasismonitor' | 'oasisscanV2' | 'nexus'

declare global {
namespace NodeJS {
Expand Down
Loading

0 comments on commit 9053e80

Please sign in to comment.