Skip to content

Commit

Permalink
Merge branch 'develop' into 25-reenable-tape
Browse files Browse the repository at this point in the history
  • Loading branch information
faboweb authored Feb 13, 2018
2 parents 2b19f5d + c2a8114 commit abc4a7e
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 46 deletions.
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 @@ -370,10 +367,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 @@ -7,7 +7,6 @@ let { join } = require('path')
let { spawn } = require('child_process')
let { newTempDir, login } = require('./common.js')

// re-use app instance
let app, home, cliHome, started
let binary = process.env.BINARY_PATH

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

0 comments on commit abc4a7e

Please sign in to comment.