-
Notifications
You must be signed in to change notification settings - Fork 926
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves brave/brave-browser#23048 Use another explorer url for filecoin network to open transaction explorer tab. Previous urls did not have web interface.
- Loading branch information
Showing
5 changed files
with
130 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// you can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import { buildExplorerUrl } from './explorer' | ||
import { | ||
mockNetwork, | ||
mockFilecoinMainnetNetwork, | ||
mockFilecoinTestnetNetwork, | ||
mockSolanaMainnetNetwork, | ||
mockSolanaTestnetNetwork | ||
} from '../constants/mocks' | ||
|
||
const etheriumTransactionId = '0xc0b00b52d0e4ea19d81f51730adc79a1850ce4c08c38e630b0c6668760d264c0' | ||
const fileCointTransactionId = 'bafy2bzacec7altnqomkd6mu2kqrfgfontjfsg67xjv6zs3vn3wakumhj3bttg' | ||
const solanaTransacitonId = 'wi14VnU8msHsmNq4N9j7YAWu7jdDPUxMKKM2VLcstSevKv4NfKbxNEUtMquSoMjtZUMd4YSASzmwvDamkWTfh9b' | ||
|
||
it('etherium explorer url', () => { | ||
const assertion = buildExplorerUrl(mockNetwork, 'tx', etheriumTransactionId, undefined) | ||
expect(assertion).toEqual(`https://etherscan.io/tx/${etheriumTransactionId}`) | ||
}) | ||
|
||
it('filecoin mainnet explorer url', () => { | ||
const assertion = buildExplorerUrl(mockFilecoinMainnetNetwork, 'tx', fileCointTransactionId, undefined) | ||
expect(assertion).toEqual( | ||
`https://filscan.io/tipset/message-detail?cid=${fileCointTransactionId}`) | ||
}) | ||
|
||
it('filecoin test explorer url', () => { | ||
const assertion = buildExplorerUrl(mockFilecoinTestnetNetwork, 'tx', fileCointTransactionId, undefined) | ||
expect(assertion).toEqual( | ||
`https://calibration.filscan.io/tipset/message-detail?cid=${fileCointTransactionId}`) | ||
}) | ||
|
||
it('solana test explorer url', () => { | ||
const assertion = buildExplorerUrl(mockSolanaTestnetNetwork, 'tx', solanaTransacitonId, undefined) | ||
expect(assertion).toEqual( | ||
`https://explorer.solana.com/tx/${solanaTransacitonId}?cluster=testnet`) | ||
}) | ||
|
||
it('solana mainnet explorer url', () => { | ||
const assertion = buildExplorerUrl(mockSolanaMainnetNetwork, 'tx', solanaTransacitonId, undefined) | ||
expect(assertion).toEqual( | ||
`https://explorer.solana.com/tx/${solanaTransacitonId}`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters