Skip to content

Commit

Permalink
feature: Updates testnet nodes and logic (#2435)
Browse files Browse the repository at this point in the history
* Updates testnet nodes and logic

* Fix type error
  • Loading branch information
comountainclimber authored Sep 30, 2022
1 parent 1d8295a commit 96bd240
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/actions/nftActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function getNFTs({ net, address }) {
const symbol = atob(tokenNameResponse.stack[0].value)

const API_URL = `https://dora.coz.io/api/v1/neo3/${
net === 'TestNet' ? 'testnet_rc4' : 'mainnet'
net === 'TestNet' ? 'testnet' : 'mainnet'
}/contract/${nft.assethash}`

const { data } = await axios.get(API_URL)
Expand Down
2 changes: 1 addition & 1 deletion app/actions/transactionHistoryActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default createActions(
let parsedEntries = []

if (chain === 'neo3') {
const network = net === 'MainNet' ? 'mainnet' : 'testnet_rc4'
const network = net === 'MainNet' ? 'mainnet' : 'testnet'
const data = await NeoRest.addressTXFull(address, page, network)
parsedEntries = await computeN3Activity(data, address, net)
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/components/ConnectDapp/ApproveTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const ApproveTransaction = ({
return electron.shell.openExternal(
net === 'MainNet'
? `https://dora.coz.io/contract/neo3/mainnet/${hash}`
: `https://dora.coz.io/contract/neo3/testnet_rc4/${hash}`,
: `https://dora.coz.io/contract/neo3/testnet/${hash}`,
)
}
return null
Expand Down
2 changes: 1 addition & 1 deletion app/containers/TransactionHistory/TransactionHistory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default class TransactionHistory extends Component<Props, State> {
let parsedEntries = []
while (shouldFetchAdditionalPages) {
if (chain === 'neo3') {
const network = net === 'MainNet' ? 'mainnet' : 'testnet_rc4'
const network = net === 'MainNet' ? 'mainnet' : 'testnet'
data = await NeoRest.addressTXFull(address, currentPage, network)
parsedEntries = await computeN3Activity(data, address, net)
parsedEntries.forEach((entry: Object) => {
Expand Down
12 changes: 2 additions & 10 deletions app/core/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ export const getExplorerTxLink = (
case DORA:
return `${baseURL}/transaction/${chain}/${
// eslint-disable-next-line
networkId == '1'
? 'mainnet'
: chain === 'neo3'
? 'testnet_rc4'
: 'testnet'
networkId == '1' ? 'mainnet' : 'testnet'
}/0x${txId}`
default:
throw new Error(`Unknown explorer ${explorer}`)
Expand All @@ -85,11 +81,7 @@ export const getExplorerAddressLink = (
case DORA:
return `${baseURL}/address/${chain}/${
// eslint-disable-next-line
networkId == '1'
? 'mainnet'
: chain === 'neo3'
? 'testnet_rc4'
: 'testnet'
networkId == '1' ? 'mainnet' : 'testnet'
}/${address}`
default:
throw new Error(`Unknown explorer ${explorer}`)
Expand Down
10 changes: 5 additions & 5 deletions app/core/n3-nodes-test-net.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
{ "url": "https://testnet1.neo.coz.io:443" },
{ "url": "https://testnet2.neo.coz.io:443" },
{ "url": "http://seed1t4.neo.org:20332" },
{ "url": "http://seed2t4.neo.org:20332" },
{ "url": "http://seed3t4.neo.org:20332" },
{ "url": "http://seed4t4.neo.org:20332" },
{ "url": "http://seed5t4.neo.org:20332" }
{ "url": "http://seed1t5.neo.org:20332" },
{ "url": "http://seed2t5.neo.org:20332" },
{ "url": "http://seed3t5.neo.org:20332" },
{ "url": "http://seed4t5.neo.org:20332" },
{ "url": "http://seed5t5.neo.org:20332" }
]

0 comments on commit 96bd240

Please sign in to comment.