Commit fbd78a5a authored by Hayden Adams's avatar Hayden Adams

rename web to web3Store, remove getBlock interval

parent 37d82f97
This diff is collapsed.
...@@ -8,7 +8,8 @@ import { ...@@ -8,7 +8,8 @@ import {
FACTORY_CONTRACT_READY, FACTORY_CONTRACT_READY,
SET_NETWORK_MESSAGE, SET_NETWORK_MESSAGE,
SET_BLOCK_TIMESTAMP, SET_BLOCK_TIMESTAMP,
SET_EXCHANGE_TYPE SET_EXCHANGE_TYPE,
PUT_WEB3_IN_STORE
} from '../constants'; } from '../constants';
// this actions folder is actually full of action creators // this actions folder is actually full of action creators
...@@ -63,3 +64,8 @@ export const setExchangeType = (exchangeType) => ({ ...@@ -63,3 +64,8 @@ export const setExchangeType = (exchangeType) => ({
type: SET_EXCHANGE_TYPE, type: SET_EXCHANGE_TYPE,
exchangeType exchangeType
}); });
export const putWeb3InStore = (globalWeb3) => ({
type: PUT_WEB3_IN_STORE,
globalWeb3
})
...@@ -42,3 +42,6 @@ export const SET_EXCHANGE_INPUT_VALUE = 'SET_EXCHANGE_INPUT_VALUE'; ...@@ -42,3 +42,6 @@ export const SET_EXCHANGE_INPUT_VALUE = 'SET_EXCHANGE_INPUT_VALUE';
export const SET_EXCHANGE_OUTPUT_VALUE = 'SET_EXCHANGE_OUTPUT_VALUE'; export const SET_EXCHANGE_OUTPUT_VALUE = 'SET_EXCHANGE_OUTPUT_VALUE';
export const SET_EXCHANGE_RATE = 'SET_EXCHANGE_RATE'; export const SET_EXCHANGE_RATE = 'SET_EXCHANGE_RATE';
export const SET_EXCHANGE_FEE = 'SET_EXCHANGE_FEE'; export const SET_EXCHANGE_FEE = 'SET_EXCHANGE_FEE';
// test setInteractionState
export const PUT_WEB3_IN_STORE = 'PUT_WEB3_IN_STORE';
import { combineReducers } from 'redux'; import { combineReducers } from 'redux';
import web3 from './web3-reducer'; import web3Store from './web3-reducer';
import exchangeContracts from './exchangeContract-reducer'; import exchangeContracts from './exchangeContract-reducer';
import tokenContracts from './tokenContract-reducer'; import tokenContracts from './tokenContract-reducer';
import exchange from './exchange-reducer'; import exchange from './exchange-reducer';
export default combineReducers({ export default combineReducers({
web3, web3Store,
exchangeContracts, exchangeContracts,
tokenContracts, tokenContracts,
exchange exchange
......
...@@ -9,11 +9,12 @@ import { ...@@ -9,11 +9,12 @@ import {
FACTORY_CONTRACT_READY, FACTORY_CONTRACT_READY,
SET_NETWORK_MESSAGE, SET_NETWORK_MESSAGE,
SET_BLOCK_TIMESTAMP, SET_BLOCK_TIMESTAMP,
SET_EXCHANGE_TYPE SET_EXCHANGE_TYPE,
PUT_WEB3_IN_STORE
} from '../constants'; } from '../constants';
export default (state = {}, action) => { export default (state = {}, action) => {
const { connected, currentMaskAddress, metamaskLocked, interaction, factoryContract, networkMessage, timestamp, exchangeType } = action const { connected, currentMaskAddress, metamaskLocked, interaction, factoryContract, networkMessage, timestamp, exchangeType, globalWeb3 } = action
switch (action.type) { switch (action.type) {
case WEB3_CONNECTION_SUCCESSFUL: case WEB3_CONNECTION_SUCCESSFUL:
return Object.assign({}, state, { connected: connected }); return Object.assign({}, state, { connected: connected });
...@@ -35,6 +36,8 @@ export default (state = {}, action) => { ...@@ -35,6 +36,8 @@ export default (state = {}, action) => {
return Object.assign({}, state, { blockTimestamp: timestamp }); return Object.assign({}, state, { blockTimestamp: timestamp });
case SET_EXCHANGE_TYPE: case SET_EXCHANGE_TYPE:
return Object.assign({}, state, { exchangeType: exchangeType }); return Object.assign({}, state, { exchangeType: exchangeType });
case PUT_WEB3_IN_STORE:
return Object.assign({}, state, { globalWeb3: globalWeb3 });
default: return state; default: return state;
} }
} }
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
// lets check if metamask is installed // lets check if metamask is installed
// also, lets assume that we're disconnected initially // also, lets assume that we're disconnected initially
// we're going to need to include a seperate nest for exchange actions // we're going to need to include a seperate nest for exchange actions
web3: { web3Store: {
connected: false, connected: false,
currentMaskAddress: '', currentMaskAddress: '',
metamaskLocked: true, metamaskLocked: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment