Browse Source

Use `withLibcore` in libcoreGetVersion

master
meriadec 7 years ago
parent
commit
8f122ffb9f
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 7
      src/commands/libcoreGetVersion.js

7
src/commands/libcoreGetVersion.js

@ -1,16 +1,17 @@
// @flow // @flow
import { createCommand, Command } from 'helpers/ipc'
import { fromPromise } from 'rxjs/observable/fromPromise' import { fromPromise } from 'rxjs/observable/fromPromise'
import { createCommand, Command } from 'helpers/ipc'
import withLibcore from 'helpers/withLibcore'
type Input = void type Input = void
type Result = { stringVersion: string, intVersion: number } type Result = { stringVersion: string, intVersion: number }
const cmd: Command<Input, Result> = createCommand('libcoreGetVersion', () => const cmd: Command<Input, Result> = createCommand('libcoreGetVersion', () =>
fromPromise( fromPromise(
Promise.resolve().then(() => { withLibcore(ledgerCore => {
const ledgerCore = require('init-ledger-core')()
const core = new ledgerCore.NJSLedgerCore() const core = new ledgerCore.NJSLedgerCore()
const stringVersion = core.getStringVersion() const stringVersion = core.getStringVersion()
const intVersion = core.getIntVersion() const intVersion = core.getIntVersion()

Loading…
Cancel
Save