Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed uionly stuff #471

Merged
merged 1 commit into from
Feb 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ To run the UI on a local node with `chain_id=local`:
$ yarn run testnet local
```

To run the UI with a mocked backend (without connecting to a testnet):
```bash
$ yarn run uionly
```

---

### Production
Expand Down Expand Up @@ -130,7 +125,6 @@ A list of all environment variables and their purpose:
|MOCK|'true', 'false'|'true' in development|Mock data to receive from the chain|
|COSMOS_TEST|'true', 'false'|'false'|Disable code that influences unit tests, like logging to files|
|COSMOS_NETWORK|{path to network configuration folder}|'../networks/gaia-1'|Network to connect to|
|COSMOS_UI_ONLY|'true', 'false'|'false'|Ignore spinning up the tendermint binaries|
|COSMOS_HOME|{path to config persistence folder}|'$HOME/cosmos-ui[-dev]'||
|COSMOS_NODE|{ip of a certain node}||Node to connect to|
|PLATFORM_TARGET|'all', 'win32', 'darwin', 'linux', 'mas'|'all'|Which platform to build for|
Expand Down
9 changes: 1 addition & 8 deletions app/src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const TEST = JSON.parse(process.env.COSMOS_TEST || 'false') !== false
// TODO default logging or default disable logging?
const LOGGING = JSON.parse(process.env.LOGGING || 'true') !== false
const MOCK = JSON.parse(process.env.MOCK || !TEST && DEV) !== false
const UI_ONLY = JSON.parse(process.env.COSMOS_UI_ONLY || 'false')
const winURL = DEV
? `http://localhost:${config.wds_port}`
: `file://${__dirname}/index.html`
Expand Down Expand Up @@ -117,9 +116,7 @@ function createWindow () {
webPreferences: { webSecurity: false }
})

if (UI_ONLY) {
mainWindow.loadURL(winURL + '?node=localhost')
} else if (!started) {
if (!started) {
mainWindow.loadURL(winURL)
} else {
startVueApp()
Expand Down Expand Up @@ -365,10 +362,6 @@ async function reconnect (seeds) {
}

async function main () {
if (UI_ONLY) {
return
}

let appVersionPath = join(root, 'app_version')
let genesisPath = join(root, 'genesis.json')
let configPath = join(root, 'config.toml')
Expand Down
22 changes: 0 additions & 22 deletions app/src/renderer/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ const RpcClient = require('tendermint')
const RestClient = require('cosmos-sdk')

module.exports = function (nodeIP, relayPort, lcdPort) {
if (JSON.parse(process.env.COSMOS_UI_ONLY || 'false')) {
return mockClient()
}

const RELAY_SERVER = 'http://localhost:' + relayPort

let node = new RestClient(RELAY_SERVER)
Expand Down Expand Up @@ -71,24 +67,6 @@ module.exports = function (nodeIP, relayPort, lcdPort) {
return node
}

function mockClient () {
return {
rpc: {
on: () => {},
subscribe: () => {},
validators: () => {},
status: () => {}
},
generateKey: () => ({
key: {
address: 'UI_ONLY_MODE'
}
}),
queryAccount: () => {},
queryNonce: () => {}
}
}

function sleep (ms = 0) {
return new Promise((resolve) => setTimeout(resolve, ms))
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"build:linux": "cross-env PLATFORM_TARGET=linux node tasks/release.js",
"build:mas": "cross-env PLATFORM_TARGET=mas node tasks/release.js",
"build:win32": "cross-env PLATFORM_TARGET=win32 node tasks/release.js",
"uionly": "cross-env COSMOS_UI_ONLY='true' yarn run testnet",
"local": "npm run testnet local",
"testnet": "node tasks/testnet.js",
"lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter app test",
Expand Down
1 change: 0 additions & 1 deletion test/e2e/launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module.exports = async function launch (t) {
startTimeout: 10000,
waitTimeout: 10000,
env: {
COSMOS_UI_ONLY: 'true',
COSMOS_TEST: 'true',
COSMOS_HOME: home,
COSMOS_NETWORK: join(__dirname, 'gaia-1')
Expand Down
8 changes: 0 additions & 8 deletions test/unit/specs/node.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ describe('LCD Connector', () => {
destroy () {}
}
}))

process.env.COSMOS_UI_ONLY = 'false'
})

beforeAll(() => {
Expand All @@ -32,12 +30,6 @@ describe('LCD Connector', () => {
expect(node.nodeIP).toBe('1.1.1.1')
})

it('should return a mockClient if setting COSMOS_UI_ONLY', () => {
process.env.COSMOS_UI_ONLY = 'true'
let node = LCDConnector('1.1.1.1')
expect(node.generateKey().key.address).toBe('UI_ONLY_MODE')
})

it('should init the rpc connection on initialization', () => {
let node = LCDConnector('1.1.1.1')
expect(node.rpc).toBeDefined()
Expand Down