Skip to content

Commit

Permalink
feature: set dora as default and url bugs (#2099)
Browse files Browse the repository at this point in the history
* Set dora as default and update tx link

* Update tests

* Fix tests

* Fix tests again
  • Loading branch information
comountainclimber committed Mar 9, 2021
1 parent 5a9d619 commit 4de52a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions __tests__/core/explorer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('explorer tests', () => {
test('Dora mainnet explorer test', () => {
const networkId = MAIN_NETWORK_ID
const explorer = EXPLORERS.DORA
const expectedUrl = `https://dora.coz.io/transaction/0x${txId}`
const expectedUrl = `https://dora.coz.io/transaction/neo2/mainnet/0x${txId}`
expect(getExplorerTxLink(networkId, explorer, txId)).toEqual(expectedUrl)
})

Expand Down Expand Up @@ -106,7 +106,7 @@ describe('explorer tests', () => {
test('Dora mainnet explorer test', () => {
const networkId = MAIN_NETWORK_ID
const explorer = EXPLORERS.DORA
const expectedUrl = `https://dora.coz.io/address/${address}`
const expectedUrl = `https://dora.coz.io/address/neo2/mainnet/${address}`
expect(getExplorerAddressLink(networkId, explorer, address)).toEqual(
expectedUrl,
)
Expand Down
2 changes: 1 addition & 1 deletion app/core/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const LANGUAGES = {

export const DEFAULT_LANGUAGE = LANGUAGES.ENGLISH.value

export const DEFAULT_EXPLORER = EXPLORERS.NEO_SCAN
export const DEFAULT_EXPLORER = EXPLORERS.DORA

export const ROUTES = {
HOME: '/',
Expand Down
8 changes: 5 additions & 3 deletions app/core/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ export const getExplorerTxLink = (
case ANT_CHAIN:
return `${baseURL}/tx/hash/0x${txId}`
case NEOTUBE:
case DORA:
return `${baseURL}/transaction/0x${txId}`
case DORA:
return `${baseURL}/transaction/neo2/mainnet/0x${txId}`
default:
throw new Error(`Unknown explorer ${explorer}`)
}
Expand All @@ -71,8 +72,9 @@ export const getExplorerAddressLink = (
case ANT_CHAIN:
return `${baseURL}/address/info/${address}`
case NEOTUBE:
case DORA:
return `${baseURL}/address/${address}`
case DORA:
return `${baseURL}/address/neo2/mainnet/${address}`
default:
throw new Error(`Unknown explorer ${explorer}`)
}
Expand All @@ -91,7 +93,7 @@ export const getExplorerAssetLink = (
case ANT_CHAIN:
return `${baseURL}/assets/hash/${assetId}`
case DORA:
return `${baseURL}/contract/${assetId}`
return `${baseURL}/contract/neo2/mainnet/${assetId}`
case NEOTUBE:
return `${baseURL}/nep5/${assetId}`
default:
Expand Down

0 comments on commit 4de52a6

Please sign in to comment.