Skip to content

Commit

Permalink
Merge pull request #1390 from KyberNetwork/update-web3js-and-remove-u…
Browse files Browse the repository at this point in the history
…nused-codes

Update web3js & Remove get block information to checking node connected
  • Loading branch information
andrewsource147 authored Dec 9, 2019
2 parents 6ac1b3e + 84a5a81 commit f1f8930
Show file tree
Hide file tree
Showing 17 changed files with 889 additions and 693 deletions.
1,012 changes: 834 additions & 178 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"trezor-connect": "^7.0.3",
"underscore": "^1.8.3",
"walletlink": "^1.0.0",
"web3": "^1.0.0-beta.33",
"web3": "^1.2.4",
"web3-providers-ws": "^1.0.0-beta.34",
"webpack-dev-server": "^3.1.10",
"websocket": "^1.0.25",
Expand Down
45 changes: 0 additions & 45 deletions src/js/actions/globalActions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as converter from "../utils/converter"

export function updateBlock(ethereum, block) {
return {
type: "GLOBAL.NEW_BLOCK_INCLUDED_PENDING",
Expand All @@ -21,13 +19,6 @@ export function updateBlockFailed(error) {
}
}

// export function updateRate(ethereum, source, reserve, ownerAddr) {
// return {
// type: "GLOBAL.RATE_UPDATED_PENDING",
// payload: {ethereum, source, reserve, ownerAddr}
// }
// }

export function updateAllRate(ethereum, tokens) {
return {
type: 'GLOBAL.RATE_UPDATE_ALL_PENDING',
Expand All @@ -42,13 +33,6 @@ export function updateAllRateComplete(rates, rateUSD) {
}
}

export function updateAllRateUSD(ethereum) {
return {
type: 'GLOBAL.UPDATE_RATE_USD_PENDING',
payload: { ethereum }
}
}

export function updateAllRateUSDComplete(rateETHUSD) {
return {
type: 'GLOBAL.UPDATE_RATE_USD_FULFILLED',
Expand Down Expand Up @@ -123,21 +107,6 @@ export function goToRoute(route) {
}
}


// export function updateHistoryExchange(ethereum, page, itemPerPage, isAutoFetch) {
// return {
// type: "GLOBAL.UPDATE_HISTORY_EXCHANGE",
// payload: { ethereum, page, itemPerPage, isAutoFetch }
// }
// }

// export function updateHistory(logs, latestBlock, page, eventsCount, isAutoFetch) {
// return {
// type: "GLOBAL.UPDATE_HISTORY",
// payload: { logs, latestBlock, page, eventsCount, isAutoFetch }
// }
// }

export function checkConnection(ethereum, count, maxCount, isCheck) {
return {
type: "GLOBAL.CHECK_CONNECTION",
Expand Down Expand Up @@ -206,7 +175,6 @@ export function setAnalyzeError(networkIssues, reserveIssues, txHash) {
}
}


export function throwErrorMematamask(err) {
return {
type: "GLOBAL.THROW_ERROR_METAMASK",
Expand All @@ -228,13 +196,6 @@ export function setNotiHandler(notiService) {
}
}

// export function setMaxGasPrice() {
// return {
// type: "GLOBAL.SET_MAX_GAS_PRICE",
// }
// }


export function setNetworkError(error) {
return {
type: "GLOBAL.SET_NETWORK_ERROR",
Expand All @@ -255,12 +216,6 @@ export function closeChangeWallet() {
}
}

// export function updateTokenStatus() {
// return {
// type: "GLOBAL.UPDATE_TOKEN_STATUS"
// }
// }

export function setOnMobile(isIOS, isAndroid) {
return {
type: "GLOBAL.SET_ON_MOBILE",
Expand Down
71 changes: 0 additions & 71 deletions src/js/components/Transaction/TransactionConfig.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/js/components/Transaction/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
export { default as TransferForm } from './TransferForm.js';

// export { default as PassphraseModal } from './PassphraseModal.js';
// export { default as ConfirmTransferModal } from './ConfirmTransferModal.js';
// export { default as ApproveModal } from './ApproveModal.js';
// export { default as PostExchangeBtn } from './PostExchangeBtn.js';
// export { default as PostTransferBtn } from './PostTransferBtn.js';

export { default as TransactionConfig } from './TransactionConfig.js'
export { default as TransactionLoadingView } from "./TransactionLoadingView.js"
// export { default as AnalyzeLogModal } from "./AnalyzeLogModal.js"
68 changes: 0 additions & 68 deletions src/js/components/TransactionCommon/GasConfig.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/js/containers/Exchange/Exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default class Exchange extends React.Component {
this.props.dispatch(exchangeActions.caculateAmount(sourceTokenDecimals, destTokenDecimals))
}

setInvervalProcess = () => {
setIntervalProcess = () => {
this.setInterValGroup( this.checkKyberEnable, 10000)
this.setInterValGroup( this.fetchRateExchange, 10000)
this.setInterValGroup( this.fetchGasExchange, 10000)
Expand All @@ -147,7 +147,7 @@ export default class Exchange extends React.Component {
}

componentDidMount = () =>{
this.setInvervalProcess()
this.setIntervalProcess()

var {sourceTokenSymbol, sourceToken, destTokenSymbol, destToken} = this.getTokenInit()

Expand Down
1 change: 0 additions & 1 deletion src/js/containers/Exchange/ExchangeBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ class ExchangeBody extends React.Component {
isAdvanceActive={this.props.exchange.isAdvanceActive}
minConversionRate={minConversionRate}
type="exchange"
maxGasPrice={this.props.exchange.maxGasPrice}
/>
)
};
Expand Down
3 changes: 0 additions & 3 deletions src/js/reducers/accountReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ const account = (state= JSON.parse(JSON.stringify(initState)), action) => {
case "ACCOUNT.CLOSE_LOADING_IMPORT":{
return {...state, loading: false}
}
case "ACCOUNT.CLOSE_LOADING_IMPORT": {
return {...state, loading: false}
}
case "ACCOUNT.THROW_ERROR": {
var error = {
error: action.payload, showError: true
Expand Down
4 changes: 0 additions & 4 deletions src/js/reducers/exchangeReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,6 @@ const exchange = (state = initState, action) => {

return newState
}
// case "EXCHANGE.SET_CAP_EXCHANGE": {
// newState.maxCap = action.payload.maxCap
// return newState
// }
case "GLOBAL.SET_GAS_PRICE_COMPLETE": {
if (!newState.isEditGasPrice) {
var { safeLowGas, standardGas, fastGas, superFastGas, defaultGas, selectedGas } = action.payload
Expand Down
2 changes: 1 addition & 1 deletion src/js/sagas/connectionActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function* createNewConnection(action) {
var connectionInstance = new EthereumService()

yield put.resolve(setConnection(connectionInstance))
connectionInstance.subcribe()
connectionInstance.subscribe()
yield put.resolve(setMaxGasPrice(connectionInstance))

var web3Service = web3Package.newWeb3Instance()
Expand Down
Loading

0 comments on commit f1f8930

Please sign in to comment.