This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #945 from LiskHQ/926-move-networks.js
Move networks.js to src/constants - Closes #926
- Loading branch information
Showing
7 changed files
with
60 additions
and
50 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,21 @@ | ||
const networks = { | ||
mainnet: 0, | ||
testnet: 1, | ||
customNode: 2, | ||
export default { | ||
mainnet: { // network name translation t('Mainnet'); | ||
name: 'Mainnet', | ||
ssl: true, | ||
port: 443, | ||
code: 0, | ||
}, | ||
testnet: { // network name translation t('Testnet'); | ||
name: 'Testnet', | ||
testnet: true, | ||
ssl: true, | ||
port: 443, | ||
code: 1, | ||
}, | ||
customNode: { // network name translation t('Custom Node'); | ||
name: 'Custom Node', | ||
custom: true, | ||
address: 'http://localhost:4000', | ||
code: 2, | ||
}, | ||
}; | ||
|
||
export default networks; |
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,11 @@ | ||
import networks from '../constants/networks'; | ||
|
||
export default (code) => { | ||
let network; | ||
Object.keys(networks).forEach((key) => { | ||
if (networks[key].code === code) { | ||
network = networks[key]; | ||
} | ||
}, this); | ||
return network; | ||
}; |