Skip to content

Commit

Permalink
Merge pull request #1497 from oasisprotocol/mz/px
Browse files Browse the repository at this point in the history
Sync PontusX with API changes
  • Loading branch information
buberdds authored Aug 13, 2024
2 parents f4eb85f + b373396 commit 02da21b
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions .changelog/1497.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sync PontusX with API changes
2 changes: 1 addition & 1 deletion src/app/components/LayerPicker/LayerDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const getDetails = (t: TFunction): Details => ({
chainDecimalId: '32456',
docs: docs.pontusx1,
},
[Layer.pontusx]: {
[Layer.pontusxtest]: {
description: t('layerPicker.testnet.pontusxtest'),
// See https://docs.pontus-x.eu/docs/Pontus-X%20Testnet/quick_start#setup-metamask
rpcHttp: 'https://rpc.test.pontus-x.eu',
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/Search/search-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const searchSuggestionTerms = {
},
cipher: undefined,
pontusxdev: undefined,
pontusx: undefined,
pontusxtest: undefined,
consensus: undefined,
},
testnet: {
Expand All @@ -57,7 +57,7 @@ export const searchSuggestionTerms = {
suggestedAccount: '0xC09c6A1d5538E7ed135d6146241c8da11e92130B',
suggestedTokenFragment: 'Ocean',
},
pontusx: {
pontusxtest: {
suggestedBlock: '390632', // TODO
suggestedTransaction: '0x244f71bcc67a0359c0d1e417b302ec3b358193769399e71f0112c58135f0fc82', // TODO
suggestedAccount: '0xC09c6A1d5538E7ed135d6146241c8da11e92130B', // TODO
Expand Down
2 changes: 1 addition & 1 deletion src/app/data/pontusx-account-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const useSearchForPontusXAccountsByName = (
: namedAccounts?.list.filter(textMatcher).map(
(account): AccountNameSearchRuntimeMatch => ({
network,
layer: Layer.pontusx,
layer: Layer.pontusxtest,
address: account.address,
}),
)
Expand Down
4 changes: 2 additions & 2 deletions src/app/hooks/useAccountMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { getOasisAddress } from '../utils/helpers'
* since this function also includes caching.
*/
export const useAccountMetadata = (scope: SearchScope, address: string): AccountMetadataInfo => {
const isPontusX = scope.layer === Layer.pontusx || scope.layer === Layer.pontusxdev
const isPontusX = scope.layer === Layer.pontusxtest || scope.layer === Layer.pontusxdev
const pontusXData = usePontusXAccountMetadata(address, { enabled: isPontusX })
const oasisData = useOasisAccountMetadata(scope.network, scope.layer, getOasisAddress(address), {
enabled: !isPontusX,
Expand All @@ -24,7 +24,7 @@ export const useSearchForAccountsByName = (
scope: SearchScope,
nameFragment = '',
): AccountNameSearchResults => {
const isPontusX = scope.layer === Layer.pontusx || scope.layer === Layer.pontusxdev
const isPontusX = scope.layer === Layer.pontusxtest || scope.layer === Layer.pontusxdev
const isValidPontusXSearch = isPontusX && !!nameFragment
const pontusXResults = useSearchForPontusXAccountsByName(scope.network, nameFragment, {
enabled: isValidPontusXSearch,
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/ParatimeDashboardPage/LearningMaterials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const getContent = (t: TFunction) => {
},
[Layer.cipher]: undefined,
[Layer.pontusxdev]: undefined,
[Layer.pontusx]: undefined,
[Layer.pontusxtest]: undefined,
},
[Network.testnet]: {
[Layer.emerald]: {
Expand Down Expand Up @@ -118,7 +118,7 @@ const getContent = (t: TFunction) => {
url: docs.pontusx3,
},
},
[Layer.pontusx]: {
[Layer.pontusxtest]: {
primary: {
description: t('learningMaterials.pontusxtestnet.1.description'),
header: t('learningMaterials.pontusxtestnet.1.header'),
Expand Down
2 changes: 1 addition & 1 deletion src/app/utils/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const getLayerLabels = (t: TFunction): Record<Layer, string> => ({
[Layer.sapphire]: t('common.sapphire'),
[Layer.cipher]: t('common.cipher'),
[Layer.pontusxdev]: t('pontusx.devnet'),
[Layer.pontusx]: t('pontusx.testnet'),
[Layer.pontusxtest]: t('pontusx.testnet'),
[Layer.consensus]: t('common.consensus'),
})

Expand Down
2 changes: 1 addition & 1 deletion src/app/utils/faucet-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const faucetLinks: Partial<Record<Network, Partial<Record<Layer, Partial<Record<
[Layer.pontusxdev]: {
[Ticker.EUROe]: `mailto:[email protected]?subject=${encodeURIComponent('Request test tokens for Pontus-X Devnet')}`,
},
[Layer.pontusx]: {
[Layer.pontusxtest]: {
[Ticker.EUROe]: `mailto:[email protected]?subject=${encodeURIComponent('Request test tokens for Pontus-X Testnet')}`,
},
},
Expand Down
4 changes: 2 additions & 2 deletions src/app/utils/route-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export abstract class RouteUtils {
[Layer.sapphire]: true,
[Layer.cipher]: false,
[Layer.pontusxdev]: false,
[Layer.pontusx]: false,
[Layer.pontusxtest]: false,
// Disable WIP Consensus on production and staging
[Layer.consensus]: !isStableDeploy,
},
Expand All @@ -87,7 +87,7 @@ export abstract class RouteUtils {
[Layer.sapphire]: true,
[Layer.cipher]: false,
[Layer.pontusxdev]: true,
[Layer.pontusx]: true,
[Layer.pontusxtest]: true,
// Disable WIP Consensus on production and staging
[Layer.consensus]: !isStableDeploy,
},
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const paraTimesConfig = {
[Layer.emerald]: emeraldConfig,
[Layer.sapphire]: sapphireConfig,
[Layer.pontusxdev]: pontusxDevConfig,
[Layer.pontusx]: pontusxTestConfig,
[Layer.pontusxtest]: pontusxTestConfig,
[Layer.consensus]: null,
} satisfies LayersConfig

Expand Down
4 changes: 2 additions & 2 deletions src/oasis-nexus/generated/api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/types/layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const layerOrder: Record<Layer, number> = {
[Layer.emerald]: 3,
[Layer.cipher]: 4,
[Layer.pontusxdev]: 5,
[Layer.pontusx]: 6,
[Layer.pontusxtest]: 6,
}

export const orderByLayer = (itemA: HasLayer, itemB: HasLayer): number =>
Expand Down

0 comments on commit 02da21b

Please sign in to comment.