From 641d677c325c10c3799160ad197a0c1cf71fe825 Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Fri, 18 May 2018 15:55:11 +0200 Subject: [PATCH] Replace lisk-js with lisk-elements - Closes #1067 --- package.json | 2 +- src/actions/peers.js | 2 +- src/actions/peers.test.js | 2 +- src/components/decryptMessage/decryptMessage.js | 2 +- src/components/decryptMessage/decryptMessage.test.js | 2 +- src/components/encryptMessage/encryptMessage.js | 2 +- src/components/encryptMessage/encryptMessage.test.js | 2 +- src/components/login/login.test.js | 2 +- src/components/registerDelegate/registerDelegate.test.js | 2 +- src/components/signMessage/signMessage.js | 2 +- src/components/verifyMessage/index.js | 2 +- src/components/voting/index.test.js | 2 +- src/store/middlewares/login.test.js | 2 +- src/store/reducers/peers.js | 2 +- src/utils/api/account.js | 2 +- src/utils/api/delegate.js | 2 +- src/utils/api/delegate.test.js | 2 +- src/utils/api/forging.test.js | 2 +- test/integration/voteDialog/index.test.js | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 9d1a0453b..c44c43643 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "i18next": "=10.0.3", "i18next-localstorage-cache": "=1.1.1", "i18next-xhr-backend": "=1.4.2", - "lisk-js": "1.0.0-beta.1", + "lisk-elements": "1.0.0-beta.3", "moment": "2.20.1", "numeral": "=2.0.6", "postcss": "6.0.12", diff --git a/src/actions/peers.js b/src/actions/peers.js index 99945d919..2dbfac60d 100644 --- a/src/actions/peers.js +++ b/src/actions/peers.js @@ -1,5 +1,5 @@ import i18next from 'i18next'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import actionTypes from '../constants/actions'; // import { getNethash } from './../utils/api/nethash'; import { errorToastDisplayed } from './toaster'; diff --git a/src/actions/peers.test.js b/src/actions/peers.test.js index c5037d116..42c81593e 100644 --- a/src/actions/peers.test.js +++ b/src/actions/peers.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; import { spy, stub, match } from 'sinon'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import actionTypes from '../constants/actions'; import netHashes from '../constants/netHashes'; import { activePeerSet, activePeerUpdate } from './peers'; diff --git a/src/components/decryptMessage/decryptMessage.js b/src/components/decryptMessage/decryptMessage.js index 729813143..d3989e592 100644 --- a/src/components/decryptMessage/decryptMessage.js +++ b/src/components/decryptMessage/decryptMessage.js @@ -1,6 +1,6 @@ import React from 'react'; import Input from 'react-toolbox/lib/input'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import { translate } from 'react-i18next'; import ActionBar from '../actionBar'; import Authenticate from '../authenticate'; diff --git a/src/components/decryptMessage/decryptMessage.test.js b/src/components/decryptMessage/decryptMessage.test.js index 7025cef8e..3569babbf 100644 --- a/src/components/decryptMessage/decryptMessage.test.js +++ b/src/components/decryptMessage/decryptMessage.test.js @@ -4,7 +4,7 @@ import { mount } from 'enzyme'; import sinon from 'sinon'; import { Provider } from 'react-redux'; import { I18nextProvider } from 'react-i18next'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import i18n from '../../i18n'; import store from '../../store'; import DecryptMessage from './decryptMessage'; diff --git a/src/components/encryptMessage/encryptMessage.js b/src/components/encryptMessage/encryptMessage.js index 42ffe9ea4..46a850781 100644 --- a/src/components/encryptMessage/encryptMessage.js +++ b/src/components/encryptMessage/encryptMessage.js @@ -1,6 +1,6 @@ import React from 'react'; import Input from 'react-toolbox/lib/input'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import { translate } from 'react-i18next'; import ActionBar from '../actionBar'; import Authenticate from '../authenticate'; diff --git a/src/components/encryptMessage/encryptMessage.test.js b/src/components/encryptMessage/encryptMessage.test.js index 4e01dfc55..4fffc8388 100644 --- a/src/components/encryptMessage/encryptMessage.test.js +++ b/src/components/encryptMessage/encryptMessage.test.js @@ -3,7 +3,7 @@ import { expect } from 'chai'; import { mount } from 'enzyme'; import sinon from 'sinon'; import PropTypes from 'prop-types'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import i18n from '../../i18n'; import store from '../../store'; import Authenticate from '../authenticate'; diff --git a/src/components/login/login.test.js b/src/components/login/login.test.js index 22bf45ba2..976492e18 100644 --- a/src/components/login/login.test.js +++ b/src/components/login/login.test.js @@ -4,7 +4,7 @@ import { spy } from 'sinon'; import { mount, shallow } from 'enzyme'; import { BrowserRouter as Router } from 'react-router-dom'; import configureMockStore from 'redux-mock-store'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import PropTypes from 'prop-types'; import i18n from '../../i18n'; import Login from './login'; diff --git a/src/components/registerDelegate/registerDelegate.test.js b/src/components/registerDelegate/registerDelegate.test.js index af00680a3..4c3eb6165 100644 --- a/src/components/registerDelegate/registerDelegate.test.js +++ b/src/components/registerDelegate/registerDelegate.test.js @@ -2,7 +2,7 @@ import React from 'react'; import { expect } from 'chai'; import { mount } from 'enzyme'; import sinon from 'sinon'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import { Provider } from 'react-redux'; import { I18nextProvider } from 'react-i18next'; import i18n from '../../i18n'; // initialized i18next instance diff --git a/src/components/signMessage/signMessage.js b/src/components/signMessage/signMessage.js index b12e3403a..9b3aa5ed6 100644 --- a/src/components/signMessage/signMessage.js +++ b/src/components/signMessage/signMessage.js @@ -1,6 +1,6 @@ import React from 'react'; import Input from 'react-toolbox/lib/input'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import InfoParagraph from '../infoParagraph'; import SignVerifyResult from '../signVerifyResult'; diff --git a/src/components/verifyMessage/index.js b/src/components/verifyMessage/index.js index fea3614eb..656791996 100644 --- a/src/components/verifyMessage/index.js +++ b/src/components/verifyMessage/index.js @@ -1,7 +1,7 @@ import { translate } from 'react-i18next'; import Input from 'react-toolbox/lib/input'; import React from 'react'; -import lisk from 'lisk-js'; +import lisk from 'lisk-elements'; import InfoParagraph from '../infoParagraph'; import SignVerifyResult from '../signVerifyResult'; diff --git a/src/components/voting/index.test.js b/src/components/voting/index.test.js index 796720416..7d790f10c 100644 --- a/src/components/voting/index.test.js +++ b/src/components/voting/index.test.js @@ -4,7 +4,7 @@ import { mount } from 'enzyme'; import { Provider } from 'react-redux'; import { BrowserRouter as Router } from 'react-router-dom'; import { I18nextProvider } from 'react-i18next'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import i18n from '../../i18n'; import VotingHOC from './'; import store from '../../store'; diff --git a/src/store/middlewares/login.test.js b/src/store/middlewares/login.test.js index 8d54bf24d..9b48548ff 100644 --- a/src/store/middlewares/login.test.js +++ b/src/store/middlewares/login.test.js @@ -1,4 +1,4 @@ -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import { expect } from 'chai'; import { spy, stub, mock } from 'sinon'; import middleware from './login'; diff --git a/src/store/reducers/peers.js b/src/store/reducers/peers.js index 49a459278..26901819b 100644 --- a/src/store/reducers/peers.js +++ b/src/store/reducers/peers.js @@ -13,7 +13,7 @@ const peers = (state = { status: {}, options: {} }, action) => { case actionTypes.activePeerSet: return Object.assign({}, state, { data: action.data.activePeer, - // options are duplicated here because lisk-js later on removes it from the 'data' object + // options are duplicated here because lisk-elements doesn't expose it as lisk-js did options: action.data.options, }); case actionTypes.activePeerUpdate: diff --git a/src/utils/api/account.js b/src/utils/api/account.js index 56a04caf4..700896311 100644 --- a/src/utils/api/account.js +++ b/src/utils/api/account.js @@ -1,4 +1,4 @@ -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; export const getAccount = (activePeer, address) => new Promise((resolve) => { diff --git a/src/utils/api/delegate.js b/src/utils/api/delegate.js index e0c2f596f..3fb36d211 100644 --- a/src/utils/api/delegate.js +++ b/src/utils/api/delegate.js @@ -1,4 +1,4 @@ -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; export const listAccountDelegates = (activePeer, address) => activePeer.votes.get({ address, limit: 101 }); diff --git a/src/utils/api/delegate.test.js b/src/utils/api/delegate.test.js index c36f5b7b3..48ccf1219 100644 --- a/src/utils/api/delegate.test.js +++ b/src/utils/api/delegate.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; import sinon from 'sinon'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import { listAccountDelegates, listDelegates, getDelegate, diff --git a/src/utils/api/forging.test.js b/src/utils/api/forging.test.js index 13d5dde33..86b276bfb 100644 --- a/src/utils/api/forging.test.js +++ b/src/utils/api/forging.test.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import Lisk from 'lisk-js'; +import Lisk from 'lisk-elements'; import { mock } from 'sinon'; import moment from 'moment'; import { getForgedBlocks, getForgedStats } from './forging'; diff --git a/test/integration/voteDialog/index.test.js b/test/integration/voteDialog/index.test.js index 2144cc945..6ef603c9a 100644 --- a/test/integration/voteDialog/index.test.js +++ b/test/integration/voteDialog/index.test.js @@ -68,7 +68,7 @@ const peers = { 'Content-Type': 'application/json', nethash: 'da3ed6a45429278bac2666961289ca17ad86595d33b31037615d4b8e8f158bba', broadhash: 'da3ed6a45429278bac2666961289ca17ad86595d33b31037615d4b8e8f158bba', - os: 'lisk-js-api', + os: 'lisk-elements-api', version: '1.0.0', minVersion: '>=0.5.0', port: 443,